Returns a class factory to create an object of the requested type
| 64 | |
| 65 | // Returns a class factory to create an object of the requested type |
| 66 | STDAPI 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 |
| 97 | STDAPI UpdateRegistration(BOOL state) { |
nothing calls this directly
no outgoing calls
no test coverage detected