methods with defined binary layout COM Object An instance of a COM Class COM Component (COM Server) PE file with one or more COM Classes DLL Class Class Instance COM Class Implements one or more COM Interfaces
1. Request with CLSID Registry 2. Lookup in registry COM Object Server process 3. Instantiates COM Object 4. Passes pointer to Object 5. Call COM Method (default) %SystemRoot%\System32\RtCOM64.dll
Initialize COM for the thread (put it into the apartment of given type) Create an instance of a given class and return a requested interface pointer to the new object. CoGetClassObject() CLSCTX_INPROC_SERVER CLSCTX_LOCAL_SERVER CLSCTX_REMOTE_SERVER Context Trying to get a pointer to IClassFactory interface ClassFactoryObject -> CreateInstance()
pServerInfo, riid, ppv) DLL EXE Service 1. Locate CLSID in HKEY_CLASSES_ROOT 2. Load DLL from InprocServer32 key CoLoadLibrary() 3. Call GetProcAddress() for DllGetClassObject() 4. Call DllGetClassObject() 5. Return Class Factory to caller 1. Locate CLSID in a global table that maps CLSID to its associated Class Factory. This map is managed by DCOMLaunch (hosted in svchost.exe) 2. If not found, locate CLSID in HKEY_CLASSES_ROOT 3. Launch executable from LocalServer32 key where Command Line is stored. DCOMLaunch uses CreateProcess() 4. Created process registers itself in the DCOMLaunch table by calling CoRegisterClassObject() 5. Once registered, client receives a proxy object to the class factory 1. Locate CLSID in a global table that maps CLSID to its associated Class Factory. This map is managed by DCOMLaunch (hosted in svchost.exe) 2. If not found, locate CLSID in HKEY_CLASSES_ROOT 3. Launch executable from AppID key where Launch permissions and service name is stored. DCOMLaunch contacts SCM 4. Created process registers itself in the DCOMLaunch table by calling CoRegisterClassObject() 5. Once registered, client receives a proxy object to the class factory