Source code of Windows XP (NT5)
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.

102 lines
1.8 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows NT Security
  4. // Copyright (C) Microsoft Corporation, 1997 - 1998
  5. //
  6. // File: svcctx.h
  7. //
  8. // Contents: NT Marta service context class
  9. //
  10. // History: 4-1-1999 kirtd Created
  11. //
  12. //----------------------------------------------------------------------------
  13. #if !defined(__SVCCTX_H__)
  14. #define __SVCCTX_H__
  15. #include <windows.h>
  16. #include <service.h>
  17. #include <assert.h>
  18. //
  19. // CServiceContext. This represents a service object to the NT Marta
  20. // infrastructure
  21. //
  22. class CServiceContext
  23. {
  24. public:
  25. //
  26. // Construction
  27. //
  28. CServiceContext ();
  29. ~CServiceContext ();
  30. DWORD InitializeByName (LPCWSTR pObjectName, ACCESS_MASK AccessMask);
  31. DWORD InitializeByHandle (HANDLE Handle);
  32. //
  33. // Dispatch methods
  34. //
  35. DWORD AddRef ();
  36. DWORD Release ();
  37. DWORD GetServiceProperties (
  38. PMARTA_OBJECT_PROPERTIES pProperties
  39. );
  40. DWORD GetServiceRights (
  41. SECURITY_INFORMATION SecurityInfo,
  42. PSECURITY_DESCRIPTOR* ppSecurityDescriptor
  43. );
  44. DWORD SetServiceRights (
  45. SECURITY_INFORMATION SecurityInfo,
  46. PSECURITY_DESCRIPTOR pSecurityDescriptor
  47. );
  48. private:
  49. //
  50. // Reference count
  51. //
  52. DWORD m_cRefs;
  53. //
  54. // Service handles
  55. //
  56. SC_HANDLE m_hService;
  57. //
  58. // Were we initialized by name or handle?
  59. //
  60. BOOL m_fNameInitialized;
  61. };
  62. //
  63. // Private functions
  64. //
  65. DWORD
  66. ServiceContextParseServiceName (
  67. LPCWSTR pwszName,
  68. LPWSTR* ppMachine,
  69. LPWSTR* ppService
  70. );
  71. DWORD
  72. StandardContextParseName (
  73. LPCWSTR pwszName,
  74. LPWSTR* ppMachine,
  75. LPWSTR* ppRest
  76. );
  77. #endif
  78.