jwadsquery.pas 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. {******************************************************************************}
  2. { }
  3. { Directory Services Query API interface Unit for Object Pascal }
  4. { }
  5. { Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft }
  6. { Corporation. All Rights Reserved. }
  7. { }
  8. { The original file is: dsquery.h, released November 2002. The original Pascal }
  9. { code is: DSQuery.pas, released March 2002. The initial developer of the }
  10. { Pascal code is Marcel van Brakel (brakelm att chello dott nl). }
  11. { }
  12. { Portions created by Marcel van Brakel are Copyright (C) 1999-2001 }
  13. { Marcel van Brakel. All Rights Reserved. }
  14. { }
  15. { Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI) }
  16. { }
  17. { You may retrieve the latest version of this file at the Project JEDI }
  18. { APILIB home page, located at http://jedi-apilib.sourceforge.net }
  19. { }
  20. { The contents of this file are used with permission, subject to the Mozilla }
  21. { Public License Version 1.1 (the "License"); you may not use this file except }
  22. { in compliance with the License. You may obtain a copy of the License at }
  23. { http://www.mozilla.org/MPL/MPL-1.1.html }
  24. { }
  25. { Software distributed under the License is distributed on an "AS IS" basis, }
  26. { WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
  27. { the specific language governing rights and limitations under the License. }
  28. { }
  29. { Alternatively, the contents of this file may be used under the terms of the }
  30. { GNU Lesser General Public License (the "LGPL License"), in which case the }
  31. { provisions of the LGPL License are applicable instead of those above. }
  32. { If you wish to allow use of your version of this file only under the terms }
  33. { of the LGPL License and not to allow others to use your version of this file }
  34. { under the MPL, indicate your decision by deleting the provisions above and }
  35. { replace them with the notice and other provisions required by the LGPL }
  36. { License. If you do not delete the provisions above, a recipient may use }
  37. { your version of this file under either the MPL or the LGPL License. }
  38. { }
  39. { For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
  40. { }
  41. {******************************************************************************}
  42. // $Id: JwaDSQuery.pas,v 1.8 2005/09/03 14:27:48 marquardt Exp $
  43. unit JwaDSQuery;
  44. {$WEAKPACKAGEUNIT}
  45. {$HPPEMIT ''}
  46. {$HPPEMIT '#include "dsquery.h"'}
  47. {$HPPEMIT ''}
  48. {$I jediapilib.inc}
  49. interface
  50. uses
  51. JwaCmnQuery, JwaWindows;
  52. const
  53. CLSID_DsQuery: TGUID = (D1:$8a23e65e; D2:$31c2; D3:$11d0; D4:($89, $1c, $0, $a0, $24, $ab, $2d, $bb));
  54. {$EXTERNALSYM CLSID_DsQuery}
  55. //
  56. // standard forms shipped in dsquery.dll
  57. //
  58. CLSID_DsFindObjects: TGUID = (D1:$83ee3fe1; D2:$57d9; D3:$11d0; D4:($b9, $32, $0, $a0, $24, $ab, $2d, $bb));
  59. {$EXTERNALSYM CLSID_DsFindObjects}
  60. CLSID_DsFindPeople: TGUID = (D1:$83ee3fe2; D2:$57d9; D3:$11d0; D4:($b9, $32, $0, $a0, $24, $ab, $2d, $bb));
  61. {$EXTERNALSYM CLSID_DsFindPeople}
  62. CLSID_DsFindPrinter: TGUID = (D1:$b577f070; D2:$7ee2; D3:$11d0; D4:($91, $3f, $0, $aa, $0, $c1, $6e, $65));
  63. {$EXTERNALSYM CLSID_DsFindPrinter}
  64. CLSID_DsFindComputer: TGUID = (D1:$16006700; D2:$87ad; D3:$11d0; D4:($91, $40, $0, $aa, $0, $c1, $6e, $65));
  65. {$EXTERNALSYM CLSID_DsFindComputer}
  66. CLSID_DsFindVolume: TGUID = (D1:$c1b3cbf1; D2:$886a; D3:$11d0; D4:($91, $40, $0, $aa, $0, $c1, $6e, $65));
  67. {$EXTERNALSYM CLSID_DsFindVolume}
  68. CLSID_DsFindContainer: TGUID = (D1:$c1b3cbf2; D2:$886a; D3:$11d0; D4:($91, $40, $0, $aa, $0, $c1, $6e, $65));
  69. {$EXTERNALSYM CLSID_DsFindContainer}
  70. CLSID_DsFindAdvanced: TGUID = (D1:$83ee3fe3; D2:$57d9; D3:$11d0; D4:($b9, $32, $0, $a0, $24, $ab, $2d, $bb));
  71. {$EXTERNALSYM CLSID_DsFindAdvanced}
  72. //
  73. // admin forms
  74. //
  75. CLSID_DsFindDomainController: TGUID = (D1:$538c7b7e; D2:$d25e; D3:$11d0; D4:($97, $42, $0, $a0, $c9, $6, $af, $45));
  76. {$EXTERNALSYM CLSID_DsFindDomainController}
  77. CLSID_DsFindFrsMembers: TGUID = (D1:$94ce4b18; D2:$b3d3; D3:$11d1; D4:($b9, $b4, $0, $c0, $4f, $d8, $d5, $b0));
  78. {$EXTERNALSYM CLSID_DsFindFrsMembers}
  79. //
  80. // DSQUERYINITPARAMS
  81. // -----------------
  82. // This structured is used when creating a new query view.
  83. //
  84. const
  85. DSQPF_NOSAVE = $00000001; // = 1 => remove save verb
  86. {$EXTERNALSYM DSQPF_NOSAVE}
  87. DSQPF_SAVELOCATION = $00000002; // = 1 => pSaveLocation contains directory to save queries into
  88. {$EXTERNALSYM DSQPF_SAVELOCATION}
  89. DSQPF_SHOWHIDDENOBJECTS = $00000004; // = 1 => show objects marked as "hidden" in results
  90. {$EXTERNALSYM DSQPF_SHOWHIDDENOBJECTS}
  91. DSQPF_ENABLEADMINFEATURES = $00000008; // = 1 => show admin verbs, property pages etc
  92. {$EXTERNALSYM DSQPF_ENABLEADMINFEATURES}
  93. DSQPF_ENABLEADVANCEDFEATURES = $00000010; // = 1 => set the advanced flag for the property pages
  94. {$EXTERNALSYM DSQPF_ENABLEADVANCEDFEATURES}
  95. DSQPF_HASCREDENTIALS = $00000020; // = 1 => pServer, pUserName & pPassword are valid
  96. {$EXTERNALSYM DSQPF_HASCREDENTIALS}
  97. DSQPF_NOCHOOSECOLUMNS = $00000040; // = 1 => remove choose columns from view
  98. {$EXTERNALSYM DSQPF_NOCHOOSECOLUMNS}
  99. type
  100. LPDSQUERYINITPARAMS = ^DSQUERYINITPARAMS;
  101. {$EXTERNALSYM LPDSQUERYINITPARAMS}
  102. DSQUERYINITPARAMS = record
  103. cbStruct: DWORD;
  104. dwFlags: DWORD;
  105. pDefaultScope: LPWSTR; // -> Active Directory path to use as scope / == NULL for none
  106. pDefaultSaveLocation: LPWSTR; // -> Directory to save queries into / == NULL default location
  107. pUserName: LPWSTR; // -> user name to authenticate with
  108. pPassword: LPWSTR; // -> password for authentication
  109. pServer: LPWSTR; // -> server to use for obtaining trusts etc
  110. end;
  111. {$EXTERNALSYM DSQUERYINITPARAMS}
  112. TDsQueryInitParams = DSQUERYINITPARAMS;
  113. PDsQueryInitParams = LPDSQUERYINITPARAMS;
  114. //
  115. // DSQUERYPARAMS
  116. // -------------
  117. // The DS query handle takes a packed structure which contains the
  118. // columns and query to be issued.
  119. //
  120. const
  121. CFSTR_DSQUERYPARAMS = TEXT('DsQueryParameters');
  122. {$EXTERNALSYM CFSTR_DSQUERYPARAMS}
  123. DSCOLUMNPROP_ADSPATH = LONG(-1);
  124. {$EXTERNALSYM DSCOLUMNPROP_ADSPATH}
  125. DSCOLUMNPROP_OBJECTCLASS = LONG(-2);
  126. {$EXTERNALSYM DSCOLUMNPROP_OBJECTCLASS}
  127. type
  128. LPDSCOLUMN = ^DSCOLUMN;
  129. {$EXTERNALSYM LPDSCOLUMN}
  130. DSCOLUMN = record
  131. dwFlags: DWORD; // flags for this column
  132. fmt: INT; // list view form information
  133. cx: INT; // default column width
  134. idsName: INT; // resource ID for the column dispaly name
  135. offsetProperty: LONG; // offset to BSTR defining column ADs property name
  136. dwReserved: DWORD; // reserved field
  137. end;
  138. {$EXTERNALSYM DSCOLUMN}
  139. TDsColumn = DSCOLUMN;
  140. PDsColumn = LPDSCOLUMN;
  141. LPDSQUERYPARAMS = ^DSQUERYPARAMS;
  142. {$EXTERNALSYM LPDSQUERYPARAMS}
  143. DSQUERYPARAMS = record
  144. cbStruct: DWORD;
  145. dwFlags: DWORD;
  146. hInstance: HINST; // instance handle used for string extraction
  147. offsetQuery: LONG; // offset to LDAP filter string
  148. iColumns: LONG; // column count
  149. dwReserved: DWORD; // reserved field for this query
  150. aColumns: array [0..0] of DSCOLUMN; // array of column descriptions
  151. end;
  152. {$EXTERNALSYM DSQUERYPARAMS}
  153. TDsQueryParams = DSQUERYPARAMS;
  154. PDsQueryParams = LPDSQUERYPARAMS;
  155. //
  156. // CF_DSQUERYSCOPE
  157. // ---------------
  158. // A clipboard format the puts a string version of the scope into a
  159. // storage medium via GlobalAlloc.
  160. //
  161. const
  162. CFSTR_DSQUERYSCOPE = TEXT('DsQueryScope');
  163. {$EXTERNALSYM CFSTR_DSQUERYSCOPE}
  164. //
  165. // DSQPM_GETCLASSLIST
  166. // ------------------
  167. // This page message is sent to the form pages to retrieve the list of classes
  168. // that the pages are going to query from. This is used by the feild selector
  169. // and the property well to build its list of display classes.
  170. //
  171. type
  172. LPDSQUERYCLASSLIST = ^DSQUERYCLASSLIST;
  173. {$EXTERNALSYM LPDSQUERYCLASSLIST}
  174. DSQUERYCLASSLIST = record
  175. cbStruct: DWORD;
  176. cClasses: LONG; // number of classes in array
  177. offsetClass: array [0..0] of DWORD; // offset to the class names (UNICODE)
  178. end;
  179. {$EXTERNALSYM DSQUERYCLASSLIST}
  180. TDsQueryClassList = DSQUERYCLASSLIST;
  181. PDsQueryClassList = LPDSQUERYCLASSLIST;
  182. const
  183. DSQPM_GETCLASSLIST = CQPM_HANDLERSPECIFIC + 0; // wParam == flags, lParam = LPLPDSQUERYCLASSLIST
  184. {$EXTERNALSYM DSQPM_GETCLASSLIST}
  185. //
  186. // DSQPM_HELPTOPICS
  187. // ----------------
  188. // This page message is sent to the form pages to allow them to handle the
  189. // "Help Topics" verb.
  190. //
  191. DSQPM_HELPTOPICS = CQPM_HANDLERSPECIFIC + 1; // wParam = 0, lParam = hWnd parent
  192. {$EXTERNALSYM DSQPM_HELPTOPICS}
  193. implementation
  194. end.