xref: /reactos/sdk/include/psdk/shlobj.h (revision d2c71d76)
1 /*
2  * Copyright (C) the Wine project
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17  */
18 
19 #ifndef __WINE_SHLOBJ_H
20 #define __WINE_SHLOBJ_H
21 
22 #include <ole2.h>
23 #include <commctrl.h>
24 #include <prsht.h>
25 
26 #ifndef INITGUID
27 #include <shlguid.h>
28 #endif
29 
30 #ifdef WINE_NO_UNICODE_MACROS
31 #undef GetObject
32 #endif
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif /* defined(__cplusplus) */
37 
38 /* Except for specific structs, this header is byte packed */
39 #include <pshpack1.h>
40 
41 #include <shtypes.h>
42 #include <shobjidl.h>
43 
44 #include <pshpack8.h>
45 
46 typedef struct
47 {
48     DWORD         dwSize;
49     DWORD         dwMask;
50     SHELLVIEWID*  pvid;
51     LPSTR         pszWebViewTemplate;
52     DWORD         cchWebViewTemplate;
53     LPSTR         pszWebViewTemplateVersion;
54     LPSTR         pszInfoTip;
55     DWORD         cchInfoTip;
56     CLSID*        pclsid;
57     DWORD         dwFlags;
58     LPSTR         pszIconFile;
59     DWORD         cchIconFile;
60     int           iIconIndex;
61     LPSTR         pszLogo;
62     DWORD         cchLogo;
63 } SHFOLDERCUSTOMSETTINGSA, *LPSHFOLDERCUSTOMSETTINGSA;
64 
65 typedef struct
66 {
67     DWORD         dwSize;
68     DWORD         dwMask;
69     SHELLVIEWID*  pvid;
70     LPWSTR        pszWebViewTemplate;
71     DWORD         cchWebViewTemplate;
72     LPWSTR        pszWebViewTemplateVersion;
73     LPWSTR        pszInfoTip;
74     DWORD         cchInfoTip;
75     CLSID*        pclsid;
76     DWORD         dwFlags;
77     LPWSTR        pszIconFile;
78     DWORD         cchIconFile;
79     int           iIconIndex;
80     LPWSTR        pszLogo;
81     DWORD         cchLogo;
82 } SHFOLDERCUSTOMSETTINGSW, *LPSHFOLDERCUSTOMSETTINGSW;
83 
84 #include <poppack.h>
85 
86 #define FCS_READ       0x00000001
87 #define FCS_FORCEWRITE 0x00000002
88 
89 #define FCSM_ICONFILE 0x00000010
90 
91 #ifndef HPSXA_DEFINED
92 #define HPSXA_DEFINED
93 DECLARE_HANDLE(HPSXA);
94 #endif
95 
96 typedef enum
97 {
98     KF_FLAG_DEFAULT                     = 0x00000000,
99     KF_FLAG_SIMPLE_IDLIST               = 0x00000100,
100     KF_FLAG_NOT_PARENT_RELATIVE         = 0x00000200,
101     KF_FLAG_DEFAULT_PATH                = 0x00000400,
102     KF_FLAG_INIT                        = 0x00000800,
103     KF_FLAG_NO_ALIAS                    = 0x00001000,
104     KF_FLAG_DONT_UNEXPAND               = 0x00002000,
105     KF_FLAG_DONT_VERIFY                 = 0x00004000,
106     KF_FLAG_CREATE                      = 0x00008000,
107     KF_FLAG_NO_APPCONTAINER_REDIRECTION = 0x00010000,
108     KF_FLAG_ALIAS_ONLY                  = 0x80000000
109 } KNOWN_FOLDER_FLAG;
110 
111 typedef int GPFIDL_FLAGS;
112 
113 UINT
114 WINAPI
115 SHAddFromPropSheetExtArray(
116   _In_ HPSXA,
117   _In_ LPFNADDPROPSHEETPAGE,
118   LPARAM);
119 
120 LPVOID       WINAPI SHAlloc(SIZE_T) __WINE_ALLOC_SIZE(1);
121 
122 HRESULT
123 WINAPI
124 SHCoCreateInstance(
125   _In_opt_ LPCWSTR,
126   _In_opt_ const CLSID*,
127   _In_opt_ IUnknown*,
128   _In_ REFIID,
129   _Outptr_ LPVOID*);
130 
131 HPSXA        WINAPI SHCreatePropSheetExtArray(_In_ HKEY, _In_opt_ LPCWSTR, UINT);
132 HPSXA        WINAPI SHCreatePropSheetExtArrayEx(HKEY,LPCWSTR,UINT,IDataObject*);
133 HRESULT      WINAPI SHCreateQueryCancelAutoPlayMoniker(IMoniker**);
134 
135 HRESULT
136 WINAPI
137 SHCreateShellItem(
138   _In_opt_ LPCITEMIDLIST,
139   _In_opt_ IShellFolder*,
140   _In_ LPCITEMIDLIST,
141   _Outptr_ IShellItem**);
142 
143 DWORD        WINAPI SHCLSIDFromStringA(_In_ LPCSTR, _Out_ CLSID*);
144 DWORD        WINAPI SHCLSIDFromStringW(_In_ LPCWSTR, _Out_ CLSID*);
145 #define             SHCLSIDFromString WINELIB_NAME_AW(SHCLSIDFromString)
146 
147 HRESULT
148 WINAPI
149 SHCreateStdEnumFmtEtc(
150   _In_ UINT cfmt,
151   _In_reads_(cfmt) const FORMATETC *,
152   _Outptr_ IEnumFORMATETC**);
153 
154 void         WINAPI SHDestroyPropSheetExtArray(_In_ HPSXA);
155 BOOL         WINAPI SHFindFiles(_In_opt_ LPCITEMIDLIST, _In_opt_ LPCITEMIDLIST);
156 DWORD        WINAPI SHFormatDrive(_In_ HWND, UINT, UINT, UINT);
157 void         WINAPI SHFree(_In_opt_ LPVOID);
158 
159 BOOL
160 WINAPI
161 GetFileNameFromBrowse(
162   _In_opt_ HWND,
163   _Inout_updates_(cchFilePath) LPWSTR,
164   UINT cchFilePath,
165   _In_opt_ LPCWSTR,
166   _In_ LPCWSTR,
167   _In_opt_ LPCWSTR,
168   _In_opt_ LPCWSTR);
169 
170 _Check_return_ HRESULT WINAPI SHGetInstanceExplorer(_Outptr_ IUnknown**);
171 
172 VOID         WINAPI SHSetInstanceExplorer(_In_opt_ IUnknown*);
173 
174 HRESULT
175 WINAPI
176 SHGetFolderPathAndSubDirA(
177   _Reserved_ HWND,
178   _In_ int,
179   _In_opt_ HANDLE,
180   _In_ DWORD,
181   _In_opt_ LPCSTR, _Out_writes_(MAX_PATH) LPSTR);
182 
183 HRESULT
184 WINAPI
185 SHGetFolderPathAndSubDirW(
186   _Reserved_ HWND,
187   _In_ int,
188   _In_opt_ HANDLE,
189   _In_ DWORD,
190   _In_opt_ LPCWSTR,
191   _Out_writes_(MAX_PATH) LPWSTR);
192 
193 #define SHGetFolderPathAndSubDir WINELIB_NAME_AW(SHGetFolderPathAndSubDir);
194 
195 _Success_(return != 0)
196 BOOL
197 WINAPI
198 SHGetPathFromIDListA(
199   _In_ LPCITEMIDLIST,
200   _Out_writes_(MAX_PATH) LPSTR);
201 
202 _Success_(return != 0)
203 BOOL
204 WINAPI
205 SHGetPathFromIDListW(
206   _In_ LPCITEMIDLIST,
207   _Out_writes_(MAX_PATH) LPWSTR);
208 
209 #define SHGetPathFromIDList WINELIB_NAME_AW(SHGetPathFromIDList)
210 
211 INT          WINAPI SHHandleUpdateImage(_In_ LPCITEMIDLIST);
212 
213 HRESULT
214 WINAPI
215 SHILCreateFromPath(
216   _In_ LPCWSTR,
217   _Outptr_ LPITEMIDLIST*,
218   _Inout_opt_ DWORD*);
219 
220 HRESULT      WINAPI SHLoadOLE(LPARAM);
221 
222 HRESULT
223 WINAPI
224 SHParseDisplayName(
225   _In_ LPCWSTR,
226   _In_opt_ IBindCtx*,
227   _Outptr_ LPITEMIDLIST*,
228   _In_ SFGAOF,
229   _Out_opt_ SFGAOF*);
230 
231 HRESULT
232 WINAPI
233 SHPathPrepareForWriteA(
234   _In_opt_ HWND,
235   _In_opt_ IUnknown*,
236   _In_ LPCSTR, DWORD);
237 
238 HRESULT
239 WINAPI
240 SHPathPrepareForWriteW(
241   _In_opt_ HWND,
242   _In_opt_ IUnknown*,
243   _In_ LPCWSTR, DWORD);
244 
245 #define SHPathPrepareForWrite WINELIB_NAME_AW(SHPathPrepareForWrite);
246 
247 UINT
248 WINAPI
249 SHReplaceFromPropSheetExtArray(
250   _In_ HPSXA,
251   UINT,
252   _In_ LPFNADDPROPSHEETPAGE,
253   LPARAM);
254 
255 LPITEMIDLIST WINAPI SHSimpleIDListFromPath(LPCWSTR);
256 
257 int
258 WINAPI
259 SHMapPIDLToSystemImageListIndex(
260   _In_ IShellFolder*,
261   _In_ LPCITEMIDLIST,
262   _Out_opt_ int*);
263 
264 HRESULT      WINAPI SHStartNetConnectionDialog(HWND,LPCSTR,DWORD);
265 VOID         WINAPI SHUpdateImageA(_In_ LPCSTR, INT, UINT, INT);
266 VOID         WINAPI SHUpdateImageW(_In_ LPCWSTR, INT, UINT, INT);
267 #define             SHUpdateImage WINELIB_NAME_AW(SHUpdateImage)
268 
269 INT
270 WINAPI
271 PickIconDlg(
272   _In_opt_ HWND,
273   _Inout_updates_(cchIconPath) LPWSTR,
274   UINT cchIconPath,
275   _Inout_opt_ int *);
276 
277 HRESULT
278 WINAPI
279 SHLimitInputEdit(
280   _In_ HWND hwnd,
281   _In_ IShellFolder *folder);
282 
283 int          WINAPI RestartDialog(_In_opt_ HWND, _In_opt_ LPCWSTR, DWORD);
284 int          WINAPI RestartDialogEx(_In_opt_ HWND, _In_opt_ LPCWSTR, DWORD, DWORD);
285 int          WINAPI DriveType(int);
286 int          WINAPI RealDriveType(int, BOOL);
287 int          WINAPI IsNetDrive(int);
288 BOOL         WINAPI IsUserAnAdmin(void);
289 
290 #define KF_FLAG_DEFAULT_PATH        0x00000400
291 
292 #define SHFMT_ERROR     0xFFFFFFFFL  /* Error on last format, drive may be formattable */
293 #define SHFMT_CANCEL    0xFFFFFFFEL  /* Last format was cancelled */
294 #define SHFMT_NOFORMAT  0xFFFFFFFDL  /* Drive is not formattable */
295 
296 /* SHFormatDrive flags */
297 #define SHFMT_ID_DEFAULT	0xFFFF
298 #define SHFMT_OPT_FULL		1
299 #define SHFMT_OPT_SYSONLY	2
300 
301 /* SHPathPrepareForWrite flags */
302 #define SHPPFW_NONE             0x00000000
303 #define SHPPFW_DIRCREATE        0x00000001
304 #define SHPPFW_DEFAULT          SHPPFW_DIRCREATE
305 #define SHPPFW_ASKDIRCREATE     0x00000002
306 #define SHPPFW_IGNOREFILENAME   0x00000004
307 #define SHPPFW_NOWRITECHECK     0x00000008
308 #define SHPPFW_MEDIACHECKONLY   0x00000010
309 
310 /* SHObjectProperties flags */
311 #define SHOP_PRINTERNAME 0x01
312 #define SHOP_FILEPATH    0x02
313 #define SHOP_VOLUMEGUID  0x04
314 
315 BOOL
316 WINAPI
317 SHObjectProperties(
318   _In_opt_ HWND,
319   _In_ DWORD,
320   _In_ LPCWSTR,
321   _In_opt_ LPCWSTR);
322 
323 #define PCS_FATAL           0x80000000
324 #define PCS_REPLACEDCHAR    0x00000001
325 #define PCS_REMOVEDCHAR     0x00000002
326 #define PCS_TRUNCATED       0x00000004
327 #define PCS_PATHTOOLONG     0x00000008
328 
329 int WINAPI PathCleanupSpec(_In_opt_ LPCWSTR, _Inout_ LPWSTR);
330 
331 /*****************************************************************************
332  * IContextMenu interface
333  */
334 
335 
336 /* DATAOBJECT_InitShellIDList*/
337 #define CFSTR_SHELLIDLISTA           "Shell IDList Array"   /* CF_IDLIST */
338 #define CFSTR_SHELLIDLISTOFFSETA     "Shell Object Offsets" /* CF_OBJECTPOSITIONS */
339 #define CFSTR_NETRESOURCESA          "Net Resource"         /* CF_NETRESOURCE */
340 /* DATAOBJECT_InitFileGroupDesc */
341 #define CFSTR_FILEDESCRIPTORA        "FileGroupDescriptor"  /* CF_FILEGROUPDESCRIPTORA */
342 /* DATAOBJECT_InitFileContents*/
343 #define CFSTR_FILECONTENTSA          "FileContents"         /* CF_FILECONTENTS */
344 #define CFSTR_FILENAMEA              "FileName"             /* CF_FILENAMEA */
345 #define CFSTR_FILENAMEMAPA           "FileNameMap"          /* CF_FILENAMEMAPA */
346 #define CFSTR_PRINTERGROUPA          "PrinterFriendlyName"  /* CF_PRINTERS */
347 #define CFSTR_SHELLURLA              "UniformResourceLocator"
348 #define CFSTR_INETURLA               CFSTR_SHELLURLA
349 #define CFSTR_PREFERREDDROPEFFECTA   "Preferred DropEffect"
350 #define CFSTR_PERFORMEDDROPEFFECTA   "Performed DropEffect"
351 #define CFSTR_PASTESUCCEEDEDA        "Paste Succeeded"
352 #define CFSTR_INDRAGLOOPA            "InShellDragLoop"
353 #define CFSTR_DRAGCONTEXTA           "DragContext"
354 #define CFSTR_MOUNTEDVOLUMEA         "MountedVolume"
355 #define CFSTR_PERSISTEDDATAOBJECTA   "PersistedDataObject"
356 #define CFSTR_TARGETCLSIDA           "TargetCLSID"
357 #define CFSTR_AUTOPLAY_SHELLIDLISTSA "Autoplay Enumerated IDList Array"
358 #define CFSTR_LOGICALPERFORMEDDROPEFFECTA "Logical Performed DropEffect"
359 
360 #if defined(__GNUC__)
361 # define CFSTR_SHELLIDLISTW \
362     (const WCHAR []){ 'S','h','e','l','l',' ','I','D','L','i','s','t',' ','A','r','r','a','y',0 }
363 # define CFSTR_SHELLIDLISTOFFSETW \
364     (const WCHAR []){ 'S','h','e','l','l',' ','O','b','j','e','c','t',' ','O','f','f','s','e','t','s',0 }
365 # define CFSTR_NETRESOURCESW \
366     (const WCHAR []){ 'N','e','t',' ','R','e','s','o','u','r','c','e',0 }
367 # define CFSTR_FILEDESCRIPTORW \
368     (const WCHAR []){ 'F','i','l','e','G','r','o','u','p','D','e','s','c','r','i','p','t','o','r','W',0 }
369 # define CFSTR_FILECONTENTSW \
370     (const WCHAR []){ 'F','i','l','e','C','o','n','t','e','n','t','s',0 }
371 # define CFSTR_FILENAMEW \
372     (const WCHAR []){ 'F','i','l','e','N','a','m','e','W',0 }
373 # define CFSTR_FILENAMEMAPW \
374     (const WCHAR []){ 'F','i','l','e','N','a','m','e','M','a','p','W',0 }
375 # define CFSTR_PRINTERGROUPW \
376     (const WCHAR []){ 'P','r','i','n','t','e','r','F','r','i','e','n','d','l','y','N','a','m','e',0 }
377 # define CFSTR_SHELLURLW \
378     (const WCHAR []){ 'U','n','i','f','o','r','m','R','e','s','o','u','r','c','e','L','o','c','a','t','o','r',0 }
379 # define CFSTR_INETURLW \
380     (const WCHAR []){ 'U','n','i','f','o','r','m','R','e','s','o','u','r','c','e','L','o','c','a','t','o','r','W',0 }
381 # define CFSTR_PREFERREDDROPEFFECTW \
382     (const WCHAR []){ 'P','r','e','f','e','r','r','e','d',' ','D','r','o','p','E','f','f','e','c','t',0 }
383 # define CFSTR_PERFORMEDDROPEFFECTW \
384     (const WCHAR []){ 'P','e','r','f','o','r','m','e','d',' ','D','r','o','p','E','f','f','e','c','t',0 }
385 # define CFSTR_PASTESUCCEEDEDW \
386     (const WCHAR []){ 'P','a','s','t','e',' ','S','u','c','c','e','e','d','e','d',0 }
387 # define CFSTR_INDRAGLOOPW \
388     (const WCHAR []){ 'I','n','S','h','e','l','l','D','r','a','g','L','o','o','p',0 }
389 # define CFSTR_DRAGCONTEXTW \
390     (const WCHAR []){ 'D','r','a','g','C','o','n','t','e','x','t',0 }
391 # define CFSTR_MOUNTEDVOLUMEW \
392     (const WCHAR []){ 'M','o','u','n','t','e','d','V','o','l','u','m','e',0 }
393 # define CFSTR_PERSISTEDDATAOBJECTW \
394     (const WCHAR []){ 'P','e','r','s','i','s','t','e','d','D','a','t','a','O','b','j','e','c','t',0 }
395 # define CFSTR_TARGETCLSIDW \
396     (const WCHAR []){ 'T','a','r','g','e','t','C','L','S','I','D',0 }
397 # define CFSTR_AUTOPLAY_SHELLIDLISTSW \
398     (const WCHAR []){ 'A','u','t','o','p','l','a','y',' ','E','n','u','m','e','r','a','t','e','d',\
399                       ' ','I','D','L','i','s','t',' ','A','r','r','a','y',0 }
400 # define CFSTR_LOGICALPERFORMEDDROPEFFECTW \
401     (const WCHAR []){ 'L','o','g','i','c','a','l',' ','P','e','r','f','o','r','m','e','d',\
402                       ' ','D','r','o','p','E','f','f','e','c','t',0 }
403 #elif defined(_MSC_VER)
404 # define CFSTR_SHELLIDLISTW           L"Shell IDList Array"
405 # define CFSTR_SHELLIDLISTOFFSETW     L"Shell Object Offsets"
406 # define CFSTR_NETRESOURCESW          L"Net Resource"
407 # define CFSTR_FILEDESCRIPTORW        L"FileGroupDescriptorW"
408 # define CFSTR_FILECONTENTSW          L"FileContents"
409 # define CFSTR_FILENAMEW              L"FileNameW"
410 # define CFSTR_FILENAMEMAPW           L"FileNameMapW"
411 # define CFSTR_PRINTERGROUPW          L"PrinterFriendlyName"
412 # define CFSTR_SHELLURLW              L"UniformResourceLocator"
413 # define CFSTR_INETURLW               L"UniformResourceLocatorW"
414 # define CFSTR_PREFERREDDROPEFFECTW   L"Preferred DropEffect"
415 # define CFSTR_PERFORMEDDROPEFFECTW   L"Performed DropEffect"
416 # define CFSTR_PASTESUCCEEDEDW        L"Paste Succeeded"
417 # define CFSTR_INDRAGLOOPW            L"InShellDragLoop"
418 # define CFSTR_DRAGCONTEXTW           L"DragContext"
419 # define CFSTR_MOUNTEDVOLUMEW         L"MountedVolume"
420 # define CFSTR_PERSISTEDDATAOBJECTW   L"PersistedDataObject"
421 # define CFSTR_TARGETCLSIDW           L"TargetCLSID"
422 # define CFSTR_AUTOPLAY_SHELLIDLISTSW L"Autoplay Enumerated IDList Array"
423 # define CFSTR_LOGICALPERFORMEDDROPEFFECTW L"Logical Performed DropEffect"
424 #else
425 static const WCHAR CFSTR_SHELLIDLISTW[] =
426     { 'S','h','e','l','l',' ','I','D','L','i','s','t',' ','A','r','r','a','y',0 };
427 static const WCHAR CFSTR_SHELLIDLISTOFFSETW[] =
428     { 'S','h','e','l','l',' ','O','b','j','e','c','t',' ','O','f','f','s','e','t','s',0 };
429 static const WCHAR CFSTR_NETRESOURCESW[] =
430     { 'N','e','t',' ','R','e','s','o','u','r','c','e',0 };
431 static const WCHAR CFSTR_FILEDESCRIPTORW[] =
432     { 'F','i','l','e','G','r','o','u','p','D','e','s','c','r','i','p','t','o','r','W',0 };
433 static const WCHAR CFSTR_FILECONTENTSW[] =
434     { 'F','i','l','e','C','o','n','t','e','n','t','s',0 };
435 static const WCHAR CFSTR_FILENAMEW[] =
436     { 'F','i','l','e','N','a','m','e','W',0 };
437 static const WCHAR CFSTR_FILENAMEMAPW[] =
438     { 'F','i','l','e','N','a','m','e','M','a','p','W',0 };
439 static const WCHAR CFSTR_PRINTERGROUPW[] =
440     { 'P','r','i','n','t','e','r','F','r','i','e','n','d','l','y','N','a','m','e',0 };
441 static const WCHAR CFSTR_SHELLURLW[] =
442     { 'U','n','i','f','o','r','m','R','e','s','o','u','r','c','e','L','o','c','a','t','o','r',0 };
443 static const WCHAR CFSTR_INETURLW[] =
444     { 'U','n','i','f','o','r','m','R','e','s','o','u','r','c','e','L','o','c','a','t','o','r','W',0 };
445 static const WCHAR CFSTR_PREFERREDDROPEFFECTW[] =
446     { 'P','r','e','f','e','r','r','e','d',' ','D','r','o','p','E','f','f','e','c','t',0 };
447 static const WCHAR CFSTR_PERFORMEDDROPEFFECTW[] =
448     { 'P','e','r','f','o','r','m','e','d',' ','D','r','o','p','E','f','f','e','c','t',0 };
449 static const WCHAR CFSTR_PASTESUCCEEDEDW[] =
450     { 'P','a','s','t','e',' ','S','u','c','c','e','e','d','e','d',0 };
451 static const WCHAR CFSTR_INDRAGLOOPW[] =
452     { 'I','n','S','h','e','l','l','D','r','a','g','L','o','o','p',0 };
453 static const WCHAR CFSTR_DRAGCONTEXTW[] =
454     { 'D','r','a','g','C','o','n','t','e','x','t',0 };
455 static const WCHAR CFSTR_MOUNTEDVOLUMEW[] =
456     { 'M','o','u','n','t','e','d','V','o','l','u','m','e',0 };
457 static const WCHAR CFSTR_PERSISTEDDATAOBJECTW[] =
458     { 'P','e','r','s','i','s','t','e','d','D','a','t','a','O','b','j','e','c','t',0 };
459 static const WCHAR CFSTR_TARGETCLSIDW[] =
460     { 'T','a','r','g','e','t','C','L','S','I','D',0 };
461 static const WCHAR CFSTR_AUTOPLAY_SHELLIDLISTSW[] =
462     { 'A','u','t','o','p','l','a','y',' ','E','n','u','m','e','r','a','t','e','d',
463       ' ','I','D','L','i','s','t',' ','A','r','r','a','y',0 };
464 static const WCHAR CFSTR_LOGICALPERFORMEDDROPEFFECTW[] =
465     { 'L','o','g','i','c','a','l',' ','P','e','r','f','o','r','m','e','d',
466       ' ','D','r','o','p','E','f','f','e','c','t',0 };
467 #endif
468 
469 #define CFSTR_SHELLIDLIST           WINELIB_NAME_AW(CFSTR_SHELLIDLIST)
470 #define CFSTR_SHELLIDLISTOFFSET     WINELIB_NAME_AW(CFSTR_SHELLIDLISTOFFSET)
471 #define CFSTR_NETRESOURCES          WINELIB_NAME_AW(CFSTR_NETRESOURCES)
472 #define CFSTR_FILEDESCRIPTOR        WINELIB_NAME_AW(CFSTR_FILEDESCRIPTOR)
473 #define CFSTR_FILECONTENTS          WINELIB_NAME_AW(CFSTR_FILECONTENTS)
474 #define CFSTR_FILENAME              WINELIB_NAME_AW(CFSTR_FILENAME)
475 #define CFSTR_FILENAMEMAP           WINELIB_NAME_AW(CFSTR_FILENAMEMAP)
476 #define CFSTR_PRINTERGROUP          WINELIB_NAME_AW(CFSTR_PRINTERGROUP)
477 #define CFSTR_SHELLURL              WINELIB_NAME_AW(CFSTR_SHELLURL)
478 #define CFSTR_INETURL               WINELIB_NAME_AW(CFSTR_INETURL)
479 #define CFSTR_PREFERREDDROPEFFECT   WINELIB_NAME_AW(CFSTR_PREFERREDDROPEFFECT)
480 #define CFSTR_PERFORMEDDROPEFFECT   WINELIB_NAME_AW(CFSTR_PERFORMEDDROPEFFECT)
481 #define CFSTR_PASTESUCCEEDED        WINELIB_NAME_AW(CFSTR_PASTESUCCEEDED)
482 #define CFSTR_INDRAGLOOP            WINELIB_NAME_AW(CFSTR_INDRAGLOOP)
483 #define CFSTR_DRAGCONTEXT           WINELIB_NAME_AW(CFSTR_DRAGCONTEXT)
484 #define CFSTR_MOUNTEDVOLUME         WINELIB_NAME_AW(CFSTR_MOUNTEDVOLUME)
485 #define CFSTR_PERSISTEDDATAOBJECT   WINELIB_NAME_AW(CFSTR_PERSISTEDDATAOBJECT)
486 #define CFSTR_TARGETCLSID           WINELIB_NAME_AW(CFSTR_TARGETCLSID)
487 #define CFSTR_AUTOPLAY_SHELLIDLISTS WINELIB_NAME_AW(CFSTR_AUTOPLAY_SHELLIDLISTS)
488 #define CFSTR_LOGICALPERFORMEDDROPEFFECT WINELIB_NAME_AW(CFSTR_LOGICALPERFORMEDDROPEFFECT)
489 
490 typedef struct
491 {	UINT cidl;
492 	UINT aoffset[1];
493 } CIDA, *LPIDA;
494 
495 /************************************************************************
496 * IShellView interface
497 */
498 
499 #define FCIDM_SHVIEWFIRST       0x0000
500 /* undocumented */
501 #define FCIDM_SHVIEW_ARRANGE    0x7001
502 #define FCIDM_SHVIEW_DELETE     0x7011
503 #define FCIDM_SHVIEW_PROPERTIES 0x7013
504 #define FCIDM_SHVIEW_CUT        0x7018
505 #define FCIDM_SHVIEW_COPY       0x7019
506 #define FCIDM_SHVIEW_INSERT     0x701A
507 #define FCIDM_SHVIEW_UNDO       0x701B
508 #define FCIDM_SHVIEW_INSERTLINK 0x701C
509 #define FCIDM_SHVIEW_COPYTO     0x701E
510 #define FCIDM_SHVIEW_MOVETO     0x701F
511 #define FCIDM_SHVIEW_SELECTALL  0x7021
512 #define FCIDM_SHVIEW_INVERTSELECTION 0x7022
513 
514 #define FCIDM_SHVIEW_BIGICON    0x7029
515 #define FCIDM_SHVIEW_SMALLICON  0x702A
516 #define FCIDM_SHVIEW_LISTVIEW   0x702B
517 #define FCIDM_SHVIEW_REPORTVIEW 0x702C
518 /* 0x7030-0x703f are used by the shellbrowser */
519 #define FCIDM_SHVIEW_AUTOARRANGE 0x7031
520 #define FCIDM_SHVIEW_SNAPTOGRID 0x7032
521 
522 #define FCIDM_SHVIEW_HELP       0x7041
523 #define FCIDM_SHVIEW_RENAME     0x7050
524 #define FCIDM_SHVIEW_CREATELINK 0x7051
525 #define FCIDM_SHVIEW_NEWLINK    0x7052
526 #define FCIDM_SHVIEW_NEWFOLDER  0x7053
527 
528 #define FCIDM_SHVIEW_REFRESH    0x7100 /* FIXME */
529 #define FCIDM_SHVIEW_EXPLORE    0x7101 /* FIXME */
530 #define FCIDM_SHVIEW_OPEN       0x7102 /* FIXME */
531 
532 #define FCIDM_SHVIEWLAST        0x7fff
533 #define FCIDM_BROWSERFIRST      0xA000
534 /* undocumented toolbar items from stddlg's*/
535 #define FCIDM_TB_UPFOLDER       0xA001
536 #define FCIDM_TB_NEWFOLDER      0xA002
537 #define FCIDM_TB_SMALLICON      0xA003
538 #define FCIDM_TB_REPORTVIEW     0xA004
539 #define FCIDM_TB_DESKTOP        0xA005  /* FIXME */
540 
541 #define FCIDM_BROWSERLAST       0xbf00
542 #define FCIDM_GLOBALFIRST       0x8000
543 #define FCIDM_GLOBALLAST        0x9fff
544 
545 /*
546 * Global submenu IDs and separator IDs
547 */
548 #define FCIDM_MENU_FILE             (FCIDM_GLOBALFIRST+0x0000)
549 #define FCIDM_MENU_EDIT             (FCIDM_GLOBALFIRST+0x0040)
550 #define FCIDM_MENU_VIEW             (FCIDM_GLOBALFIRST+0x0080)
551 #define FCIDM_MENU_VIEW_SEP_OPTIONS (FCIDM_GLOBALFIRST+0x0081)
552 #define FCIDM_MENU_TOOLS            (FCIDM_GLOBALFIRST+0x00c0)
553 #define FCIDM_MENU_TOOLS_SEP_GOTO   (FCIDM_GLOBALFIRST+0x00c1)
554 #define FCIDM_MENU_HELP             (FCIDM_GLOBALFIRST+0x0100)
555 #define FCIDM_MENU_FIND             (FCIDM_GLOBALFIRST+0x0140)
556 #define FCIDM_MENU_EXPLORE          (FCIDM_GLOBALFIRST+0x0150)
557 #define FCIDM_MENU_FAVORITES        (FCIDM_GLOBALFIRST+0x0170)
558 
559 /* control IDs known to the view */
560 #define FCIDM_TOOLBAR      (FCIDM_BROWSERFIRST + 0)
561 #define FCIDM_STATUS       (FCIDM_BROWSERFIRST + 1)
562 
563 #define INTERFACE IShellDetails
564 DECLARE_INTERFACE_(IShellDetails, IUnknown)
565 {
566     /*** IUnknown methods ***/
567     STDMETHOD_(HRESULT,QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
568     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
569     STDMETHOD_(ULONG,Release) (THIS) PURE;
570     /*** IShellDetails methods ***/
571     STDMETHOD(GetDetailsOf)(THIS_ _In_opt_ PCUITEMID_CHILD pidl, UINT iColumn, _Out_ SHELLDETAILS *pDetails) PURE;
572     STDMETHOD(ColumnClick)(THIS_ UINT iColumn) PURE;
573 };
574 #undef INTERFACE
575 
576 #if !defined(__cplusplus) || defined(CINTERFACE)
577 /*** IUnknown methods ***/
578 #define IShellDetails_QueryInterface(p,a,b)    (p)->lpVtbl->QueryInterface(p,a,b)
579 #define IShellDetails_AddRef(p)                (p)->lpVtbl->AddRef(p)
580 #define IShellDetails_Release(p)               (p)->lpVtbl->Release(p)
581 /*** IShellDetails methods ***/
582 #define IShellDetails_GetDetailsOf(p,a,b,c)    (p)->lpVtbl->GetDetailsOf(p,a,b,c)
583 #define IShellDetails_ColumnClick(p,a)         (p)->lpVtbl->ColumnClick(p,a)
584 #endif
585 
586 /* IQueryInfo interface */
587 #define INTERFACE IQueryInfo
588 DECLARE_INTERFACE_(IQueryInfo,IUnknown)
589 {
590     /*** IUnknown methods ***/
591     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
592     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
593     STDMETHOD_(ULONG,Release)(THIS) PURE;
594     /*** IQueryInfo methods ***/
595     STDMETHOD(GetInfoTip)(THIS_ DWORD dwFlags, _Outptr_ WCHAR** lppTips) PURE;
596     STDMETHOD(GetInfoFlags)(THIS_ _Out_ DWORD* lpFlags) PURE;
597 };
598 #undef INTERFACE
599 
600 #if !defined(__cplusplus) || defined(CINTERFACE)
601 /*** IUnknown methods ***/
602 #define IQueryInfo_QueryInterface(p,a,b)      (p)->lpVtbl->QueryInterface(p,a,b)
603 #define IQueryInfo_AddRef(p)                  (p)->lpVtbl->AddRef(p)
604 #define IQueryInfo_Release(p)                 (p)->lpVtbl->Release(p)
605 /*** IQueryInfo methods ***/
606 #define IQueryInfo_GetInfoTip(p,a,b)          (p)->lpVtbl->GetInfoTip(p,a,b)
607 #define IQueryInfo_GetInfoFlags(p,a)          (p)->lpVtbl->GetInfoFlags(p,a)
608 #endif
609 
610 /* IInputObject interface */
611 #define INTERFACE IInputObject
612 DECLARE_INTERFACE_(IInputObject,IUnknown)
613 {
614     /*** IUnknown methods ***/
615     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
616     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
617     STDMETHOD_(ULONG,Release)(THIS) PURE;
618     /*** IInputObject methods ***/
619     STDMETHOD(UIActivateIO)(THIS_ BOOL bActivating, LPMSG lpMsg) PURE;
620     STDMETHOD(HasFocusIO)(THIS) PURE;
621     STDMETHOD(TranslateAcceleratorIO)(THIS_ LPMSG lpMsg) PURE;
622 };
623 #undef INTERFACE
624 
625 #if !defined(__cplusplus) || defined(CINTERFACE)
626 /*** IUnknown methods ***/
627 #define IInputObject_QueryInterface(p,a,b)       (p)->lpVtbl->QueryInterface(p,a,b)
628 #define IInputObject_AddRef(p)                   (p)->lpVtbl->AddRef(p)
629 #define IInputObject_Release(p)                  (p)->lpVtbl->Release(p)
630 /*** IInputObject methods ***/
631 #define IInputObject_UIActivateIO(p,a,b)         (p)->lpVtbl->UIActivateIO(p,a,b)
632 #define IInputObject_HasFocusIO(p)               (p)->lpVtbl->HasFocusIO(p)
633 #define IInputObject_TranslateAcceleratorIO(p,a) (p)->lpVtbl->TranslateAcceleratorIO(p,a)
634 #endif
635 
636 /* IInputObjectSite interface */
637 #define INTERFACE IInputObjectSite
638 DECLARE_INTERFACE_(IInputObjectSite,IUnknown)
639 {
640     /*** IUnknown methods ***/
641     STDMETHOD_(HRESULT,QueryInterface) (THIS_ REFIID riid, void** ppvObject) PURE;
642     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
643     STDMETHOD_(ULONG,Release) (THIS) PURE;
644     /*** IInputObjectSite methods ***/
645     STDMETHOD(OnFocusChangeIS)(THIS_ LPUNKNOWN lpUnknown, BOOL bFocus) PURE;
646 };
647 #undef INTERFACE
648 
649 #if !defined(__cplusplus) || defined(CINTERFACE)
650 /*** IUnknown methods ***/
651 #define IInputObjectSite_QueryInterface(p,a,b)  (p)->lpVtbl->QueryInterface(p,a,b)
652 #define IInputObjectSite_AddRef(p)              (p)->lpVtbl->AddRef(p)
653 #define IInputObjectSite_Release(p)             (p)->lpVtbl->Release(p)
654 /*** IInputObject methods ***/
655 #define IInputObjectSite_OnFocusChangeIS(p,a,b) (p)->lpVtbl->OnFocusChangeIS(p,a,b)
656 #endif
657 
658 /* IObjMgr interface */
659 #define INTERFACE IObjMgr
660 DECLARE_INTERFACE_(IObjMgr,IUnknown)
661 {
662     /*** IUnknown methods ***/
663     STDMETHOD_(HRESULT,QueryInterface) (THIS_ REFIID riid, void** ppvObject) PURE;
664     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
665     STDMETHOD_(ULONG,Release) (THIS) PURE;
666     /*** IObjMgr methods ***/
667     STDMETHOD(Append)(THIS_ _In_ LPUNKNOWN punk) PURE;
668     STDMETHOD(Remove)(THIS_ _In_ LPUNKNOWN punk) PURE;
669 };
670 #undef INTERFACE
671 
672 #if !defined(__cplusplus) || defined(CINTERFACE)
673 /*** IUnknown methods ***/
674 #define IObjMgr_QueryInterface(p,a,b)  (p)->lpVtbl->QueryInterface(p,a,b)
675 #define IObjMgr_AddRef(p)              (p)->lpVtbl->AddRef(p)
676 #define IObjMgr_Release(p)             (p)->lpVtbl->Release(p)
677 /*** IObjMgr methods ***/
678 #define IObjMgr_Append(p,a) (p)->lpVtbl->Append(p,a)
679 #define IObjMgr_Remove(p,a) (p)->lpVtbl->Remove(p,a)
680 #endif
681 
682 /* ICurrentWorkingDirectory interface */
683 #define INTERFACE ICurrentWorkingDirectory
684 DECLARE_INTERFACE_(ICurrentWorkingDirectory,IUnknown)
685 {
686     /*** IUnknown methods ***/
687     STDMETHOD_(HRESULT,QueryInterface) (THIS_ REFIID riid, void** ppvObject) PURE;
688     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
689     STDMETHOD_(ULONG,Release) (THIS) PURE;
690     /*** ICurrentWorkingDirectory methods ***/
691     STDMETHOD(GetDirectory)(THIS_ _Out_writes_(cchSize) PWSTR pwzPath, DWORD cchSize) PURE;
692     STDMETHOD(SetDirectory)(THIS_ _In_ PCWSTR pwzPath) PURE;
693 };
694 #undef INTERFACE
695 
696 #if !defined(__cplusplus) || defined(CINTERFACE)
697 /*** IUnknown methods ***/
698 #define ICurrentWorkingDirectory_QueryInterface(p,a,b)  (p)->lpVtbl->QueryInterface(p,a,b)
699 #define ICurrentWorkingDirectory_AddRef(p)              (p)->lpVtbl->AddRef(p)
700 #define ICurrentWorkingDirectory_Release(p)             (p)->lpVtbl->Release(p)
701 /*** ICurrentWorkingDirectory methods ***/
702 #define ICurrentWorkingDirectory_GetDirectory(p,a,b)    (p)->lpVtbl->GetDirectory(p,a,b)
703 #define ICurrentWorkingDirectory_SetDirectory(p,a)      (p)->lpVtbl->SetDirectory(p,a)
704 #endif
705 
706 /* IACList interface */
707 #define INTERFACE IACList
708 DECLARE_INTERFACE_(IACList,IUnknown)
709 {
710     /*** IUnknown methods ***/
711     STDMETHOD_(HRESULT,QueryInterface) (THIS_ REFIID riid, void** ppvObject) PURE;
712     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
713     STDMETHOD_(ULONG,Release) (THIS) PURE;
714     /*** IACList methods ***/
715     STDMETHOD(Expand)(THIS_ _In_ LPCOLESTR str) PURE;
716 };
717 #undef INTERFACE
718 
719 #if !defined(__cplusplus) || defined(CINTERFACE)
720 /*** IUnknown methods ***/
721 #define IACList_QueryInterface(p,a,b)  (p)->lpVtbl->QueryInterface(p,a,b)
722 #define IACList_AddRef(p)              (p)->lpVtbl->AddRef(p)
723 #define IACList_Release(p)             (p)->lpVtbl->Release(p)
724 /*** IACList methods ***/
725 #define IACList_Expand(p,a)             (p)->lpVtbl->Expand(p,a)
726 #endif
727 
728 /* IACList2 interface */
729 
730 #define ACLO_NONE           0x00000000
731 #define ACLO_CURRENTDIR     0x00000001
732 #define ACLO_MYCOMPUTER     0x00000002
733 #define ACLO_DESKTOP        0x00000004
734 #define ACLO_FAVORITES      0x00000008
735 #define ACLO_FILESYSONLY    0x00000010
736 #define ACLO_FILESYSDIRS    0x00000020
737 
738 #define INTERFACE IACList2
739 DECLARE_INTERFACE_(IACList2,IACList)
740 {
741     /*** IUnknown methods ***/
742     STDMETHOD_(HRESULT,QueryInterface) (THIS_ REFIID riid, void** ppvObject) PURE;
743     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
744     STDMETHOD_(ULONG,Release) (THIS) PURE;
745     /*** IACList methods ***/
746     STDMETHOD(Expand)(THIS_ LPCOLESTR str) PURE;
747     /*** IACList2 methods ***/
748     STDMETHOD(SetOptions)(THIS_ DWORD dwFlag) PURE;
749     STDMETHOD(GetOptions)(THIS_ _Out_ DWORD* pdwFlag) PURE;
750 };
751 #undef INTERFACE
752 
753 #if !defined(__cplusplus) || defined(CINTERFACE)
754 /*** IUnknown methods ***/
755 #define IACList2_QueryInterface(p,a,b)  (p)->lpVtbl->QueryInterface(p,a,b)
756 #define IACList2_AddRef(p)              (p)->lpVtbl->AddRef(p)
757 #define IACList2_Release(p)             (p)->lpVtbl->Release(p)
758 /*** IACList2 methods ***/
759 #define IACList2_GetOptions(p,a)        (p)->lpVtbl->GetOptions(p,a)
760 #define IACList2_SetOptions(p,a)        (p)->lpVtbl->SetOptions(p,a)
761 #endif
762 
763 /****************************************************************************
764  * IShellFolderViewCB interface
765  */
766 
767 #define INTERFACE IShellFolderViewCB
768 DECLARE_INTERFACE_(IShellFolderViewCB,IUnknown)
769 {
770     /*** IUnknown methods ***/
771     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
772     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
773     STDMETHOD_(ULONG,Release)(THIS) PURE;
774     /*** IShellFolderViewCB methods ***/
775     STDMETHOD(MessageSFVCB)(THIS_ UINT uMsg, WPARAM wParam, LPARAM lParam) PURE;
776 };
777 #undef INTERFACE
778 
779 #if !defined(__cplusplus) || defined(CINTERFACE)
780 /*** IUnknown methods ***/
781 #define IShellFolderViewCB_QueryInterface(p,a,b)      (p)->lpVtbl->QueryInterface(p,a,b)
782 #define IShellFolderViewCB_AddRef(p)                  (p)->lpVtbl->AddRef(p)
783 #define IShellFolderViewCB_Release(p)                 (p)->lpVtbl->Release(p)
784 /*** IShellFolderViewCB methods ***/
785 #define IShellFolderViewCB_MessageSFVCB(p,a,b,c)      (p)->lpVtbl->MessageSFVCB(p,a,b,c)
786 #endif
787 
788 /****************************************************************************
789  * IShellFolderView interface
790  */
791 
792 #include <pshpack8.h>
793 
794 typedef struct _ITEMSPACING
795 {
796     int cxSmall;
797     int cySmall;
798     int cxLarge;
799     int cyLarge;
800 } ITEMSPACING;
801 
802 #include <poppack.h>
803 
804 #define INTERFACE IShellFolderView
805 DEFINE_GUID(IID_IShellFolderView,0x37a378c0,0xf82d,0x11ce,0xae,0x65,0x08,0x00,0x2b,0x2e,0x12,0x62);
806 DECLARE_INTERFACE_(IShellFolderView, IUnknown)
807 {
808     /*** IUnknown methods ***/
809     STDMETHOD_(HRESULT,QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
810     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
811     STDMETHOD_(ULONG,Release) (THIS) PURE;
812 
813     /*** IShellFolderView methods ***/
814     STDMETHOD(Rearrange) (THIS_ LPARAM lParamSort) PURE;
815     STDMETHOD(GetArrangeParam) (THIS_ _Out_ LPARAM *plParamSort) PURE;
816     STDMETHOD(ArrangeGrid) (THIS) PURE;
817     STDMETHOD(AutoArrange) (THIS) PURE;
818     STDMETHOD(GetAutoArrange) (THIS) PURE;
819     STDMETHOD(AddObject) (THIS_ _In_ PITEMID_CHILD pidl, _Out_ UINT *puItem) PURE;
820     STDMETHOD(GetObject) (THIS_ _Outptr_ PITEMID_CHILD *ppidl, UINT uItem) PURE;
821     STDMETHOD(RemoveObject) (THIS_ _In_opt_ PITEMID_CHILD pidl, _Out_ UINT *puItem) PURE;
822     STDMETHOD(GetObjectCount) (THIS_ _Out_ UINT *puCount) PURE;
823     STDMETHOD(SetObjectCount) (THIS_ UINT uCount, UINT dwFlags) PURE;
824     STDMETHOD(UpdateObject) (THIS_ _In_ PITEMID_CHILD pidlOld, _In_ PITEMID_CHILD pidlNew, _Out_ UINT *puItem) PURE;
825     STDMETHOD(RefreshObject) (THIS_ _In_ PITEMID_CHILD pidl, _Out_ UINT *puItem) PURE;
826     STDMETHOD(SetRedraw) (THIS_ BOOL bRedraw) PURE;
827     STDMETHOD(GetSelectedCount) (THIS_ _Out_ UINT *puSelected) PURE;
828     STDMETHOD(GetSelectedObjects) (THIS_ _Outptr_result_buffer_(*puItems) PCUITEMID_CHILD **pppidl, _Out_ UINT *puItems) PURE;
829     STDMETHOD(IsDropOnSource) (THIS_ _In_opt_ IDropTarget *pDropTarget) PURE;
830     STDMETHOD(GetDragPoint) (THIS_ _Out_ POINT *ppt) PURE;
831     STDMETHOD(GetDropPoint) (THIS_ _Out_ POINT *ppt) PURE;
832     STDMETHOD(MoveIcons) (THIS_ _In_ IDataObject *pDataObject) PURE;
833     STDMETHOD(SetItemPos) (THIS_ _In_ PCUITEMID_CHILD pidl, _In_ POINT *ppt) PURE;
834     STDMETHOD(IsBkDropTarget) (THIS_ _In_opt_ IDropTarget *pDropTarget) PURE;
835     STDMETHOD(SetClipboard) (THIS_ BOOL bMove) PURE;
836     STDMETHOD(SetPoints) (THIS_ _In_ IDataObject *pDataObject) PURE;
837     STDMETHOD(GetItemSpacing) (THIS_ _Out_ ITEMSPACING *pSpacing) PURE;
838     STDMETHOD(SetCallback) (THIS_ _In_opt_ IShellFolderViewCB* pNewCB, _Outptr_result_maybenull_ IShellFolderViewCB** ppOldCB) PURE;
839     STDMETHOD(Select) ( THIS_  UINT dwFlags ) PURE;
840     STDMETHOD(QuerySupport) (THIS_ _Inout_ UINT * pdwSupport) PURE;
841     STDMETHOD(SetAutomationObject)(THIS_ _In_opt_ IDispatch* pdisp) PURE;
842 };
843 #undef INTERFACE
844 
845 #if !defined(__cplusplus) || defined(CINTERFACE)
846 /*** IUnknown methods ***/
847 #define IShellFolderView_QueryInterface(p,a,b)      (p)->lpVtbl->QueryInterface(p,a,b)
848 #define IShellFolderView_AddRef(p)                  (p)->lpVtbl->AddRef(p)
849 #define IShellFolderView_Release(p)                 (p)->lpVtbl->Release(p)
850 /*** IShellFolderView methods ***/
851 #define IShellFolderView_Rearrange(p,a)             (p)->lpVtbl->Rearrange(p,a)
852 #define IShellFolderView_GetArrangeParam(p,a)       (p)->lpVtbl->GetArrangeParam(p,a)
853 #define IShellFolderView_ArrangeGrid(p)             (p)->lpVtbl->ArrangeGrid(p)
854 #define IShellFolderView_AutoArrange(p)             (p)->lpVtbl->AutoArrange(p)
855 #define IShellFolderView_GetAutoArrange(p)          (p)->lpVtbl->GetAutoArrange(p)
856 #define IShellFolderView_AddObject(p,a,b)           (p)->lpVtbl->AddObject(p,a,b)
857 #define IShellFolderView_GetObject(p,a,b)           (p)->lpVtbl->GetObject(p,a,b)
858 #define IShellFolderView_RemoveObject(p,a,b)        (p)->lpVtbl->RemoveObject(p,a,b)
859 #define IShellFolderView_GetObjectCount(p,a)        (p)->lpVtbl->GetObjectCount(p,a)
860 #define IShellFolderView_SetObjectCount(p,a,b)      (p)->lpVtbl->SetObjectCount(p,a,b)
861 #define IShellFolderView_UpdateObject(p,a,b,c)      (p)->lpVtbl->UpdateObject(p,a,b,c)
862 #define IShellFolderView_RefreshObject(p,a,b)       (p)->lpVtbl->RefreshObject(p,a,b)
863 #define IShellFolderView_SetRedraw(p,a)             (p)->lpVtbl->SetRedraw(p,a)
864 #define IShellFolderView_GetSelectedCount(p,a)      (p)->lpVtbl->GetSelectedCount(p,a)
865 #define IShellFolderView_GetSelectedObjects(p,a,b)  (p)->lpVtbl->GetSelectedObjects(p,a,b)
866 #define IShellFolderView_IsDropOnSource(p,a)        (p)->lpVtbl->IsDropOnSource(p,a)
867 #define IShellFolderView_GetDragPoint(p,a)          (p)->lpVtbl->GetDragPoint(p,a)
868 #define IShellFolderView_GetDropPoint(p,a)          (p)->lpVtbl->GetDropPoint(p,a)
869 #define IShellFolderView_MoveIcons(p,a)             (p)->lpVtbl->MoveIcons(p,a)
870 #define IShellFolderView_SetItemPos(p,a,b)          (p)->lpVtbl->SetItemPos(p,a,b)
871 #define IShellFolderView_DropTarget(p,a)            (p)->lpVtbl->DropTarget(p,a)
872 #define IShellFolderView_SetClipboard(p,a)          (p)->lpVtbl->SetClipboard(p,a)
873 #define IShellFolderView_SetPoints(p,a)             (p)->lpVtbl->SetPoints(p,a)
874 #define IShellFolderView_GetItemSpacing(p,a)        (p)->lpVtbl->GetItemSpacing(p,a)
875 #define IShellFolderView_SetCallback(p,a)           (p)->lpVtbl->SetCallback(p,a)
876 #define IShellFolderView_Select(p,a)                (p)->lpVtbl->Select(p,a)
877 #define IShellFolderView_QuerySupport(p,a)          (p)->lpVtbl->QuerySupport(p,a)
878 #define IShellFolderView_SetAutomationObject(p,a)   (p)->lpVtbl->SetAutomationObject(p,a)
879 #endif
880 
881 /* IProgressDialog interface */
882 #define PROGDLG_NORMAL           0x00000000
883 #define PROGDLG_MODAL            0x00000001
884 #define PROGDLG_AUTOTIME         0x00000002
885 #define PROGDLG_NOTIME           0x00000004
886 #define PROGDLG_NOMINIMIZE       0x00000008
887 #define PROGDLG_NOPROGRESSBAR    0x00000010
888 #define PROGDLG_MARQUEEPROGRESS  0x00000020
889 #define PROGDLG_NOCANCEL         0x00000040
890 
891 #define PDTIMER_RESET            0x00000001
892 #define PDTIMER_PAUSE            0x00000002
893 #define PDTIMER_RESUME           0x00000003
894 
895 #define INTERFACE IProgressDialog
896 DECLARE_INTERFACE_(IProgressDialog,IUnknown)
897 {
898     /*** IUnknown methods ***/
899     STDMETHOD_(HRESULT,QueryInterface) (THIS_ REFIID riid, void** ppvObject) PURE;
900     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
901     STDMETHOD_(ULONG,Release) (THIS) PURE;
902     /*** IProgressDialog methods ***/
903     STDMETHOD(StartProgressDialog)(THIS_ _In_opt_ HWND hwndParent, _In_opt_ IUnknown *punkEnableModeless, DWORD dwFlags, _Reserved_ LPCVOID reserved) PURE;
904     STDMETHOD(StopProgressDialog)(THIS) PURE;
905     STDMETHOD(SetTitle)(THIS_ _In_ LPCWSTR pwzTitle) PURE;
906     STDMETHOD(SetAnimation)(THIS_ _In_opt_ HINSTANCE hInstance, UINT uiResourceId) PURE;
907     STDMETHOD_(BOOL,HasUserCancelled)(THIS) PURE;
908     STDMETHOD(SetProgress)(THIS_ DWORD dwCompleted, DWORD dwTotal) PURE;
909     STDMETHOD(SetProgress64)(THIS_ ULONGLONG ullCompleted, ULONGLONG ullTotal) PURE;
910     STDMETHOD(SetLine)(THIS_ DWORD dwLineNum, _In_ LPCWSTR pwzString, BOOL bPath, _Reserved_ LPCVOID reserved) PURE;
911     STDMETHOD(SetCancelMsg)(THIS_ _In_ LPCWSTR pwzCancelMsg, _Reserved_ LPCVOID reserved) PURE;
912     STDMETHOD(Timer)(THIS_ DWORD dwTimerAction, _Reserved_ LPCVOID reserved) PURE;
913 };
914 #undef INTERFACE
915 
916 #if !defined(__cplusplus) || defined(CINTERFACE)
917 /*** IUnknown methods ***/
918 #define IProgressDialog_QueryInterface(p,a,b)  (p)->lpVtbl->QueryInterface(p,a,b)
919 #define IProgressDialog_AddRef(p)              (p)->lpVtbl->AddRef(p)
920 #define IProgressDialog_Release(p)             (p)->lpVtbl->Release(p)
921 /*** IProgressDialog methods ***/
922 #define IProgressDialog_StartProgressDialog(p,a,b,c,d)    (p)->lpVtbl->StartProgressDialog(p,a,b,c,d)
923 #define IProgressDialog_StopProgressDialog(p)             (p)->lpVtbl->StopProgressDialog(p)
924 #define IProgressDialog_SetTitle(p,a)                     (p)->lpVtbl->SetTitle(p,a)
925 #define IProgressDialog_SetAnimation(p,a,b)               (p)->lpVtbl->SetAnimation(p,a,b)
926 #define IProgressDialog_HasUserCancelled(p)               (p)->lpVtbl->HasUserCancelled(p)
927 #define IProgressDialog_SetProgress(p,a,b)                (p)->lpVtbl->SetProgress(p,a,b)
928 #define IProgressDialog_SetProgress64(p,a,b)              (p)->lpVtbl->SetProgress64(p,a,b)
929 #define IProgressDialog_SetLine(p,a,b,c,d)                (p)->lpVtbl->SetLine(p,a,b,c,d)
930 #define IProgressDialog_SetCancelMsg(p,a,b)               (p)->lpVtbl->SetCancelMsg(p,a,b)
931 #define IProgressDialog_Timer(p,a,b)                      (p)->lpVtbl->Timer(p,a,b)
932 #endif
933 
934 
935 /* IDeskBarClient interface */
936 #define INTERFACE IDeskBarClient
937 DECLARE_INTERFACE_(IDeskBarClient,IOleWindow)
938 {
939     /*** IUnknown methods ***/
940     STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE;
941     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
942     STDMETHOD_(ULONG,Release)(THIS) PURE;
943     /*** IOleWindow methods ***/
944     STDMETHOD_(HRESULT,GetWindow)(THIS_ HWND*) PURE;
945     STDMETHOD_(HRESULT,ContextSensitiveHelp)(THIS_ BOOL) PURE;
946     /*** IDeskBarClient methods ***/
947     STDMETHOD_(HRESULT,SetDeskBarSite)(THIS_ _In_opt_ IUnknown*) PURE;
948     STDMETHOD_(HRESULT,SetModeDBC)(THIS_ DWORD) PURE;
949     STDMETHOD_(HRESULT,UIActivateDBC)(THIS_ DWORD) PURE;
950     STDMETHOD_(HRESULT,GetSize)(THIS_ DWORD, _Out_ LPRECT) PURE;
951 };
952 #undef INTERFACE
953 
954 #if !defined(__cplusplus) || defined(CINTERFACE)
955 /*** IUnknown methods ***/
956 #define IDeskBarClient_QueryInterface(p,a,b)       (p)->lpVtbl->QueryInterface(p,a,b)
957 #define IDeskBarClient_AddRef(p)                   (p)->lpVtbl->AddRef(p)
958 #define IDeskBarClient_Release(p)                  (p)->lpVtbl->Release(p)
959 /*** IOleWindow methods ***/
960 #define IDeskBarClient_GetWindow(p,a)              (p)->lpVtbl->GetWindow(p,a)
961 #define IDeskBarClient_ContextSensitiveHelp(p,a)   (p)->lpVtbl->ContextSensitiveHelp(p,a)
962 /*** IOleWindow IDeskBarClient ***/
963 #define IDeskBarClient_SetDeskBarSite(p,a)         (p)->lpVtbl->SetDeskBarSite(p,a)
964 #define IDeskBarClient_SetModeDBC(p,a)             (p)->lpVtbl->SetModeDBC(p,a)
965 #define IDeskBarClient_UIActivateDBC(p,a)          (p)->lpVtbl->UIActivateDBC(p,a)
966 #define IDeskBarClient_GetSize(p,a,b)              (p)->lpVtbl->GetSize(p,a,b)
967 #endif
968 
969 #define DBC_GS_IDEAL    0
970 #define DBC_GS_SIZEDOWN 1
971 
972 #define DBC_HIDE        0
973 #define DBC_SHOW        1
974 #define DBC_SHOWOBSCURE 2
975 
976 
977 /* As indicated by the documentation for IActiveDesktop,
978    you must include wininet.h before shlobj.h */
979 #ifdef _WINE_WININET_H_
980 
981 
982 /* Structs are taken from msdn, and not verified!
983    Only stuff needed to make it compile are here, no flags or anything */
984 
985 typedef struct _tagWALLPAPEROPT
986 {
987     DWORD dwSize;
988     DWORD dwStyle;
989 } WALLPAPEROPT;
990 
991 typedef WALLPAPEROPT *LPWALLPAPEROPT;
992 typedef const WALLPAPEROPT *LPCWALLPAPEROPT;
993 
994 typedef struct _tagCOMPONENTSOPT
995 {
996     DWORD dwSize;
997     BOOL  fEnableComponents;
998     BOOL  fActiveDesktop;
999 } COMPONENTSOPT;
1000 
1001 typedef COMPONENTSOPT *LPCOMPONENTSOPT;
1002 typedef const COMPONENTSOPT *LPCCOMPONENTSOPT;
1003 
1004 
1005 typedef struct _tagCOMPPOS
1006 {
1007     DWORD dwSize;
1008     int   iLeft;
1009     int   iTop;
1010     DWORD dwWidth;
1011     DWORD dwHeight;
1012     int   izIndex;
1013     BOOL  fCanResize;
1014     BOOL  fCanResizeX;
1015     BOOL  fCanResizeY;
1016     int   iPreferredLeftPercent;
1017     int   iPreferredTopPercent;
1018 } COMPPOS;
1019 
1020 typedef struct _tagCOMPSTATEINFO
1021 {
1022     DWORD dwSize;
1023     int   iLeft;
1024     int   iTop;
1025     DWORD dwWidth;
1026     DWORD dwHeight;
1027     DWORD dwItemState;
1028 } COMPSTATEINFO;
1029 
1030 typedef struct _tagCOMPONENT
1031 {
1032     DWORD         dwSize;
1033     DWORD         dwID;
1034     int           iComponentType;
1035     BOOL          fChecked;
1036     BOOL          fDirty;
1037     BOOL          fNoScroll;
1038     COMPPOS       cpPos;
1039     WCHAR         wszFriendlyName[MAX_PATH];
1040     WCHAR         wszSource[INTERNET_MAX_URL_LENGTH];
1041     WCHAR         wszSubscribedURL[INTERNET_MAX_URL_LENGTH];
1042     DWORD         dwCurItemState;
1043     COMPSTATEINFO csiOriginal;
1044     COMPSTATEINFO csiRestored;
1045 } COMPONENT;
1046 
1047 typedef COMPONENT *LPCOMPONENT;
1048 typedef const COMPONENT *LPCCOMPONENT;
1049 
1050 #pragma push_macro("AddDesktopItem")
1051 #undef AddDesktopItem
1052 
1053 /* IDeskBarClient interface */
1054 #define INTERFACE IActiveDesktop
1055 DECLARE_INTERFACE_(IActiveDesktop, IUnknown)
1056 {
1057     /*** IUnknown methods ***/
1058     STDMETHOD(QueryInterface) (THIS_ _In_ REFIID riid, _Outptr_ void **ppv) PURE;
1059     STDMETHOD_(ULONG,AddRef)  (THIS) PURE;
1060     STDMETHOD_(ULONG,Release) (THIS) PURE;
1061 
1062     /*** IActiveDesktop methods ***/
1063     STDMETHOD(ApplyChanges)(THIS_ DWORD dwFlags) PURE;
1064     STDMETHOD(GetWallpaper)(THIS_ PWSTR pwszWallpaper, UINT cchWallpaper, DWORD dwFlags) PURE;
1065     STDMETHOD(SetWallpaper)(THIS_ PCWSTR pwszWallpaper, DWORD dwReserved) PURE;
1066     STDMETHOD(GetWallpaperOptions)(THIS_ LPWALLPAPEROPT pwpo, DWORD dwReserved) PURE;
1067     STDMETHOD(SetWallpaperOptions)(THIS_ LPCWALLPAPEROPT pwpo, DWORD dwReserved) PURE;
1068     STDMETHOD(GetPattern)(THIS_ PWSTR pwszPattern, UINT cchPattern, DWORD dwReserved) PURE;
1069     STDMETHOD(SetPattern)(THIS_ PCWSTR pwszPattern, DWORD dwReserved) PURE;
1070     STDMETHOD(GetDesktopItemOptions)(THIS_ LPCOMPONENTSOPT pco, DWORD dwReserved) PURE;
1071     STDMETHOD(SetDesktopItemOptions)(THIS_ LPCCOMPONENTSOPT pco, DWORD dwReserved) PURE;
1072     STDMETHOD(AddDesktopItem)(THIS_ LPCCOMPONENT pcomp, DWORD dwReserved) PURE;
1073     STDMETHOD(AddDesktopItemWithUI)(THIS_ HWND hwnd, LPCOMPONENT pcomp, DWORD dwReserved) PURE;
1074     STDMETHOD(ModifyDesktopItem)(THIS_ LPCCOMPONENT pcomp, DWORD dwFlags) PURE;
1075     STDMETHOD(RemoveDesktopItem)(THIS_ LPCCOMPONENT pcomp, DWORD dwReserved) PURE;
1076     STDMETHOD(GetDesktopItemCount)(THIS_ int *pcItems, DWORD dwReserved) PURE;
1077     STDMETHOD(GetDesktopItem)(THIS_ int nComponent, LPCOMPONENT pcomp, DWORD dwReserved) PURE;
1078     STDMETHOD(GetDesktopItemByID)(THIS_ ULONG_PTR dwID, LPCOMPONENT pcomp, DWORD dwReserved) PURE;
1079     STDMETHOD(GenerateDesktopItemHtml)(THIS_ PCWSTR pwszFileName, LPCOMPONENT pcomp, DWORD dwReserved) PURE;
1080     STDMETHOD(AddUrl)(THIS_ HWND hwnd, PCWSTR pszSource, LPCOMPONENT pcomp, DWORD dwFlags) PURE;
1081     STDMETHOD(GetDesktopItemBySource)(THIS_ PCWSTR pwszSource, LPCOMPONENT pcomp, DWORD dwReserved) PURE;
1082 };
1083 #undef INTERFACE
1084 
1085 #pragma pop_macro("AddDesktopItem")
1086 
1087 #endif
1088 
1089 /****************************************************************************
1090 * SHAddToRecentDocs API
1091 */
1092 #define SHARD_PIDL      0x00000001L
1093 #define SHARD_PATHA     0x00000002L
1094 #define SHARD_PATHW     0x00000003L
1095 #define SHARD_PATH WINELIB_NAME_AW(SHARD_PATH)
1096 
1097 void WINAPI SHAddToRecentDocs(UINT, _In_opt_ LPCVOID);
1098 
1099 /****************************************************************************
1100  * SHBrowseForFolder API
1101  */
1102 typedef INT (CALLBACK *BFFCALLBACK)(HWND,UINT,LPARAM,LPARAM);
1103 
1104 #include <pshpack8.h>
1105 
1106 typedef struct tagBROWSEINFOA {
1107     HWND        hwndOwner;
1108     LPCITEMIDLIST pidlRoot;
1109     LPSTR         pszDisplayName;
1110     LPCSTR        lpszTitle;
1111     UINT        ulFlags;
1112     BFFCALLBACK   lpfn;
1113     LPARAM        lParam;
1114     INT         iImage;
1115 } BROWSEINFOA, *PBROWSEINFOA, *LPBROWSEINFOA;
1116 
1117 typedef struct tagBROWSEINFOW {
1118     HWND        hwndOwner;
1119     LPCITEMIDLIST pidlRoot;
1120     LPWSTR        pszDisplayName;
1121     LPCWSTR       lpszTitle;
1122     UINT        ulFlags;
1123     BFFCALLBACK   lpfn;
1124     LPARAM        lParam;
1125     INT         iImage;
1126 } BROWSEINFOW, *PBROWSEINFOW, *LPBROWSEINFOW;
1127 
1128 #define BROWSEINFO   WINELIB_NAME_AW(BROWSEINFO)
1129 #define PBROWSEINFO  WINELIB_NAME_AW(PBROWSEINFO)
1130 #define LPBROWSEINFO WINELIB_NAME_AW(LPBROWSEINFO)
1131 
1132 #include <poppack.h>
1133 
1134 /* Browsing for directory. */
1135 #define BIF_RETURNONLYFSDIRS   0x0001
1136 #define BIF_DONTGOBELOWDOMAIN  0x0002
1137 #define BIF_STATUSTEXT         0x0004
1138 #define BIF_RETURNFSANCESTORS  0x0008
1139 #define BIF_EDITBOX            0x0010
1140 #define BIF_VALIDATE           0x0020
1141 #define BIF_NEWDIALOGSTYLE     0x0040
1142 #define BIF_USENEWUI           (BIF_NEWDIALOGSTYLE | BIF_EDITBOX)
1143 #define BIF_BROWSEINCLUDEURLS  0x0080
1144 #define BIF_UAHINT             0x0100
1145 #define BIF_NONEWFOLDERBUTTON  0x0200
1146 #define BIF_NOTRANSLATETARGETS 0x0400
1147 
1148 #define BIF_BROWSEFORCOMPUTER  0x1000
1149 #define BIF_BROWSEFORPRINTER   0x2000
1150 #define BIF_BROWSEINCLUDEFILES 0x4000
1151 #define BIF_SHAREABLE          0x8000
1152 
1153 /* message from browser */
1154 #define BFFM_INITIALIZED        1
1155 #define BFFM_SELCHANGED         2
1156 #define BFFM_VALIDATEFAILEDA    3
1157 #define BFFM_VALIDATEFAILEDW    4
1158 #define BFFM_IUNKNOWN           5
1159 
1160 /* messages to browser */
1161 #define BFFM_SETSTATUSTEXTA     (WM_USER+100)
1162 #define BFFM_ENABLEOK           (WM_USER+101)
1163 #define BFFM_SETSELECTIONA      (WM_USER+102)
1164 #define BFFM_SETSELECTIONW      (WM_USER+103)
1165 #define BFFM_SETSTATUSTEXTW     (WM_USER+104)
1166 #define BFFM_SETOKTEXT          (WM_USER+105)
1167 #define BFFM_SETEXPANDED        (WM_USER+106)
1168 
1169 LPITEMIDLIST WINAPI SHBrowseForFolderA(_In_ LPBROWSEINFOA lpbi);
1170 LPITEMIDLIST WINAPI SHBrowseForFolderW(_In_ LPBROWSEINFOW lpbi);
1171 #define SHBrowseForFolder WINELIB_NAME_AW(SHBrowseForFolder)
1172 
1173 #define BFFM_SETSTATUSTEXT  WINELIB_NAME_AW(BFFM_SETSTATUSTEXT)
1174 #define BFFM_SETSELECTION   WINELIB_NAME_AW(BFFM_SETSELECTION)
1175 #define BFFM_VALIDATEFAILED WINELIB_NAME_AW(BFFM_VALIDATEFAILED)
1176 
1177 /**********************************************************************
1178  * SHCreateShellFolderViewEx API
1179  */
1180 
1181 typedef HRESULT
1182 (CALLBACK *LPFNVIEWCALLBACK)(
1183   _In_ IShellView* dwUser,
1184   _In_ IShellFolder* pshf,
1185   _In_ HWND hWnd,
1186   UINT uMsg,
1187   WPARAM wParam,
1188   LPARAM lParam);
1189 
1190 #include <pshpack8.h>
1191 
1192 typedef struct _CSFV
1193 {
1194   UINT             cbSize;
1195   IShellFolder*    pshf;
1196   IShellView*      psvOuter;
1197   LPCITEMIDLIST    pidl;
1198   LONG             lEvents;
1199   LPFNVIEWCALLBACK pfnCallback;
1200   FOLDERVIEWMODE   fvm;
1201 } CSFV, *LPCSFV;
1202 
1203 #include <poppack.h>
1204 
1205 HRESULT
1206 WINAPI
1207 SHCreateShellFolderViewEx(
1208   _In_ LPCSFV pshfvi,
1209   _Outptr_ IShellView **ppshv);
1210 
1211 /* SHCreateShellFolderViewEx callback messages */
1212 #define SFVM_MERGEMENU                 1
1213 #define SFVM_INVOKECOMMAND             2
1214 #define SFVM_GETHELPTEXT               3
1215 #define SFVM_GETTOOLTIPTEXT            4
1216 #define SFVM_GETBUTTONINFO             5
1217 #define SFVM_GETBUTTONS                6
1218 #define SFVM_INITMENUPOPUP             7
1219 #define SFVM_SELECTIONCHANGED          8 /* undocumented */
1220 #define SFVM_DRAWMENUITEM              9 /* undocumented */
1221 #define SFVM_MEASUREMENUITEM          10 /* undocumented */
1222 #define SFVM_EXITMENULOOP             11 /* undocumented */
1223 #define SFVM_VIEWRELEASE              12 /* undocumented */
1224 #define SFVM_GETNAMELENGTH            13 /* undocumented */
1225 #define SFVM_FSNOTIFY                 14
1226 #define SFVM_WINDOWCREATED            15
1227 #define SFVM_WINDOWCLOSING            16 /* undocumented */
1228 #define SFVM_LISTREFRESHED            17 /* undocumented */
1229 #define SFVM_WINDOWFOCUSED            18 /* undocumented */
1230 #define SFVM_REGISTERCOPYHOOK         20 /* undocumented */
1231 #define SFVM_COPYHOOKCALLBACK         21 /* undocumented */
1232 #define SFVM_GETDETAILSOF             23
1233 #define SFVM_COLUMNCLICK              24
1234 #define SFVM_QUERYFSNOTIFY            25
1235 #define SFVM_DEFITEMCOUNT             26
1236 #define SFVM_DEFVIEWMODE              27
1237 #define SFVM_UNMERGEFROMMENU          28
1238 #define SFVM_ADDINGOBJECT             29 /* undocumented */
1239 #define SFVM_REMOVINGOBJECT           30 /* undocumented */
1240 #define SFVM_UPDATESTATUSBAR          31
1241 #define SFVM_BACKGROUNDENUM           32
1242 #define SFVM_GETCOMMANDDIR            33 /* undocumented */
1243 #define SFVM_GETCOLUMNSTREAM          34 /* undocumented */
1244 #define SFVM_CANSELECTALL             35 /* undocumented */
1245 #define SFVM_DIDDRAGDROP              36
1246 #define SFVM_ISSTRICTREFRESH          37 /* undocumented */
1247 #define SFVM_ISCHILDOBJECT            38 /* undocumented */
1248 #define SFVM_SETISFV                  39
1249 #define SFVM_GETEXTVIEWS              40 /* undocumented */
1250 #define SFVM_THISIDLIST               41
1251 #define SFVM_ADDPROPERTYPAGES         47
1252 #define SFVM_BACKGROUNDENUMDONE       48
1253 #define SFVM_GETNOTIFY                49
1254 #define SFVM_GETSORTDEFAULTS          53
1255 #define SFVM_SIZE                     57
1256 #define SFVM_GETZONE                  58
1257 #define SFVM_GETPANE                  59
1258 #define SFVM_GETHELPTOPIC             63
1259 #define SFVM_GETANIMATION             68
1260 #define SFVM_GET_CUSTOMVIEWINFO       77 /* undocumented */
1261 #define SFVM_ENUMERATEDITEMS          79 /* undocumented */
1262 #define SFVM_GET_VIEW_DATA            80 /* undocumented */
1263 #define SFVM_GET_WEBVIEW_LAYOUT       82 /* undocumented */
1264 #define SFVM_GET_WEBVIEW_CONTENT      83 /* undocumented */
1265 #define SFVM_GET_WEBVIEW_TASKS        84 /* undocumented */
1266 #define SFVM_GET_WEBVIEW_THEME        86 /* undocumented */
1267 #define SFVM_GETDEFERREDVIEWSETTINGS  92 /* undocumented */
1268 
1269 #include <pshpack8.h>
1270 
1271 typedef struct _SFV_CREATE
1272 {
1273     UINT cbSize;
1274     IShellFolder *pshf;
1275     IShellView *psvOuter;
1276     IShellFolderViewCB *psfvcb;
1277 } SFV_CREATE;
1278 
1279 #include <poppack.h>
1280 
1281 HRESULT
1282 WINAPI
1283 SHCreateShellFolderView(
1284   _In_ const SFV_CREATE *pscfv,
1285   _Outptr_ IShellView **ppsv);
1286 
1287 /* Types and definitions for the SFM_* parameters */
1288 #include <pshpack8.h>
1289 
1290 #define QCMINFO_PLACE_BEFORE          0
1291 #define QCMINFO_PLACE_AFTER           1
1292 typedef struct _QCMINFO_IDMAP_PLACEMENT
1293 {
1294     UINT id;
1295     UINT fFlags;
1296 } QCMINFO_IDMAP_PLACEMENT;
1297 
1298 typedef struct _QCMINFO_IDMAP
1299 {
1300     UINT nMaxIds;
1301     QCMINFO_IDMAP_PLACEMENT pIdList[1];
1302 } QCMINFO_IDMAP;
1303 
1304 typedef struct _QCMINFO
1305 {
1306     HMENU hmenu;
1307     UINT indexMenu;
1308     UINT idCmdFirst;
1309     UINT idCmdLast;
1310     QCMINFO_IDMAP const* pIdMap;
1311 } QCMINFO, *LPQCMINFO;
1312 
1313 #define TBIF_DEFAULT           0x00000000
1314 #define TBIF_APPEND            0x00000000
1315 #define TBIF_PREPEND           0x00000001
1316 #define TBIF_REPLACE           0x00000002
1317 #define TBIF_INTERNETBAR       0x00010000
1318 #define TBIF_STANDARDTOOLBAR   0x00020000
1319 #define TBIF_NOTOOLBAR         0x00030000
1320 
1321 typedef struct _TBINFO
1322 {
1323     UINT cbuttons;
1324     UINT uFlags;
1325 } TBINFO, *LPTBINFO;
1326 
1327 #include <poppack.h>
1328 
1329 /****************************************************************************
1330 *	SHShellFolderView_Message API
1331 */
1332 
1333 LRESULT
1334 WINAPI
1335 SHShellFolderView_Message(
1336   _In_ HWND hwndCabinet,
1337   UINT uMessage,
1338   LPARAM lParam);
1339 
1340 /* SHShellFolderView_Message messages */
1341 #define SFVM_REARRANGE          0x0001
1342 #define SFVM_GETARRANGECOLUMN   0x0002 /* undocumented */
1343 #define SFVM_ADDOBJECT          0x0003
1344 #define SFVM_GETITEMCOUNT       0x0004 /* undocumented */
1345 #define SFVM_GETITEMPIDL        0x0005 /* undocumented */
1346 #define SFVM_REMOVEOBJECT       0x0006
1347 #define SFVM_UPDATEOBJECT       0x0007
1348 #define SFVM_SETREDRAW          0x0008 /* undocumented */
1349 #define SFVM_GETSELECTEDOBJECTS 0x0009
1350 #define SFVM_ISDROPONSOURCE     0x000A /* undocumented */
1351 #define SFVM_MOVEICONS          0x000B /* undocumented */
1352 #define SFVM_GETDRAGPOINT       0x000C /* undocumented */
1353 #define SFVM_GETDROPPOINT       0x000D /* undocumented */
1354 #define SFVM_SETITEMPOS         0x000E
1355 #define SFVM_ISDROPONBACKGROUND 0x000F /* undocumented */
1356 #define SFVM_SETCLIPBOARD       0x0010
1357 #define SFVM_TOGGLEAUTOARRANGE  0x0011 /* undocumented */
1358 #define SFVM_LINEUPICONS        0x0012 /* undocumented */
1359 #define SFVM_GETAUTOARRANGE     0x0013 /* undocumented */
1360 #define SFVM_GETSELECTEDCOUNT   0x0014 /* undocumented */
1361 #define SFVM_GETITEMSPACING     0x0015 /* undocumented */
1362 #define SFVM_REFRESHOBJECT      0x0016 /* undocumented */
1363 #define SFVM_SETPOINTS          0x0017
1364 
1365 /****************************************************************************
1366 *	SHGetDataFromIDList API
1367 */
1368 #define SHGDFIL_FINDDATA        1
1369 #define SHGDFIL_NETRESOURCE     2
1370 #define SHGDFIL_DESCRIPTIONID   3
1371 
1372 #define SHDID_ROOT_REGITEM          1
1373 #define SHDID_FS_FILE               2
1374 #define SHDID_FS_DIRECTORY          3
1375 #define SHDID_FS_OTHER              4
1376 #define SHDID_COMPUTER_DRIVE35      5
1377 #define SHDID_COMPUTER_DRIVE525     6
1378 #define SHDID_COMPUTER_REMOVABLE    7
1379 #define SHDID_COMPUTER_FIXED        8
1380 #define SHDID_COMPUTER_NETDRIVE     9
1381 #define SHDID_COMPUTER_CDROM        10
1382 #define SHDID_COMPUTER_RAMDISK      11
1383 #define SHDID_COMPUTER_OTHER        12
1384 #define SHDID_NET_DOMAIN            13
1385 #define SHDID_NET_SERVER            14
1386 #define SHDID_NET_SHARE             15
1387 #define SHDID_NET_RESTOFNET         16
1388 #define SHDID_NET_OTHER             17
1389 #define SHDID_COMPUTER_IMAGING      18
1390 #define SHDID_COMPUTER_AUDIO        19
1391 #define SHDID_COMPUTER_SHAREDDOCS   20
1392 
1393 #include <pshpack8.h>
1394 
1395 typedef struct _SHDESCRIPTIONID
1396 {   DWORD   dwDescriptionId;
1397     CLSID   clsid;
1398 } SHDESCRIPTIONID, *LPSHDESCRIPTIONID;
1399 
1400 #include <poppack.h>
1401 
1402 HRESULT
1403 WINAPI
1404 SHGetDataFromIDListA(
1405   _In_ LPSHELLFOLDER psf,
1406   _In_ LPCITEMIDLIST pidl,
1407   int nFormat,
1408   _Out_writes_bytes_(cb) LPVOID pv,
1409   int cb);
1410 
1411 HRESULT
1412 WINAPI
1413 SHGetDataFromIDListW(
1414   _In_ LPSHELLFOLDER psf,
1415   _In_ LPCITEMIDLIST pidl,
1416   int nFormat,
1417   _Out_writes_bytes_(cb) LPVOID pv,
1418   int cb);
1419 
1420 #define SHGetDataFromIDList WINELIB_NAME_AW(SHGetDataFromIDList)
1421 
1422 LPITEMIDLIST
1423 WINAPI
1424 SHCloneSpecialIDList(
1425   _Reserved_ HWND hwnd,
1426   _In_ int csidl,
1427   _In_ BOOL fCreate);
1428 
1429 _Success_(return != 0)
1430 BOOL
1431 WINAPI
1432 SHGetSpecialFolderPathA(
1433   _Reserved_ HWND hwndOwner,
1434   _Out_writes_(MAX_PATH) LPSTR szPath,
1435   _In_ int nFolder,
1436   _In_ BOOL bCreate);
1437 
1438 _Success_(return != 0)
1439 BOOL
1440 WINAPI
1441 SHGetSpecialFolderPathW(
1442   _Reserved_ HWND hwndOwner,
1443   _Out_writes_(MAX_PATH) LPWSTR szPath,
1444   _In_ int nFolder,
1445   _In_ BOOL bCreate);
1446 
1447 #define SHGetSpecialFolderPath WINELIB_NAME_AW(SHGetSpecialFolderPath)
1448 
1449 _Check_return_ HRESULT WINAPI SHGetMalloc(_Outptr_ LPMALLOC *lpmal);
1450 
1451 /**********************************************************************
1452  * SHGetSetSettings ()
1453  */
1454 
1455 typedef struct
1456 {
1457     BOOL fShowAllObjects : 1;
1458     BOOL fShowExtensions : 1;
1459     BOOL fNoConfirmRecycle : 1;
1460 
1461     BOOL fShowSysFiles : 1;
1462     BOOL fShowCompColor : 1;
1463     BOOL fDoubleClickInWebView : 1;
1464     BOOL fDesktopHTML : 1;
1465     BOOL fWin95Classic : 1;
1466     BOOL fDontPrettyPath : 1;
1467     BOOL fShowAttribCol : 1;
1468     BOOL fMapNetDrvBtn : 1;
1469     BOOL fShowInfoTip : 1;
1470     BOOL fHideIcons : 1;
1471     BOOL fWebView : 1;
1472     BOOL fFilter : 1;
1473     BOOL fShowSuperHidden : 1;
1474     BOOL fNoNetCrawling : 1;
1475 
1476     UINT :15; /* Required for proper binary layout with gcc */
1477     DWORD dwWin95Unused;
1478     UINT  uWin95Unused;
1479     LONG   lParamSort;
1480     int    iSortDirection;
1481     UINT   version;
1482     UINT uNotUsed;
1483     BOOL fSepProcess: 1;
1484     BOOL fStartPanelOn: 1;
1485     BOOL fShowStartPage: 1;
1486     UINT fSpareFlags : 13;
1487     UINT :15; /* Required for proper binary layout with gcc */
1488 } SHELLSTATE, *LPSHELLSTATE;
1489 
1490 VOID WINAPI SHGetSetSettings(LPSHELLSTATE lpss, DWORD dwMask, BOOL bSet);
1491 
1492 /**********************************************************************
1493  * SHGetSettings ()
1494  */
1495 typedef struct
1496 {	BOOL fShowAllObjects : 1;
1497 	BOOL fShowExtensions : 1;
1498 	BOOL fNoConfirmRecycle : 1;
1499 	BOOL fShowSysFiles : 1;
1500 
1501 	BOOL fShowCompColor : 1;
1502 	BOOL fDoubleClickInWebView : 1;
1503 	BOOL fDesktopHTML : 1;
1504 	BOOL fWin95Classic : 1;
1505 
1506 	BOOL fDontPrettyPath : 1;
1507 	BOOL fShowAttribCol : 1;
1508 	BOOL fMapNetDrvBtn : 1;
1509 	BOOL fShowInfoTip : 1;
1510 
1511 	BOOL fHideIcons : 1;
1512 	UINT fRestFlags : 3;
1513 	UINT :15; /* Required for proper binary layout with gcc */
1514 } SHELLFLAGSTATE, * LPSHELLFLAGSTATE;
1515 
1516 VOID WINAPI SHGetSettings(_Out_ LPSHELLFLAGSTATE lpsfs, DWORD dwMask);
1517 
1518 #define SSF_SHOWALLOBJECTS		0x0001
1519 #define SSF_SHOWEXTENSIONS		0x0002
1520 #define SSF_SHOWCOMPCOLOR		0x0008
1521 #define SSF_SHOWSYSFILES		0x0020
1522 #define SSF_DOUBLECLICKINWEBVIEW	0x0080
1523 #define SSF_SHOWATTRIBCOL		0x0100
1524 #define SSF_DESKTOPHTML			0x0200
1525 #define SSF_WIN95CLASSIC		0x0400
1526 #define SSF_DONTPRETTYPATH		0x0800
1527 #define SSF_SHOWINFOTIP			0x2000
1528 #define SSF_MAPNETDRVBUTTON		0x1000
1529 #define SSF_NOCONFIRMRECYCLE		0x8000
1530 #define SSF_HIDEICONS			0x4000
1531 #define SSF_SHOWSUPERHIDDEN		0x00040000
1532 #define SSF_SEPPROCESS			0x00080000
1533 
1534 /****************************************************************************
1535 * SHRestricted API
1536 */
1537 typedef enum RESTRICTIONS
1538 {
1539 	REST_NONE			= 0x00000000,
1540 	REST_NORUN			= 0x00000001,
1541 	REST_NOCLOSE			= 0x00000002,
1542 	REST_NOSAVESET			= 0x00000004,
1543 	REST_NOFILEMENU			= 0x00000008,
1544 	REST_NOSETFOLDERS		= 0x00000010,
1545 	REST_NOSETTASKBAR		= 0x00000020,
1546 	REST_NODESKTOP			= 0x00000040,
1547 	REST_NOFIND			= 0x00000080,
1548 	REST_NODRIVES			= 0x00000100,
1549 	REST_NODRIVEAUTORUN		= 0x00000200,
1550 	REST_NODRIVETYPEAUTORUN		= 0x00000400,
1551 	REST_NONETHOOD			= 0x00000800,
1552 	REST_STARTBANNER		= 0x00001000,
1553 	REST_RESTRICTRUN		= 0x00002000,
1554 	REST_NOPRINTERTABS		= 0x00004000,
1555 	REST_NOPRINTERDELETE		= 0x00008000,
1556 	REST_NOPRINTERADD		= 0x00010000,
1557 	REST_NOSTARTMENUSUBFOLDERS	= 0x00020000,
1558 	REST_MYDOCSONNET		= 0x00040000,
1559 	REST_NOEXITTODOS		= 0x00080000,
1560 	REST_ENFORCESHELLEXTSECURITY	= 0x00100000,
1561 	REST_LINKRESOLVEIGNORELINKINFO	= 0x00200000,
1562 	REST_NOCOMMONGROUPS		= 0x00400000,
1563 	REST_SEPARATEDESKTOPPROCESS	= 0x00800000,
1564 	REST_NOWEB			= 0x01000000,
1565 	REST_NOTRAYCONTEXTMENU		= 0x02000000,
1566 	REST_NOVIEWCONTEXTMENU		= 0x04000000,
1567 	REST_NONETCONNECTDISCONNECT	= 0x08000000,
1568 	REST_STARTMENULOGOFF		= 0x10000000,
1569 	REST_NOSETTINGSASSIST		= 0x20000000,
1570 	REST_NOINTERNETICON		= 0x40000001,
1571 	REST_NORECENTDOCSHISTORY,
1572 	REST_NORECENTDOCSMENU,
1573 	REST_NOACTIVEDESKTOP,
1574 	REST_NOACTIVEDESKTOPCHANGES,
1575 	REST_NOFAVORITESMENU,
1576 	REST_CLEARRECENTDOCSONEXIT,
1577 	REST_CLASSICSHELL,
1578 	REST_NOCUSTOMIZEWEBVIEW,
1579 
1580 	REST_NOHTMLWALLPAPER		= 0x40000010,
1581 	REST_NOCHANGINGWALLPAPER,
1582 	REST_NODESKCOMP,
1583 	REST_NOADDDESKCOMP,
1584 	REST_NODELDESKCOMP,
1585 	REST_NOCLOSEDESKCOMP,
1586 	REST_NOCLOSE_DRAGDROPBAND,
1587 	REST_NOMOVINGBAND,
1588 	REST_NOEDITDESKCOMP,
1589 	REST_NORESOLVESEARCH,
1590 	REST_NORESOLVETRACK,
1591 	REST_FORCECOPYACLWITHFILE,
1592 #if (NTDDI_VERSION < NTDDI_LONGHORN)
1593 	REST_NOLOGO3CHANNELNOTIFY	= 0x4000001C,
1594 #endif
1595 	REST_NOFORGETSOFTWAREUPDATE	= 0x4000001D,
1596 	REST_NOSETACTIVEDESKTOP,
1597 	REST_NOUPDATEWINDOWS,
1598 	REST_NOCHANGESTARMENU,		/* 0x40000020 */
1599 	REST_NOFOLDEROPTIONS,
1600 	REST_HASFINDCOMPUTERS,
1601 	REST_INTELLIMENUS,
1602 	REST_RUNDLGMEMCHECKBOX,
1603 	REST_ARP_ShowPostSetup,
1604 	REST_NOCSC,
1605 	REST_NOCONTROLPANEL,
1606 	REST_ENUMWORKGROUP,
1607 	REST_ARP_NOARP,
1608 	REST_ARP_NOREMOVEPAGE,
1609 	REST_ARP_NOADDPAGE,
1610 	REST_ARP_NOWINSETUPPAGE,
1611 	REST_GREYMSIADS,
1612 	REST_NOCHANGEMAPPEDDRIVELABEL,
1613 	REST_NOCHANGEMAPPEDDRIVECOMMENT,
1614 	REST_MaxRecentDocs,		/* 0x40000030 */
1615 	REST_NONETWORKCONNECTIONS,
1616 	REST_FORCESTARTMENULOGOFF,
1617 	REST_NOWEBVIEW,
1618 	REST_NOCUSTOMIZETHISFOLDER,
1619 	REST_NOENCRYPTION,
1620 
1621 	REST_ALLOWFRENCHENCRYPTION,	/* not documented */
1622 
1623 	REST_DONTSHOWSUPERHIDDEN,
1624 	REST_NOSHELLSEARCHBUTTON,
1625 	REST_NOHARDWARETAB,
1626 	REST_NORUNASINSTALLPROMPT,
1627 	REST_PROMPTRUNASINSTALLNETPATH,
1628 	REST_NOMANAGEMYCOMPUTERVERB,
1629 	REST_NORECENTDOCSNETHOOD,
1630 	REST_DISALLOWRUN,
1631 	REST_NOWELCOMESCREEN,
1632 	REST_RESTRICTCPL,		/* 0x40000040 */
1633 	REST_DISALLOWCPL,
1634 	REST_NOSMBALLOONTIP,
1635 	REST_NOSMHELP,
1636 	REST_NOWINKEYS,
1637 	REST_NOENCRYPTONMOVE,
1638 	REST_NOLOCALMACHINERUN,
1639 	REST_NOCURRENTUSERRUN,
1640 	REST_NOLOCALMACHINERUNONCE,
1641 	REST_NOCURRENTUSERRUNONCE,
1642 	REST_FORCEACTIVEDESKTOPON,
1643 	REST_NOCOMPUTERSNEARME,
1644 	REST_NOVIEWONDRIVE,
1645 	REST_NONETCRAWL,
1646 	REST_NOSHAREDDOCUMENTS,
1647 	REST_NOSMMYDOCS,
1648 	REST_NOSMMYPICS,		/* 0x40000050 */
1649 	REST_ALLOWBITBUCKDRIVES,
1650 	REST_NONLEGACYSHELLMODE,
1651 	REST_NOCONTROLPANELBARRICADE,
1652 	REST_NOSTARTPAGE,
1653 	REST_NOAUTOTRAYNOTIFY,
1654 	REST_NOTASKGROUPING,
1655 	REST_NOCDBURNING,
1656 	REST_MYCOMPNOPROP,
1657 	REST_MYDOCSNOPROP,
1658 	REST_NOSTARTPANEL,
1659 	REST_NODISPLAYAPPEARANCEPAGE,
1660 	REST_NOTHEMESTAB,
1661 	REST_NOVISUALSTYLECHOICE,
1662 	REST_NOSIZECHOICE,
1663 	REST_NOCOLORCHOICE,
1664 	REST_SETVISUALSTYLE,		/* 0x40000060 */
1665 	REST_STARTRUNNOHOMEPATH,
1666 	REST_NOUSERNAMEINSTARTPANEL,
1667 	REST_NOMYCOMPUTERICON,
1668 	REST_NOSMNETWORKPLACES,
1669 	REST_NOSMPINNEDLIST,
1670 	REST_NOSMMYMUSIC,
1671 	REST_NOSMEJECTPC,
1672 	REST_NOSMMOREPROGRAMS,
1673 	REST_NOSMMFUPROGRAMS,
1674 	REST_NOTRAYITEMSDISPLAY,
1675 	REST_NOTOOLBARSONTASKBAR,
1676 	/* 0x4000006C
1677 	   0x4000006D
1678 	   0x4000006E */
1679 	REST_NOSMCONFIGUREPROGRAMS	= 0x4000006F,
1680 	REST_HIDECLOCK,			/* 0x40000070 */
1681 	REST_NOLOWDISKSPACECHECKS,
1682 	REST_NOENTIRENETWORK,
1683 	REST_NODESKTOPCLEANUP,
1684 	REST_BITBUCKNUKEONDELETE,
1685 	REST_BITBUCKCONFIRMDELETE,
1686 	REST_BITBUCKNOPROP,
1687 	REST_NODISPBACKGROUND,
1688 	REST_NODISPSCREENSAVEPG,
1689 	REST_NODISPSETTINGSPG,
1690 	REST_NODISPSCREENSAVEPREVIEW,
1691 	REST_NODISPLAYCPL,
1692 	REST_HIDERUNASVERB,
1693 	REST_NOTHUMBNAILCACHE,
1694 	REST_NOSTRCMPLOGICAL,
1695 	REST_NOPUBLISHWIZARD,
1696 	REST_NOONLINEPRINTSWIZARD,	/* 0x40000080 */
1697 	REST_NOWEBSERVICES,
1698 	REST_ALLOWUNHASHEDWEBVIEW,
1699 	REST_ALLOWLEGACYWEBVIEW,
1700 	REST_REVERTWEBVIEWSECURITY,
1701 
1702 	REST_INHERITCONSOLEHANDLES	= 0x40000086,
1703 
1704 	REST_NODISCONNECT		= 0x41000001,
1705 	REST_NOSECURITY,
1706 	REST_NOFILEASSOCIATE,		/* 0x41000003 */
1707 } RESTRICTIONS;
1708 
1709 DWORD WINAPI SHRestricted(RESTRICTIONS rest);
1710 
1711 /****************************************************************************
1712 * SHChangeNotify API
1713 */
1714 typedef struct _SHChangeNotifyEntry
1715 {
1716     LPCITEMIDLIST pidl;
1717     BOOL   fRecursive;
1718 } SHChangeNotifyEntry;
1719 
1720 #define SHCNE_RENAMEITEM	0x00000001
1721 #define SHCNE_CREATE		0x00000002
1722 #define SHCNE_DELETE		0x00000004
1723 #define SHCNE_MKDIR		0x00000008
1724 #define SHCNE_RMDIR		0x00000010
1725 #define SHCNE_MEDIAINSERTED	0x00000020
1726 #define SHCNE_MEDIAREMOVED	0x00000040
1727 #define SHCNE_DRIVEREMOVED	0x00000080
1728 #define SHCNE_DRIVEADD		0x00000100
1729 #define SHCNE_NETSHARE		0x00000200
1730 #define SHCNE_NETUNSHARE	0x00000400
1731 #define SHCNE_ATTRIBUTES	0x00000800
1732 #define SHCNE_UPDATEDIR		0x00001000
1733 #define SHCNE_UPDATEITEM	0x00002000
1734 #define SHCNE_SERVERDISCONNECT	0x00004000
1735 #define SHCNE_UPDATEIMAGE	0x00008000
1736 #define SHCNE_DRIVEADDGUI	0x00010000
1737 #define SHCNE_RENAMEFOLDER	0x00020000
1738 #define SHCNE_FREESPACE		0x00040000
1739 
1740 #define SHCNE_EXTENDED_EVENT	0x04000000
1741 #define SHCNE_ASSOCCHANGED	0x08000000
1742 #define SHCNE_DISKEVENTS	0x0002381F
1743 #define SHCNE_GLOBALEVENTS	0x0C0581E0
1744 #define SHCNE_ALLEVENTS		0x7FFFFFFF
1745 #define SHCNE_INTERRUPT		0x80000000
1746 
1747 #define SHCNEE_ORDERCHANGED	0x0002L
1748 #define SHCNEE_MSI_CHANGE	0x0004L
1749 #define SHCNEE_MSI_UNINSTALL	0x0005L
1750 
1751 #define SHCNF_IDLIST		0x0000
1752 #define SHCNF_PATHA		0x0001
1753 #define SHCNF_PRINTERA		0x0002
1754 #define SHCNF_DWORD		0x0003
1755 #define SHCNF_PATHW		0x0005
1756 #define SHCNF_PRINTERW		0x0006
1757 #define SHCNF_TYPE		0x00FF
1758 #define SHCNF_FLUSH		0x1000
1759 #define SHCNF_FLUSHNOWAIT	0x3000
1760 #define SHCNF_NOTIFYRECURSIVE	0x10000
1761 
1762 #define SHCNF_PATH              WINELIB_NAME_AW(SHCNF_PATH)
1763 #define SHCNF_PRINTER           WINELIB_NAME_AW(SHCNF_PRINTER)
1764 
1765 #define SHCNRF_InterruptLevel 0x0001
1766 #define SHCNRF_ShellLevel 0x0002
1767 #define SHCNRF_RecursiveInterrupt 0x1000
1768 #define SHCNRF_NewDelivery 0x8000
1769 
1770 void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2);
1771 
1772 typedef enum {
1773     SLDF_DEFAULT = 0x00000000,
1774     SLDF_HAS_ID_LIST = 0x00000001,
1775     SLDF_HAS_LINK_INFO = 0x00000002,
1776     SLDF_HAS_NAME = 0x00000004,
1777     SLDF_HAS_RELPATH = 0x00000008,
1778     SLDF_HAS_WORKINGDIR = 0x00000010,
1779     SLDF_HAS_ARGS = 0x00000020,
1780     SLDF_HAS_ICONLOCATION = 0x00000040,
1781     SLDF_UNICODE = 0x00000080,
1782     SLDF_FORCE_NO_LINKINFO = 0x00000100,
1783     SLDF_HAS_EXP_SZ = 0x00000200,
1784     SLDF_RUN_IN_SEPARATE = 0x00000400,
1785 #if (NTDDI_VERSION < NTDDI_LONGHORN)
1786     SLDF_HAS_LOGO3ID = 0x00000800,
1787 #endif
1788     SLDF_HAS_DARWINID = 0x00001000,
1789     SLDF_RUNAS_USER = 0x00002000,
1790     SLDF_HAS_EXP_ICON_SZ = 0x00004000,
1791     SLDF_NO_PIDL_ALIAS = 0x00008000,
1792     SLDF_FORCE_UNCNAME = 0x00010000,
1793     SLDF_RUN_WITH_SHIMLAYER = 0x00020000,
1794 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
1795     SLDF_FORCE_NO_LINKTRACK = 0x00040000,
1796     SLDF_ENABLE_TARGET_METADATA = 0x00080000,
1797     SLDF_DISABLE_LINK_PATH_TRACKING = 0x00100000,
1798     SLDF_DISABLE_KNOWNFOLDER_RELATIVE_TRACKING = 0x00200000,
1799 #if (NTDDI_VERSION >= NTDDI_WIN7)
1800     SLDF_NO_KF_ALIAS = 0x00400000,
1801     SLDF_ALLOW_LINK_TO_LINK = 0x00800000,
1802     SLDF_UNALIAS_ON_SAVE = 0x01000000,
1803     SLDF_PREFER_ENVIRONMENT_PATH = 0x02000000,
1804     SLDF_KEEP_LOCAL_IDLIST_FOR_UNC_TARGET = 0x04000000,
1805 #if (NTDDI_VERSION >= NTDDI_WIN8)
1806     SLDF_PERSIST_VOLUME_ID_RELATIVE = 0x08000000,
1807     SLDF_VALID = 0x0ffff7ff, /* Windows 8 */
1808 #else
1809     SLDF_VALID = 0x07fff7ff, /* Windows 7 */
1810 #endif
1811 #else
1812     SLDF_VALID = 0x003ff7ff, /* Windows Vista */
1813 #endif
1814 #endif
1815     SLDF_RESERVED = 0x80000000,
1816 } SHELL_LINK_DATA_FLAGS;
1817 
1818 typedef struct tagDATABLOCKHEADER
1819 {
1820     DWORD cbSize;
1821     DWORD dwSignature;
1822 } DATABLOCK_HEADER, *LPDATABLOCK_HEADER, *LPDBLIST;
1823 
1824 #ifdef LF_FACESIZE
1825 typedef struct {
1826     DATABLOCK_HEADER dbh;
1827     WORD wFillAttribute;
1828     WORD wPopupFillAttribute;
1829     COORD dwScreenBufferSize;
1830     COORD dwWindowSize;
1831     COORD dwWindowOrigin;
1832     DWORD nFont;
1833     DWORD nInputBufferSize;
1834     COORD dwFontSize;
1835     UINT uFontFamily;
1836     UINT uFontWeight;
1837     WCHAR FaceName[LF_FACESIZE];
1838     UINT uCursorSize;
1839     BOOL bFullScreen;
1840     BOOL bQuickEdit;
1841     BOOL bInsertMode;
1842     BOOL bAutoPosition;
1843     UINT uHistoryBufferSize;
1844     UINT uNumberOfHistoryBuffers;
1845     BOOL bHistoryNoDup;
1846     COLORREF ColorTable[16];
1847 } NT_CONSOLE_PROPS, *LPNT_CONSOLE_PROPS;
1848 #endif
1849 
1850 typedef struct {
1851     DATABLOCK_HEADER dbh;
1852     UINT uCodePage;
1853 } NT_FE_CONSOLE_PROPS, *LPNT_FE_CONSOLE_PROPS;
1854 
1855 typedef struct {
1856     DWORD cbSize;
1857     DWORD dwSignature;
1858     CHAR szTarget[MAX_PATH];
1859     WCHAR szwTarget[MAX_PATH];
1860 } EXP_SZ_LINK, *LPEXP_SZ_LINK;
1861 
1862 typedef struct {
1863     DATABLOCK_HEADER dbh;
1864     CHAR szDarwinID[MAX_PATH];
1865     WCHAR szwDarwinID[MAX_PATH];
1866 } EXP_DARWIN_LINK, *LPEXP_DARWIN_LINK;
1867 
1868 typedef struct {
1869     DWORD cbSize;
1870     DWORD dwSignature;
1871     DWORD idSpecialFolder;
1872     DWORD cbOffset;
1873 } EXP_SPECIAL_FOLDER, *LPEXP_SPECIAL_FOLDER;
1874 
1875 typedef struct {
1876     DWORD cbSize;
1877     DWORD dwSignature;
1878     BYTE abPropertyStorage[1];
1879 } EXP_PROPERTYSTORAGE;
1880 
1881 #define EXP_SZ_LINK_SIG         0xA0000001 /* EXP_SZ_LINK */
1882 #define NT_CONSOLE_PROPS_SIG    0xA0000002 /* NT_CONSOLE_PROPS */
1883 #define NT_FE_CONSOLE_PROPS_SIG 0xA0000004 /* NT_FE_CONSOLE_PROPS */
1884 #define EXP_SPECIAL_FOLDER_SIG  0xA0000005 /* EXP_SPECIAL_FOLDER */
1885 #define EXP_DARWIN_ID_SIG       0xA0000006 /* EXP_DARWIN_LINK */
1886 #if (NTDDI_VERSION < NTDDI_LONGHORN)
1887 #define EXP_LOGO3_ID_SIG        0xA0000007 /* EXP_DARWIN_LINK, for Logo3 / MS Internet Component Download (MSICD) shortcuts; old SDKs only (deprecated) */
1888 #endif
1889 #define EXP_SZ_ICON_SIG         0xA0000007 /* EXP_SZ_LINK */
1890 #define EXP_PROPERTYSTORAGE_SIG 0xA0000009 /* EXP_PROPERTYSTORAGE */
1891 
1892 typedef struct _SHChangeDWORDAsIDList {
1893     USHORT   cb;
1894     DWORD    dwItem1;
1895     DWORD    dwItem2;
1896     USHORT   cbZero;
1897 } SHChangeDWORDAsIDList, *LPSHChangeDWORDAsIDList;
1898 
1899 typedef struct _SHChangeProductKeyAsIDList {
1900     USHORT cb;
1901     WCHAR wszProductKey[39];
1902     USHORT cbZero;
1903 } SHChangeProductKeyAsIDList, *LPSHChangeProductKeyAsIDList;
1904 
1905 ULONG
1906 WINAPI
1907 SHChangeNotifyRegister(
1908   _In_ HWND hwnd,
1909   int fSources,
1910   LONG fEvents,
1911   UINT wMsg,
1912   int cEntries,
1913   _In_ SHChangeNotifyEntry *pshcne);
1914 
1915 BOOL WINAPI SHChangeNotifyDeregister(ULONG ulID);
1916 
1917 HANDLE
1918 WINAPI
1919 SHChangeNotification_Lock(
1920   _In_ HANDLE hChangeNotification,
1921   DWORD dwProcessId,
1922   _Outptr_opt_result_buffer_(2)_Outptr_opt_result_buffer_(2) LPITEMIDLIST **pppidl,
1923   _Out_opt_ LONG *plEvent);
1924 
1925 BOOL WINAPI SHChangeNotification_Unlock(_In_ HANDLE hLock);
1926 
1927 HRESULT
1928 WINAPI
1929 SHGetRealIDL(
1930   _In_ IShellFolder *psf,
1931   _In_ LPCITEMIDLIST pidlSimple,
1932   _Outptr_ LPITEMIDLIST * ppidlReal);
1933 
1934 /****************************************************************************
1935 * SHCreateDirectory API
1936 */
1937 int WINAPI SHCreateDirectory(_In_opt_ HWND, _In_ LPCWSTR);
1938 
1939 int
1940 WINAPI
1941 SHCreateDirectoryExA(
1942   _In_opt_ HWND,
1943   _In_ LPCSTR,
1944   _In_opt_ LPSECURITY_ATTRIBUTES);
1945 
1946 int
1947 WINAPI
1948 SHCreateDirectoryExW(
1949   _In_opt_ HWND,
1950   _In_ LPCWSTR,
1951   _In_opt_ LPSECURITY_ATTRIBUTES);
1952 
1953 #define SHCreateDirectoryEx WINELIB_NAME_AW(SHCreateDirectoryEx)
1954 
1955 /****************************************************************************
1956 * SHGetSpecialFolderLocation API
1957 */
1958 _Check_return_
1959 HRESULT
1960 WINAPI
1961 SHGetSpecialFolderLocation(
1962   _Reserved_ HWND hwndOwner,
1963   _In_ int nFolder,
1964   _Outptr_ LPITEMIDLIST *ppidl);
1965 
1966 HRESULT
1967 WINAPI
1968 SHGetFolderLocation(
1969   _Reserved_ HWND hwndOwner,
1970   _In_ int nFolder,
1971   _In_opt_ HANDLE hToken,
1972   _In_ DWORD dwReserved,
1973   _Outptr_ LPITEMIDLIST *ppidl);
1974 
1975 /****************************************************************************
1976 * SHGetFolderPath API
1977 */
1978 typedef enum {
1979     SHGFP_TYPE_CURRENT = 0,
1980     SHGFP_TYPE_DEFAULT = 1
1981 } SHGFP_TYPE;
1982 
1983 HRESULT
1984 WINAPI
1985 SHGetFolderPathA(
1986   _Reserved_ HWND hwnd,
1987   _In_ int nFolder,
1988   _In_opt_ HANDLE hToken,
1989   _In_ DWORD dwFlags,
1990   _Out_writes_(MAX_PATH) LPSTR pszPath);
1991 
1992 HRESULT
1993 WINAPI
1994 SHGetFolderPathW(
1995   _Reserved_ HWND hwnd,
1996   _In_ int nFolder,
1997   _In_opt_ HANDLE hToken,
1998   _In_ DWORD dwFlags,
1999   _Out_writes_(MAX_PATH) LPWSTR pszPath);
2000 
2001 #define SHGetFolderPath WINELIB_NAME_AW(SHGetFolderPath)
2002 
2003 #define CSIDL_DESKTOP		0x0000
2004 #define CSIDL_INTERNET		0x0001
2005 #define CSIDL_PROGRAMS		0x0002
2006 #define CSIDL_CONTROLS		0x0003
2007 #define CSIDL_PRINTERS		0x0004
2008 #define CSIDL_PERSONAL		0x0005
2009 #define CSIDL_FAVORITES		0x0006
2010 #define CSIDL_STARTUP		0x0007
2011 #define CSIDL_RECENT		0x0008
2012 #define CSIDL_SENDTO		0x0009
2013 #define CSIDL_BITBUCKET		0x000a
2014 #define CSIDL_STARTMENU		0x000b
2015 #define CSIDL_MYDOCUMENTS	CSIDL_PERSONAL
2016 #define CSIDL_MYMUSIC		0x000d
2017 #define CSIDL_MYVIDEO		0x000e
2018 #define CSIDL_DESKTOPDIRECTORY	0x0010
2019 #define CSIDL_DRIVES		0x0011
2020 #define CSIDL_NETWORK		0x0012
2021 #define CSIDL_NETHOOD		0x0013
2022 #define CSIDL_FONTS		0x0014
2023 #define CSIDL_TEMPLATES		0x0015
2024 #define CSIDL_COMMON_STARTMENU	0x0016
2025 #define CSIDL_COMMON_PROGRAMS	0X0017
2026 #define CSIDL_COMMON_STARTUP	0x0018
2027 #define CSIDL_COMMON_DESKTOPDIRECTORY	0x0019
2028 #define CSIDL_APPDATA		0x001a
2029 #define CSIDL_PRINTHOOD		0x001b
2030 #define CSIDL_LOCAL_APPDATA	0x001c
2031 #define CSIDL_ALTSTARTUP	0x001d
2032 #define CSIDL_COMMON_ALTSTARTUP	0x001e
2033 #define CSIDL_COMMON_FAVORITES  0x001f
2034 #define CSIDL_INTERNET_CACHE	0x0020
2035 #define CSIDL_COOKIES		0x0021
2036 #define CSIDL_HISTORY		0x0022
2037 #define CSIDL_COMMON_APPDATA	0x0023
2038 #define CSIDL_WINDOWS		0x0024
2039 #define CSIDL_SYSTEM		0x0025
2040 #define CSIDL_PROGRAM_FILES	0x0026
2041 #define CSIDL_MYPICTURES	0x0027
2042 #define CSIDL_PROFILE		0x0028
2043 #define CSIDL_SYSTEMX86		0x0029
2044 #define CSIDL_PROGRAM_FILESX86	0x002a
2045 #define CSIDL_PROGRAM_FILES_COMMON	0x002b
2046 #define CSIDL_PROGRAM_FILES_COMMONX86	0x002c
2047 #define CSIDL_COMMON_TEMPLATES	0x002d
2048 #define CSIDL_COMMON_DOCUMENTS	0x002e
2049 #define CSIDL_COMMON_ADMINTOOLS	0x002f
2050 #define CSIDL_ADMINTOOLS	0x0030
2051 #define CSIDL_CONNECTIONS	0x0031
2052 #define CSIDL_COMMON_MUSIC	0x0035
2053 #define CSIDL_COMMON_PICTURES	0x0036
2054 #define CSIDL_COMMON_VIDEO	0x0037
2055 #define CSIDL_RESOURCES		0x0038
2056 #define CSIDL_RESOURCES_LOCALIZED 0x0039
2057 #define CSIDL_COMMON_OEM_LINKS	0x003a
2058 #define CSIDL_CDBURN_AREA	0x003b
2059 #define CSIDL_COMPUTERSNEARME	0x003d
2060 #define CSIDL_PROFILES		0x003e
2061 #define CSIDL_FOLDER_MASK	0x00ff
2062 #define CSIDL_FLAG_PER_USER_INIT 0x0800
2063 #define CSIDL_FLAG_NO_ALIAS	0x1000
2064 #define CSIDL_FLAG_DONT_VERIFY	0x4000
2065 #define CSIDL_FLAG_CREATE	0x8000
2066 
2067 #define CSIDL_FLAG_MASK		0xff00
2068 
2069 /****************************************************************************
2070  * SHGetDesktopFolder API
2071  */
2072 _Check_return_ HRESULT WINAPI SHGetDesktopFolder(_Outptr_ IShellFolder * *);
2073 
2074 /****************************************************************************
2075  * SHBindToParent API
2076  */
2077 HRESULT
2078 WINAPI
2079 SHBindToParent(
2080   _In_ LPCITEMIDLIST pidl,
2081   _In_ REFIID riid,
2082   _Outptr_ LPVOID *ppv,
2083   _Outptr_opt_ LPCITEMIDLIST *ppidlLast);
2084 
2085 /****************************************************************************
2086 * SHDefExtractIcon API
2087 */
2088 HRESULT
2089 WINAPI
2090 SHDefExtractIconA(
2091   _In_ LPCSTR pszIconFile,
2092   int iIndex,
2093   UINT uFlags,
2094   _Out_opt_ HICON* phiconLarge,
2095   _Out_opt_ HICON* phiconSmall,
2096   UINT nIconSize);
2097 
2098 HRESULT
2099 WINAPI
2100 SHDefExtractIconW(
2101   _In_ LPCWSTR pszIconFile,
2102   int iIndex,
2103   UINT uFlags,
2104   _Out_opt_ HICON* phiconLarge,
2105   _Out_opt_ HICON* phiconSmall,
2106   UINT nIconSize);
2107 
2108 #define SHDefExtractIcon WINELIB_NAME_AW(SHDefExtractIcon)
2109 
2110 /*
2111  * DROPFILES for CF_HDROP and CF_PRINTERS
2112  */
2113 typedef struct _DROPFILES
2114 {
2115   DWORD pFiles;
2116   POINT pt;
2117   BOOL  fNC;
2118   BOOL  fWide;
2119 } DROPFILES, *LPDROPFILES;
2120 
2121 /*
2122  * Properties of a file in the clipboard
2123  */
2124 typedef struct _FILEDESCRIPTORA {
2125     DWORD dwFlags;
2126     CLSID clsid;
2127     SIZEL sizel;
2128     POINTL pointl;
2129     DWORD dwFileAttributes;
2130     FILETIME ftCreationTime;
2131     FILETIME ftLastAccessTime;
2132     FILETIME ftLastWriteTime;
2133     DWORD nFileSizeHigh;
2134     DWORD nFileSizeLow;
2135     CHAR cFileName[MAX_PATH];
2136 } FILEDESCRIPTORA, *LPFILEDESCRIPTORA;
2137 
2138 typedef struct _FILEDESCRIPTORW {
2139     DWORD dwFlags;
2140     CLSID clsid;
2141     SIZEL sizel;
2142     POINTL pointl;
2143     DWORD dwFileAttributes;
2144     FILETIME ftCreationTime;
2145     FILETIME ftLastAccessTime;
2146     FILETIME ftLastWriteTime;
2147     DWORD nFileSizeHigh;
2148     DWORD nFileSizeLow;
2149     WCHAR cFileName[MAX_PATH];
2150 } FILEDESCRIPTORW, *LPFILEDESCRIPTORW;
2151 
2152 DECL_WINELIB_TYPE_AW(FILEDESCRIPTOR)
2153 DECL_WINELIB_TYPE_AW(LPFILEDESCRIPTOR)
2154 
2155 /*
2156  * CF_FILEGROUPDESCRIPTOR clipboard format
2157  */
2158 typedef struct _FILEGROUPDESCRIPTORA {
2159     UINT cItems;
2160     FILEDESCRIPTORA fgd[1];
2161 } FILEGROUPDESCRIPTORA, *LPFILEGROUPDESCRIPTORA;
2162 
2163 typedef struct _FILEGROUPDESCRIPTORW {
2164     UINT cItems;
2165     FILEDESCRIPTORW fgd[1];
2166 } FILEGROUPDESCRIPTORW, *LPFILEGROUPDESCRIPTORW;
2167 
2168 DECL_WINELIB_TYPE_AW(FILEGROUPDESCRIPTOR)
2169 DECL_WINELIB_TYPE_AW(LPFILEGROUPDESCRIPTOR)
2170 
2171 /****************************************************************************
2172  * Cabinet functions
2173  */
2174 
2175 typedef struct {
2176     WORD cLength;
2177     WORD nVersion;
2178     BOOL fFullPathTitle:1;
2179     BOOL fSaveLocalView:1;
2180     BOOL fNotShell:1;
2181     BOOL fSimpleDefault:1;
2182     BOOL fDontShowDescBar:1;
2183     BOOL fNewWindowMode:1;
2184     BOOL fShowCompColor:1;
2185     BOOL fDontPrettyNames:1;
2186     BOOL fAdminsCreateCommonGroups:1;
2187     UINT fUnusedFlags:7;
2188     UINT :15; /* Required for proper binary layout with gcc */
2189     UINT fMenuEnumFilter;
2190 } CABINETSTATE, *LPCABINETSTATE;
2191 
2192 #define CABINETSTATE_VERSION 2
2193 
2194 BOOL
2195 WINAPI
2196 ReadCabinetState(
2197   _Out_writes_bytes_(cLength) CABINETSTATE *,
2198   int cLength);
2199 
2200 BOOL WINAPI WriteCabinetState(_In_ CABINETSTATE *);
2201 
2202 /****************************************************************************
2203  * Path Manipulation Routines
2204  */
2205 
2206 /* PathProcessCommand flags */
2207 #define PPCF_ADDQUOTES        0x01
2208 #define PPCF_INCLUDEARGS      0x02
2209 #define PPCF_ADDARGUMENTS     0x03
2210 #define PPCF_NODIRECTORIES    0x10
2211 #define PPCF_DONTRESOLVE      0x20
2212 #define PPCF_FORCEQUALIFY     0x40
2213 #define PPCF_LONGESTPOSSIBLE  0x80
2214 
2215 /* PathResolve flags */
2216 #define PRF_VERIFYEXISTS         0x01
2217 #define PRF_EXECUTABLE           0x02
2218 #define PRF_TRYPROGRAMEXTENSIONS (PRF_EXECUTABLE | PRF_VERIFYEXISTS)
2219 #define PRF_FIRSTDIRDEF          0x04
2220 #define PRF_DONTFINDLNK          0x08 // Used when PRF_TRYPROGRAMEXTENSIONS is specified
2221 #if (NTDDI_VERSION >= NTDDI_WINXPSP2)
2222 #define PRF_REQUIREABSOLUTE      0x10
2223 #endif
2224 
2225 VOID WINAPI PathGetShortPath(_Inout_updates_(MAX_PATH) LPWSTR pszPath);
2226 
2227 LONG
2228 WINAPI
2229 PathProcessCommand(
2230   _In_ LPCWSTR,
2231   _Out_writes_(cchDest) LPWSTR,
2232   int cchDest,
2233   DWORD);
2234 
2235 _Success_(return != 0)
2236 BOOL
2237 WINAPI
2238 PathYetAnotherMakeUniqueName(
2239   _Out_writes_(MAX_PATH) LPWSTR,
2240   _In_ LPCWSTR,
2241   _In_opt_ LPCWSTR,
2242   _In_opt_ LPCWSTR);
2243 
2244 /****************************************************************************
2245  * Drag And Drop Routines
2246  */
2247 
2248 /* DAD_AutoScroll sample structure */
2249 #define NUM_POINTS 3
2250 typedef struct
2251 {
2252     int   iNextSample;
2253     DWORD dwLastScroll;
2254     BOOL  bFull;
2255     POINT pts[NUM_POINTS];
2256     DWORD dwTimes[NUM_POINTS];
2257 } AUTO_SCROLL_DATA;
2258 
2259 BOOL         WINAPI DAD_SetDragImage(HIMAGELIST,LPPOINT);
2260 BOOL         WINAPI DAD_DragEnterEx(HWND,POINT);
2261 BOOL         WINAPI DAD_DragEnterEx2(_In_ HWND, POINT, _In_opt_ IDataObject*);
2262 BOOL         WINAPI DAD_DragMove(POINT);
2263 BOOL         WINAPI DAD_DragLeave(void);
2264 BOOL         WINAPI DAD_AutoScroll(HWND,AUTO_SCROLL_DATA*,const POINT*);
2265 
2266 HRESULT
2267 WINAPI
2268 SHDoDragDrop(
2269   _In_opt_ HWND,
2270   _In_ IDataObject*,
2271   _In_opt_ IDropSource*,
2272   _In_ DWORD,
2273   _Out_ LPDWORD);
2274 
2275 /****************************************************************************
2276  * Internet shortcut properties
2277  */
2278 
2279 #define PID_IS_URL         2
2280 #define PID_IS_NAME        4
2281 #define PID_IS_WORKINGDIR  5
2282 #define PID_IS_HOTKEY      6
2283 #define PID_IS_SHOWCMD     7
2284 #define PID_IS_ICONINDEX   8
2285 #define PID_IS_ICONFILE    9
2286 #define PID_IS_WHATSNEW    10
2287 #define PID_IS_AUTHOR      11
2288 #define PID_IS_DESCRIPTION 12
2289 #define PID_IS_COMMENT     13
2290 
2291 
2292 LPITEMIDLIST WINAPI ILAppendID(_In_opt_ LPITEMIDLIST, _In_ LPCSHITEMID, BOOL);
2293 LPITEMIDLIST WINAPI ILClone(_In_ LPCITEMIDLIST);
2294 LPITEMIDLIST WINAPI ILCloneFirst(_In_ LPCITEMIDLIST);
2295 LPITEMIDLIST WINAPI ILCreateFromPathA(_In_ LPCSTR);
2296 LPITEMIDLIST WINAPI ILCreateFromPathW(_In_ LPCWSTR);
2297 #define             ILCreateFromPath WINELIB_NAME_AW(ILCreateFromPath)
2298 LPITEMIDLIST WINAPI ILCombine(_In_opt_ LPCITEMIDLIST, _In_opt_ LPCITEMIDLIST);
2299 LPITEMIDLIST WINAPI ILFindChild(_In_ LPCITEMIDLIST, _In_ LPCITEMIDLIST);
2300 LPITEMIDLIST WINAPI ILFindLastID(_In_ LPCITEMIDLIST);
2301 void         WINAPI ILFree(_In_opt_ LPITEMIDLIST);
2302 LPITEMIDLIST WINAPI ILGetNext(_In_opt_ LPCITEMIDLIST);
2303 UINT         WINAPI ILGetSize(_In_opt_ LPCITEMIDLIST);
2304 BOOL         WINAPI ILIsEqual(_In_ LPCITEMIDLIST, _In_ LPCITEMIDLIST);
2305 BOOL         WINAPI ILIsParent(_In_ LPCITEMIDLIST, _In_ LPCITEMIDLIST, BOOL);
2306 HRESULT      WINAPI ILLoadFromStream(_In_ LPSTREAM, _Inout_ LPITEMIDLIST*);
2307 BOOL         WINAPI ILRemoveLastID(_Inout_opt_ LPITEMIDLIST);
2308 HRESULT      WINAPI ILSaveToStream(_In_ LPSTREAM, _In_ LPCITEMIDLIST);
2309 
2310 static inline BOOL ILIsEmpty(_In_opt_ LPCITEMIDLIST pidl)
2311 {
2312     return !(pidl && pidl->mkid.cb);
2313 }
2314 
2315 #include <poppack.h>
2316 
2317 
2318 /* menu merging */
2319 #define MM_ADDSEPARATOR         0x00000001L
2320 #define MM_SUBMENUSHAVEIDS      0x00000002L
2321 #define MM_DONTREMOVESEPS       0x00000004L
2322 
2323 UINT
2324 WINAPI
2325 Shell_MergeMenus(
2326   _In_ HMENU hmDst,
2327   _In_ HMENU hmSrc,
2328   UINT uInsert,
2329   UINT uIDAdjust,
2330   UINT uIDAdjustMax,
2331   ULONG uFlags);
2332 
2333 
2334 /****************************************************************************
2335  * SHCreateDefaultContextMenu API
2336  */
2337 
2338 typedef struct
2339 {
2340   HWND hwnd;
2341   IContextMenuCB *pcmcb;
2342   PCIDLIST_ABSOLUTE pidlFolder;
2343   IShellFolder *psf;
2344   UINT cidl;
2345   PCUITEMID_CHILD_ARRAY apidl;
2346   IUnknown *punkAssociationInfo;
2347   UINT cKeys;
2348   const HKEY *aKeys;
2349 }DEFCONTEXTMENU;
2350 
2351 HRESULT
2352 WINAPI
2353 SHCreateDefaultContextMenu(
2354   _In_ const DEFCONTEXTMENU *,
2355   _In_ REFIID,
2356   _Outptr_ void **ppv);
2357 
2358 typedef HRESULT
2359 (CALLBACK * LPFNDFMCALLBACK)(
2360   _In_opt_ IShellFolder*,
2361   _In_opt_ HWND,
2362   _In_opt_ IDataObject*,
2363   UINT,
2364   WPARAM,
2365   LPARAM);
2366 
2367 HRESULT
2368 WINAPI
2369 CDefFolderMenu_Create2(
2370   _In_opt_ PCIDLIST_ABSOLUTE,
2371   _In_opt_ HWND,
2372   UINT cidl,
2373   _In_reads_opt_(cidl) PCUITEMID_CHILD_ARRAY,
2374   _In_opt_ IShellFolder*,
2375   _In_opt_ LPFNDFMCALLBACK,
2376   UINT nKeys,
2377   _In_reads_opt_(nKeys) const HKEY *,
2378   _Outptr_ IContextMenu **);
2379 
2380 #define DFM_MERGECONTEXTMENU         1
2381 #define DFM_INVOKECOMMAND            2
2382 #define DFM_INVOKECOMMANDEX          12
2383 #define DFM_GETDEFSTATICID           14
2384 
2385 #define DFM_CMD_DELETE          ((UINT)-1)
2386 #define DFM_CMD_MOVE            ((UINT)-2)
2387 #define DFM_CMD_COPY            ((UINT)-3)
2388 #define DFM_CMD_LINK            ((UINT)-4)
2389 #define DFM_CMD_PROPERTIES      ((UINT)-5)
2390 #define DFM_CMD_NEWFOLDER       ((UINT)-6)
2391 #define DFM_CMD_PASTE           ((UINT)-7)
2392 #define DFM_CMD_VIEWLIST        ((UINT)-8)
2393 #define DFM_CMD_VIEWDETAILS     ((UINT)-9)
2394 #define DFM_CMD_PASTELINK       ((UINT)-10)
2395 #define DFM_CMD_PASTESPECIAL    ((UINT)-11)
2396 #define DFM_CMD_MODALPROP       ((UINT)-12)
2397 #define DFM_CMD_RENAME          ((UINT)-13)
2398 
2399 /****************************************************************************
2400  * SHCreateDefaultExtractIcon API
2401  */
2402 
2403 HRESULT WINAPI
2404 SHCreateDefaultExtractIcon(
2405   REFIID riid,
2406   void **ppv);
2407 /****************************************************************************
2408  * SHCreateDataObject API
2409  */
2410 
2411 HRESULT WINAPI SHCreateDataObject(
2412   _In_opt_ PCIDLIST_ABSOLUTE pidlFolder,
2413   _In_ UINT cidl,
2414   _In_reads_opt_(cidl) PCUITEMID_CHILD_ARRAY apidl,
2415   _In_opt_ IDataObject *pdtInner,
2416   _In_ REFIID riid,
2417   _Outptr_ void **ppv);
2418 
2419 /****************************************************************************
2420  * CIDLData_CreateFromIDArray API
2421  */
2422 
2423 HRESULT WINAPI CIDLData_CreateFromIDArray(
2424   _In_ PCIDLIST_ABSOLUTE pidlFolder,
2425   _In_ UINT cidl,
2426   _In_reads_opt_(cidl) PCUIDLIST_RELATIVE_ARRAY apidl,
2427   _Outptr_ IDataObject **ppdtobj);
2428 
2429 /****************************************************************************
2430  * SHOpenWithDialog
2431  */
2432 
2433 enum tagOPEN_AS_INFO_FLAGS
2434 {
2435 	OAIF_ALLOW_REGISTRATION = 1,
2436 	OAIF_REGISTER_EXT       = 2,
2437 	OAIF_EXEC               = 4,
2438 	OAIF_FORCE_REGISTRATION = 8,
2439 #if (NTDDI_VERSION >= NTDDI_VISTA)
2440 	OAIF_HIDE_REGISTRATION  = 32,
2441 	OAIF_URL_PROTOCOL       = 64,
2442 #endif
2443 };
2444 typedef int OPEN_AS_INFO_FLAGS;
2445 
2446 
2447 typedef struct tagOPENASINFO {
2448 	LPCWSTR pcszFile;
2449 	LPCWSTR pcszClass;
2450 	OPEN_AS_INFO_FLAGS oaifInFlags;
2451 } OPENASINFO;
2452 
2453 HRESULT
2454 WINAPI
2455 SHOpenWithDialog(
2456   _In_opt_ HWND hwndParent,
2457   _In_ const OPENASINFO *poainfo);
2458 
2459 #define INTERFACE   IShellIconOverlayIdentifier
2460 
2461 DECLARE_INTERFACE_(IShellIconOverlayIdentifier, IUnknown)
2462 {
2463     STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
2464     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
2465     STDMETHOD_(ULONG,Release) (THIS) PURE;
2466 
2467     STDMETHOD (IsMemberOf)(THIS_ _In_ LPCWSTR pwszPath, DWORD dwAttrib) PURE;
2468     STDMETHOD (GetOverlayInfo)(THIS_ _Out_writes_(cchMax) LPWSTR pwszIconFile, int cchMax, _Out_ int * pIndex, _Out_ DWORD * pdwFlags) PURE;
2469     STDMETHOD (GetPriority)(THIS_ _Out_ int * pIPriority) PURE;
2470 };
2471 
2472 #if !defined(__cplusplus) || defined(CINTERFACE)
2473 /*** IUnknown methods ***/
2474 #define IShellIconOverlayIdentifier_QueryInterface(p,a,b)         (p)->lpVtbl->QueryInterface(p,a,b)
2475 #define IShellIconOverlayIdentifier_AddRef(p)                     (p)->lpVtbl->AddRef(p)
2476 #define IShellIconOverlayIdentifier_Release(p)                    (p)->lpVtbl->Release(p)
2477 /*** IShellIconOverlayIdentifier methods ***/
2478 #define IShellIconOverlayIdentifier_IsMemberOf(p,a,b)             (p)->lpVtbl->IsMemberOf(p,a,b)
2479 #define IShellIconOverlayIdentifier_GetOverlayInfo(p,a,b,c,d)     (p)->lpVtbl->GetOverlayInfo(p,a,b,c,d)
2480 #define IShellIconOverlayIdentifier_GetPriority(p,a)              (p)->lpVtbl->GetPriority(p,a)
2481 #endif
2482 
2483 #define ISIOI_ICONFILE  0x00000001
2484 #define ISIOI_ICONINDEX 0x00000002
2485 
2486 #undef INTERFACE
2487 
2488 /****************************************************************************
2489  * Travel log
2490  */
2491 
2492 #define TLOG_BACK  -1
2493 #define TLOG_FORE   1
2494 
2495 #define TLMENUF_INCLUDECURRENT      0x00000001
2496 #define TLMENUF_CHECKCURRENT        (TLMENUF_INCLUDECURRENT | 0x00000002)
2497 #define TLMENUF_BACK                0x00000010  // Default
2498 #define TLMENUF_FORE                0x00000020
2499 #define TLMENUF_BACKANDFORTH        (TLMENUF_BACK | TLMENUF_FORE | TLMENUF_INCLUDECURRENT)
2500 
2501 /*****************************************************************************
2502  * IDockingWindowSite interface
2503  */
2504 #define INTERFACE IDockingWindowSite
2505 DECLARE_INTERFACE_(IDockingWindowSite, IOleWindow)
2506 {
2507     // *** IUnknown methods ***
2508     STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
2509     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
2510     STDMETHOD_(ULONG,Release)(THIS) PURE;
2511 
2512     // *** IOleWindow methods ***
2513     STDMETHOD(GetWindow)(THIS_ HWND *lphwnd) PURE;
2514     STDMETHOD(ContextSensitiveHelp)(THIS_ BOOL fEnterMode) PURE;
2515 
2516     // *** IDockingWindowSite methods ***
2517     STDMETHOD(GetBorderDW)(THIS_ _In_ IUnknown *punkObj, _Out_ LPRECT prcBorder) PURE;
2518     STDMETHOD(RequestBorderSpaceDW)(THIS_ _In_ IUnknown *punkObj, _In_ LPCBORDERWIDTHS pbw) PURE;
2519     STDMETHOD(SetBorderSpaceDW)(THIS_ _In_ IUnknown *punkObj, _In_ LPCBORDERWIDTHS pbw) PURE;
2520 };
2521 #undef INTERFACE
2522 
2523 #if !defined(__cplusplus) || defined(CINTERFACE)
2524 /*** IUnknown methods ***/
2525 #define IDockingWindowSite_QueryInterface(p,a,b)         (p)->lpVtbl->QueryInterface(p,a,b)
2526 #define IDockingWindowSite_AddRef(p)                     (p)->lpVtbl->AddRef(p)
2527 #define IDockingWindowSite_Release(p)                    (p)->lpVtbl->Release(p)
2528 /*** IOleWindow methods ***/
2529 #define IDockingWindowSite_GetWindow(p,a)                (p)->lpVtbl->GetWindow(p,a)
2530 #define IDockingWindowSite_ContextSensitiveHelp(p,a)     (p)->lpVtbl->ContextSensitiveHelp(p,a)
2531 /*** IDockingWindowSite methods ***/
2532 #define IDockingWindowSite_GetBorderDW(p,a,b)            (p)->lpVtbl->GetBorderDW(p,a,b)
2533 #define IDockingWindowSite_RequestBorderSpaceDW(p,a,b)   (p)->lpVtbl->RequestBorderSpaceDW(p,a,b)
2534 #define IDockingWindowSite_SetBorderSpaceDW(p,a,b)       (p)->lpVtbl->SetBorderSpaceDW(p,a,b)
2535 #endif
2536 
2537 typedef void (CALLBACK *PFNASYNCICONTASKBALLBACK)(LPCITEMIDLIST pidl, LPVOID pvData, LPVOID pvHint, INT iIconIndex, INT iOpenIconIndex);
2538 
2539 #define ISFB_MASK_STATE       0x00000001
2540 #define ISFB_MASK_IDLIST      0x00000010
2541 
2542 #define ISFB_STATE_QLINKSMODE 0x00000020
2543 #define ISFB_STATE_NOSHOWTEXT 0x00000004
2544 
2545 #include <pshpack8.h>
2546 
2547 typedef struct {
2548     DWORD       dwMask;
2549     DWORD       dwStateMask;
2550     DWORD       dwState;
2551     COLORREF    crBkgnd;
2552     COLORREF    crBtnLt;
2553     COLORREF    crBtnDk;
2554     WORD        wViewMode;
2555     WORD        wAlign;
2556     IShellFolder * psf;
2557     PIDLIST_ABSOLUTE pidl;
2558 } BANDINFOSFB, *PBANDINFOSFB;
2559 
2560 #include <poppack.h>
2561 
2562 #undef INTERFACE
2563 #define INTERFACE IShellFolderBand
2564 
2565 DECLARE_INTERFACE_(IShellFolderBand, IUnknown)
2566 {
2567     // *** IUnknown methods ***
2568     STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
2569     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
2570     STDMETHOD_(ULONG,Release) (THIS) PURE;
2571 
2572     // *** IShellFolderBand Methods ***
2573     STDMETHOD(InitializeSFB)(THIS_ IShellFolder *psf, PCIDLIST_ABSOLUTE pidl) PURE;
2574     STDMETHOD(SetBandInfoSFB)(THIS_ PBANDINFOSFB pbi) PURE;
2575     STDMETHOD(GetBandInfoSFB)(THIS_ PBANDINFOSFB pbi) PURE;
2576 };
2577 #undef INTERFACE
2578 
2579 
2580 /*****************************************************************************
2581  * Control Panel functions
2582  */
2583 LRESULT WINAPI CallCPLEntry16(HINSTANCE hMod, FARPROC pFunc, HWND dw3, UINT dw4, LPARAM dw5, LPARAM dw6);
2584 
2585 #ifdef __cplusplus
2586 } /* extern "C" */
2587 #endif /* defined(__cplusplus) */
2588 
2589 #endif /* __WINE_SHLOBJ_H */
2590