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.

62 lines
1.8 KiB

  1. // stdafx.h : include file for standard system include files,
  2. // or project specific include files that are used frequently,
  3. // but are changed infrequently
  4. #if !defined(AFX_STDAFX_H__131CC295_7634_11D1_8B6B_0060089BD8C4__INCLUDED_)
  5. #define AFX_STDAFX_H__131CC295_7634_11D1_8B6B_0060089BD8C4__INCLUDED_
  6. #if _MSC_VER >= 1000
  7. #pragma once
  8. #endif // _MSC_VER >= 1000
  9. #define STRICT
  10. #if !defined(_WIN32_WINNT) || (defined(_WIN32_WINNT) && (_WIN32_WINNT < 0x0400))
  11. #define _WIN32_WINNT 0x0400
  12. #endif
  13. #define _ATL_APARTMENT_THREADED
  14. #include <atlbase.h>
  15. //You may derive a class from CComModule and use it if you want to override
  16. //something, but do not change the name of _Module
  17. class CServiceModule : public CComModule
  18. {
  19. public:
  20. HRESULT RegisterServer(BOOL bRegTypeLib, BOOL bService);
  21. HRESULT UnregisterServer();
  22. void Init(_ATL_OBJMAP_ENTRY* p, HINSTANCE h, UINT nServiceNameID);
  23. void Start();
  24. void ServiceMain(DWORD dwArgc, LPTSTR* lpszArgv);
  25. void Handler(DWORD dwOpcode);
  26. void Run();
  27. BOOL IsInstalled();
  28. BOOL Install();
  29. BOOL Uninstall();
  30. LONG Unlock();
  31. void LogEvent(LPCTSTR pszFormat, ...);
  32. void SetServiceStatus(DWORD dwState);
  33. void SetupAsLocalServer();
  34. //Implementation
  35. private:
  36. static void WINAPI _ServiceMain(DWORD dwArgc, LPTSTR* lpszArgv);
  37. static void WINAPI _Handler(DWORD dwOpcode);
  38. // data members
  39. public:
  40. TCHAR m_szServiceName[256];
  41. SERVICE_STATUS_HANDLE m_hServiceStatus;
  42. SERVICE_STATUS m_status;
  43. DWORD dwThreadID;
  44. BOOL m_bService;
  45. };
  46. extern CServiceModule _Module;
  47. #include <atlcom.h>
  48. //{{AFX_INSERT_LOCATION}}
  49. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  50. #endif // !defined(AFX_STDAFX_H__131CC295_7634_11D1_8B6B_0060089BD8C4__INCLUDED)