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.

98 lines
1.8 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows NT Security
  4. // Copyright (C) Microsoft Corporation, 1997 - 1998
  5. //
  6. // File: krnctx.h
  7. //
  8. // Contents: NT Marta kernel context class
  9. //
  10. // History: 4-1-1999 kirtd Created
  11. //
  12. //----------------------------------------------------------------------------
  13. #if !defined(__KRNCTX_H__)
  14. #define __KRNCTX_H__
  15. extern "C" {
  16. #include <nt.h>
  17. #include <ntrtl.h>
  18. #include <nturtl.h>
  19. }
  20. #include <windows.h>
  21. #include <kernel.h>
  22. #include <assert.h>
  23. #include <ntstatus.h>
  24. //
  25. // CKernelContext. This represents a LanMan share object to the NT Marta
  26. // infrastructure
  27. //
  28. class CKernelContext
  29. {
  30. public:
  31. //
  32. // Construction
  33. //
  34. CKernelContext ();
  35. ~CKernelContext ();
  36. DWORD InitializeByName (LPCWSTR pObjectName, ACCESS_MASK AccessMask);
  37. DWORD InitializeByWmiName (LPCWSTR pObjectName, ACCESS_MASK AccessMask);
  38. DWORD InitializeByHandle (HANDLE Handle);
  39. //
  40. // Dispatch methods
  41. //
  42. DWORD AddRef ();
  43. DWORD Release ();
  44. DWORD GetKernelProperties (
  45. PMARTA_OBJECT_PROPERTIES pProperties
  46. );
  47. DWORD GetKernelRights (
  48. SECURITY_INFORMATION SecurityInfo,
  49. PSECURITY_DESCRIPTOR* ppSecurityDescriptor
  50. );
  51. DWORD SetKernelRights (
  52. SECURITY_INFORMATION SecurityInfo,
  53. PSECURITY_DESCRIPTOR pSecurityDescriptor
  54. );
  55. private:
  56. //
  57. // Reference count
  58. //
  59. DWORD m_cRefs;
  60. //
  61. // Kernel object handle
  62. //
  63. HANDLE m_hObject;
  64. //
  65. // Initialized by name
  66. //
  67. BOOL m_fNameInitialized;
  68. };
  69. DWORD
  70. OpenWmiGuidObject(IN LPWSTR pwszObject,
  71. IN ACCESS_MASK AccessMask,
  72. OUT PHANDLE pHandle);
  73. #endif
  74.