More Related Content Similar to com architecture Similar to com architecture (20) com architecture2. 2
Burden O.S with Server Loading
• CLSID
• ProgID: <Program>.<Component>.<Version>
– Visio.Application.3
– RealAudio.RealAudioo ActiveX Control (32-bit).1
– Office.Binder.95
(ProgID) CLSID Server Path
{0x39ebbe42, 0xb1c, 0x4369,
{0xb6, 0x91, 0x53, 0xc2, 0x7b,
0x66, 0x8, 0xd5}}
c:myserver.dll
4. 4
Functions for Client
HRESULT CoGetClassObject (
REFCLSID rclsid,
DWORD dwClsContext,
COSERVERINFO pServerInfo,
REFIID riid,
LPVOID *ppv );
HRESULT CoCreateInstance (
REFCLSID rclsid,
LPUNKNOWN pUnkOuter,
DWORD dwClsContext,
REFIID riid,
LPVOID *ppv );
- Loading Server
- Getting Interface
5. 5
Functions for Server
extern “C” HRESULT __stdcall
DllRegisterServer()
extern “C” HRESULT __stdcall
DllUnRegisterServer()
extern “C” HRESULT __stdcall
DllGetClassObject(const CLSID&,const IID&, void**)
CreateInstance()
REGSVR32.EXE [-u] server.dll
10. 10
Local Process Server
a.exe b.exe
Local Procedure Call
Remote Procedure Call
Proxy Stub
Inter-Process Communication channel
marshaling/unmarshaling
11. 11
Interface Definition Language
import "unknwn.idl";
[
object,
uuid(32bb8323-b41b-11cf-a6bb-0080c7b2d682),
helpstring("IX Interface"),
pointer_default(unique)
]
interface IX : IUnknown
{
HRESULT FxStringIn([in, string] wchar_t* szIn);
HRESULT FxStringOut([out, string] wchar_t** szOut);
};
[
uuid(60D754D5-DDBA-4D23-A84A-63A812AB2C49)
]
coclass COMPONENT
{
interface IX;
}
13. 13
COM vs Web Service
Interface
IDL
Registry
LPC/RPC
plain text
Service
WSDL
UDDI
SOAP
XML
(Web Service Description Language)
(Universal Description, Discovery
and Integration)
(Simple Object Access Protocol)
COM Web Service