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.

292 lines
6.5 KiB

  1. //----------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 2000.
  5. //
  6. // File: cumiobj.hxx
  7. //
  8. // Contents: Header file for CLDAPUmiObject for LDAP Provider.
  9. //
  10. // History: 03-06-00 SivaramR Created.
  11. // 04-07-00 AjayR modified for LDAP Provider.
  12. //
  13. //----------------------------------------------------------------------------
  14. #ifndef __CUMIOBJ_H__
  15. #define __CUMIOBJ_H__
  16. //
  17. // Used internall to do implicit getinfo on clone/copy as needed.
  18. //
  19. #define ADSI_INTERNAL_FLAG_GETINFO_AS_NEEDED 0x8000
  20. class CPropetyManager;
  21. class CCoreADsObject;
  22. class CLDAPUmiObject : INHERIT_TRACKING,
  23. public IUmiContainer,
  24. public IUmiCustomInterfaceFactory,
  25. public IADsObjOptPrivate
  26. {
  27. public:
  28. //
  29. // IUnknown support.
  30. //
  31. DECLARE_STD_REFCOUNTING
  32. //
  33. // IADsObjOptPrivate.
  34. //
  35. DECLARE_IADsObjOptPrivate_METHODS
  36. STDMETHOD (QueryInterface)(
  37. IN REFIID iid,
  38. OUT LPVOID *ppInterface
  39. );
  40. //
  41. // IUmiObject support.
  42. //
  43. STDMETHOD (Clone)(
  44. IN ULONG uFlags,
  45. IN REFIID riid,
  46. OUT LPVOID *pCopy
  47. );
  48. STDMETHOD (CopyTo)(
  49. IN ULONG uFlags,
  50. IN IUmiURL *pURL,
  51. IN REFIID riid,
  52. OUT LPVOID *pCopy
  53. );
  54. STDMETHOD (Refresh)(
  55. IN ULONG uFlags,
  56. IN ULONG uNameCount,
  57. IN LPWSTR *pszNames
  58. );
  59. STDMETHOD (Commit)(IN ULONG uFlags);
  60. //
  61. // IUmiPropList support.
  62. //
  63. STDMETHOD (Put)(
  64. IN LPCWSTR pszName,
  65. IN ULONG uFlags,
  66. IN UMI_PROPERTY_VALUES *pProp
  67. );
  68. STDMETHOD (Get)(
  69. IN LPCWSTR pszName,
  70. IN ULONG uFlags,
  71. OUT UMI_PROPERTY_VALUES **ppProp
  72. );
  73. STDMETHOD (GetAs)(
  74. IN LPCWSTR pszName,
  75. IN ULONG uFlags,
  76. IN ULONG uCoercionType,
  77. OUT UMI_PROPERTY_VALUES **ppProp
  78. );
  79. STDMETHOD (GetAt)(
  80. IN LPCWSTR pszName,
  81. IN ULONG uFlags,
  82. IN ULONG uBufferLength,
  83. OUT LPVOID pExistingMem
  84. );
  85. STDMETHOD (FreeMemory)(
  86. IN ULONG uReserved,
  87. IN LPVOID pMem
  88. );
  89. STDMETHOD (Delete)(
  90. IN LPCWSTR pszName,
  91. IN ULONG uFlags
  92. );
  93. STDMETHOD (GetProps)(
  94. IN LPCWSTR *pszNames,
  95. IN ULONG uNameCount,
  96. IN ULONG uFlags,
  97. OUT UMI_PROPERTY_VALUES **pProps
  98. );
  99. STDMETHOD (PutProps)(
  100. IN LPCWSTR *pszNames,
  101. IN ULONG uNameCount,
  102. IN ULONG uFlags,
  103. IN UMI_PROPERTY_VALUES *pProps
  104. );
  105. STDMETHOD (PutFrom)(
  106. IN LPCWSTR pszName,
  107. IN ULONG uFlags,
  108. IN ULONG uBufferLength,
  109. IN LPVOID pExistingMem
  110. );
  111. //
  112. // IUmiBaseObject support.
  113. //
  114. STDMETHOD (GetLastStatus)(
  115. IN ULONG uFlags,
  116. OUT ULONG *puSpecificStatus,
  117. IN REFIID riid,
  118. OUT LPVOID *pStatusObj
  119. );
  120. STDMETHOD (GetInterfacePropList)(
  121. IN ULONG uFlags,
  122. OUT IUmiPropList **pPropList
  123. );
  124. //
  125. // IUmiContainer Support.
  126. //
  127. STDMETHOD (Open)(
  128. IN IUmiURL *pURL,
  129. IN ULONG uFlags,
  130. IN REFIID TargetIID,
  131. OUT LPVOID *ppInterface
  132. );
  133. STDMETHOD (PutObject)(
  134. IN ULONG uFlags,
  135. IN REFIID TargetIID,
  136. IN LPVOID pInterface
  137. );
  138. STDMETHOD (DeleteObject)(
  139. IN IUmiURL *pURL,
  140. IN ULONG uFlags
  141. );
  142. STDMETHOD (Create)(
  143. IN IUmiURL *pURL,
  144. IN ULONG uFlags,
  145. OUT IUmiObject **pNewObj
  146. );
  147. STDMETHOD (Move)(
  148. IN ULONG uFlags,
  149. IN IUmiURL *pOldURL,
  150. IN IUmiURL *pNewURL
  151. );
  152. STDMETHOD (CreateEnum)(
  153. IN IUmiURL *pszEnumContext,
  154. IN ULONG uFlags,
  155. IN REFIID TargetIID,
  156. OUT LPVOID *ppInterface
  157. );
  158. STDMETHOD (ExecQuery)(
  159. IN IUmiQuery *pQuery,
  160. IN ULONG uFlags,
  161. IN REFIID TargetIID,
  162. OUT LPVOID *ppInterface
  163. );
  164. //
  165. // IUmiCustomInterfaceFactory support.
  166. //
  167. STDMETHOD (GetCLSIDForIID)(
  168. IN REFIID riid,
  169. IN long lFlags,
  170. IN OUT CLSID *pCLSID
  171. );
  172. STDMETHOD (GetObjectByCLSID)(
  173. IN CLSID clsid,
  174. IN IUnknown *pUnkOuter,
  175. IN DWORD dwClsContext,
  176. IN REFIID riid,
  177. IN long lFlags,
  178. OUT void **ppInterface
  179. );
  180. STDMETHOD (GetCLSIDForNames)(
  181. IN LPOLESTR * rgszNames,
  182. IN UINT cNames,
  183. IN LCID lcid,
  184. OUT DISPID * rgDispId,
  185. IN long lFlags,
  186. IN OUT CLSID *pCLSID
  187. );
  188. //
  189. // Constructor and destructor and other miscellaneos methods.
  190. //
  191. CLDAPUmiObject::CLDAPUmiObject();
  192. CLDAPUmiObject::~CLDAPUmiObject();
  193. static
  194. HRESULT
  195. CLDAPUmiObject::CreateLDAPUmiObject(
  196. INTF_PROP_DATA intfPropTable[],
  197. CPropertyCache *pPropertyCache,
  198. IUnknown *pUnkInner,
  199. CCoreADsObject *pCoreObj,
  200. IADs *pIADs,
  201. CCredentials *pCreds,
  202. CLDAPUmiObject **ppUmiObj,
  203. DWORD dwPort = (DWORD) -1,
  204. PADSLDP pLdapHandle = NULL,
  205. LPWSTR pszServerName = NULL,
  206. LPWSTR _pszLDAPDn = NULL,
  207. CADsExtMgr *pExtMgr = NULL
  208. );
  209. protected:
  210. HRESULT
  211. CLDAPUmiObject::CopyToHelper(
  212. IUmiObject *pUmiSrcObj,
  213. IUmiObject *pUmiDestObj,
  214. ULONG uFlags,
  215. BOOL fMarkAsUpdate = TRUE,
  216. BOOL fCopyIntfProps = FALSE
  217. );
  218. HRESULT
  219. CLDAPUmiObject::VerifyIfQueryIsValid(
  220. IUmiQuery * pUmiQuery
  221. );
  222. HRESULT
  223. CLDAPUmiObject::VerifyIfClassMatches(
  224. LPWSTR pszClass,
  225. IUnknown * pUnk,
  226. LONG lGenus
  227. );
  228. private:
  229. CPropertyManager *_pPropMgr;
  230. CPropertyManager *_pIntfPropMgr;
  231. IUnknown *_pUnkInner;
  232. IADs *_pIADs;
  233. IADsContainer *_pIADsContainer;
  234. ULONG _ulErrorStatus;
  235. CCoreADsObject *_pCoreObj;
  236. CADsExtMgr *_pExtMgr;
  237. BOOL _fOuterUnkSet;
  238. //
  239. // Make sure to update the cxx file.
  240. //
  241. //
  242. // do not free this are just ptrs.
  243. //
  244. CCredentials *_pCreds;
  245. LPWSTR _pszLDAPServer;
  246. LPWSTR _pszLDAPDn;
  247. PADSLDP _pLdapHandle;
  248. DWORD _dwPort;
  249. void SetLastStatus(ULONG ulStatus);
  250. };
  251. #endif //__CUMIOBJ_H__