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