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
2.0 KiB

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