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.

61 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__843E2879_B549_4D68_BB30_1ED43D4D2651__INCLUDED_)
  5. #define AFX_STDAFX_H__843E2879_B549_4D68_BB30_1ED43D4D2651__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. #define STRICT
  10. #ifndef _WIN32_WINNT
  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, const GUID* plibid = NULL);
  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. // LogEvent() function removed and added to global.cpp since its used globally
  33. void SetServiceStatus(DWORD dwState);
  34. void SetupAsLocalServer();
  35. //Implementation
  36. private:
  37. static void WINAPI _ServiceMain(DWORD dwArgc, LPTSTR* lpszArgv);
  38. static void WINAPI _Handler(DWORD dwOpcode);
  39. // data members
  40. public:
  41. _TCHAR m_szServiceName[256];
  42. SERVICE_STATUS_HANDLE m_hServiceStatus;
  43. SERVICE_STATUS m_status;
  44. DWORD dwThreadID;
  45. BOOL m_bService;
  46. };
  47. extern CServiceModule _Module;
  48. #include <atlcom.h>
  49. //{{AFX_INSERT_LOCATION}}
  50. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  51. #endif // !defined(AFX_STDAFX_H__843E2879_B549_4D68_BB30_1ED43D4D2651__INCLUDED)