1 #define INITGUID 2 3 #include <windef.h> 4 #include "comsup.h" 5 6 LONG LockCount; 7 LONG ObjectCount; 8 9 10 VOID DllInitServer(VOID)11DllInitServer(VOID) 12 { 13 ObjectCount = 0; 14 LockCount = 0; 15 } 16 17 18 STDAPI DllRegisterServer(VOID)19DllRegisterServer(VOID) 20 { 21 /* Always return S_OK, since there is currently nothing that can go wrong */ 22 return S_OK; 23 } 24 25 26 STDAPI DllUnregisterServer(VOID)27DllUnregisterServer(VOID) 28 { 29 /* Always return S_OK, since there is currently nothing that can go wrong */ 30 return S_OK; 31 } 32 33 34 STDAPI DllCanUnloadNow(VOID)35DllCanUnloadNow(VOID) 36 { 37 if ((ObjectCount != 0) || (LockCount != 0)) 38 { 39 return S_FALSE; 40 } 41 else 42 { 43 return S_OK; 44 } 45 } 46 47 48 STDAPI DllGetClassObject(REFCLSID rclsid,REFIID riid,LPVOID * ppv)49DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) 50 { 51 HRESULT hr; 52 53 /* There are no classes to export, so always return CLASS_E_CLASSNOTAVAILABLE*/ 54 *ppv = NULL; 55 hr = CLASS_E_CLASSNOTAVAILABLE; 56 57 return hr; 58 } 59