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