MCPcopy Create free account
hub / github.com/LegacyUpdate/LegacyUpdate / DllGetClassObject

Function DllGetClassObject

LegacyUpdate/dllmain.cpp:66–94  ·  view source on GitHub ↗

Returns a class factory to create an object of the requested type

Source from the content-addressed store, hash-verified

64
65// Returns a class factory to create an object of the requested type
66STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) {
67 if (PrxDllGetClassObject(rclsid, riid, ppv) == S_OK) {
68 return S_OK;
69 }
70
71 if (ppv == NULL) {
72 return E_POINTER;
73 }
74
75 *ppv = NULL;
76
77 for (DWORD i = 0; i < ARRAYSIZE(g_classEntries); i++) {
78 if (IsEqualCLSID(rclsid, *g_classEntries[i].clsid)) {
79 CClassFactory *pFactory;
80 HRESULT hr = CClassFactory::Create(NULL, riid, (void **)&pFactory);
81 if (pFactory == NULL) {
82 return E_OUTOFMEMORY;
83 }
84
85 pFactory->createFunc = g_classEntries[i].createFunc;
86 pFactory->clsid = g_classEntries[i].clsid;
87
88 *ppv = pFactory;
89 return hr;
90 }
91 }
92
93 return CLASS_E_CLASSNOTAVAILABLE;
94}
95
96// Shared register/unregister method
97STDAPI UpdateRegistration(BOOL state) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected