Leaked source code of windows server 2003
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.

69 lines
1.5 KiB

  1. #include <nt.h>
  2. #include <ntrtl.h>
  3. #include <nturtl.h>
  4. #include <windows.h>
  5. #include "fact.h"
  6. #include "HDService.h"
  7. #include "shsrvice\shsrvice.h"
  8. ///////////////////////////////////////////////////////////////////////////////
  9. // Exported functions
  10. // These are static C++ member functions that are called from the common exported functions.
  11. extern HINSTANCE g_hInstance;
  12. BOOL CHDService::Main(DWORD dwReason)
  13. {
  14. BOOL f;
  15. if (DLL_PROCESS_ATTACH == dwReason)
  16. {
  17. f = SUCCEEDED(CCOMBaseFactory::DllAttach(g_hInstance));
  18. if (f)
  19. {
  20. f = SUCCEEDED(CGenericServiceManager::DllAttach(g_hInstance));
  21. }
  22. }
  23. else
  24. {
  25. if (DLL_PROCESS_DETACH == dwReason)
  26. {
  27. f = SUCCEEDED(CCOMBaseFactory::DllDetach());
  28. if (f)
  29. {
  30. f = SUCCEEDED(CGenericServiceManager::DllDetach());
  31. }
  32. }
  33. else
  34. {
  35. // Whatever...
  36. f = TRUE;
  37. }
  38. }
  39. return f;
  40. }
  41. HRESULT CHDService::RegisterServer ()
  42. {
  43. return CCOMBaseFactory::_RegisterAll();
  44. }
  45. HRESULT CHDService::UnregisterServer()
  46. {
  47. return CCOMBaseFactory::_UnregisterAll();
  48. }
  49. HRESULT CHDService::CanUnloadNow()
  50. {
  51. return CCOMBaseFactory::_CanUnloadNow();
  52. }
  53. HRESULT CHDService::GetClassObject(REFCLSID rclsid, REFIID riid, void** ppv)
  54. {
  55. return CCOMBaseFactory::_GetClassObject(rclsid, riid, ppv);
  56. }