1 | /*
|
---|
2 | * objsel.h
|
---|
3 | *
|
---|
4 | * Object Picker Dialog
|
---|
5 | *
|
---|
6 | * THIS SOFTWARE IS NOT COPYRIGHTED
|
---|
7 | *
|
---|
8 | * This source code is offered for use in the public domain. You may
|
---|
9 | * use, modify or distribute it freely.
|
---|
10 | *
|
---|
11 | * This code is distributed in the hope that it will be useful but
|
---|
12 | * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
---|
13 | * DISCLAIMED. This includes but is not limited to warranties of
|
---|
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
---|
15 | *
|
---|
16 | */
|
---|
17 |
|
---|
18 | /*
|
---|
19 | * Sun LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
|
---|
20 | * other than GPL or LGPL is available it will apply instead, Sun elects to use only
|
---|
21 | * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
|
---|
22 | * a choice of LGPL license versions is made available with the language indicating
|
---|
23 | * that LGPLv2 or any later version may be used, or where a choice of which version
|
---|
24 | * of the LGPL is applied is otherwise unspecified.
|
---|
25 | */
|
---|
26 |
|
---|
27 | #ifndef __OBJSEL_H_
|
---|
28 | #define __OBJSEL_H_
|
---|
29 |
|
---|
30 | #ifdef __cplusplus
|
---|
31 | extern "C" {
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | DEFINE_GUID(CLSID_DsObjectPicker, 0x17d6ccd8, 0x3b7b, 0x11d2, 0x00b9, 0xe0,0x00,0xc0,0x4f,0xd8,0xdb,0xf7);
|
---|
35 | DEFINE_GUID(IID_IDsObjectPicker, 0x0c87e64e, 0x3b7a, 0x11d2, 0x00b9, 0xe0,0x00,0xc0,0x4f,0xd8,0xdb,0xf7);
|
---|
36 |
|
---|
37 | #define CFSTR_DSOP_DS_SELECTION_LIST TEXT("CFSTR_DSOP_DS_SELECTION_LIST")
|
---|
38 |
|
---|
39 | /* up-level scope filters in the DSOP_UPLEVEL_FILTER_FLAGS structure */
|
---|
40 | #define DSOP_FILTER_INCLUDE_ADVANCED_VIEW (0x1)
|
---|
41 | #define DSOP_FILTER_USERS (0x2)
|
---|
42 | #define DSOP_FILTER_BUILTIN_GROUPS (0x4)
|
---|
43 | #define DSOP_FILTER_WELL_KNOWN_PRINCIPALS (0x8)
|
---|
44 | #define DSOP_FILTER_UNIVERSAL_GROUPS_DL (0x10)
|
---|
45 | #define DSOP_FILTER_UNIVERSAL_GROUPS_SE (0x20)
|
---|
46 | #define DSOP_FILTER_GLOBAL_GROUPS_DL (0x40)
|
---|
47 | #define DSOP_FILTER_GLOBAL_GROUPS_SE (0x80)
|
---|
48 | #define DSOP_FILTER_DOMAIN_LOCAL_GROUPS_DL (0x100)
|
---|
49 | #define DSOP_FILTER_DOMAIN_LOCAL_GROUPS_SE (0x200)
|
---|
50 | #define DSOP_FILTER_CONTACTS (0x400)
|
---|
51 | #define DSOP_FILTER_COMPUTERS (0x800)
|
---|
52 |
|
---|
53 | typedef struct _DSOP_UPLEVEL_FILTER_FLAGS
|
---|
54 | {
|
---|
55 | ULONG flBothModes;
|
---|
56 | ULONG flMixedModeOnly;
|
---|
57 | ULONG flNativeModeOnly;
|
---|
58 | } DSOP_UPLEVEL_FILTER_FLAGS, *PDSOP_UPLEVEL_FILTER_FLAGS;
|
---|
59 |
|
---|
60 | /* down-level scope filters in the DSOP_FILTER_FLAGS structure */
|
---|
61 | #define DSOP_DOWNLEVEL_FILTER_USERS (0x80000001)
|
---|
62 | #define DSOP_DOWNLEVEL_FILTER_LOCAL_GROUPS (0x80000002)
|
---|
63 | #define DSOP_DOWNLEVEL_FILTER_GLOBAL_GROUPS (0x80000004)
|
---|
64 | #define DSOP_DOWNLEVEL_FILTER_COMPUTERS (0x80000008)
|
---|
65 | #define DSOP_DOWNLEVEL_FILTER_WORLD (0x80000010)
|
---|
66 | #define DSOP_DOWNLEVEL_FILTER_AUTHENTICATED_USER (0x80000020)
|
---|
67 | #define DSOP_DOWNLEVEL_FILTER_ANONYMOUS (0x80000040)
|
---|
68 | #define DSOP_DOWNLEVEL_FILTER_BATCH (0x80000080)
|
---|
69 | #define DSOP_DOWNLEVEL_FILTER_CREATOR_OWNER (0x80000100)
|
---|
70 | #define DSOP_DOWNLEVEL_FILTER_CREATOR_GROUP (0x80000200)
|
---|
71 | #define DSOP_DOWNLEVEL_FILTER_DIALUP (0x80000400)
|
---|
72 | #define DSOP_DOWNLEVEL_FILTER_INTERACTIVE (0x80000800)
|
---|
73 | #define DSOP_DOWNLEVEL_FILTER_NETWORK (0x80001000)
|
---|
74 | #define DSOP_DOWNLEVEL_FILTER_SERVICE (0x80002000)
|
---|
75 | #define DSOP_DOWNLEVEL_FILTER_SYSTEM (0x80004000)
|
---|
76 | #define DSOP_DOWNLEVEL_FILTER_EXCLUDE_BUILTIN_GROUPS (0x80008000)
|
---|
77 | #define DSOP_DOWNLEVEL_FILTER_TERMINAL_SERVER (0x80010000)
|
---|
78 | #define DSOP_DOWNLEVEL_FILTER_ALL_WELLKNOWN_SIDS (0x80020000)
|
---|
79 | #define DSOP_DOWNLEVEL_FILTER_LOCAL_SERVICE (0x80040000)
|
---|
80 | #define DSOP_DOWNLEVEL_FILTER_NETWORK_SERVICE (0x80080000)
|
---|
81 | #define DSOP_DOWNLEVEL_FILTER_REMOTE_LOGON (0x80100000)
|
---|
82 |
|
---|
83 | typedef struct _DSOP_FILTER_FLAGS
|
---|
84 | {
|
---|
85 | DSOP_UPLEVEL_FILTER_FLAGS Uplevel;
|
---|
86 | ULONG flDownlevel;
|
---|
87 | } DSOP_FILTER_FLAGS, *PDSOP_FILTER_FLAGS;
|
---|
88 |
|
---|
89 | /* ADsPath format flags in the DSOP_SCOPE_INIT_INFO structure */
|
---|
90 | #define DSOP_SCOPE_FLAG_STARTING_SCOPE (0x1)
|
---|
91 | #define DSOP_SCOPE_FLAG_WANT_PROVIDER_WINNT (0x2)
|
---|
92 | #define DSOP_SCOPE_FLAG_WANT_PROVIDER_LDAP (0x4)
|
---|
93 | #define DSOP_SCOPE_FLAG_WANT_PROVIDER_GC (0x8)
|
---|
94 | #define DSOP_SCOPE_FLAG_WANT_SID_PATH (0x10)
|
---|
95 | #define DSOP_SCOPE_FLAG_WANT_DOWNLEVEL_BUILTIN_PATH (0x20)
|
---|
96 | #define DSOP_SCOPE_FLAG_DEFAULT_FILTER_USERS (0x40)
|
---|
97 | #define DSOP_SCOPE_FLAG_DEFAULT_FILTER_GROUPS (0x80)
|
---|
98 | #define DSOP_SCOPE_FLAG_DEFAULT_FILTER_COMPUTERS (0x100)
|
---|
99 | #define DSOP_SCOPE_FLAG_DEFAULT_FILTER_CONTACTS (0x200)
|
---|
100 |
|
---|
101 | typedef struct _DSOP_SCOPE_INIT_INFO
|
---|
102 | {
|
---|
103 | ULONG cbSize;
|
---|
104 | ULONG flType;
|
---|
105 | ULONG flScope;
|
---|
106 | DSOP_FILTER_FLAGS FilterFlags;
|
---|
107 | PCWSTR pwzDcName;
|
---|
108 | PCWSTR pwzADsPath;
|
---|
109 | HRESULT hr;
|
---|
110 | } DSOP_SCOPE_INIT_INFO, *PDSOP_SCOPE_INIT_INFO;
|
---|
111 | typedef const DSOP_SCOPE_INIT_INFO *PCDSOP_SCOPE_INIT_INFO;
|
---|
112 |
|
---|
113 | /* object picker options in the DSOP_INIT_INFO structure */
|
---|
114 | #define DSOP_FLAG_MULTISELECT (0x1)
|
---|
115 | #define DSOP_FLAG_SKIP_TARGET_COMPUTER_DC_CHECK (0x2)
|
---|
116 |
|
---|
117 | typedef struct _DSOP_INIT_INFO
|
---|
118 | {
|
---|
119 | ULONG cbSize;
|
---|
120 | PCWSTR pwzTargetComputer;
|
---|
121 | ULONG cDsScopeInfos;
|
---|
122 | PDSOP_SCOPE_INIT_INFO aDsScopeInfos;
|
---|
123 | ULONG flOptions;
|
---|
124 | ULONG cAttributesToFetch;
|
---|
125 | PCWSTR *apwzAttributeNames;
|
---|
126 | } DSOP_INIT_INFO, *PDSOP_INIT_INFO;
|
---|
127 |
|
---|
128 | typedef const DSOP_INIT_INFO *PCDSOP_INIT_INFO;
|
---|
129 |
|
---|
130 | /* selection scope types in the DS_SELECTION structure */
|
---|
131 | #define DSOP_SCOPE_TYPE_TARGET_COMPUTER (0x1)
|
---|
132 | #define DSOP_SCOPE_TYPE_UPLEVEL_JOINED_DOMAIN (0x2)
|
---|
133 | #define DSOP_SCOPE_TYPE_DOWNLEVEL_JOINED_DOMAIN (0x4)
|
---|
134 | #define DSOP_SCOPE_TYPE_ENTERPRISE_DOMAIN (0x8)
|
---|
135 | #define DSOP_SCOPE_TYPE_GLOBAL_CATALOG (0x10)
|
---|
136 | #define DSOP_SCOPE_TYPE_EXTERNAL_UPLEVEL_DOMAIN (0x20)
|
---|
137 | #define DSOP_SCOPE_TYPE_EXTERNAL_DOWNLEVEL_DOMAIN (0x40)
|
---|
138 | #define DSOP_SCOPE_TYPE_WORKGROUP (0x80)
|
---|
139 | #define DSOP_SCOPE_TYPE_USER_ENTERED_UPLEVEL_SCOPE (0x100)
|
---|
140 | #define DSOP_SCOPE_TYPE_USER_ENTERED_DOWNLEVEL_SCOPE (0x200)
|
---|
141 |
|
---|
142 | typedef struct _DS_SELECTION
|
---|
143 | {
|
---|
144 | PWSTR pwzName;
|
---|
145 | PWSTR pwzADsPath;
|
---|
146 | PWSTR pwzClass;
|
---|
147 | PWSTR pwzUPN;
|
---|
148 | VARIANT *pvarFetchedAttributes;
|
---|
149 | ULONG flScopeType;
|
---|
150 | } DS_SELECTION, *PDS_SELECTION;
|
---|
151 |
|
---|
152 | typedef struct _DS_SELECTION_LIST
|
---|
153 | {
|
---|
154 | ULONG cItems;
|
---|
155 | ULONG cFetchedAttributes;
|
---|
156 | DS_SELECTION aDsSelection[ANYSIZE_ARRAY];
|
---|
157 | } DS_SELECTION_LIST, *PDS_SELECTION_LIST;
|
---|
158 |
|
---|
159 | /*****************************************************************************
|
---|
160 | * IDsObjectPicker interface
|
---|
161 | */
|
---|
162 | #define INTERFACE IDsObjectPicker
|
---|
163 | DECLARE_INTERFACE_(IDsObjectPicker,IUnknown)
|
---|
164 | {
|
---|
165 | /*** IUnknown methods ***/
|
---|
166 | STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
|
---|
167 | STDMETHOD_(ULONG,AddRef)(THIS) PURE;
|
---|
168 | STDMETHOD_(ULONG,Release)(THIS) PURE;
|
---|
169 | /*** IDsObjectPicker methods ***/
|
---|
170 | STDMETHOD(Initialize)(THIS_ PDSOP_INIT_INFO pInitInfo) PURE;
|
---|
171 | STDMETHOD(InvokeDialog)(THIS_ HWND hwndParent, IDataObject** ppdoSelections) PURE;
|
---|
172 | };
|
---|
173 | #undef INTERFACE
|
---|
174 |
|
---|
175 |
|
---|
176 | #ifdef __cplusplus
|
---|
177 | }
|
---|
178 | #endif
|
---|
179 | #endif /* __OBJSEL_H_ */
|
---|