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.

212 lines
4.3 KiB

  1. //----------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 2000.
  5. //
  6. // File: cumicurs.hxx
  7. //
  8. // Contents: Header file for CUmiCursor, can be used with both IADsContainer
  9. // and also for queries.
  10. //
  11. // History: 03-16-00 SivaramR Created (in WinNT).
  12. // 03-28-00 AjayR modified for LDAP.
  13. //
  14. //----------------------------------------------------------------------------
  15. #ifndef __CUMICURS_H__
  16. #define __CUMICURS_H__
  17. class CUmiCursor : INHERIT_TRACKING,
  18. public IUmiCursor
  19. {
  20. public:
  21. //
  22. // IUknown Support.
  23. //
  24. DECLARE_STD_REFCOUNTING
  25. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) ;
  26. //
  27. // IUmiCursor Methods.
  28. //
  29. STDMETHOD (SetIID)(
  30. IN REFIID riid
  31. );
  32. STDMETHOD (Reset)();
  33. STDMETHOD (Next)(
  34. IN ULONG uNumRequested,
  35. OUT ULONG *puNumReturned,
  36. OUT LPVOID *ppObjects
  37. );
  38. STDMETHOD (Count)(
  39. OUT ULONG *puNumObjects
  40. );
  41. STDMETHOD (Previous)(
  42. IN ULONG uFlags,
  43. OUT LPVOID *pObj
  44. );
  45. //
  46. // IUmiBaseObject methods
  47. //
  48. STDMETHOD (GetLastStatus)(
  49. IN ULONG uFlags,
  50. OUT ULONG *puSpecificStatus,
  51. IN REFIID riid,
  52. OUT LPVOID *pStatusObj
  53. );
  54. STDMETHOD (GetInterfacePropList)(
  55. IN ULONG uFlags,
  56. OUT IUmiPropList **pPropList
  57. );
  58. //
  59. // IUmiPropList Methods - none need to be implemented.
  60. // There are only interface properties on cursors.
  61. //
  62. STDMETHODIMP Put(
  63. IN LPCWSTR pszName,
  64. IN ULONG uFlags,
  65. OUT UMI_PROPERTY_VALUES *pProp
  66. )
  67. {
  68. SetLastStatus(0);
  69. RRETURN(E_NOTIMPL);
  70. }
  71. STDMETHODIMP Get(
  72. IN LPCWSTR pszName,
  73. IN ULONG uFlags,
  74. OUT UMI_PROPERTY_VALUES **ppProp
  75. )
  76. {
  77. SetLastStatus(0);
  78. RRETURN(E_NOTIMPL);
  79. }
  80. STDMETHODIMP GetAs(
  81. IN LPCWSTR pszName,
  82. IN ULONG uFlags,
  83. IN ULONG uCoercionType,
  84. OUT UMI_PROPERTY_VALUES **ppProp
  85. )
  86. {
  87. SetLastStatus(0);
  88. RRETURN(E_NOTIMPL);
  89. }
  90. STDMETHODIMP FreeMemory(
  91. IN ULONG uReserved,
  92. IN LPVOID pMem
  93. )
  94. {
  95. SetLastStatus(0);
  96. RRETURN(E_NOTIMPL);
  97. }
  98. STDMETHODIMP GetAt(
  99. IN LPCWSTR pszName,
  100. IN ULONG uFlags,
  101. IN ULONG uBufferLength,
  102. OUT LPVOID pExistingMem
  103. )
  104. {
  105. SetLastStatus(0);
  106. RRETURN(E_NOTIMPL);
  107. }
  108. STDMETHODIMP GetProps(
  109. IN LPCWSTR *pszNames,
  110. IN ULONG uNameCount,
  111. IN ULONG uFlags,
  112. OUT UMI_PROPERTY_VALUES **pProps
  113. )
  114. {
  115. SetLastStatus(0);
  116. RRETURN(E_NOTIMPL);
  117. }
  118. STDMETHODIMP PutProps(
  119. IN LPCWSTR *pszNames,
  120. IN ULONG uNameCount,
  121. IN ULONG uFlags,
  122. OUT UMI_PROPERTY_VALUES *pProps
  123. )
  124. {
  125. SetLastStatus(0);
  126. RRETURN(E_NOTIMPL);
  127. }
  128. STDMETHODIMP PutFrom(
  129. IN LPCWSTR pszName,
  130. IN ULONG uFlags,
  131. IN ULONG uBufferLength,
  132. IN LPVOID pExistingMem
  133. )
  134. {
  135. SetLastStatus(0);
  136. RRETURN(E_NOTIMPL);
  137. }
  138. STDMETHODIMP Delete(
  139. IN LPCWSTR pszName,
  140. IN ULONG uFlags
  141. )
  142. {
  143. SetLastStatus(0);
  144. RRETURN(E_NOTIMPL);
  145. }
  146. CUmiCursor::CUmiCursor();
  147. CUmiCursor::~CUmiCursor();
  148. //
  149. // For use with IADsContainer.
  150. //
  151. static
  152. HRESULT
  153. CUmiCursor::CreateCursor(
  154. IUnknown *pCont,
  155. REFIID iid,
  156. LPVOID *ppInterface
  157. );
  158. //
  159. // For use with a query -> IUmiQuery.
  160. //
  161. static
  162. HRESULT
  163. CUmiCursor::CreateCursor(
  164. IUmiQuery *pQuery,
  165. IUmiConnection *pConnection,
  166. IUnknown *pUnk,
  167. LPCWSTR pszADsPath,
  168. LPCWSTR pszLdapServer,
  169. LPCWSTR pszLdapDn,
  170. CCredentials cCredentials,
  171. DWORD dwPort,
  172. REFIID iid,
  173. LPVOID *ppInterface
  174. );
  175. private:
  176. void SetLastStatus(ULONG ulStatus);
  177. HRESULT GetFilter(VARIANT *pvFilter);
  178. BOOL _fQuery;
  179. CPropertyManager *_pPropMgr;
  180. ULONG _ulErrorStatus;
  181. IID *_pIID;
  182. IADsContainer *_pContainer;
  183. IEnumVARIANT *_pEnum;
  184. CUmiSearchHelper *_pSearchHelper;
  185. };
  186. #endif // __CUMICURS_H__