Putting the Distributed into COM

Slides:



Advertisements
Similar presentations
Enabling Secure Internet Access with ISA Server
Advertisements

NDU Software Upgrade Software upgrades for the NDU are accomplished through a network connection. Software upgrades for the NDU are accomplished through.
Fundamentals of COM Mary Kirtland Program Manager COM Team Microsoft Corporation.
Fundamentals Of COM(+) (Part 2) Don Box Cofounder DevelopMentor
1 Configuring Internet- related services (April 22, 2015) © Abdou Illia, Spring 2015.
Intro to COM What is it and how do I use it?. Objectives Teach the fundamentals of COM. Understand the reason for using it. Learn to make a simple in-process.
AP 01/01 Asynchronous Calls Standard COM+ model is completely synchronous –Emulates standard procedure calls –Problematic in distributed scenarios with.
1 Configuring Web services (Week 15, Monday 4/17/2006) © Abdou Illia, Spring 2006.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment Chapter 8: Implementing and Managing Printers.
Maintaining and Updating Windows Server 2008
1 Chapter Overview Introduction to Windows XP Professional Printing Setting Up Network Printers Connecting to Network Printers Configuring Network Printers.
Installing Ricoh Driver. Items you need to know IP address of Printer Options that are installed And Paper Sizes To get all this information you can print.
FileSecure Implementation Training Patch Management Version 1.1.
Chapter 5 Roles and features. objectives Performing management tasks using the Server Manager console Understanding the Windows Server 2008 roles Understanding.
August 25, SSO with Microsoft Active Directory Presented by: Craig Larrabee.
Microsoft Windows 2003 Server. Client/Server Environment Many client computers connect to a server.
1 Modular Software/ Component Software 2 Modular Software Code developed in modules. Modules can then be linked together to produce finished product/program.
Visual Basic: An Object Oriented Approach 12 – Creating and using ActiveX objects.
CTSP TRAINING Router 101 And Networking Basics. You Don’t Need Internet Access to Run or Connect your devices to an Ethernet switch or Router Enable DHCP.
5 Chapter Five Web Servers. 5 Chapter Objectives Learn about the Microsoft Personal Web Server Software Learn how to improve Web site performance Learn.
Fundamentals Of COM(+) (Part 2). COM – The idea COM is based on three fundamental ideas COM is based on three fundamental ideas Clients program in terms.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
COM/DCOM Implementation Basics of: Object creation and access Object Reuse Interface referencing.
COM and DCOM CS 562 February 27, Motivation Data Analyzer Resource Monitor int compute (…) { } int compute (…) { } Data Analyzer int compute (…)
Introduction to COM and DCOM Organizational Communications and Technologies Prithvi N. Rao H. John Heinz III School of Public Policy and Management Carnegie.
CS 603 DCOM April 5, DCOM – What is it? Start with COM – Component Object Model –Language-independent object interface Add interprocess communication.
Microsoft FrontPage 2003 Illustrated Complete Finalizing a Web Site.
Database-Driven Web Sites, Second Edition1 Chapter 5 WEB SERVERS.
OOMI From COM to DCOM.
Ni.com Understanding COM/ActiveX Jeff Paulter Staff Software Engineer Thurs Aug 17 10:15-11:30 a.m., 1:45-3:00 p.m. Ash (10A) Jeff Paulter Staff Software.
Implementing COM Objects 主講人:虞台文. Content Types of COM Servers Objects with Single interface – Example  Enumerators Objects with Multiple interfaces.
OOMI A short introduction to Microsoft's COM From COM to DCOM.
Web Access. Overview  Purpose  Prerequisites  Install Components  Enable Virtual Directories  IIS Configuration & Security  Troubleshooting.
Administering Microsoft Windows Server 2003 Chapter 2.
Type Information 主講人:虞台文. Content Overview The Type Library Building Type Library Type Library Deployment Loading and Using a Type Library Objects with.
Internet Explorer 7 Updated Advice for the NHS 04 February 2008 Version 1.3.
Maintaining and Updating Windows Server 2008 Lesson 8.
COMP1321 Digital Infrastructure Richard Henson March 2016.
ClickOnce Deployment (One-click Deployment)
Chapter Overview Understanding Windows Name Resolution Using WINS.
Understand Names Resolution
Architecture Review 10/11/2004
Packaging and Deploying Windows Applications
Jim Fawcett CSE775 – Distributed Objects Spring 2003
Tiny http client and server
Lesson 6: Configuring Servers for Remote Management
Configuring Attendant Console
Apartments and COM Threading Models
WaterWare description
COM components + persistent storage = objects
Out-of-Process Components
Enterprise Computing Collaboration System Example
Matt Smouse CSE775 – Distributed Objects Spring 2003
Microsoft FrontPage 2003 Illustrated Complete
IIS.
Windows Internals Brown-Bag Seminar Chapter 1 – Concepts and Tools
Configuring Internet-related services
DCOM-CORBA Comparison
Out-of-Process Components
Designing IIS Security (IIS – Internet Information Service)
Network Diagnostics Framework
Active Template Library
Matt Smouse CSE775 – Distributed Objects Spring 2003
ClickOnce Deployment (One-click Deployment)
Jim Fawcett CSE775 – Distributed Objects Spring 2007
Automation and IDispatch
Jim Fawcett CSE791 – Distributed Objects Spring 2002
Message Passing Systems Version 2
Matt Smouse CSE775 – Distributed Objects Spring 2003
Presentation transcript:

