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.

90 lines
2.5 KiB

  1. /******************************************************************************
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. module.h
  5. Abstract:
  6. This file contains the declaration of the CComModule extension for the service.
  7. Revision History:
  8. Davide Massarenti (Dmassare) 03/14/2000
  9. created
  10. ******************************************************************************/
  11. #if !defined(__INCLUDED___PCH___MODULE_H___)
  12. #define __INCLUDED___PCH___MODULE_H___
  13. #if _MSC_VER > 1000
  14. #pragma once
  15. #endif // _MSC_VER > 1000
  16. #define STRICT
  17. #ifndef _WIN32_WINNT
  18. #define _WIN32_WINNT 0x0400
  19. #endif
  20. #include <atlbase.h>
  21. class CServiceModule : public CComModule
  22. {
  23. HANDLE m_hEventShutdown;
  24. DWORD m_dwThreadID;
  25. HANDLE m_hMonitor;
  26. BOOL m_bActivity;
  27. LPCWSTR m_szServiceName;
  28. UINT m_iDisplayName;
  29. UINT m_iDescription;
  30. SERVICE_STATUS_HANDLE m_hServiceStatus;
  31. SERVICE_STATUS m_status;
  32. BOOL m_bService;
  33. public:
  34. CServiceModule();
  35. virtual ~CServiceModule();
  36. HRESULT RegisterServer ( BOOL bRegTypeLib, BOOL bService, LPCWSTR szSvcHostGroup );
  37. HRESULT UnregisterServer( LPCWSTR szSvcHostGroup );
  38. void Init( _ATL_OBJMAP_ENTRY* p, HINSTANCE h, LPCWSTR szServiceName, UINT iDisplayName, UINT iDescription, const GUID* plibid = NULL );
  39. BOOL Start( BOOL bService );
  40. HRESULT Run ( );
  41. BOOL IsInstalled( );
  42. BOOL Install ( LPCWSTR szSvcHostGroup );
  43. BOOL Uninstall ( LPCWSTR szSvcHostGroup );
  44. LONG Lock ( );
  45. LONG Unlock ( );
  46. void ServiceMain ( DWORD dwArgc, LPWSTR* lpszArgv );
  47. void Handler ( DWORD dwOpcode );
  48. void SetServiceStatus( DWORD dwState );
  49. #ifdef DEBUG
  50. static void ReadDebugSettings();
  51. #endif
  52. void ForceShutdown();
  53. //Implementation
  54. private:
  55. void MonitorShutdown();
  56. BOOL StartMonitor ();
  57. static void WINAPI _ServiceMain( DWORD dwArgc, LPWSTR* lpszArgv );
  58. static void WINAPI _Handler ( DWORD dwOpcode );
  59. static DWORD WINAPI _Monitor ( void* pv );
  60. };
  61. extern CServiceModule _Module;
  62. #include <atlcom.h>
  63. #include <NTEventMsg.h>
  64. #endif // !defined(__INCLUDED___PCH___MODULE_H___)