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.

224 lines
4.4 KiB

  1. class CADsExtMgr;
  2. class CLDAPGenObject : INHERIT_TRACKING,
  3. public CCoreADsObject,
  4. public ISupportErrorInfo,
  5. public IADs,
  6. public IADsContainer,
  7. public IDirectoryObject,
  8. public IDirectorySearch,
  9. public IDirectorySchemaMgmt,
  10. public IADsPropertyList,
  11. public IADsObjectOptions,
  12. public IGetAttributeSyntax,
  13. public IADsDeleteOps,
  14. public IADsObjOptPrivate
  15. {
  16. public:
  17. /* IUnknown methods */
  18. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) ;
  19. DECLARE_STD_REFCOUNTING
  20. DECLARE_IDispatch_METHODS
  21. DECLARE_ISupportErrorInfo_METHODS
  22. DECLARE_IADs_METHODS
  23. DECLARE_IADsPropertyList_METHODS
  24. DECLARE_IADsContainer_METHODS
  25. DECLARE_IDirectoryObject_METHODS
  26. DECLARE_IDirectorySearch_METHODS
  27. DECLARE_IDirectorySchemaMgmt_METHODS
  28. DECLARE_IADsObjectOptions_METHODS
  29. DECLARE_IADsObjOptPrivate_METHODS
  30. DECLARE_IGetAttributeSyntax_METHODS
  31. DECLARE_IADsDeleteOps_METHODS
  32. CLDAPGenObject::CLDAPGenObject();
  33. CLDAPGenObject::~CLDAPGenObject();
  34. static
  35. HRESULT
  36. CLDAPGenObject::CreateGenericObject(
  37. BSTR Parent,
  38. BSTR CommonName,
  39. BSTR LdapClassName,
  40. CCredentials& Credentials,
  41. DWORD dwObjectState,
  42. REFIID riid,
  43. void **ppvObj,
  44. BOOL fClassDefaulted = FALSE,
  45. BOOL fNoQI = FALSE
  46. );
  47. static
  48. HRESULT
  49. CLDAPGenObject::CreateGenericObject(
  50. BSTR Parent,
  51. BSTR CommonName,
  52. LPWSTR LdapClassNames[],
  53. long lnNumClasses,
  54. CCredentials& Credentials,
  55. DWORD dwObjectState,
  56. REFIID riid,
  57. void **ppvObj,
  58. BOOL fClassDefaulted = FALSE,
  59. BOOL fNoQI = FALSE
  60. );
  61. //
  62. // This static constructor is used by UMI Searches.
  63. //
  64. static
  65. HRESULT
  66. CLDAPGenObject::CreateGenericObject(
  67. BSTR Parent,
  68. BSTR CommonName,
  69. CCredentials& Credentials,
  70. DWORD dwObjectState,
  71. PADSLDP ldapHandle,
  72. LDAPMessage *pldapMsg,
  73. REFIID riid,
  74. void **ppvObj
  75. );
  76. static
  77. HRESULT
  78. CLDAPGenObject::AllocateGenObject(
  79. LPWSTR pszClassName,
  80. CCredentials &Credentials,
  81. CLDAPGenObject ** ppGenObject
  82. );
  83. STDMETHOD(GetInfo)(
  84. DWORD dwFlags
  85. );
  86. HRESULT
  87. CLDAPGenObject::GetActualHostName(
  88. LPWSTR *pValue
  89. );
  90. HRESULT
  91. CLDAPGenObject::LDAPSetObject();
  92. HRESULT
  93. CLDAPGenObject::LDAPCreateObject();
  94. protected:
  95. VARIANT _vFilter;
  96. VARIANT _vHints;
  97. CADsExtMgr FAR * _pExtMgr;
  98. CPropertyCache FAR * _pPropertyCache;
  99. CAggregatorDispMgr FAR * _pDispMgr;
  100. LPWSTR _pszLDAPServer;
  101. LPWSTR _pszLDAPDn;
  102. PADSLDP _pLdapHandle;
  103. LDAP_SEARCH_PREF _SearchPref;
  104. CCredentials _Credentials;
  105. DWORD _dwPort;
  106. DWORD _dwOptReferral;
  107. DWORD _dwPageSize;
  108. SECURITY_INFORMATION _seInfo;
  109. //
  110. // Used to hold info about class and GUID
  111. //
  112. DWORD _dwCorePropStatus;
  113. BOOL _fRangeRetrieval;
  114. BOOL _fExplicitSecurityMask;
  115. };
  116. //
  117. // Will be used as a mask for the _dwCorePropStatus
  118. #define LDAP_CLASS_VALID 0x1
  119. #define LDAP_GUID_VALID 0x2
  120. HRESULT
  121. ConvertByRefSafeArrayToVariantArray(
  122. VARIANT varSafeArray,
  123. PVARIANT * ppVarArray,
  124. PDWORD pdwNumVariants
  125. );
  126. HRESULT
  127. CreatePropEntry(
  128. LPWSTR szPropName,
  129. DWORD ADsType,
  130. DWORD numValues,
  131. DWORD dwControlCode,
  132. VARIANT varData,
  133. REFIID riid,
  134. LPVOID * ppDispatch
  135. );
  136. HRESULT
  137. ConvertVariantToLdapValues(
  138. VARIANT varData,
  139. LPWSTR szPropertyName,
  140. PDWORD pdwControlCode,
  141. LDAPOBJECTARRAY * pldapDestObjects,
  142. PDWORD pdwSyntaxId,
  143. LPWSTR pszServer,
  144. CCredentials* Credentials,
  145. DWORD dwPort
  146. );
  147. void
  148. FreeVariantArray(
  149. VARIANT * pVarArray,
  150. DWORD dwNumValues
  151. );
  152. HRESULT
  153. ConvertVariantToVariantArray(
  154. VARIANT varData,
  155. VARIANT ** ppVarArray,
  156. DWORD * pdwNumValues
  157. );
  158. HRESULT
  159. ConvertLdapValuesToVariant(
  160. BSTR bstrPropName,
  161. LDAPOBJECTARRAY * pldapSrcObjects,
  162. DWORD dwAdsType,
  163. DWORD dwControlCode,
  164. PVARIANT pVarProp,
  165. LPWSTR pszServer,
  166. CCredentials* Credentials
  167. );
  168. DWORD
  169. MapPropCacheFlagToControlCode(
  170. DWORD dwPropStatus
  171. );