Putting the Distributed into COM Jim Fawcett CSE775 - Distributed Objects Spring 2003

Network Configuration Using NT administered domains make sure printer and file sharing are on using OLE/COM Object Viewer from the Visual C++ Tools menu (oleview.exe): check that Distributed COM is enabled check the Default Launch Permissions. If your group, e.g., one of the NT users groups, is not specified then you will have to manually start the server on the remote machine check the Access Permissions. Usually everyone has access permission. using the NT Task Manager check that the service control manager is running - RPCSS.EXE (DCOM Server Process Launcher with XP SP2)

Install Components Log on to the server machine and: copy all files needed for the server application onto the server machine dlls for components and proxy/stubs type libraries if there are any automation interfaces if you’ve used type library marshalling there won’t be any proxy/stub dll exes for server applications data files needed by the server register dll’s for components and proxy/stub using regsvr32 register exe’s for components using comp /RegServer Use ipconfig to determine the IP address of the server machine.

Hooking “Local” clients to Remote Components To remotely run components with clients that are not configured for remote operations, we need, on client machine, the registry settings: \HKEY_CLASSES_ROOT\AppID\<component CLSID> \RemoteServerName=“ip address of server node” \HKEY_CLASSES_ROOT\AppID\<component CLSID> \RunAs=“Interactive User” We must remove the settings: \HKEY_CLASSES_ROOT\CLSID\<component CLSID> \InProcServer32 \HKEY_CLASSES_ROOT\CLSID\<component CLSID> \LocalServer32

Making Clients “Remote” Aware To avoid the need for registry settings described on the previous slide, the client must know that it will call a remote server. Client uses CoCreateInstanceEx: HRESULT CoCreateInstanceEx( REFCLSID rclsid, // component CLSID IUnknown *punkOuter, // must be NULL DWORD *dwClsCtx, // usually CLSCTX_SERVER COSERVERINFO *pServerInfo, // see next slide ULONG cmq, // number of MULTI_QIs MULTI_QI rgmqResults // array of MULTI_QIs ); Returns S_OK, E_INVALIDARG, E_NOINTERFACE, or CO_S_NOTALLINTERFACES

COSERVERINFO Structure This structure identifies the remote machine and may also define security settings typedef struct _COSERVERINFO { DWORD dwReserved1; // set to zero LPWSTR pwszName; // IP address or DNS or UNC name COAUTHINFO __RPC_FAR *pSuthInfo; // see below DWORD dwReserved2; // set to zero } COSERVERINFO; If pSuthInfo is set to NULL the NT Domain server is used to authenticate a user.

COAUTHINFO Structure This structure is used to activate a server based on specified security settings rather than taking the InterActive User settings. typedef struct _COAUTHINFO { DWORD dwAuthnSvc; DWORD dwAuthzSvc; LPWSTR pwszServerPrincName; DWORD dwAuthnLevel; DWORD dwImpersonationLevel; COAUTHIDENTITY __RPC_FAR *pAuthIdentityData; DWORD dwCapabilities; } COAUTHINFO;

MULTI_QI Structure We can pass to CoCreateInstanceEx an array of MULTI_QI structures to get back pointers to several interfaces with a single round trip call. typedef struct _MULTI_QI { const IID *pIID; // a desired interface CLSID IUnknown *pItf; // contains interface pointer on return HRESULT hr; // returns S_OK if successful } MULTI_QI;

Downloading Proxy/Stub dlls If your client needs to download a proxy/stub dll to communicate with a remote server, it may make its interfaces available without making registry entries locally by using CoRegisterPSClsid: WINOLEAPI CoRegisterPSClsid( REFIID riid, // interface used by client REFCLSID rclsid // proxy/stub CLSID ); This will not make permanent changes in the local registry. The interface will be available for the lifetime of the process or until CoRegisterPSClsid is called again.

Automated Download and Install An activeX control can be embedded in web page using object tag: <object ID = “MyControl” CLSSID=“clsid::xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx” CODEBASE=“http://xxxx/yyyy/…/control.dll#version=1,0,0,121” TYPE=”application/x-oleobject” WIDTH=150 HEIGHT=60 VSPACE=0 ALIGN=left > The control will be downloaded if it hasn’t been installed locally or if the local version number is older than that in the object tag.

CoGetClassObjectFromURL To process this object tag the browser (IE3.0 or later) will use: STDAPI CoGetClassObjectFromURL( REFCLSID rclsid, // CLSID of object LPCWSTR szCodeURL, // URL path w file name DWORD dwFileVersionMS, // major version number DWORD dwFileVersionLS, // minor version number LPCWSTR szContentTYPE, // content type string LPBINDCTX pBindCtx, // client generated bind context DWORD dwClsContext, // CLSCTX_INPROC_SERVER LPVOID pvReserved, // NULL REFIID riid // UUID of IClassFactory VOID ** ppv // returned interface );