jwaObjsel.pas 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674
  1. {******************************************************************************}
  2. { }
  3. { Object Picker 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: objsel.h, released June 2000. The original Pascal }
  9. { code is: ObjSel.pas, released December 2000. 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. unit JwaObjSel;
  43. {$WEAKPACKAGEUNIT}
  44. {$HPPEMIT ''}
  45. {$HPPEMIT '#include "ObjSel.h"'}
  46. {$HPPEMIT ''}
  47. {$I jediapilib.inc}
  48. interface
  49. uses
  50. ActiveX {TODO}, JwaWinType;
  51. // Contents: Object Picker Dialog public header
  52. const
  53. //'{17d6ccd8-3b7b-11d2-b9e0-00c04fd8dbf7}'
  54. CLSID_DsObjectPicker: TGUID = (
  55. D1:$17d6ccd8; D2:$3b7b; D3:$11d2; D4:($b9,$e0,$00,$c0,$4f,$d8,$db,$f7));
  56. {$EXTERNALSYM CLSID_DsObjectPicker}
  57. IID_IDsObjectPicker: TGUID = (
  58. D1:$0c87e64e; D2:$3b7a; D3:$11d2; D4:($b9,$e0,$00,$c0,$4f,$d8,$db,$f7));
  59. {$EXTERNALSYM IID_IDsObjectPicker}
  60. {
  61. CLIPBOARD FORMATS
  62. =================
  63. CFSTR_DSOP_DS_SELECTION_LIST
  64. Returns an HGLOBAL for global memory containing a DS_SELECTION_LIST
  65. variable length structure.
  66. }
  67. const
  68. CFSTR_DSOP_DS_SELECTION_LIST = 'CFSTR_DSOP_DS_SELECTION_LIST';
  69. {$EXTERNALSYM CFSTR_DSOP_DS_SELECTION_LIST}
  70. {
  71. SCOPE TYPES
  72. ===========
  73. A scope is an entry in the "Look In" dropdown list of the Object Picker
  74. dialog.
  75. When initializing the DS Object Picker, DSOP_SCOPE_TYPEs are used with
  76. DSOP_SCOPE_INIT_INFO.flType member to specify which types of scopes the
  77. DS Object Picker should put in the "Look In" list.
  78. DSOP_SCOPE_TYPE_TARGET_COMPUTER
  79. Computer specified by DSOP_INIT_INFO.pwzTargetComputer, NULL is
  80. local computer.
  81. DSOP_SCOPE_TYPE_UPLEVEL_JOINED_DOMAIN
  82. Uplevel domain to which target computer is joined.
  83. DSOP_SCOPE_TYPE_DOWNLEVEL_JOINED_DOMAIN
  84. Downlevel domain to which target computer is joined.
  85. DSOP_SCOPE_TYPE_ENTERPRISE_DOMAIN
  86. All domains in the enterprise to which the target computer belongs
  87. other than the JOINED_DOMAIN or USER_SPECIFIED_*_SCOPEs.
  88. DSOP_SCOPE_TYPE_GLOBAL_CATALOG
  89. The Entire Directory scope.
  90. DSOP_SCOPE_TYPE_EXTERNAL_UPLEVEL_DOMAIN
  91. All uplevel domains external to the enterprise but trusted by the
  92. domain to which the target computer is joined.
  93. DSOP_SCOPE_TYPE_EXTERNAL_DOWNLEVEL_DOMAIN
  94. All downlevel domains external to the enterprise but trusted by the
  95. domain to which the target computer is joined.
  96. DSOP_SCOPE_TYPE_WORKGROUP
  97. The workgroup of which TARGET_COMPUTER is a member. Applies only if the
  98. TARGET_COMPUTER is not joined to a domain.
  99. DSOP_SCOPE_TYPE_USER_ENTERED_UPLEVEL_SCOPE
  100. DSOP_SCOPE_TYPE_USER_ENTERED_DOWNLEVEL_SCOPE
  101. Any uplevel or downlevel scope generated by processing user input. If
  102. neither of these types is specified, user entries that do not refer to
  103. one of the scopes in the "Look In" control will be rejected.
  104. }
  105. const
  106. DSOP_SCOPE_TYPE_TARGET_COMPUTER = $00000001;
  107. {$EXTERNALSYM DSOP_SCOPE_TYPE_TARGET_COMPUTER}
  108. DSOP_SCOPE_TYPE_UPLEVEL_JOINED_DOMAIN = $00000002;
  109. {$EXTERNALSYM DSOP_SCOPE_TYPE_UPLEVEL_JOINED_DOMAIN}
  110. DSOP_SCOPE_TYPE_DOWNLEVEL_JOINED_DOMAIN = $00000004;
  111. {$EXTERNALSYM DSOP_SCOPE_TYPE_DOWNLEVEL_JOINED_DOMAIN}
  112. DSOP_SCOPE_TYPE_ENTERPRISE_DOMAIN = $00000008;
  113. {$EXTERNALSYM DSOP_SCOPE_TYPE_ENTERPRISE_DOMAIN}
  114. DSOP_SCOPE_TYPE_GLOBAL_CATALOG = $00000010;
  115. {$EXTERNALSYM DSOP_SCOPE_TYPE_GLOBAL_CATALOG}
  116. DSOP_SCOPE_TYPE_EXTERNAL_UPLEVEL_DOMAIN = $00000020;
  117. {$EXTERNALSYM DSOP_SCOPE_TYPE_EXTERNAL_UPLEVEL_DOMAIN}
  118. DSOP_SCOPE_TYPE_EXTERNAL_DOWNLEVEL_DOMAIN = $00000040;
  119. {$EXTERNALSYM DSOP_SCOPE_TYPE_EXTERNAL_DOWNLEVEL_DOMAIN}
  120. DSOP_SCOPE_TYPE_WORKGROUP = $00000080;
  121. {$EXTERNALSYM DSOP_SCOPE_TYPE_WORKGROUP}
  122. DSOP_SCOPE_TYPE_USER_ENTERED_UPLEVEL_SCOPE = $00000100;
  123. {$EXTERNALSYM DSOP_SCOPE_TYPE_USER_ENTERED_UPLEVEL_SCOPE}
  124. DSOP_SCOPE_TYPE_USER_ENTERED_DOWNLEVEL_SCOPE = $00000200;
  125. {$EXTERNALSYM DSOP_SCOPE_TYPE_USER_ENTERED_DOWNLEVEL_SCOPE}
  126. {
  127. DSOP_SCOPE_INIT_INFO flags
  128. ==========================
  129. The flScope member can contain zero or more of the following flags:
  130. DSOP_SCOPE_FLAG_STARTING_SCOPE
  131. The scope should be the first one selected in the Look In control after
  132. dialog initialization. If more than one scope specifies this flag,
  133. the one which is chosen to be the starting scope is implementation
  134. dependant.
  135. DSOP_SCOPE_FLAG_WANT_PROVIDER_WINNT
  136. ADs paths for objects selected from this scope should be converted to use
  137. the WinNT provider.
  138. DSOP_SCOPE_FLAG_WANT_PROVIDER_LDAP
  139. ADs paths for objects selected from this scope should be converted to use
  140. the LDAP provider.
  141. DSOP_SCOPE_FLAG_WANT_PROVIDER_GC
  142. ADs paths for objects selected from this scope should be converted to use
  143. the GC provider.
  144. DSOP_SCOPE_FLAG_WANT_SID_PATH
  145. ADs paths for objects selected from this scope having an objectSid
  146. attribute should be converted to the form LDAP://<SID=x>, where x
  147. represents the hexidecimal digits of the objectSid attribute value.
  148. DSOP_SCOPE_FLAG_WANT_DOWNLEVEL_BUILTIN_PATH
  149. ADs paths for downlevel well-known SID objects (for example,
  150. DSOP_DOWNLEVEL_FILTER_INTERACTIVE) are an empty string unless this flag is
  151. specified. If it is, the paths will be of the form
  152. WinNT://NT AUTHORITY/Interactive or WinNT://Creator owner.
  153. DSOP_SCOPE_FLAG_DEFAULT_FILTER_USERS
  154. If the scope filter contains the DSOP_FILTER_USERS or
  155. DSOP_DOWNLEVEL_FILTER_USERS flag, then check the Users checkbox by
  156. default in the Look For dialog.
  157. DSOP_SCOPE_FLAG_DEFAULT_FILTER_GROUPS
  158. DSOP_SCOPE_FLAG_DEFAULT_FILTER_COMPUTERS
  159. DSOP_SCOPE_FLAG_DEFAULT_FILTER_CONTACTS
  160. }
  161. const
  162. DSOP_SCOPE_FLAG_STARTING_SCOPE = $00000001;
  163. {$EXTERNALSYM DSOP_SCOPE_FLAG_STARTING_SCOPE}
  164. DSOP_SCOPE_FLAG_WANT_PROVIDER_WINNT = $00000002;
  165. {$EXTERNALSYM DSOP_SCOPE_FLAG_WANT_PROVIDER_WINNT}
  166. DSOP_SCOPE_FLAG_WANT_PROVIDER_LDAP = $00000004;
  167. {$EXTERNALSYM DSOP_SCOPE_FLAG_WANT_PROVIDER_LDAP}
  168. DSOP_SCOPE_FLAG_WANT_PROVIDER_GC = $00000008;
  169. {$EXTERNALSYM DSOP_SCOPE_FLAG_WANT_PROVIDER_GC}
  170. DSOP_SCOPE_FLAG_WANT_SID_PATH = $00000010;
  171. {$EXTERNALSYM DSOP_SCOPE_FLAG_WANT_SID_PATH}
  172. DSOP_SCOPE_FLAG_WANT_DOWNLEVEL_BUILTIN_PATH = $00000020;
  173. {$EXTERNALSYM DSOP_SCOPE_FLAG_WANT_DOWNLEVEL_BUILTIN_PATH}
  174. DSOP_SCOPE_FLAG_DEFAULT_FILTER_USERS = $00000040;
  175. {$EXTERNALSYM DSOP_SCOPE_FLAG_DEFAULT_FILTER_USERS}
  176. DSOP_SCOPE_FLAG_DEFAULT_FILTER_GROUPS = $00000080;
  177. {$EXTERNALSYM DSOP_SCOPE_FLAG_DEFAULT_FILTER_GROUPS}
  178. DSOP_SCOPE_FLAG_DEFAULT_FILTER_COMPUTERS = $00000100;
  179. {$EXTERNALSYM DSOP_SCOPE_FLAG_DEFAULT_FILTER_COMPUTERS}
  180. DSOP_SCOPE_FLAG_DEFAULT_FILTER_CONTACTS = $00000200;
  181. {$EXTERNALSYM DSOP_SCOPE_FLAG_DEFAULT_FILTER_CONTACTS}
  182. {
  183. The flMixedModeOnly/flNativeModeOnly member of an uplevel scope can
  184. contain one or more of the following flags (at least one must be specified):
  185. DSOP_FILTER_INCLUDE_ADVANCED_VIEW
  186. Include objects which have the attribute showInAdvancedViewOnly set to
  187. true.
  188. DSOP_FILTER_USERS
  189. Include user objects.
  190. DSOP_FILTER_BUILTIN_GROUPS
  191. Include group objects with a groupType value having the flag
  192. GROUP_TYPE_BUILTIN_LOCAL_GROUP.
  193. DSOP_FILTER_WELL_KNOWN_PRINCIPALS
  194. Include the contents of the WellKnown Security Principals container.
  195. DSOP_FILTER_UNIVERSAL_GROUPS_DL
  196. Include distribution list universal groups.
  197. DSOP_FILTER_UNIVERSAL_GROUPS_SE
  198. Include security enabled universal groups.
  199. DSOP_FILTER_GLOBAL_GROUPS_DL
  200. Include distribution list global groups.
  201. DSOP_FILTER_GLOBAL_GROUPS_SE
  202. Include security enabled global groups.
  203. DSOP_FILTER_DOMAIN_LOCAL_GROUPS_DL
  204. Include distribution list domain global groups.
  205. DSOP_FILTER_DOMAIN_LOCAL_GROUPS_SE
  206. Include security enabled domain local groups.
  207. DSOP_FILTER_CONTACTS
  208. Include contact objects.
  209. DSOP_FILTER_COMPUTERS
  210. Include computer objects.
  211. }
  212. const
  213. DSOP_FILTER_INCLUDE_ADVANCED_VIEW = $00000001;
  214. {$EXTERNALSYM DSOP_FILTER_INCLUDE_ADVANCED_VIEW}
  215. DSOP_FILTER_USERS = $00000002;
  216. {$EXTERNALSYM DSOP_FILTER_USERS}
  217. DSOP_FILTER_BUILTIN_GROUPS = $00000004;
  218. {$EXTERNALSYM DSOP_FILTER_BUILTIN_GROUPS}
  219. DSOP_FILTER_WELL_KNOWN_PRINCIPALS = $00000008;
  220. {$EXTERNALSYM DSOP_FILTER_WELL_KNOWN_PRINCIPALS}
  221. DSOP_FILTER_UNIVERSAL_GROUPS_DL = $00000010;
  222. {$EXTERNALSYM DSOP_FILTER_UNIVERSAL_GROUPS_DL}
  223. DSOP_FILTER_UNIVERSAL_GROUPS_SE = $00000020;
  224. {$EXTERNALSYM DSOP_FILTER_UNIVERSAL_GROUPS_SE}
  225. DSOP_FILTER_GLOBAL_GROUPS_DL = $00000040;
  226. {$EXTERNALSYM DSOP_FILTER_GLOBAL_GROUPS_DL}
  227. DSOP_FILTER_GLOBAL_GROUPS_SE = $00000080;
  228. {$EXTERNALSYM DSOP_FILTER_GLOBAL_GROUPS_SE}
  229. DSOP_FILTER_DOMAIN_LOCAL_GROUPS_DL = $00000100;
  230. {$EXTERNALSYM DSOP_FILTER_DOMAIN_LOCAL_GROUPS_DL}
  231. DSOP_FILTER_DOMAIN_LOCAL_GROUPS_SE = $00000200;
  232. {$EXTERNALSYM DSOP_FILTER_DOMAIN_LOCAL_GROUPS_SE}
  233. DSOP_FILTER_CONTACTS = $00000400;
  234. {$EXTERNALSYM DSOP_FILTER_CONTACTS}
  235. DSOP_FILTER_COMPUTERS = $00000800;
  236. {$EXTERNALSYM DSOP_FILTER_COMPUTERS}
  237. {
  238. The flFilter member of a downlevel scope can contain one or more of the
  239. following flags:
  240. DSOP_DOWNLEVEL_FILTER_USERS
  241. Include user objects.
  242. DSOP_DOWNLEVEL_FILTER_LOCAL_GROUPS
  243. Include all local groups.
  244. DSOP_DOWNLEVEL_FILTER_GLOBAL_GROUPS
  245. Include all global groups.
  246. DSOP_DOWNLEVEL_FILTER_COMPUTERS
  247. Include computer objects
  248. DSOP_DOWNLEVEL_FILTER_WORLD
  249. Include builtin security principal World (Everyone).
  250. DSOP_DOWNLEVEL_FILTER_AUTHENTICATED_USER
  251. Include builtin security principal Authenticated User.
  252. DSOP_DOWNLEVEL_FILTER_ANONYMOUS
  253. Include builtin security principal Anonymous.
  254. DSOP_DOWNLEVEL_FILTER_BATCH
  255. Include builtin security principal Batch.
  256. DSOP_DOWNLEVEL_FILTER_CREATOR_OWNER
  257. Include builtin security principal Creator Owner.
  258. DSOP_DOWNLEVEL_FILTER_CREATOR_GROUP
  259. Include builtin security principal Creator Group.
  260. DSOP_DOWNLEVEL_FILTER_DIALUP
  261. Include builtin security principal Dialup.
  262. DSOP_DOWNLEVEL_FILTER_INTERACTIVE
  263. Include builtin security principal Interactive.
  264. DSOP_DOWNLEVEL_FILTER_NETWORK
  265. Include builtin security principal Network.
  266. DSOP_DOWNLEVEL_FILTER_SERVICE
  267. Include builtin security principal Service.
  268. DSOP_DOWNLEVEL_FILTER_SYSTEM
  269. Include builtin security principal System.
  270. DSOP_DOWNLEVEL_FILTER_EXCLUDE_BUILTIN_GROUPS
  271. Exclude local builtin groups returned by groups enumeration.
  272. DSOP_DOWNLEVEL_FILTER_TERMINAL_SERVER
  273. Include builtin security principal Terminal Server.
  274. DSOP_DOWNLEVEL_FILTER_LOCAL_SERVICE
  275. Include builtin security principal Local Service
  276. DSOP_DOWNLEVEL_FILTER_NETWORK_SERVICE
  277. Include builtin security principal Network Service
  278. DSOP_DOWNLEVEL_FILTER_ALL_WELLKNOWN_SIDS
  279. Include all builtin security principals.
  280. }
  281. const
  282. DSOP_DOWNLEVEL_FILTER_USERS = DWORD($80000001);
  283. {$EXTERNALSYM DSOP_DOWNLEVEL_FILTER_USERS}
  284. DSOP_DOWNLEVEL_FILTER_LOCAL_GROUPS = DWORD($80000002);
  285. {$EXTERNALSYM DSOP_DOWNLEVEL_FILTER_LOCAL_GROUPS}
  286. DSOP_DOWNLEVEL_FILTER_GLOBAL_GROUPS = DWORD($80000004);
  287. {$EXTERNALSYM DSOP_DOWNLEVEL_FILTER_GLOBAL_GROUPS}
  288. DSOP_DOWNLEVEL_FILTER_COMPUTERS = DWORD($80000008);
  289. {$EXTERNALSYM DSOP_DOWNLEVEL_FILTER_COMPUTERS}
  290. DSOP_DOWNLEVEL_FILTER_WORLD = DWORD($80000010);
  291. {$EXTERNALSYM DSOP_DOWNLEVEL_FILTER_WORLD}
  292. DSOP_DOWNLEVEL_FILTER_AUTHENTICATED_USER = DWORD($80000020);
  293. {$EXTERNALSYM DSOP_DOWNLEVEL_FILTER_AUTHENTICATED_USER}
  294. DSOP_DOWNLEVEL_FILTER_ANONYMOUS = DWORD($80000040);
  295. {$EXTERNALSYM DSOP_DOWNLEVEL_FILTER_ANONYMOUS}
  296. DSOP_DOWNLEVEL_FILTER_BATCH = DWORD($80000080);
  297. {$EXTERNALSYM DSOP_DOWNLEVEL_FILTER_BATCH}
  298. DSOP_DOWNLEVEL_FILTER_CREATOR_OWNER = DWORD($80000100);
  299. {$EXTERNALSYM DSOP_DOWNLEVEL_FILTER_CREATOR_OWNER}
  300. DSOP_DOWNLEVEL_FILTER_CREATOR_GROUP = DWORD($80000200);
  301. {$EXTERNALSYM DSOP_DOWNLEVEL_FILTER_CREATOR_GROUP}
  302. DSOP_DOWNLEVEL_FILTER_DIALUP = DWORD($80000400);
  303. {$EXTERNALSYM DSOP_DOWNLEVEL_FILTER_DIALUP}
  304. DSOP_DOWNLEVEL_FILTER_INTERACTIVE = DWORD($80000800);
  305. {$EXTERNALSYM DSOP_DOWNLEVEL_FILTER_INTERACTIVE}
  306. DSOP_DOWNLEVEL_FILTER_NETWORK = DWORD($80001000);
  307. {$EXTERNALSYM DSOP_DOWNLEVEL_FILTER_NETWORK}
  308. DSOP_DOWNLEVEL_FILTER_SERVICE = DWORD($80002000);
  309. {$EXTERNALSYM DSOP_DOWNLEVEL_FILTER_SERVICE}
  310. DSOP_DOWNLEVEL_FILTER_SYSTEM = DWORD($80004000);
  311. {$EXTERNALSYM DSOP_DOWNLEVEL_FILTER_SYSTEM}
  312. DSOP_DOWNLEVEL_FILTER_EXCLUDE_BUILTIN_GROUPS = DWORD($80008000);
  313. {$EXTERNALSYM DSOP_DOWNLEVEL_FILTER_EXCLUDE_BUILTIN_GROUPS}
  314. DSOP_DOWNLEVEL_FILTER_TERMINAL_SERVER = DWORD($80010000);
  315. {$EXTERNALSYM DSOP_DOWNLEVEL_FILTER_TERMINAL_SERVER}
  316. DSOP_DOWNLEVEL_FILTER_ALL_WELLKNOWN_SIDS = DWORD($80020000);
  317. {$EXTERNALSYM DSOP_DOWNLEVEL_FILTER_ALL_WELLKNOWN_SIDS}
  318. DSOP_DOWNLEVEL_FILTER_LOCAL_SERVICE = DWORD($80040000);
  319. {$EXTERNALSYM DSOP_DOWNLEVEL_FILTER_LOCAL_SERVICE}
  320. DSOP_DOWNLEVEL_FILTER_NETWORK_SERVICE = DWORD($80080000);
  321. {$EXTERNALSYM DSOP_DOWNLEVEL_FILTER_NETWORK_SERVICE}
  322. DSOP_DOWNLEVEL_FILTER_REMOTE_LOGON = DWORD($80100000);
  323. {$EXTERNALSYM DSOP_DOWNLEVEL_FILTER_REMOTE_LOGON}
  324. {
  325. DSOP_UPLEVEL_FILTER_FLAGS
  326. =========================
  327. Contains the DSOP_FILTER_* flags for use with a DSOP_SCOPE_INIT_INFO
  328. structure when the scope is uplevel (DS-aware).
  329. flBothModes
  330. Flags to use for an uplevel scope, regardless of whether it is a
  331. mixed or native mode domain.
  332. flMixedModeOnly
  333. Flags to use when an uplevel domain is in mixed mode.
  334. flNativeModeOnly
  335. Flags to use when an uplevel domain is in native mode.
  336. DSOP_FILTER_FLAGS
  337. =================
  338. Uplevel
  339. Contains flags to use for an uplevel scope.
  340. flDownlevel
  341. Flags to use for a downlevel scope.
  342. }
  343. type
  344. _DSOP_UPLEVEL_FILTER_FLAGS = record
  345. flBothModes: ULONG;
  346. flMixedModeOnly: ULONG;
  347. flNativeModeOnly: ULONG;
  348. end;
  349. {$EXTERNALSYM _DSOP_UPLEVEL_FILTER_FLAGS}
  350. DSOP_UPLEVEL_FILTER_FLAGS = _DSOP_UPLEVEL_FILTER_FLAGS;
  351. {$EXTERNALSYM DSOP_UPLEVEL_FILTER_FLAGS}
  352. TDsOpUpLevelFilterFlags = DSOP_UPLEVEL_FILTER_FLAGS;
  353. PDsOpUpLevelFilterFlags = ^DSOP_UPLEVEL_FILTER_FLAGS;
  354. _DSOP_FILTER_FLAGS = record
  355. Uplevel: DSOP_UPLEVEL_FILTER_FLAGS;
  356. flDownlevel: ULONG;
  357. end;
  358. {$EXTERNALSYM _DSOP_FILTER_FLAGS}
  359. DSOP_FILTER_FLAGS = _DSOP_FILTER_FLAGS;
  360. {$EXTERNALSYM DSOP_FILTER_FLAGS}
  361. TDsOpFilterFlags = DSOP_FILTER_FLAGS;
  362. PDsOpFilterFlags = ^DSOP_FILTER_FLAGS;
  363. {
  364. DSOP_SCOPE_INIT_INFO
  365. ====================
  366. Each DSOP_SCOPE_INIT_INFO structure in the array DSOP_INIT_INFO.aDsScopeInfos
  367. describes a single scope or a group of scopes with the same settings.
  368. cbSize
  369. Size, in bytes, of the entire structure.
  370. flType
  371. DSOP_SCOPE_TYPE_* flags. It is legal to combine multiple values via
  372. bitwise OR if all of the types of scopes combined in this way require
  373. the same settings.
  374. flScope
  375. DSOP_SCOPE_ * flags.
  376. FilterFlags
  377. DSOP_FILTER_* flags that indicate which types of objects should be
  378. presented to the user in this scope.
  379. pwzDcName
  380. Name of the DC of a domain. This member is used only if the flType
  381. member contains the flag DSOP_SCOPE_TYPE_JOINED_DOMAIN. If that flag is
  382. not set, this member must be NULL.
  383. pwzADsPath
  384. Currently not supported, must be NULL.
  385. hr
  386. Filled with S_OK if the scope represented by this structure could be
  387. created, or an error message indicating why it could not. If
  388. IDsObjectPicker::SetScopes returns a success code, this value will
  389. also be a success code.
  390. }
  391. type
  392. PDSOP_SCOPE_INIT_INFO = ^DSOP_SCOPE_INIT_INFO;
  393. {$EXTERNALSYM PDSOP_SCOPE_INIT_INFO}
  394. _DSOP_SCOPE_INIT_INFO = record
  395. cbSize: ULONG;
  396. flType: ULONG;
  397. flScope: ULONG;
  398. FilterFlags: DSOP_FILTER_FLAGS;
  399. pwzDcName: PWSTR; // OPTIONAL
  400. pwzADsPath: PWSTR; // OPTIONAL
  401. hr: HRESULT;
  402. end;
  403. {$EXTERNALSYM _DSOP_SCOPE_INIT_INFO}
  404. DSOP_SCOPE_INIT_INFO = _DSOP_SCOPE_INIT_INFO;
  405. {$EXTERNALSYM DSOP_SCOPE_INIT_INFO}
  406. PCDSOP_SCOPE_INIT_INFO = PDSOP_SCOPE_INIT_INFO;
  407. {$EXTERNALSYM PCDSOP_SCOPE_INIT_INFO}
  408. TDsOpScopeInitInfo = DSOP_SCOPE_INIT_INFO;
  409. PDsOpScopeInitInfo = PDSOP_SCOPE_INIT_INFO;
  410. {
  411. DSOP_INIT_INFO flags
  412. ====================
  413. The following flags may be set in DSOP_INIT_INFO.flOptions:
  414. DSOP_FLAG_MULTISELECT
  415. Allow multiple selections. If this flag is not set, the dialog will
  416. return zero or one objects.
  417. DSOP_FLAG_SKIP_TARGET_COMPUTER_DC_CHECK
  418. If this flag is NOT set, then the DSOP_SCOPE_TYPE_TARGET_COMPUTER flag
  419. will be ignored if the target computer is a DC. This flag has no effect
  420. unless DSOP_SCOPE_TYPE_TARGET_COMPUTER is specified.
  421. }
  422. const
  423. DSOP_FLAG_MULTISELECT = $00000001;
  424. {$EXTERNALSYM DSOP_FLAG_MULTISELECT}
  425. DSOP_FLAG_SKIP_TARGET_COMPUTER_DC_CHECK = $00000002;
  426. {$EXTERNALSYM DSOP_FLAG_SKIP_TARGET_COMPUTER_DC_CHECK}
  427. {
  428. DSOP_INIT_INFO
  429. ==============
  430. Used to configure the DS Object Picker dialog.
  431. cbSize
  432. Size, in bytes, of entire structure.
  433. pwzTargetComputer
  434. Sets the computer associated with DSOP_SCOPE_TARGET_COMPUTER, and
  435. which is used to determine the joined domain and enterprise.
  436. If this value is NULL, the target computer is the local machine.
  437. cDsScopeInfos
  438. Count of elements in aDsScopeInfos. Must be at least 1, since
  439. the object picker cannot operate without at least one scope.
  440. aDsScopeInfos
  441. Array of scope initialization structures. Must be present and
  442. contain at least one element.
  443. flOptions
  444. Various DS Object Picker flags (DSOP_FLAG_MULTISELECT).
  445. cAttributesToFetch
  446. Count of elements in apwzAttributeNames. Can be 0.
  447. apwzAttributeNames
  448. Array of names of attributes to fetch for each object. Ignored
  449. if cAttributesToFetch is 0.
  450. }
  451. type
  452. PDSOP_INIT_INFO = ^DSOP_INIT_INFO;
  453. {$EXTERNALSYM PDSOP_INIT_INFO}
  454. _DSOP_INIT_INFO = record
  455. cbSize: ULONG;
  456. pwzTargetComputer: PWSTR;
  457. cDsScopeInfos: ULONG;
  458. aDsScopeInfos: PDSOP_SCOPE_INIT_INFO;
  459. flOptions: ULONG;
  460. cAttributesToFetch: ULONG;
  461. apwzAttributeNames: LPLPWSTR;
  462. end;
  463. {$EXTERNALSYM _DSOP_INIT_INFO}
  464. DSOP_INIT_INFO = _DSOP_INIT_INFO;
  465. {$EXTERNALSYM DSOP_INIT_INFO}
  466. PCDSOP_INIT_INFO = PDSOP_INIT_INFO;
  467. {$EXTERNALSYM PCDSOP_INIT_INFO}
  468. TDsOpInitInfo = DSOP_INIT_INFO;
  469. PDsOpInitInfo = PDSOP_INIT_INFO;
  470. {
  471. DS_SELECTION
  472. ============
  473. Describes an object selected by the user.
  474. pwzName
  475. The object's RDN.
  476. pwzADsPath
  477. The object's ADsPath.
  478. pwzClass
  479. The object's class attribute value.
  480. pwzUPN
  481. The object's userPrincipalName attribute value.
  482. pvarFetchedAttributes
  483. An array of VARIANTs, one for each attribute fetched.
  484. flScopeType
  485. A single DSOP_SCOPE_TYPE_* flag describing the type of the scope
  486. from which this object was selected.
  487. DS_SELECTION_LIST
  488. =================
  489. Available as a clipboard format from the data object returned by
  490. IDsObjectPicker::InvokeDialog. Contains a list of objects that the user
  491. selected.
  492. cItems
  493. Number of elements in the aDsSelection array.
  494. cFetchedAttributes
  495. Number of elements in each DSSELECTION.avarFetchedAttributes member.
  496. aDsSelection
  497. Array of cItems DSSELECTION structures.
  498. }
  499. type
  500. PDS_SELECTION = ^DS_SELECTION;
  501. {$EXTERNALSYM PDS_SELECTION}
  502. _DS_SELECTION = record
  503. pwzName: PWSTR;
  504. pwzADsPath: PWSTR;
  505. pwzClass: PWSTR;
  506. pwzUPN: PWSTR;
  507. pvarFetchedAttributes: POleVariant;
  508. flScopeType: ULONG;
  509. end;
  510. {$EXTERNALSYM _DS_SELECTION}
  511. DS_SELECTION = _DS_SELECTION;
  512. {$EXTERNALSYM DS_SELECTION}
  513. TDsSelection = DS_SELECTION;
  514. PDsSelection = PDS_SELECTION;
  515. PDS_SELECTION_LIST = ^DS_SELECTION_LIST;
  516. {$EXTERNALSYM PDS_SELECTION_LIST}
  517. _DS_SELECTION_LIST = record
  518. cItems: ULONG;
  519. cFetchedAttributes: ULONG;
  520. aDsSelection: array [0..ANYSIZE_ARRAY - 1] of DS_SELECTION;
  521. end;
  522. {$EXTERNALSYM _DS_SELECTION_LIST}
  523. DS_SELECTION_LIST = _DS_SELECTION_LIST;
  524. {$EXTERNALSYM DS_SELECTION_LIST}
  525. TDsSelectionList = DS_SELECTION_LIST;
  526. PDsSelectionList = PDS_SELECTION_LIST;
  527. //
  528. // Object Picker Interfaces
  529. //
  530. //
  531. // The main interface to the DS Object Picker, used to initialize it,
  532. // invoke the dialog, and return the user's selections.
  533. //
  534. type
  535. IDsObjectPicker = interface (IUnknown)
  536. ['{0c87e64e-3b7a-11d2-b9e0-00c04fd8dbf7}']
  537. // Sets scope, filter, etc. for use with next invocation of dialog
  538. function Initialize(const pInitInfo: DSOP_INIT_INFO): HRESULT; stdcall;
  539. // Creates the modal DS Object Picker dialog.
  540. function InvokeDialog(hwndParent: HWND; out ppdoSelections: IDataObject): HRESULT; stdcall;
  541. end;
  542. {$EXTERNALSYM IDsObjectPicker}
  543. implementation
  544. end.