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.

160 lines
5.1 KiB

  1. // Copyright (c) 2000-2001 Microsoft Corporation, All Rights Reserved
  2. // CJobObjSecLimitInfoProps.h
  3. #pragma once
  4. //*****************************************************************************
  5. // BEGIN: Declaration of Win32_JobObjectSecLimitInfo class properties.
  6. //*****************************************************************************
  7. #define IDS_Win32_NamedJobObjectSecLimitSetting L"Win32_NamedJobObjectSecLimitSetting"
  8. #define IDS_GroupCount L"GroupCount"
  9. #define IDS_Groups L"Groups"
  10. #define IDS_Privileges L"Privileges"
  11. #define IDS_PrivilegeCount L"PrivilegeCount"
  12. #define IDS_SID L"SID"
  13. #define IDS_AccountName L"AccountName"
  14. #define IDS_ReferencedDomainName L"ReferencedDomainName"
  15. #define IDS_Attributes L"Attributes"
  16. #define IDS_LUID L"LUID"
  17. #define IDS_Win32_TokenGroups L"Win32_TokenGroups"
  18. #define IDS_Win32_TokenPrivileges L"Win32_TokenPrivileges"
  19. #define IDS_Win32_SidAndAttributes L"Win32_SidAndAttributes"
  20. #define IDS_Win32_LUIDAndAttributes L"Win32_LUIDAndAttributes"
  21. #define IDS_Win32_Sid L"Win32_Sid"
  22. #define IDS_Win32_LUID L"Win32_LUID"
  23. #define IDS_HighPart L"HighPart"
  24. #define IDS_LowPart L"LowPart"
  25. #define PROP_ALL_REQUIRED 0xFFFFFFFF
  26. #define PROP_NONE_REQUIRED 0x00000000
  27. #define PROP_JOSecLimitInfoID 0x00000001
  28. #define PROP_SecurityLimitFlags 0x00000002
  29. #define PROP_SidsToDisable 0x00000004
  30. #define PROP_PrivilagesToDelete 0x00000008
  31. #define PROP_RestrictedSids 0x00000010
  32. // The following enum is used to reference
  33. // into the array that follows it. Hence,
  34. // they must be kept in synch.
  35. typedef enum tag_JOB_OBJ_SEC_LIMIT_INFO_PROPS
  36. {
  37. JOSECLMTPROP_ID = 0,
  38. JOSECLMTPROP_SecurityLimitFlags,
  39. JOSECLMTPROP_SidsToDisable,
  40. JOSECLMTPROP_PrivilegesToDelete,
  41. JOSECLMTPROP_RestrictedSids,
  42. // used to keep track of how many props we have:
  43. JOIOACTGPROP_JobObjSecLimitInfoPropertyCount
  44. } JOB_OBJ_SEC_LIMIT_INFO_PROPS;
  45. // WARNING!! MUST KEEP MEMBERS OF THE FOLLOWING ARRAY
  46. // IN SYNCH WITH THE ENUMERATION DECLARED ABOVE!!!
  47. extern LPCWSTR g_rgJobObjSecLimitInfoPropNames[];
  48. //*****************************************************************************
  49. // END: Declaration of Win32_JobObjectSecLimitInfo class properties.
  50. //*****************************************************************************
  51. class CJobObjSecLimitInfoProps : public CObjProps
  52. {
  53. public:
  54. CJobObjSecLimitInfoProps();
  55. CJobObjSecLimitInfoProps(CHString& chstrNamespace);
  56. CJobObjSecLimitInfoProps(
  57. HANDLE hJob,
  58. CHString& chstrNamespace);
  59. virtual ~CJobObjSecLimitInfoProps();
  60. HRESULT SetKeysFromPath(
  61. const BSTR ObjectPath,
  62. IWbemContext __RPC_FAR *pCtx);
  63. HRESULT SetKeysDirect(
  64. std::vector<CVARIANT>& vecvKeys);
  65. HRESULT GetWhichPropsReq(
  66. CFrameworkQuery& cfwq);
  67. HRESULT SetNonKeyReqProps();
  68. HRESULT LoadPropertyValues(
  69. IWbemClassObject* pIWCO,
  70. IWbemContext* pCtx,
  71. IWbemServices* pNamespace);
  72. void SetHandle(const HANDLE hJob);
  73. HANDLE& GetHandle();
  74. HRESULT SetWin32JOSecLimitInfoProps(
  75. IWbemClassObject __RPC_FAR *pInst);
  76. private:
  77. HANDLE m_hJob;
  78. // Because many of the security limit info
  79. // properties can't be directly represented
  80. // as a variant type, we don't use our
  81. // m_PropMap and other mechanisms for this
  82. // class. Instead, we store the properties
  83. // in this member variable.
  84. PJOBOBJECT_SECURITY_LIMIT_INFORMATION m_pjosli;
  85. // Helpers to set an outgoing instance...
  86. HRESULT SetInstanceFromJOSLI(
  87. IWbemClassObject* pIWCO,
  88. IWbemContext* pCtx,
  89. IWbemServices* pNamespace);
  90. HRESULT SetInstanceSidsToDisable(
  91. IWbemClassObject* pIWCO,
  92. IWbemContext* pCtx,
  93. IWbemServices* pNamespace);
  94. HRESULT SetInstancePrivilegesToDelete(
  95. IWbemClassObject* pIWCO,
  96. IWbemContext* pCtx,
  97. IWbemServices* pNamespace);
  98. HRESULT SetInstanceRestrictedSids(
  99. IWbemClassObject* pIWCO,
  100. IWbemContext* pCtx,
  101. IWbemServices* pNamespace);
  102. HRESULT SetInstanceTokenGroups(
  103. IWbemClassObject* pWin32TokenGroups,
  104. PTOKEN_GROUPS ptg,
  105. IWbemContext* pCtx,
  106. IWbemServices* pNamespace);
  107. HRESULT SetInstanceTokenPrivileges(
  108. IWbemClassObject* pWin32TokenPrivileges,
  109. PTOKEN_PRIVILEGES ptp,
  110. IWbemContext* pCtx,
  111. IWbemServices* pNamespace);
  112. // Member meant to only be called
  113. // by base class.
  114. static DWORD CheckProps(
  115. CFrameworkQuery& Query);
  116. };