29 #define IDataObject_AddRef(This) ((This)->lpVtbl->AddRef(This))
30 #define IDataObject_Release(This) ((This)->lpVtbl->Release(This))
31 #define IDataObject_GetData(This, pformatetcIn, pmedium) ((This)->lpVtbl->GetData(This, pformatetcIn, pmedium))
33 #define IDsObjectPicker_QueryInterface(This, riid, ppvObject) ((This)->lpVtbl->QueryInterface(This, riid, ppvObject))
34 #define IDsObjectPicker_AddRef(This) ((This)->lpVtbl->AddRef(This))
35 #define IDsObjectPicker_Release(This) ((This)->lpVtbl->Release(This))
36 #define IDsObjectPicker_Initialize(This, pInitInfo) ((This)->lpVtbl->Initialize(This, pInitInfo))
37 #define IDsObjectPicker_InvokeDialog(This, hwndParent, ppdoSelections) ((This)->lpVtbl->InvokeDialog(This, hwndParent, ppdoSelections))
43 static CLSID CLSID_DsObjectPicker_I = { 0x17d6ccd8, 0x3b7b, 0x11d2, { 0xb9, 0xe0, 0x00, 0xc0, 0x4f, 0xd8, 0xdb, 0xf7 } };
44 static IID IID_IDsObjectPicker_I = { 0x0c87e64e, 0x3b7a, 0x11d2, { 0xb9, 0xe0, 0x00, 0xc0, 0x4f, 0xd8, 0xdb, 0xf7 } };
46 IDsObjectPicker *picker;
48 if (SUCCEEDED(CoCreateInstance(
49 &CLSID_DsObjectPicker_I,
52 &IID_IDsObjectPicker_I,
65 _In_ PVOID PickerDialog
75 IDsObjectPicker *picker;
76 DSOP_INIT_INFO initInfo;
77 DSOP_SCOPE_INIT_INFO scopeInit[1];
84 memset(scopeInit, 0,
sizeof(scopeInit));
86 scopeInit[0].cbSize =
sizeof(DSOP_SCOPE_INIT_INFO);
87 scopeInit[0].flType = DSOP_SCOPE_TYPE_TARGET_COMPUTER;
88 scopeInit[0].flScope =
89 DSOP_SCOPE_FLAG_WANT_PROVIDER_WINNT |
90 DSOP_SCOPE_FLAG_WANT_SID_PATH |
91 DSOP_SCOPE_FLAG_DEFAULT_FILTER_USERS |
92 DSOP_SCOPE_FLAG_DEFAULT_FILTER_GROUPS;
93 scopeInit[0].FilterFlags.Uplevel.flBothModes =
94 DSOP_FILTER_INCLUDE_ADVANCED_VIEW |
96 DSOP_FILTER_BUILTIN_GROUPS |
97 DSOP_FILTER_WELL_KNOWN_PRINCIPALS;
98 scopeInit[0].FilterFlags.flDownlevel =
99 DSOP_DOWNLEVEL_FILTER_USERS |
100 DSOP_DOWNLEVEL_FILTER_LOCAL_GROUPS |
101 DSOP_DOWNLEVEL_FILTER_GLOBAL_GROUPS |
102 DSOP_DOWNLEVEL_FILTER_ALL_WELLKNOWN_SIDS;
104 memset(&initInfo, 0,
sizeof(DSOP_INIT_INFO));
105 initInfo.cbSize =
sizeof(DSOP_INIT_INFO);
106 initInfo.pwzTargetComputer = NULL;
107 initInfo.cDsScopeInfos = 1;
108 initInfo.aDsScopeInfos = scopeInit;
109 initInfo.flOptions = DSOP_FLAG_SKIP_TARGET_COMPUTER_DC_CHECK;
112 initInfo.flOptions |= DSOP_FLAG_MULTISELECT;
124 _In_ IDataObject *Selections
130 format.cfFormat = (CLIPFORMAT)RegisterClipboardFormat(L
"CFSTR_DSOP_DS_SELECTION_LIST");
132 format.dwAspect = -1;
134 format.tymed = TYMED_HGLOBAL;
138 if (medium.tymed != TYMED_HGLOBAL)
141 return (PDS_SELECTION_LIST)GlobalLock(medium.hGlobal);
151 _In_ PVOID PickerDialog,
155 IDsObjectPicker *picker;
156 IDataObject *dataObject;
157 PDS_SELECTION_LIST selections;
161 picker = (IDsObjectPicker *)PickerDialog;
175 objects = PhAllocate(
182 for (i = 0; i < selections->cItems; i++)
184 PDS_SELECTION selection;
189 selection = &selections->aDsSelection[i];
194 if (selection->pwzADsPath && selection->pwzADsPath[0] != 0)
202 path.
Length -=
sizeof(WCHAR);
204 sid = PhAllocate(path.
Length /
sizeof(WCHAR) / 2);
237 for (i = 0; i < Objects->NumberOfObjects; i++)
241 if (Objects->Objects[i].Sid)
242 PhFree(Objects->Objects[i].Sid);