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.

335 lines
7.2 KiB

  1. class CPropertyCache;
  2. class CLDAPSchema : INHERIT_TRACKING,
  3. public CCoreADsObject,
  4. public ISupportErrorInfo,
  5. public IADs,
  6. public IADsContainer,
  7. public IGetAttributeSyntax
  8. {
  9. public:
  10. /* IUnknown methods */
  11. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) ;
  12. DECLARE_STD_REFCOUNTING
  13. /* Other methods */
  14. DECLARE_IDispatch_METHODS
  15. DECLARE_ISupportErrorInfo_METHODS
  16. DECLARE_IADs_METHODS
  17. DECLARE_IADsContainer_METHODS
  18. DECLARE_IGetAttributeSyntax_METHODS
  19. /* Constructors, Destructors .... */
  20. CLDAPSchema::CLDAPSchema();
  21. CLDAPSchema::~CLDAPSchema();
  22. static HRESULT CLDAPSchema::CreateSchema(
  23. BSTR bstrParent,
  24. BSTR bstrName,
  25. LPTSTR pszServerPath,
  26. CCredentials& Credentials,
  27. DWORD dwObjectState,
  28. REFIID riid,
  29. void **ppvObj );
  30. static HRESULT CLDAPSchema::AllocateSchemaObject(
  31. CLDAPSchema **ppSchema,
  32. CCredentials& Credentials
  33. );
  34. HRESULT CLDAPSchema::LDAPRefreshSchema();
  35. STDMETHOD(GetInfo)(DWORD dwFlags);
  36. protected:
  37. CAggregatorDispMgr FAR * _pDispMgr;
  38. VARIANT _vFilter;
  39. VARIANT _vHints;
  40. TCHAR _szServerPath[MAX_PATH];
  41. CCredentials _Credentials;
  42. DWORD _dwPort;
  43. CPropertyCache FAR * _pPropertyCache;
  44. };
  45. class CLDAPClass : INHERIT_TRACKING,
  46. public CCoreADsObject,
  47. public IADsClass,
  48. public IGetAttributeSyntax,
  49. public ISupportErrorInfo,
  50. public IADsUmiHelperPrivate
  51. {
  52. public:
  53. /* IUnknown methods */
  54. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) ;
  55. DECLARE_STD_REFCOUNTING
  56. /* Other methods */
  57. DECLARE_IDispatch_METHODS
  58. DECLARE_ISupportErrorInfo_METHODS
  59. DECLARE_IADs_METHODS
  60. DECLARE_IADsClass_METHODS
  61. DECLARE_IGetAttributeSyntax_METHODS
  62. //
  63. // Used for Umi Schema support.
  64. //
  65. STDMETHOD (GetPropertiesHelper)(
  66. void **ppPropertyInfo,
  67. PDWORD pdwPropCount
  68. );
  69. STDMETHOD (GetOriginHelper)(
  70. LPCWSTR pszName,
  71. BSTR *pbstrOrigin
  72. );
  73. /* Constructors, Destructors, .... */
  74. CLDAPClass::CLDAPClass();
  75. CLDAPClass::~CLDAPClass();
  76. static HRESULT CLDAPClass::CreateClass(
  77. BSTR bstrParent,
  78. LDAP_SCHEMA_HANDLE hSchema,
  79. BSTR bstrName,
  80. CLASSINFO *pClassInfo,
  81. CCredentials& Credentials,
  82. DWORD dwObjectState,
  83. REFIID riid,
  84. void **ppvObj );
  85. static HRESULT CLDAPClass::AllocateClassObject(
  86. CCredentials& Credentials,
  87. CLDAPClass **ppClass );
  88. HRESULT CLDAPClass::LDAPSetObject( BOOL *pfChanged );
  89. HRESULT CLDAPClass::LDAPCreateObject();
  90. HRESULT CLDAPClass::LDAPRefreshSchema();
  91. HRESULT CLDAPClass::FindModifications(
  92. int *pOIDs,
  93. DWORD nNumOfOids,
  94. LPTSTR pszPropName,
  95. LDAPModW ***aMods,
  96. DWORD *pdwNumOfMods
  97. );
  98. HRESULT CLDAPClass::AddModifyRequest(
  99. LDAPModW ***aMods,
  100. DWORD *pdwNumOfMods,
  101. LPTSTR pszPropName,
  102. LPTSTR *aValuesAdd,
  103. LPTSTR *aValuesRemove
  104. );
  105. HRESULT CLDAPClass::get_NTDSProp_Helper(
  106. BSTR bstrName,
  107. VARIANT FAR *pvProp
  108. );
  109. HRESULT CLDAPClass::GetNTDSSchemaInfo(
  110. BOOL fForce
  111. );
  112. STDMETHOD(GetInfo)(DWORD dwFlags);
  113. HRESULT
  114. CLDAPClass::LoadInterfaceInfo(void);
  115. protected:
  116. CAggregatorDispMgr FAR * _pDispMgr;
  117. CPropertyCache FAR * _pPropertyCache;
  118. /* Properties */
  119. BOOL _fLoadedInterfaceInfo;
  120. BSTR _bstrCLSID;
  121. BSTR _bstrPrimaryInterface;
  122. BSTR _bstrHelpFileName;
  123. long _lHelpFileContext;
  124. LDAP_SCHEMA_HANDLE _hSchema;
  125. CLASSINFO *_pClassInfo;
  126. /* NT Specific */
  127. BOOL _fNTDS;
  128. ADS_LDP *_ld;
  129. LPWSTR _pszLDAPServer;
  130. LPWSTR _pszLDAPDn;
  131. CCredentials _Credentials;
  132. DWORD _dwPort;
  133. };
  134. class CLDAPProperty : INHERIT_TRACKING,
  135. public ISupportErrorInfo,
  136. public CCoreADsObject,
  137. public IADsProperty,
  138. public IGetAttributeSyntax
  139. {
  140. public:
  141. /* IUnknown methods */
  142. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) ;
  143. DECLARE_STD_REFCOUNTING
  144. /* Other methods */
  145. DECLARE_IDispatch_METHODS
  146. DECLARE_ISupportErrorInfo_METHODS
  147. DECLARE_IADs_METHODS
  148. DECLARE_IADsProperty_METHODS
  149. DECLARE_IGetAttributeSyntax_METHODS
  150. /* Constructors, Destructors, ... */
  151. CLDAPProperty::CLDAPProperty();
  152. CLDAPProperty::~CLDAPProperty();
  153. HRESULT CLDAPProperty::LDAPSetObject( BOOL *pfChanged );
  154. HRESULT CLDAPProperty::LDAPCreateObject();
  155. HRESULT CLDAPProperty::LDAPRefreshSchema();
  156. static HRESULT CLDAPProperty::CreateProperty(
  157. BSTR bstrParent,
  158. LDAP_SCHEMA_HANDLE hSchema,
  159. BSTR bstrName,
  160. PROPERTYINFO *pPropertyInfo,
  161. CCredentials& Credentials,
  162. DWORD dwObjectState,
  163. REFIID riid,
  164. void **ppvObj );
  165. static HRESULT CLDAPProperty::AllocatePropertyObject(
  166. CCredentials& Credentials,
  167. CLDAPProperty **ppProperty );
  168. STDMETHOD(GetInfo)(DWORD dwFlags);
  169. HRESULT CLDAPProperty::GetNTDSSchemaInfo(
  170. BOOL fForce
  171. );
  172. protected:
  173. CAggregatorDispMgr FAR * _pDispMgr;
  174. CPropertyCache FAR * _pPropertyCache;
  175. /* Properties */
  176. LDAP_SCHEMA_HANDLE _hSchema;
  177. PROPERTYINFO *_pPropertyInfo;
  178. BSTR _bstrSyntax;
  179. /* NT Specific */
  180. BOOL _fNTDS;
  181. ADS_LDP *_ld;
  182. TCHAR *_pszLDAPPathName;
  183. LPWSTR _pszLDAPServer;
  184. LPWSTR _pszLDAPDn;
  185. CCredentials _Credentials;
  186. DWORD _dwPort;
  187. };
  188. class CLDAPSyntax : INHERIT_TRACKING,
  189. public CCoreADsObject,
  190. public ISupportErrorInfo,
  191. public IADsSyntax,
  192. public IGetAttributeSyntax
  193. {
  194. public:
  195. /* IUnknown methods */
  196. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) ;
  197. DECLARE_STD_REFCOUNTING
  198. /* Other methods */
  199. DECLARE_IDispatch_METHODS
  200. DECLARE_IADs_METHODS
  201. DECLARE_ISupportErrorInfo_METHODS
  202. DECLARE_IADsSyntax_METHODS
  203. DECLARE_IGetAttributeSyntax_METHODS
  204. /* Constructors, Destructors, ... */
  205. CLDAPSyntax::CLDAPSyntax();
  206. CLDAPSyntax::~CLDAPSyntax();
  207. static HRESULT CLDAPSyntax::CreateSyntax(
  208. BSTR bstrParent,
  209. SYNTAXINFO *pSyntaxInfo,
  210. CCredentials& Credentials,
  211. DWORD dwObjectState,
  212. REFIID riid,
  213. void **ppvObj );
  214. static HRESULT CLDAPSyntax::AllocateSyntaxObject(
  215. CCredentials& Credentials,
  216. CLDAPSyntax **ppSyntax );
  217. protected:
  218. CAggregatorDispMgr FAR * _pDispMgr;
  219. /* Properties */
  220. long _lOleAutoDataType;
  221. CCredentials _Credentials;
  222. //
  223. // Used only in Umi land.
  224. //
  225. CPropertyCache FAR * _pPropertyCache;
  226. };
  227. extern DWORD g_cLDAPSyntax;
  228. extern SYNTAXINFO g_aLDAPSyntax[];
  229. BOOL
  230. MapLdapClassToADsClass(
  231. LPTSTR *aLdapClasses,
  232. int nCount,
  233. LPTSTR pszADsClass
  234. );
  235. BOOL
  236. MapLdapClassToADsClass(
  237. LPTSTR pszClassName,
  238. LDAP_SCHEMA_HANDLE hSchema,
  239. LPTSTR pszADsClass
  240. );