Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.3 KiB

  1. #include "fact.h"
  2. #include "HDService.h"
  3. ///////////////////////////////////////////////////////////////////////////////
  4. // Exported functions
  5. // These are static C++ member functions that are called from the common exported functions.
  6. extern HINSTANCE g_hInstance;
  7. void CHDService::Main (DWORD dwReason)
  8. {
  9. if (DLL_PROCESS_ATTACH == dwReason)
  10. {
  11. CCOMBaseFactory::_hModule = (HINSTANCE)g_hInstance;
  12. if (!CCOMBaseFactory::_fCritSectInit)
  13. {
  14. InitializeCriticalSection(&CCOMBaseFactory::_cs);
  15. CCOMBaseFactory::_fCritSectInit = TRUE;
  16. }
  17. }
  18. else
  19. {
  20. if (DLL_PROCESS_DETACH == dwReason)
  21. {
  22. if (CCOMBaseFactory::_fCritSectInit)
  23. {
  24. DeleteCriticalSection(&CCOMBaseFactory::_cs);
  25. }
  26. }
  27. }
  28. }
  29. HRESULT CHDService::RegisterServer (void)
  30. {
  31. return CCOMBaseFactory::_RegisterAll();
  32. }
  33. HRESULT CHDService::UnregisterServer (void)
  34. {
  35. return CCOMBaseFactory::_UnregisterAll();
  36. }
  37. HRESULT CHDService::CanUnloadNow (void)
  38. {
  39. return CCOMBaseFactory::_CanUnloadNow();
  40. }
  41. HRESULT CHDService::GetClassObject (REFCLSID rclsid, REFIID riid, void** ppv)
  42. {
  43. return CCOMBaseFactory::_GetClassObject(rclsid, riid, ppv);
  44. }