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.9 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__45E0CB04_09E8_49C7_9D4D_EFB99DA65BD5__INCLUDED_)
  5. #define AFX_STDAFX_H__45E0CB04_09E8_49C7_9D4D_EFB99DA65BD5__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. void SetServiceStatus(DWORD dwState);
  33. void SetupAsLocalServer();
  34. BOOL FMMain();
  35. BOOL GetRegData(DWORD *Interval, TCHAR *SourceDir, TCHAR *ArchiveDir, TCHAR *MQConnectionString);
  36. //Implementation
  37. private:
  38. static void WINAPI _ServiceMain(DWORD dwArgc, LPTSTR* lpszArgv);
  39. static void WINAPI _Handler(DWORD dwOpcode);
  40. // data members
  41. public:
  42. TCHAR m_szServiceName[256];
  43. SERVICE_STATUS_HANDLE m_hServiceStatus;
  44. SERVICE_STATUS m_status;
  45. DWORD dwThreadID;
  46. BOOL m_bService;
  47. };
  48. #define s_cszStopEvent _T("CentralFilemover_Event")
  49. extern CServiceModule _Module;
  50. #include <atlcom.h>
  51. //{{AFX_INSERT_LOCATION}}
  52. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  53. #endif // !defined(AFX_STDAFX_H__45E0CB04_09E8_49C7_9D4D_EFB99DA65BD5__INCLUDED)