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.

275 lines
9.7 KiB

  1. #ifndef __dsquery_h
  2. #define __dsquery_h
  3. #ifndef __dsqueryp_h ;internal
  4. #define __dsqueryp_h ;internal
  5. //
  6. // query handler ID for dsquery.
  7. //
  8. DEFINE_GUID(CLSID_DsQuery, 0x8a23e65e, 0x31c2, 0x11d0, 0x89, 0x1c, 0x0, 0xa0, 0x24, 0xab, 0x2d, 0xbb);
  9. //
  10. // standard forms shipped in dsquery.dll
  11. //
  12. DEFINE_GUID(CLSID_DsFindObjects, 0x83ee3fe1, 0x57d9, 0x11d0, 0xb9, 0x32, 0x0, 0xa0, 0x24, 0xab, 0x2d, 0xbb);
  13. DEFINE_GUID(CLSID_DsFindPeople, 0x83ee3fe2, 0x57d9, 0x11d0, 0xb9, 0x32, 0x0, 0xa0, 0x24, 0xab, 0x2d, 0xbb);
  14. DEFINE_GUID(CLSID_DsFindPrinter, 0xb577f070, 0x7ee2, 0x11d0, 0x91, 0x3f, 0x0, 0xaa, 0x0, 0xc1, 0x6e, 0x65);
  15. DEFINE_GUID(CLSID_DsFindComputer, 0x16006700, 0x87ad, 0x11d0, 0x91, 0x40, 0x0, 0xaa, 0x0, 0xc1, 0x6e, 0x65);
  16. DEFINE_GUID(CLSID_DsFindVolume, 0xc1b3cbf1, 0x886a, 0x11d0, 0x91, 0x40, 0x0, 0xaa, 0x0, 0xc1, 0x6e, 0x65);
  17. DEFINE_GUID(CLSID_DsFindContainer, 0xc1b3cbf2, 0x886a, 0x11d0, 0x91, 0x40, 0x0, 0xaa, 0x0, 0xc1, 0x6e, 0x65);
  18. DEFINE_GUID(CLSID_DsFindAdvanced, 0x83ee3fe3, 0x57d9, 0x11d0, 0xb9, 0x32, 0x0, 0xa0, 0x24, 0xab, 0x2d, 0xbb);
  19. //
  20. // admin forms
  21. //
  22. DEFINE_GUID(CLSID_DsFindDomainController, 0x538c7b7e, 0xd25e, 0x11d0, 0x97, 0x42, 0x0, 0xa0, 0xc9, 0x6, 0xaf, 0x45);
  23. DEFINE_GUID(CLSID_DsFindFrsMembers, 0x94ce4b18, 0xb3d3, 0x11d1, 0xb9, 0xb4, 0x0, 0xc0, 0x4f, 0xd8, 0xd5, 0xb0);
  24. ;begin_internal
  25. #define IID_IDsQueryHandler CLSID_DsQuery
  26. DEFINE_GUID(IID_IDsQueryColumnHandler, 0xc072999e, 0xfa49, 0x11d1, 0xa0, 0xaf, 0x00, 0xc0, 0x4f, 0xa3, 0x1a, 0x86);
  27. ;end_internal
  28. #ifndef GUID_DEFS_ONLY ;both
  29. //
  30. // DSQUERYINITPARAMS
  31. // -----------------
  32. // This structured is used when creating a new query view.
  33. //
  34. #define DSQPF_NOSAVE 0x00000001 // = 1 => remove save verb
  35. #define DSQPF_SAVELOCATION 0x00000002 // = 1 => pSaveLocation contains directory to save queries into
  36. #define DSQPF_SHOWHIDDENOBJECTS 0x00000004 // = 1 => show objects marked as "hidden" in results
  37. #define DSQPF_ENABLEADMINFEATURES 0x00000008 // = 1 => show admin verbs, property pages etc
  38. #define DSQPF_ENABLEADVANCEDFEATURES 0x00000010 // = 1 => set the advanced flag for the property pages
  39. #define DSQPF_HASCREDENTIALS 0x00000020 // = 1 => pServer, pUserName & pPassword are valid
  40. #define DSQPF_NOCHOOSECOLUMNS 0x00000040 // = 1 => remove choose columns from view
  41. ;begin_internal
  42. #define DSQPF_RETURNALLRESULTS 0x80000000 // = 1 => return all results on OK, not just selection
  43. ;end_internal
  44. typedef struct
  45. {
  46. DWORD cbStruct;
  47. DWORD dwFlags;
  48. LPWSTR pDefaultScope; // -> Active Directory path to use as scope / == NULL for none
  49. LPWSTR pDefaultSaveLocation; // -> Directory to save queries into / == NULL default location
  50. LPWSTR pUserName; // -> user name to authenticate with
  51. LPWSTR pPassword; // -> password for authentication
  52. LPWSTR pServer; // -> server to use for obtaining trusts etc
  53. } DSQUERYINITPARAMS, * LPDSQUERYINITPARAMS;
  54. //
  55. // DSQUERYPARAMS
  56. // -------------
  57. // The DS query handle takes a packed structure which contains the
  58. // columns and query to be issued.
  59. //
  60. #define CFSTR_DSQUERYPARAMS TEXT("DsQueryParameters")
  61. #define DSCOLUMNPROP_ADSPATH ((LONG)(-1))
  62. #define DSCOLUMNPROP_OBJECTCLASS ((LONG)(-2))
  63. typedef struct
  64. {
  65. DWORD dwFlags; // flags for this column
  66. INT fmt; // list view form information
  67. INT cx; // default column width
  68. INT idsName; // resource ID for the column dispaly name
  69. LONG offsetProperty; // offset to BSTR defining column ADs property name
  70. DWORD dwReserved; // reserved field
  71. } DSCOLUMN, * LPDSCOLUMN;
  72. typedef struct
  73. {
  74. DWORD cbStruct;
  75. DWORD dwFlags;
  76. HINSTANCE hInstance; // instance handle used for string extraction
  77. LONG offsetQuery; // offset to LDAP filter string
  78. LONG iColumns; // column count
  79. DWORD dwReserved; // reserved field for this query
  80. DSCOLUMN aColumns[1]; // array of column descriptions
  81. } DSQUERYPARAMS, * LPDSQUERYPARAMS;
  82. //
  83. // CF_DSQUERYSCOPE
  84. // ---------------
  85. // A clipboard format the puts a string version of the scope into a
  86. // storage medium via GlobalAlloc.
  87. //
  88. #define CFSTR_DSQUERYSCOPE TEXT("DsQueryScope")
  89. //
  90. // DSQPM_GETCLASSLIST
  91. // ------------------
  92. // This page message is sent to the form pages to retrieve the list of classes
  93. // that the pages are going to query from. This is used by the feild selector
  94. // and the property well to build its list of display classes.
  95. //
  96. typedef struct
  97. {
  98. DWORD cbStruct;
  99. LONG cClasses; // number of classes in array
  100. DWORD offsetClass[1]; // offset to the class names (UNICODE)
  101. } DSQUERYCLASSLIST, * LPDSQUERYCLASSLIST;
  102. ;begin_internal
  103. #define DSQPM_GCL_FORPROPERTYWELL 0x8000 // == 1 => for property well
  104. ;end_internal
  105. #define DSQPM_GETCLASSLIST (CQPM_HANDLERSPECIFIC+0) // wParam == flags, lParam = LPLPDSQUERYCLASSLIST
  106. //
  107. // DSQPM_HELPTOPICS
  108. // ----------------
  109. // This page message is sent to the form pages to allow them to handle the
  110. // "Help Topics" verb.
  111. //
  112. #define DSQPM_HELPTOPICS (CQPM_HANDLERSPECIFIC+1) // wParam = 0, lParam = hWnd parent
  113. ;begin_internal
  114. //-----------------------------------------------------------------------------
  115. // Internal form helper functions
  116. //-----------------------------------------------------------------------------
  117. // filter types
  118. #define FILTER_FIRST 0x0100
  119. #define FILTER_LAST 0x0200
  120. #define FILTER_CONTAINS 0x0100
  121. #define FILTER_NOTCONTAINS 0x0101
  122. #define FILTER_STARTSWITH 0x0102
  123. #define FILTER_ENDSWITH 0x0103
  124. #define FILTER_IS 0x0104
  125. #define FILTER_ISNOT 0x0105
  126. #define FILTER_GREATEREQUAL 0x0106
  127. #define FILTER_LESSEQUAL 0x0107
  128. #define FILTER_DEFINED 0x0108
  129. #define FILTER_UNDEFINED 0x0109
  130. #define FILTER_ISTRUE 0x010A
  131. #define FILTER_ISFALSE 0x010B
  132. // structures
  133. typedef struct
  134. {
  135. INT fmt;
  136. INT cx;
  137. UINT idsName;
  138. LONG iPropertyIndex;
  139. LPWSTR pPropertyName;
  140. } COLUMNINFO, * LPCOLUMNINFO;
  141. typedef struct
  142. {
  143. UINT nIDDlgItem;
  144. LPWSTR pPropertyName;
  145. INT iFilter;
  146. } PAGECTRL, * LPPAGECTRL;
  147. // form APIs - private
  148. STDAPI ClassListAlloc(LPDSQUERYCLASSLIST* ppDsQueryClassList, LPWSTR* aClassNames, INT cClassNames);
  149. STDAPI QueryParamsAlloc(LPDSQUERYPARAMS* ppDsQueryParams, LPWSTR pQuery, HINSTANCE hInstance, LONG iColumns, LPCOLUMNINFO aColumnInfo);
  150. STDAPI QueryParamsAddQueryString(LPDSQUERYPARAMS* ppDsQueryParams, LPWSTR pQuery);
  151. STDAPI GetFilterString(LPWSTR pFilter, UINT* pLen, INT iFilter, LPWSTR pProperty, LPWSTR pValue);
  152. STDAPI GetQueryString(LPWSTR* ppQuery, LPWSTR pPrefixQuery, HWND hDlg, LPPAGECTRL aCtrls, INT iCtrls);
  153. STDAPI GetPatternString(LPTSTR pFilter, UINT* pLen, INT iFilter, LPTSTR pValue);
  154. STDAPI_(VOID) ResetPageControls(HWND hDlg, LPPAGECTRL aCtrl, INT iCtrls);
  155. STDAPI_(VOID) EnablePageControls(HWND hDlg, LPPAGECTRL aCtrl, INT iCtrls, BOOL fEnable);
  156. STDAPI PersistQuery(IPersistQuery* pPersistQuery, BOOL fRead, LPCTSTR pSection, HWND hDlg, LPPAGECTRL aCtrl, INT iCtrls);
  157. STDAPI SetDlgItemFromProperty(IPropertyBag* ppb, LPCWSTR pszProperty, HWND hwnd, INT id, LPCWSTR pszDefault);
  158. //---------------------------------------------------------------------------//
  159. //
  160. // IDsQueryColumnHandler
  161. // =====================
  162. // This interface is used by the query result view to allow the form to replace
  163. // the contents of the form columns.
  164. //
  165. // If the property name is property,{CLSID}, we CoCreateInstance the GUID
  166. // asking for the IDsQueryColumnHandler which we then call for each
  167. // string property we are going to place into the result view.
  168. //
  169. // The handler only gets called when the results are being unpacked from
  170. // the server, subsequent filtering, sort etc of the view doesn't
  171. // invole this handler.
  172. //
  173. // However perf should be considered when implementing this object.
  174. //
  175. //---------------------------------------------------------------------------//
  176. #undef INTERFACE
  177. #define INTERFACE IDsQueryColumnHandler
  178. DECLARE_INTERFACE_(IDsQueryColumnHandler, IUnknown)
  179. {
  180. // *** IUnknown methods ***
  181. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  182. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  183. STDMETHOD_(ULONG,Release) (THIS) PURE;
  184. // **** IDsQueryColumnHandler ****
  185. STDMETHOD(Initialize)(THIS_ DWORD dwFlags, LPCWSTR pszServer, LPCWSTR pszUserName, LPCWSTR pszPassword) PURE;
  186. STDMETHOD(GetText)(THIS_ ADS_SEARCH_COLUMN* psc, LPWSTR pszBuffer, INT cchBuffer) PURE;
  187. };
  188. //---------------------------------------------------------------------------//
  189. //---------------------------------------------------------------------------//
  190. //
  191. // IDsQuery
  192. // ========
  193. //
  194. //---------------------------------------------------------------------------//
  195. #undef INTERFACE
  196. #define INTERFACE IDsQueryHandler
  197. //
  198. // flags passed to IDsQueryHandler::UpdateView
  199. //
  200. #define DSQRVF_REQUERY 0x00000000
  201. #define DSQRVF_ITEMSDELETED 0x00000001 // pdon -> array of items to remove from the view
  202. #define DSQRVF_OPMASK 0x00000fff
  203. DECLARE_INTERFACE_(IDsQueryHandler, IUnknown)
  204. {
  205. // *** IUnknown methods ***
  206. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  207. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  208. STDMETHOD_(ULONG,Release) (THIS) PURE;
  209. // **** IDsQuery ****
  210. STDMETHOD(UpdateView)(THIS_ DWORD dwType, LPDSOBJECTNAMES pdon) PURE;
  211. };
  212. //---------------------------------------------------------------------------//
  213. ;end_internal
  214. ;begin_both
  215. #endif // GUID_DEFS_ONLY
  216. #endif
  217. ;end_both