JwaObjSel.pas
上传用户:davidchvip
上传日期:2009-07-28
资源大小:1749k
文件大小:24k
源码类别:

Windows编程

开发平台:

Delphi

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