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.

164 lines
3.2 KiB

  1. #define COMPUTER_Group 1
  2. #define DOMAIN_Group 2
  3. class CWinNTGroup;
  4. class CWinNTGroup : INHERIT_TRACKING,
  5. public CCoreADsObject,
  6. public ISupportErrorInfo,
  7. public IADsGroup,
  8. public IADsPropertyList,
  9. public INonDelegatingUnknown,
  10. public IADsExtension
  11. {
  12. friend class CWinNTGroupGenInfo;
  13. public:
  14. /* IUnknown methods */
  15. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) ;
  16. STDMETHODIMP_(ULONG) AddRef(void);
  17. STDMETHODIMP_(ULONG) Release(void);
  18. // INonDelegatingUnknown methods
  19. STDMETHOD(NonDelegatingQueryInterface)(THIS_
  20. const IID&,
  21. void **
  22. );
  23. DECLARE_NON_DELEGATING_REFCOUNTING
  24. DECLARE_IDispatch_METHODS
  25. DECLARE_ISupportErrorInfo_METHODS
  26. DECLARE_IADs_METHODS
  27. DECLARE_IADsGroup_METHODS
  28. DECLARE_IADsPropertyList_METHODS
  29. DECLARE_IADsExtension_METHODS
  30. CWinNTGroup::CWinNTGroup();
  31. CWinNTGroup::~CWinNTGroup();
  32. static
  33. HRESULT
  34. CWinNTGroup::CreateGroup(
  35. BSTR Parent,
  36. ULONG ParentType,
  37. BSTR DomainName,
  38. BSTR ServerName,
  39. BSTR GroupName,
  40. ULONG GroupType,
  41. DWORD dwObjectState,
  42. REFIID riid,
  43. CWinNTCredentials& Credentials,
  44. void **ppvObj
  45. );
  46. static
  47. HRESULT
  48. CWinNTGroup::CreateGroup(
  49. BSTR Parent,
  50. ULONG ParentType,
  51. BSTR DomainName,
  52. BSTR ServerName,
  53. BSTR GroupName,
  54. ULONG GroupType,
  55. DWORD dwObjectState,
  56. PSID pSid, // OPTIONAL
  57. REFIID riid,
  58. CWinNTCredentials& Credentials,
  59. void **ppvObj
  60. );
  61. static
  62. HRESULT
  63. CWinNTGroup::AllocateGroupObject(
  64. CWinNTGroup ** ppGroup
  65. );
  66. STDMETHOD(GetInfo)(THIS_ DWORD dwApiLevel, BOOL fExplicit) ;
  67. STDMETHOD(ImplicitGetInfo)(void);
  68. //
  69. // Helper to delete based on SID.
  70. //
  71. HRESULT DeleteBySID(
  72. LPWSTR pszStringSID,
  73. LPWSTR pszServerName
  74. );
  75. //
  76. // Helper to add based on SID.
  77. //
  78. HRESULT AddBySID(
  79. LPWSTR pszStringSID,
  80. LPWSTR pszServerName
  81. );
  82. protected:
  83. HRESULT
  84. CWinNTGroup::UnMarshall(LPBYTE lpBuffer, DWORD dwApiLevel, BOOL fExplicit);
  85. HRESULT
  86. CWinNTGroup::UnMarshall_Level1(BOOL fExplicit, LPBYTE pBuffer);
  87. HRESULT
  88. CWinNTGroup::Prepopulate(
  89. BOOL fExplicit,
  90. PSID pSid // OPTIONAL
  91. );
  92. HRESULT
  93. CWinNTGroup::Marshall_Set_Level1(
  94. LPWSTR szHostServerName,
  95. BOOL fExplicit,
  96. LPBYTE pBuffer
  97. );
  98. HRESULT
  99. CWinNTGroup::Marshall_Create_Level1(
  100. LPWSTR szHostServerName,
  101. LPGROUP_INFO_1 pGroupInfo1
  102. );
  103. HRESULT
  104. CWinNTGroup::GetStandardInfo(
  105. DWORD dwApiLevel,
  106. BOOL fExplicit
  107. );
  108. HRESULT
  109. CWinNTGroup::GetSidInfo(
  110. BOOL fExplicit
  111. );
  112. protected:
  113. ULONG _ParentType;
  114. BSTR _DomainName;
  115. BSTR _ServerName;
  116. ULONG _GroupType;
  117. CAggregatorDispMgr FAR * _pDispMgr;
  118. CADsExtMgr FAR * _pExtMgr;
  119. CPropertyCache * _pPropertyCache;
  120. CWinNTCredentials _Credentials;
  121. };