xref: /reactos/sdk/include/reactos/undocshell.h (revision 84df40a1)
1 /*
2  * Copyright 1999, 2000 Juergen Schmied
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_UNDOCSHELL_H
20 #define __WINE_UNDOCSHELL_H
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif /* defined(__cplusplus) */
25 
26 #if (NTDDI_VERSION < NTDDI_LONGHORN)
27 #define DBIMF_NOGRIPPER         0x0800
28 #define DBIMF_ALWAYSGRIPPER     0x1000
29 #define DBIMF_NOMARGINS         0x2000
30 #endif  // NTDDI_LONGHORN
31 
32 #if defined (_SHELLAPI_H) || defined (_INC_SHELLAPI)
33 
34 /****************************************************************************
35  * Taskbar interface WM_COPYDATA structures
36  * See http://www.geoffchappell.com/studies/windows/shell/shell32/api/shlnot/copydata.htm
37  */
38 /* Data structure for Shell_NotifyIcon messages */
39 typedef struct _TRAYNOTIFYDATAW
40 {
41     DWORD dwSignature;
42     DWORD dwMessage;
43     NOTIFYICONDATAW nid; // Always use the latest NOTIFYICONDATAW structure version.
44 } TRAYNOTIFYDATAW, *PTRAYNOTIFYDATAW;
45 // Note: One could also introduce TRAYNOTIFYDATAA
46 
47 #define NI_NOTIFY_SIG 0x34753423 /* TRAYNOTIFYDATA */
48 
49 #endif /* defined (_SHELLAPI_H) || defined (_INC_SHELLAPI) */
50 
51 /****************************************************************************
52  * Taskbar WM_COMMAND identifiers
53  */
54 #define TWM_DOEXITWINDOWS (WM_USER + 342)
55 #define TWM_CYCLEFOCUS (WM_USER + 348)
56 
57 /****************************************************************************
58  * ProgMan messages
59  */
60 #define WM_PROGMAN_OPENSHELLSETTINGS (WM_USER + 22) /* wParam specifies the dialog (and tab page) */
61 #define WM_PROGMAN_SAVESTATE         (WM_USER + 77)
62 
63 /****************************************************************************
64  *  IDList Functions
65  */
66 BOOL WINAPI ILGetDisplayName(
67     LPCITEMIDLIST pidl,
68     LPVOID path);
69 
70 /* type parameter for ILGetDisplayNameEx() */
71 #define ILGDN_FORPARSING  0
72 #define ILGDN_NORMAL      1
73 #define ILGDN_INFOLDER    2
74 
75 BOOL WINAPI ILGetDisplayNameEx(
76     LPSHELLFOLDER psf,
77     LPCITEMIDLIST pidl,
78     LPVOID path,
79     DWORD type);
80 
81 LPITEMIDLIST WINAPI ILGlobalClone(LPCITEMIDLIST pidl);
82 void WINAPI ILGlobalFree(LPITEMIDLIST pidl);
83 LPITEMIDLIST WINAPI SHSimpleIDListFromPathA (LPCSTR lpszPath); //FIXME
84 LPITEMIDLIST WINAPI SHSimpleIDListFromPathW (LPCWSTR lpszPath);
85 
86 HRESULT WINAPI SHILCreateFromPathA (
87     LPCSTR path,
88     LPITEMIDLIST * ppidl,
89     DWORD *attributes);
90 
91 HRESULT WINAPI SHILCreateFromPathW (
92     LPCWSTR path,
93     LPITEMIDLIST * ppidl,
94     DWORD *attributes);
95 
96 HRESULT WINAPI SHInvokeCommand(
97     HWND hWnd,
98     IShellFolder* lpFolder,
99     LPCITEMIDLIST lpApidl,
100     LPCSTR lpVerb);
101 HRESULT WINAPI SHInvokeCommandOnContextMenu(
102     _In_opt_ HWND hWnd,
103     _In_opt_ IUnknown* pUnk,
104     _In_ IContextMenu* pCM,
105     _In_ UINT fCMIC,
106     _In_opt_ LPCSTR pszVerb);
107 BOOL WINAPI IContextMenu_Invoke(
108     _In_ IContextMenu *pContextMenu,
109     _In_ HWND hwnd,
110     _In_ LPCSTR lpVerb,
111     _In_ UINT uFlags);
112 
113 /*
114     string functions
115 */
116 BOOL WINAPI StrRetToStrNA(LPSTR,DWORD,LPSTRRET,const ITEMIDLIST*);
117 BOOL WINAPI StrRetToStrNW(LPWSTR,DWORD,LPSTRRET,const ITEMIDLIST*);
118 
119 /****************************************************************************
120  * SHChangeNotifyRegister API
121  */
122 #define SHCNRF_InterruptLevel       0x0001
123 #define SHCNRF_ShellLevel           0x0002
124 #define SHCNRF_RecursiveInterrupt   0x1000  /* Must be combined with SHCNRF_InterruptLevel */
125 #define SHCNRF_NewDelivery          0x8000  /* Messages use shared memory */
126 
127 /****************************************************************************
128  * SHChangeNotify
129  */
130 
131 typedef struct _SHCNF_PRINTJOB_INFO
132 {
133     DWORD JobId;
134     // More info,,,
135 } SHCNF_PRINTJOB_INFO, *PSHCNF_PRINTJOB_INFO;
136 
137 //
138 // Add missing types for print job notifications.
139 //
140 #define SHCNF_PRINTJOBA 0x0004
141 #define SHCNF_PRINTJOBW 0x0007
142 
143 HRESULT WINAPI SHUpdateRecycleBinIcon(void);
144 
145 /****************************************************************************
146  * Shell Common Dialogs
147  */
148 
149 /* RunFileDlg flags */
150 #define RFF_NOBROWSE        0x01    /* Removes the browse button */
151 #define RFF_NODEFAULT       0x02    /* No default item selected */
152 #define RFF_CALCDIRECTORY   0x04    /* Calculates the working directory from the file name */
153 #define RFF_NOLABEL         0x08    /* Removes the edit box label */
154 #define RFF_NOSEPARATEMEM   0x20    /* Removes the Separate Memory Space check box (Windows NT only) */
155 
156 /* RunFileFlg notification value and structure */
157 #define RFN_VALIDATE    (-510)
158 #if 0 // Deprecated ANSI structure
159 typedef struct _NMRUNFILEDLGA
160 {
161     NMHDR   hdr;
162     LPCSTR  lpFile;
163     LPCSTR  lpDirectory;
164     UINT    nShow;
165 } NMRUNFILEDLGA, *PNMRUNFILEDLGA, *LPNMRUNFILEDLGA;
166 #endif
167 typedef struct _NMRUNFILEDLGW
168 {
169     NMHDR   hdr;
170     LPCWSTR lpFile;
171     LPCWSTR lpDirectory;
172     UINT    nShow;
173 } NMRUNFILEDLGW, *PNMRUNFILEDLGW, *LPNMRUNFILEDLGW;
174 
175 typedef NMRUNFILEDLGW NMRUNFILEDLG;
176 typedef PNMRUNFILEDLGW PNMRUNFILEDLG;
177 typedef LPNMRUNFILEDLGW LPNMRUNFILEDLG;
178 
179 /* RunFileDlg notification return values */
180 #define RF_OK      0x00
181 #define RF_CANCEL  0x01
182 #define RF_RETRY   0x02
183 
184 void WINAPI RunFileDlg(
185     HWND hWndOwner,
186     HICON hIcon,
187     LPCWSTR lpstrDirectory,
188     LPCWSTR lpstrTitle,
189     LPCWSTR lpstrDescription,
190     UINT uFlags);
191 
192 int WINAPI LogoffWindowsDialog(HWND hWndOwner);
193 void WINAPI ExitWindowsDialog(HWND hWndOwner);
194 
195 BOOL WINAPI SHFindComputer(
196     LPCITEMIDLIST pidlRoot,
197     LPCITEMIDLIST pidlSavedSearch);
198 
199 void WINAPI SHHandleDiskFull(HWND hwndOwner,
200     UINT uDrive);
201 
202 int  WINAPI SHOutOfMemoryMessageBox(
203     HWND hwndOwner,
204     LPCSTR lpCaption,
205     UINT uType);
206 
207 HRESULT WINAPI SHShouldShowWizards(_In_ IUnknown *pUnknown);
208 
209 DWORD WINAPI SHNetConnectionDialog(
210     HWND hwndOwner,
211     LPCWSTR lpstrRemoteName,
212     DWORD dwType);
213 
214 BOOL WINAPI SHIsTempDisplayMode(VOID);
215 
216 HRESULT WINAPI
217 SHGetUserDisplayName(
218     _Out_writes_to_(*puSize, *puSize) PWSTR pName,
219     _Inout_ PULONG puSize);
220 
221 /****************************************************************************
222  * Cabinet Window Messages
223  */
224 
225 #define CWM_SETPATH           (WM_USER + 2)
226 #define CWM_WANTIDLE          (WM_USER + 3)
227 #define CWM_GETSETCURRENTINFO (WM_USER + 4)
228 #define CWM_SELECTITEM        (WM_USER + 5)
229 #define CWM_SELECTITEMSTR     (WM_USER + 6)
230 #define CWM_GETISHELLBROWSER  (WM_USER + 7)
231 #define CWM_TESTPATH          (WM_USER + 9)
232 #define CWM_STATECHANGE       (WM_USER + 10)
233 #define CWM_GETPATH           (WM_USER + 12)
234 
235 #define WM_GETISHELLBROWSER CWM_GETISHELLBROWSER
236 
237 /* CWM_TESTPATH types */
238 #define CWTP_ISEQUAL  0
239 #define CWTP_ISCHILD  1
240 
241 /* CWM_TESTPATH structure */
242 typedef struct
243 {
244     DWORD dwType;
245     ITEMIDLIST idl;
246 } CWTESTPATHSTRUCT,* LPCWTESTPATHSTRUCT;
247 
248 /****************************************************************************
249  * System Imagelist Routines
250  */
251 
252 int WINAPI Shell_GetCachedImageIndexA(
253     LPCSTR lpszFileName,
254     int nIconIndex,
255     UINT bSimulateDoc);
256 
257 BOOL WINAPI Shell_GetImageLists(
258     HIMAGELIST *lphimlLarge,
259     HIMAGELIST *lphimlSmall);
260 
261 HICON WINAPI SHGetFileIcon(
262     DWORD dwReserved,
263     LPCSTR lpszPath,
264     DWORD dwFileAttributes,
265     UINT uFlags);
266 
267 BOOL WINAPI FileIconInit(BOOL bFullInit);
268 
269 WORD WINAPI
270 ExtractIconResInfoA(
271     _In_ HANDLE hHandle,
272     _In_ LPCSTR lpFileName,
273     _In_ WORD wIndex,
274     _Out_ LPWORD lpSize,
275     _Out_ LPHANDLE lpIcon);
276 
277 WORD WINAPI
278 ExtractIconResInfoW(
279     _In_ HANDLE hHandle,
280     _In_ LPCWSTR lpFileName,
281     _In_ WORD wIndex,
282     _Out_ LPWORD lpSize,
283     _Out_ LPHANDLE lpIcon);
284 
285 /****************************************************************************
286  * File Menu Routines
287  */
288 
289 /* FileMenu_Create nSelHeight constants */
290 #define FM_DEFAULT_SELHEIGHT  -1
291 #define FM_FULL_SELHEIGHT     0
292 
293 /* FileMenu_Create flags */
294 #define FMF_SMALL_ICONS      0x00
295 #define FMF_LARGE_ICONS      0x08
296 #define FMF_NO_COLUMN_BREAK  0x10
297 
298 HMENU WINAPI FileMenu_Create(
299     COLORREF crBorderColor,
300     int nBorderWidth,
301     HBITMAP hBorderBmp,
302     int nSelHeight,
303     UINT uFlags);
304 
305 void WINAPI FileMenu_Destroy(HMENU hMenu);
306 
307 /* FileMenu_AppendItem constants */
308 #define FM_SEPARATOR       (LPCSTR)1
309 #define FM_BLANK_ICON      -1
310 #define FM_DEFAULT_HEIGHT  0
311 
312 BOOL WINAPI FileMenu_AppendItem(
313     HMENU hMenu,
314     LPCSTR lpszText,
315     UINT uID,
316     int iIcon,
317     HMENU hMenuPopup,
318     int nItemHeight);
319 
320 /* FileMenu_InsertUsingPidl flags */
321 #define FMF_NO_EMPTY_ITEM      0x01
322 #define FMF_NO_PROGRAM_GROUPS  0x04
323 
324 /* FileMenu_InsertUsingPidl callback function */
325 typedef void (CALLBACK *LPFNFMCALLBACK)(LPCITEMIDLIST pidlFolder, LPCITEMIDLIST pidlFile);
326 
327 int WINAPI FileMenu_InsertUsingPidl(
328     HMENU hMenu,
329     UINT uID,
330     LPCITEMIDLIST pidl,
331     UINT uFlags,
332     UINT uEnumFlags,
333     LPFNFMCALLBACK lpfnCallback);
334 
335 int WINAPI FileMenu_ReplaceUsingPidl(
336     HMENU hMenu,
337     UINT uID,
338     LPCITEMIDLIST pidl,
339     UINT uEnumFlags,
340     LPFNFMCALLBACK lpfnCallback);
341 
342 void WINAPI FileMenu_Invalidate(HMENU hMenu);
343 
344 HMENU WINAPI FileMenu_FindSubMenuByPidl(
345     HMENU hMenu,
346     LPCITEMIDLIST pidl);
347 
348 BOOL WINAPI FileMenu_TrackPopupMenuEx(
349     HMENU hMenu,
350     UINT uFlags,
351     int x,
352     int y,
353     HWND hWnd,
354     LPTPMPARAMS lptpm);
355 
356 BOOL WINAPI FileMenu_GetLastSelectedItemPidls(
357     UINT uReserved,
358     LPCITEMIDLIST *ppidlFolder,
359     LPCITEMIDLIST *ppidlItem);
360 
361 LRESULT WINAPI FileMenu_MeasureItem(
362     HWND hWnd,
363     LPMEASUREITEMSTRUCT lpmis);
364 
365 LRESULT WINAPI FileMenu_DrawItem(
366     HWND hWnd,
367     LPDRAWITEMSTRUCT lpdis);
368 
369 BOOL WINAPI FileMenu_InitMenuPopup(HMENU hMenu);
370 
371 void WINAPI FileMenu_AbortInitMenu(void);
372 
373 LRESULT WINAPI FileMenu_HandleMenuChar(
374     HMENU hMenu,
375     WPARAM wParam);
376 
377 BOOL WINAPI FileMenu_DeleteAllItems(HMENU hMenu);
378 
379 BOOL WINAPI FileMenu_DeleteItemByCmd(
380     HMENU hMenu,
381     UINT uID);
382 
383 BOOL WINAPI FileMenu_DeleteItemByIndex(
384     HMENU hMenu,
385     UINT uPos);
386 
387 BOOL WINAPI FileMenu_DeleteMenuItemByFirstID(
388     HMENU hMenu,
389     UINT uID);
390 
391 BOOL WINAPI FileMenu_DeleteSeparator(HMENU hMenu);
392 
393 BOOL WINAPI FileMenu_EnableItemByCmd(
394     HMENU hMenu,
395     UINT uID,
396     BOOL bEnable);
397 
398 DWORD WINAPI FileMenu_GetItemExtent(
399     HMENU hMenu,
400     UINT uPos);
401 
402 int WINAPI FileMenu_AppendFilesForPidl(
403     HMENU hMenu,
404     LPCITEMIDLIST pidl,
405     BOOL bAddSeparator);
406 
407 int WINAPI FileMenu_AddFilesForPidl(
408     HMENU hMenu,
409     UINT uReserved,
410     UINT uID,
411     LPCITEMIDLIST pidl,
412     UINT uFlags,
413     UINT uEnumFlags,
414     LPFNFMCALLBACK lpfnCallback);
415 
416 /****************************************************************************
417  * Drag And Drop Routines
418  */
419 
420 HRESULT WINAPI SHRegisterDragDrop(
421     HWND hWnd,
422     LPDROPTARGET lpDropTarget);
423 
424 HRESULT WINAPI SHRevokeDragDrop(HWND hWnd);
425 
426 BOOL WINAPI DAD_DragEnter(HWND hWnd);
427 
428 BOOL WINAPI DAD_SetDragImageFromListView(
429     HWND hWnd,
430     POINT pt);
431 
432 BOOL WINAPI DAD_ShowDragImage(BOOL bShow);
433 
434 /****************************************************************************
435  * Path Manipulation Routines
436  */
437 
438 BOOL WINAPI PathAppendAW(LPVOID lpszPath1, LPCVOID lpszPath2);
439 
440 LPVOID WINAPI PathCombineAW(LPVOID szDest, LPCVOID lpszDir, LPCVOID lpszFile);
441 
442 LPVOID  WINAPI PathAddBackslashAW(LPVOID path);
443 
444 LPVOID WINAPI PathBuildRootAW(LPVOID lpszPath, int drive);
445 
446 LPVOID WINAPI PathFindExtensionAW(LPCVOID path);
447 
448 LPVOID WINAPI PathFindFileNameAW(LPCVOID path);
449 
450 LPVOID WINAPI PathGetExtensionAW(LPCVOID lpszPath,  DWORD void1, DWORD void2);
451 
452 LPVOID WINAPI PathGetArgsAW(LPVOID lpszPath);
453 
454 BOOL WINAPI PathRemoveFileSpecAW(LPVOID lpszPath);
455 
456 void WINAPI PathRemoveBlanksAW(LPVOID lpszPath);
457 
458 VOID  WINAPI PathQuoteSpacesAW(LPVOID path);
459 
460 void WINAPI PathUnquoteSpacesAW(LPVOID lpszPath);
461 
462 BOOL WINAPI PathIsUNCAW(LPCVOID lpszPath);
463 
464 BOOL WINAPI PathIsRelativeAW(LPCVOID lpszPath);
465 
466 BOOL WINAPI PathIsRootAW(LPCVOID x);
467 
468 BOOL WINAPI PathIsExeAW(LPCVOID lpszPath);
469 
470 BOOL WINAPI PathIsDirectoryAW(LPCVOID lpszPath);
471 
472 BOOL WINAPI PathFileExistsAW(LPCVOID lpszPath);
473 
474 BOOL WINAPI PathMatchSpecAW(LPVOID lpszPath, LPVOID lpszSpec);
475 
476 BOOL WINAPI PathMakeUniqueNameAW(
477     LPVOID lpszBuffer,
478     DWORD dwBuffSize,
479     LPCVOID lpszShortName,
480     LPCVOID lpszLongName,
481     LPCVOID lpszPathName);
482 
483 BOOL WINAPI PathYetAnotherMakeUniqueName(
484     LPWSTR lpszBuffer,
485     LPCWSTR lpszPathName,
486     LPCWSTR lpszShortName,
487     LPCWSTR lpszLongName);
488 
489 VOID WINAPI PathQualifyA(LPSTR pszPath);
490 VOID WINAPI PathQualifyW(LPWSTR pszPath);
491 VOID WINAPI PathQualifyAW(LPVOID path);
492 
493 /* PathResolve flags */
494 #define PRF_CHECKEXISTANCE  0x01
495 #define PRF_EXECUTABLE      0x02
496 #define PRF_QUALIFYONPATH   0x04
497 #define PRF_WINDOWS31       0x08
498 
499 BOOL WINAPI PathResolveA(LPSTR path, LPCSTR *dirs, DWORD flags);
500 BOOL WINAPI PathResolveW(LPWSTR path, LPCWSTR *dirs, DWORD flags);
501 BOOL WINAPI PathResolveAW(LPVOID lpszPath, LPCVOID *alpszPaths, DWORD dwFlags);
502 
503 VOID WINAPI PathSetDlgItemPathAW(HWND hDlg, int nIDDlgItem, LPCVOID lpszPath);
504 
505 /* PathProcessCommand flags */
506 #define PPCF_QUOTEPATH        0x01 /* implies PPCF_INCLUDEARGS */
507 #define PPCF_INCLUDEARGS      0x02
508 //#define PPCF_NODIRECTORIES    0x10 move to shlobj
509 #define PPCF_DONTRESOLVE      0x20
510 #define PPCF_PATHISRELATIVE   0x40
511 
512 HRESULT WINAPI PathProcessCommandAW(LPCVOID lpszPath, LPVOID lpszBuff,
513                                     DWORD dwBuffSize, DWORD dwFlags);
514 
515 void WINAPI PathStripPathAW(LPVOID lpszPath);
516 
517 BOOL WINAPI PathStripToRootAW(LPVOID lpszPath);
518 
519 void WINAPI PathRemoveArgsAW(LPVOID lpszPath);
520 
521 void WINAPI PathRemoveExtensionAW(LPVOID lpszPath);
522 
523 int WINAPI PathParseIconLocationAW(LPVOID lpszPath);
524 
525 BOOL WINAPI PathIsSameRootAW(LPCVOID lpszPath1, LPCVOID lpszPath2);
526 
527 BOOL WINAPI PathFindOnPathAW(LPVOID sFile, LPCVOID *sOtherDirs);
528 
529 BOOL WINAPI PathIsEqualOrSubFolder(_In_ LPCWSTR pszFile1OrCSIDL, _In_ LPCWSTR pszFile2);
530 
531 BOOL WINAPI PathIsTemporaryA(_In_ LPCSTR Str);
532 BOOL WINAPI PathIsTemporaryW(_In_ LPCWSTR Str);
533 
534 /****************************************************************************
535  * Shell File Operations error codes - SHFileOperationA/W
536  */
537 
538 /* Error codes could be pre-Win32 */
539 #define DE_SAMEFILE         0x71
540 #define DE_MANYSRC1DEST     0x72
541 #define DE_DIFFDIR          0x73
542 #define DE_ROOTDIR          0x74
543 #define DE_OPCANCELLED      0x75
544 #define DE_DESTSUBTREE      0x76
545 #define DE_ACCESSDENIEDSRC  0x78
546 #define DE_PATHTOODEEP      0x79
547 #define DE_MANYDEST         0x7A
548 #define DE_INVALIDFILES     0x7C
549 #define DE_DESTSAMETREE     0x7D
550 #define DE_FLDDESTISFILE    0x7E
551 #define DE_FILEDESTISFLD    0x80
552 #define DE_FILENAMETOOLONG  0x81
553 #define DE_DEST_IS_CDROM    0x82
554 #define DE_DEST_IS_DVD      0x83
555 #define DE_DEST_IS_CDRECORD 0x84
556 #define DE_FILE_TOO_LARGE   0x85
557 #define DE_SRC_IS_CDROM     0x86
558 #define DE_SRC_IS_DVD       0x87
559 #define DE_SRC_IS_CDRECORD  0x88
560 // #define DE_ERROR_MAX
561 #define ERRORONDEST         0x10000
562 
563 /****************************************************************************
564  * Shell settings
565  */
566 
567 typedef struct _REGSHELLSTATE
568 {
569     DWORD dwSize;
570     SHELLSTATE ss;
571 } REGSHELLSTATE, *PREGSHELLSTATE;
572 #define REGSHELLSTATE_SIZE 0x24
573 #define REGSHELLSTATE_VERSION 0xD
574 C_ASSERT(sizeof(REGSHELLSTATE) == REGSHELLSTATE_SIZE);
575 
576 /****************************************************************************
577  * Shell Namespace Routines
578  */
579 
580 /* Generic structure used by several messages */
581 typedef struct
582 {
583   DWORD          dwReserved;
584   DWORD          dwReserved2;
585   LPCITEMIDLIST  pidl;
586   LPDWORD        lpdwUser;
587 } SFVCBINFO, * LPSFVCBINFO;
588 typedef const SFVCBINFO * LPCSFVCBINFO;
589 
590 /* SFVCB_SELECTIONCHANGED structure */
591 typedef struct
592 {
593   UINT           uOldState;
594   UINT           uNewState;
595   LPCITEMIDLIST  pidl;
596   LPDWORD        lpdwUser;
597 } SFVSELECTSTATE, * LPSFVSELECTSTATE;
598 typedef const SFVSELECTSTATE * LPCSFVSELECTSTATE;
599 
600 /* SFVCB_COPYHOOKCALLBACK structure */
601 typedef struct
602 {
603   HWND    hwnd;
604   UINT    wFunc;
605   UINT    wFlags;
606   LPCSTR  pszSrcFile;
607   DWORD   dwSrcAttribs;
608   LPCSTR  pszDestFile;
609   DWORD   dwDestAttribs;
610 } SFVCOPYHOOKINFO, * LPSFVCOPYHOOKINFO;
611 typedef const SFVCOPYHOOKINFO * LPCSFVCOPYHOOKINFO;
612 
613 /* SFVCB_GETDETAILSOF structure */
614 typedef struct
615 {
616   LPCITEMIDLIST  pidl;
617   int            fmt;
618   int            cx;
619   STRRET         lpText;
620 } SFVCOLUMNINFO, * LPSFVCOLUMNINFO;
621 
622 /****************************************************************************
623  * Misc Stuff
624  */
625 
626 BOOL WINAPI
627 RegenerateUserEnvironment(LPVOID *lpEnvironment, BOOL bUpdateSelf);
628 
629 /* SHWaitForFileToOpen flags */
630 #define SHWFF_ADD     0x01
631 #define SHWFF_REMOVE  0x02
632 #define SHWFF_WAIT    0x04
633 
634 BOOL WINAPI SHWaitForFileToOpen(
635     LPCITEMIDLIST pidl,
636     DWORD dwFlags,
637     DWORD dwTimeout);
638 
639 WORD WINAPI ArrangeWindows(
640     HWND hwndParent,
641     DWORD dwReserved,
642     LPCRECT lpRect,
643     WORD cKids,
644     CONST HWND * lpKids);
645 
646 /* Flags for ShellExecCmdLine */
647 #define SECL_NO_UI          0x2
648 #define SECL_LOG_USAGE      0x8
649 #define SECL_USE_IDLIST     0x10
650 #define SECL_ALLOW_NONEXE   0x20
651 #define SECL_RUNAS          0x40
652 
653 HRESULT WINAPI ShellExecCmdLine(
654     HWND hwnd,
655     LPCWSTR pwszCommand,
656     LPCWSTR pwszStartDir,
657     int nShow,
658     LPVOID pUnused,
659     DWORD dwSeclFlags);
660 
661 HINSTANCE WINAPI
662 RealShellExecuteA(
663     _In_opt_ HWND hwnd,
664     _In_opt_ LPCSTR lpOperation,
665     _In_opt_ LPCSTR lpFile,
666     _In_opt_ LPCSTR lpParameters,
667     _In_opt_ LPCSTR lpDirectory,
668     _In_opt_ LPSTR lpReturn,
669     _In_opt_ LPCSTR lpTitle,
670     _In_opt_ LPVOID lpReserved,
671     _In_ INT nCmdShow,
672     _Out_opt_ PHANDLE lphProcess);
673 
674 HINSTANCE WINAPI
675 RealShellExecuteW(
676     _In_opt_ HWND hwnd,
677     _In_opt_ LPCWSTR lpOperation,
678     _In_opt_ LPCWSTR lpFile,
679     _In_opt_ LPCWSTR lpParameters,
680     _In_opt_ LPCWSTR lpDirectory,
681     _In_opt_ LPWSTR lpReturn,
682     _In_opt_ LPCWSTR lpTitle,
683     _In_opt_ LPVOID lpReserved,
684     _In_ INT nCmdShow,
685     _Out_opt_ PHANDLE lphProcess);
686 
687 HINSTANCE WINAPI
688 RealShellExecuteExA(
689     _In_opt_ HWND hwnd,
690     _In_opt_ LPCSTR lpOperation,
691     _In_opt_ LPCSTR lpFile,
692     _In_opt_ LPCSTR lpParameters,
693     _In_opt_ LPCSTR lpDirectory,
694     _In_opt_ LPSTR lpReturn,
695     _In_opt_ LPCSTR lpTitle,
696     _In_opt_ LPVOID lpReserved,
697     _In_ INT nCmdShow,
698     _Out_opt_ PHANDLE lphProcess,
699     _In_ DWORD dwFlags);
700 
701 HINSTANCE WINAPI
702 RealShellExecuteExW(
703     _In_opt_ HWND hwnd,
704     _In_opt_ LPCWSTR lpOperation,
705     _In_opt_ LPCWSTR lpFile,
706     _In_opt_ LPCWSTR lpParameters,
707     _In_opt_ LPCWSTR lpDirectory,
708     _In_opt_ LPWSTR lpReturn,
709     _In_opt_ LPCWSTR lpTitle,
710     _In_opt_ LPVOID lpReserved,
711     _In_ INT nCmdShow,
712     _Out_opt_ PHANDLE lphProcess,
713     _In_ DWORD dwFlags);
714 
715 VOID WINAPI
716 ShellExec_RunDLL(
717     _In_opt_ HWND hwnd,
718     _In_opt_ HINSTANCE hInstance,
719     _In_ PCSTR pszCmdLine,
720     _In_ INT nCmdShow);
721 
722 VOID WINAPI
723 ShellExec_RunDLLA(
724     _In_opt_ HWND hwnd,
725     _In_opt_ HINSTANCE hInstance,
726     _In_ PCSTR pszCmdLine,
727     _In_ INT nCmdShow);
728 
729 VOID WINAPI
730 ShellExec_RunDLLW(
731     _In_opt_ HWND hwnd,
732     _In_opt_ HINSTANCE hInstance,
733     _In_ PCWSTR pszCmdLine,
734     _In_ INT nCmdShow);
735 
736 /* RegisterShellHook types */
737 #define RSH_DEREGISTER        0
738 #define RSH_REGISTER          1
739 #define RSH_REGISTER_PROGMAN  2
740 #define RSH_REGISTER_TASKMAN  3
741 
742 BOOL WINAPI RegisterShellHook(
743     HWND hWnd,
744     DWORD dwType);
745 
746 /* SHCreateDefClassObject callback function */
747 typedef HRESULT (CALLBACK *LPFNCDCOCALLBACK)(
748     LPUNKNOWN pUnkOuter,
749     REFIID riidObject,
750     LPVOID *ppvObject);
751 
752 HRESULT WINAPI SHCreateDefClassObject(
753     REFIID riidFactory,
754     LPVOID *ppvFactory,
755     LPFNCDCOCALLBACK lpfnCallback,
756     LPDWORD lpdwUsage,
757     REFIID riidObject);
758 
759 void WINAPI SHFreeUnusedLibraries(void);
760 
761 /* SHCreateLinks flags */
762 #define SHCLF_PREFIXNAME       0x01
763 #define SHCLF_CREATEONDESKTOP  0x02
764 
765 HRESULT WINAPI SHCreateLinks(
766     HWND hWnd,
767     LPCSTR lpszDir,
768     LPDATAOBJECT lpDataObject,
769     UINT uFlags,
770     LPITEMIDLIST *lppidlLinks);
771 
772 VOID WINAPI CheckEscapesA(LPSTR string, DWORD len);
773 VOID WINAPI CheckEscapesW(LPWSTR string, DWORD len);
774 
775 /* policy functions */
776 BOOL WINAPI SHInitRestricted(LPCVOID unused, LPCVOID inpRegKey);
777 
778 #define CSIDL_FOLDER_MASK   0x00ff
779 
780 /* Utility functions */
781 #include <stdio.h>
782 
783 #define SMC_EXEC 4
784 INT WINAPI Shell_GetCachedImageIndex(LPCWSTR szPath, INT nIndex, UINT bSimulateDoc);
785 
786 HRESULT WINAPI SHCreatePropertyBag(_In_ REFIID riid, _Out_ void **ppvObj);
787 HRESULT WINAPI SHLimitInputCombo(HWND hWnd, IShellFolder *psf);
788 HRESULT WINAPI SHGetImageList(int iImageList, REFIID riid, void **ppv);
789 
790 BOOL WINAPI GUIDFromStringA(
791     _In_   PCSTR psz,
792     _Out_  LPGUID pguid);
793 BOOL WINAPI GUIDFromStringW(
794     _In_   PCWSTR psz,
795     _Out_  LPGUID pguid);
796 
797 PSTR WINAPI
798 StrRStrA(
799     _In_ PCSTR pszSrc,
800     _In_opt_ PCSTR pszLast,
801     _In_ PCSTR pszSearch);
802 
803 PWSTR WINAPI
804 StrRStrW(
805     _In_ PCWSTR pszSrc,
806     _In_opt_ PCWSTR pszLast,
807     _In_ PCWSTR pszSearch);
808 
809 LPSTR WINAPI SheRemoveQuotesA(LPSTR psz);
810 LPWSTR WINAPI SheRemoveQuotesW(LPWSTR psz);
811 
812 /* Flags for Int64ToString and LargeIntegerToString */
813 #define FMT_USE_NUMDIGITS 0x01
814 #define FMT_USE_LEADZERO  0x02
815 #define FMT_USE_GROUPING  0x04
816 #define FMT_USE_DECIMAL   0x08
817 #define FMT_USE_THOUSAND  0x10
818 #define FMT_USE_NEGNUMBER 0x20
819 
820 INT WINAPI
821 Int64ToString(
822     _In_ LONGLONG llValue,
823     _Out_writes_z_(cchOut) LPWSTR pszOut,
824     _In_ UINT cchOut,
825     _In_ BOOL bUseFormat,
826     _In_opt_ const NUMBERFMTW *pNumberFormat,
827     _In_ DWORD dwNumberFlags);
828 
829 INT WINAPI
830 LargeIntegerToString(
831     _In_ const LARGE_INTEGER *pLargeInt,
832     _Out_writes_z_(cchOut) LPWSTR pszOut,
833     _In_ UINT cchOut,
834     _In_ BOOL bUseFormat,
835     _In_opt_ const NUMBERFMTW *pNumberFormat,
836     _In_ DWORD dwNumberFlags);
837 
838 LPWSTR WINAPI
839 ShortSizeFormatW(
840     _In_ DWORD dwNumber,
841     _Out_writes_(0x8FFF) LPWSTR pszBuffer);
842 
843 BOOL WINAPI SHOpenEffectiveToken(_Out_ LPHANDLE phToken);
844 DWORD WINAPI SHGetUserSessionId(_In_opt_ HANDLE hToken);
845 
846 typedef HRESULT (CALLBACK *PRIVILEGED_FUNCTION)(LPARAM lParam);
847 
848 HRESULT WINAPI
849 SHInvokePrivilegedFunctionW(
850     _In_z_ LPCWSTR pszName,
851     _In_ PRIVILEGED_FUNCTION fn,
852     _In_opt_ LPARAM lParam);
853 
854 BOOL WINAPI
855 SHTestTokenPrivilegeW(_In_opt_ HANDLE hToken, _In_z_ LPCWSTR lpName);
856 BOOL WINAPI IsSuspendAllowed(VOID);
857 
858 BOOL WINAPI
859 Activate_RunDLL(
860     _In_ HWND hwnd,
861     _In_ HINSTANCE hinst,
862     _In_ LPCWSTR cmdline,
863     _In_ INT cmdshow);
864 
865 BOOL WINAPI SHSettingsChanged(LPCVOID unused, LPCWSTR pszKey);
866 
867 /*****************************************************************************
868  * Shell32 resources
869  */
870 // these resources are in shell32.dll
871 #define IDB_GOBUTTON_NORMAL         0x0e6
872 #define IDB_GOBUTTON_HOT            0x0e7
873 
874 // band ids in internet toolbar
875 #define ITBBID_MENUBAND             1
876 #define ITBBID_BRANDBAND            5
877 #define ITBBID_TOOLSBAND            2
878 #define ITBBID_ADDRESSBAND          4
879 
880 // commands in the CGID_PrivCITCommands command group handled by the internet toolbar
881 // there seems to be some support for hiding the menubar and an auto hide feature that are
882 // unavailable in the UI
883 #define ITID_TEXTLABELS             3
884 #define ITID_TOOLBARBANDSHOWN       4
885 #define ITID_ADDRESSBANDSHOWN       5
886 #define ITID_LINKSBANDSHOWN         6
887 #define ITID_MENUBANDSHOWN          12
888 #define ITID_AUTOHIDEENABLED        13
889 #define ITID_CUSTOMIZEENABLED       20
890 #define ITID_TOOLBARLOCKED          27
891 
892 // commands in the CGID_BrandCmdGroup command group handled by the brand band
893 #define BBID_STARTANIMATION         1
894 #define BBID_STOPANIMATION          2
895 
896 // undocumented flags for IShellMenu::SetShellFolder
897 #define SMSET_UNKNOWN08             0x08
898 #define SMSET_UNKNOWN10             0x10
899 
900 // explorer tray commands
901 #define TRAYCMD_STARTMENU           305
902 #define TRAYCMD_RUN_DIALOG          401
903 #define TRAYCMD_LOGOFF_DIALOG       402
904 #define TRAYCMD_CASCADE             403
905 #define TRAYCMD_TILE_H              404
906 #define TRAYCMD_TILE_V              405
907 #define TRAYCMD_TOGGLE_DESKTOP      407
908 #define TRAYCMD_DATE_AND_TIME       408
909 #define TRAYCMD_TASKBAR_PROPERTIES  413
910 #define TRAYCMD_MINIMIZE_ALL        415
911 #define TRAYCMD_RESTORE_ALL         416
912 #define TRAYCMD_SHOW_DESKTOP        419
913 #define TRAYCMD_SHOW_TASK_MGR       420
914 #define TRAYCMD_CUSTOMIZE_TASKBAR   421
915 #define TRAYCMD_LOCK_TASKBAR        424
916 #define TRAYCMD_HELP_AND_SUPPORT    503
917 #define TRAYCMD_CONTROL_PANEL       505
918 #define TRAYCMD_SHUTDOWN_DIALOG     506
919 #define TRAYCMD_PRINTERS_AND_FAXES  510
920 #define TRAYCMD_LOCK_DESKTOP        517
921 #define TRAYCMD_SWITCH_USER_DIALOG  5000
922 #define TRAYCMD_SEARCH_FILES        41093
923 #define TRAYCMD_SEARCH_COMPUTERS    41094
924 
925 // Explorer Tray Application Bar Data Message Commands
926 #define TABDMC_APPBAR     0
927 #define TABDMC_NOTIFY     1
928 #define TABDMC_LOADINPROC 2
929 
930 void WINAPI ShellDDEInit(BOOL bInit);
931 DWORD WINAPI WinList_Init(void);
932 
933 IStream* WINAPI SHGetViewStream(LPCITEMIDLIST, DWORD, LPCTSTR, LPCTSTR, LPCTSTR);
934 
935 HRESULT WINAPI SHCreateSessionKey(REGSAM samDesired, PHKEY phKey);
936 
937 LONG WINAPI SHRegQueryValueExA(
938     HKEY hkey,
939     LPCSTR lpValueName,
940     LPDWORD lpReserved,
941     LPDWORD lpType,
942     LPBYTE lpData,
943     LPDWORD lpcbData);
944 LONG WINAPI SHRegQueryValueExW(
945     HKEY hkey,
946     LPCWSTR pszValue,
947     LPDWORD pdwReserved,
948     LPDWORD pdwType,
949     LPVOID pvData,
950     LPDWORD pcbData);
951 #ifdef UNICODE
952     #define SHRegQueryValueEx SHRegQueryValueExW
953 #else
954     #define SHRegQueryValueEx SHRegQueryValueExA
955 #endif
956 
957 BOOL WINAPI
958 SHIsBadInterfacePtr(
959     _In_ LPCVOID pv,
960     _In_ UINT_PTR ucb);
961 
962 HRESULT WINAPI
963 CopyStreamUI(
964     _In_ IStream *pSrc,
965     _Out_ IStream *pDst,
966     _Inout_opt_ IProgressDialog *pProgress,
967     _In_opt_ DWORDLONG dwlSize);
968 
969 // Flags for SHGetComputerDisplayNameW
970 #define SHGCDN_NOCACHE 0x1
971 #define SHGCDN_NOSERVERNAME 0x10000
972 
973 HRESULT WINAPI
974 SHGetComputerDisplayNameW(
975     _In_opt_ LPWSTR pszServerName,
976     _In_ DWORD dwFlags,
977     _Out_writes_z_(cchNameMax) LPWSTR pszName,
978     _In_ DWORD cchNameMax);
979 
980 /*****************************************************************************
981  * INVALID_FILETITLE_CHARACTERS
982  */
983 
984 #define INVALID_FILETITLE_CHARACTERSA "\\/:*?\"<>|"
985 #define INVALID_FILETITLE_CHARACTERSW L"\\/:*?\"<>|"
986 
987 #ifdef UNICODE
988     #define INVALID_FILETITLE_CHARACTERS INVALID_FILETITLE_CHARACTERSW
989 #else
990     #define INVALID_FILETITLE_CHARACTERS INVALID_FILETITLE_CHARACTERSA
991 #endif
992 
993 /*****************************************************************************
994  * Shell Link
995  */
996 #include <pshpack1.h>
997 
998 typedef struct tagSHELL_LINK_HEADER
999 {
1000     /* The size of this structure (always 0x0000004C) */
1001     DWORD dwSize;
1002     /* CLSID = class identifier (always 00021401-0000-0000-C000-000000000046) */
1003     CLSID clsid;
1004     /* Flags (SHELL_LINK_DATA_FLAGS) */
1005     DWORD dwFlags;
1006     /* Informations about the link target: */
1007     DWORD dwFileAttributes;
1008     FILETIME ftCreationTime;
1009     FILETIME ftLastAccessTime;
1010     FILETIME ftLastWriteTime;
1011     DWORD nFileSizeLow; /* only the least significant 32 bits */
1012     /* The index of an icon (signed?) */
1013     DWORD nIconIndex;
1014     /* The expected window state of an application launched by the link */
1015     DWORD nShowCommand;
1016     /* The keystrokes used to launch the application */
1017     WORD wHotKey;
1018     /* Reserved (must be zero) */
1019     WORD wReserved1;
1020     DWORD dwReserved2;
1021     DWORD dwReserved3;
1022 } SHELL_LINK_HEADER, *LPSHELL_LINK_HEADER;
1023 
1024 /*****************************************************************************
1025  * SHELL_LINK_INFOA/W
1026  * If cbHeaderSize == 0x0000001C then use SHELL_LINK_INFOA
1027  * If cbHeaderSize >= 0x00000024 then use SHELL_LINK_INFOW
1028  */
1029 typedef struct tagSHELL_LINK_INFOA
1030 {
1031     /* Size of the link info data */
1032     DWORD cbSize;
1033     /* Size of this structure (ANSI: = 0x0000001C) */
1034     DWORD cbHeaderSize;
1035     /* Specifies which fields are present/populated (SLI_*) */
1036     DWORD dwFlags;
1037     /* Offset of the VolumeID field (SHELL_LINK_INFO_VOLUME_ID) */
1038     DWORD cbVolumeIDOffset;
1039     /* Offset of the LocalBasePath field (ANSI, NULL-terminated string) */
1040     DWORD cbLocalBasePathOffset;
1041     /* Offset of the CommonNetworkRelativeLink field (SHELL_LINK_INFO_CNR_LINK) */
1042     DWORD cbCommonNetworkRelativeLinkOffset;
1043     /* Offset of the CommonPathSuffix field (ANSI, NULL-terminated string) */
1044     DWORD cbCommonPathSuffixOffset;
1045 } SHELL_LINK_INFOA, *LPSHELL_LINK_INFOA;
1046 
1047 typedef struct tagSHELL_LINK_INFOW
1048 {
1049     /* Size of the link info data */
1050     DWORD cbSize;
1051     /* Size of this structure (Unicode: >= 0x00000024) */
1052     DWORD cbHeaderSize;
1053     /* Specifies which fields are present/populated (SLI_*) */
1054     DWORD dwFlags;
1055     /* Offset of the VolumeID field (SHELL_LINK_INFO_VOLUME_ID) */
1056     DWORD cbVolumeIDOffset;
1057     /* Offset of the LocalBasePath field (ANSI, NULL-terminated string) */
1058     DWORD cbLocalBasePathOffset;
1059     /* Offset of the CommonNetworkRelativeLink field (SHELL_LINK_INFO_CNR_LINK) */
1060     DWORD cbCommonNetworkRelativeLinkOffset;
1061     /* Offset of the CommonPathSuffix field (ANSI, NULL-terminated string) */
1062     DWORD cbCommonPathSuffixOffset;
1063     /* Offset of the LocalBasePathUnicode field (Unicode, NULL-terminated string) */
1064     DWORD cbLocalBasePathUnicodeOffset;
1065     /* Offset of the CommonPathSuffixUnicode field (Unicode, NULL-terminated string) */
1066     DWORD cbCommonPathSuffixUnicodeOffset;
1067 } SHELL_LINK_INFOW, *LPSHELL_LINK_INFOW;
1068 
1069 /* VolumeID, LocalBasePath, LocalBasePathUnicode(cbHeaderSize >= 0x24) are present */
1070 #define SLI_VALID_LOCAL   0x00000001
1071 /* CommonNetworkRelativeLink is present */
1072 #define SLI_VALID_NETWORK 0x00000002
1073 
1074 /*****************************************************************************
1075  * SHELL_LINK_INFO_VOLUME_IDA/W
1076  * If cbVolumeLabelOffset != 0x00000014 (should be 0x00000010) then use
1077  * SHELL_LINK_INFO_VOLUME_IDA
1078  * If cbVolumeLabelOffset == 0x00000014 then use SHELL_LINK_INFO_VOLUME_IDW
1079  */
1080 typedef struct tagSHELL_LINK_INFO_VOLUME_IDA
1081 {
1082     /* Size of the VolumeID field (> 0x00000010) */
1083     DWORD cbSize;
1084     /* Drive type of the drive the link target is stored on (DRIVE_*) */
1085     DWORD dwDriveType;
1086     /* Serial number of the volume the link target is stored on */
1087     DWORD nDriveSerialNumber;
1088     /* Offset of the volume label (ANSI, NULL-terminated string).
1089        Must be != 0x00000014 (see tagSHELL_LINK_INFO_VOLUME_IDW) */
1090     DWORD cbVolumeLabelOffset;
1091 } SHELL_LINK_INFO_VOLUME_IDA, *LPSHELL_LINK_INFO_VOLUME_IDA;
1092 
1093 typedef struct tagSHELL_LINK_INFO_VOLUME_IDW
1094 {
1095     /* Size of the VolumeID field (> 0x00000010) */
1096     DWORD cbSize;
1097     /* Drive type of the drive the link target is stored on (DRIVE_*) */
1098     DWORD dwDriveType;
1099     /* Serial number of the volume the link target is stored on */
1100     DWORD nDriveSerialNumber;
1101     /* Offset of the volume label (ANSI, NULL-terminated string).
1102        If the value of this field is 0x00000014, ignore it and use
1103        cbVolumeLabelUnicodeOffset! */
1104     DWORD cbVolumeLabelOffset;
1105     /* Offset of the volume label (Unicode, NULL-terminated string).
1106        If the value of the VolumeLabelOffset field is not 0x00000014,
1107        this field must be ignored (==> it doesn't exists ==> ANSI). */
1108     DWORD cbVolumeLabelUnicodeOffset;
1109 } SHELL_LINK_INFO_VOLUME_IDW, *LPSHELL_LINK_INFO_VOLUME_IDW;
1110 
1111 /*****************************************************************************
1112  * SHELL_LINK_INFO_CNR_LINKA/W (CNR = Common Network Relative)
1113  * If cbNetNameOffset == 0x00000014 then use SHELL_LINK_INFO_CNR_LINKA
1114  * If cbNetNameOffset > 0x00000014 then use SHELL_LINK_INFO_CNR_LINKW
1115  */
1116 typedef struct tagSHELL_LINK_INFO_CNR_LINKA
1117 {
1118     /* Size of the CommonNetworkRelativeLink field (>= 0x00000014) */
1119     DWORD cbSize;
1120     /* Specifies which fields are present/populated (SLI_CNR_*) */
1121     DWORD dwFlags;
1122     /* Offset of the NetName field (ANSI, NULL–terminated string) */
1123     DWORD cbNetNameOffset;
1124     /* Offset of the DeviceName field (ANSI, NULL–terminated string) */
1125     DWORD cbDeviceNameOffset;
1126     /* Type of the network provider (WNNC_NET_* defined in winnetwk.h) */
1127     DWORD dwNetworkProviderType;
1128 } SHELL_LINK_INFO_CNR_LINKA, *LPSHELL_LINK_INFO_CNR_LINKA;
1129 
1130 typedef struct tagSHELL_LINK_INFO_CNR_LINKW
1131 {
1132     /* Size of the CommonNetworkRelativeLink field (>= 0x00000014) */
1133     DWORD cbSize;
1134     /* Specifies which fields are present/populated (SLI_CNR_*) */
1135     DWORD dwFlags;
1136     /* Offset of the NetName field (ANSI, NULL–terminated string) */
1137     DWORD cbNetNameOffset;
1138     /* Offset of the DeviceName field (ANSI, NULL–terminated string) */
1139     DWORD cbDeviceNameOffset;
1140     /* Type of the network provider (WNNC_NET_* defined in winnetwk.h) */
1141     DWORD dwNetworkProviderType;
1142     /* Offset of the NetNameUnicode field (Unicode, NULL–terminated string) */
1143     DWORD cbNetNameUnicodeOffset;
1144     /* Offset of the DeviceNameUnicode field (Unicode, NULL–terminated string) */
1145     DWORD cbDeviceNameUnicodeOffset;
1146 } SHELL_LINK_INFO_CNR_LINKW, *LPSHELL_LINK_INFO_CNR_LINKW;
1147 
1148 /* DeviceName is present */
1149 #define SLI_CNR_VALID_DEVICE   0x00000001
1150 /* NetworkProviderType is present */
1151 #define SLI_CNR_VALID_NET_TYPE 0x00000002
1152 
1153 /*****************************************************************************
1154  * Shell Link Extra Data (IShellLinkDataList)
1155  */
1156 typedef struct tagEXP_TRACKER
1157 {
1158     /* .cbSize = 0x00000060, .dwSignature = 0xa0000003 */
1159     DATABLOCK_HEADER dbh;
1160     /* Length >= 0x00000058 */
1161     DWORD nLength;
1162     /* Must be 0x00000000 */
1163     DWORD nVersion;
1164     /* NetBIOS name (ANSI, unused bytes are set to zero) */
1165     CHAR szMachineID[16]; /* "variable" >= 16 (?) */
1166     /* Some GUIDs for the Link Tracking service (from the FS?) */
1167     GUID guidDroidVolume;
1168     GUID guidDroidObject;
1169     GUID guidDroidBirthVolume;
1170     GUID guidDroidBirthObject;
1171 } EXP_TRACKER, *LPEXP_TRACKER;
1172 
1173 typedef struct tagEXP_SHIM
1174 {
1175     /* .cbSize >= 0x00000088, .dwSignature = 0xa0000008 */
1176     DATABLOCK_HEADER dbh;
1177     /* Name of a shim layer to apply (Unicode, unused bytes are set to zero) */
1178     WCHAR szwLayerName[64]; /* "variable" >= 64 */
1179 } EXP_SHIM, *LPEXP_SHIM;
1180 
1181 typedef struct tagEXP_KNOWN_FOLDER
1182 {
1183     /* .cbSize = 0x0000001c, .dwSignature = 0xa000000b */
1184     DATABLOCK_HEADER dbh;
1185     /* A GUID value that identifies a known folder */
1186     GUID guidKnownFolder;
1187     /* Specifies the location of the ItemID of the first child
1188        segment of the IDList specified by guidKnownFolder */
1189     DWORD cbOffset;
1190 } EXP_KNOWN_FOLDER, *LPEXP_KNOWN_FOLDER;
1191 
1192 typedef struct tagEXP_VISTA_ID_LIST
1193 {
1194     /* .cbSize >= 0x0000000a, .dwSignature = 0xa000000c */
1195     DATABLOCK_HEADER dbh;
1196     /* Specifies an alternate IDList that can be used instead
1197        of the "normal" IDList (SLDF_HAS_ID_LIST) */
1198     /* LPITEMIDLIST pIDList; (variable) */
1199 } EXP_VISTA_ID_LIST, *LPEXP_VISTA_ID_LIST;
1200 
1201 #define EXP_TRACKER_SIG       0xa0000003
1202 #define EXP_SHIM_SIG          0xa0000008
1203 #define EXP_KNOWN_FOLDER_SIG  0xa000000b
1204 #define EXP_VISTA_ID_LIST_SIG 0xa000000c
1205 
1206 /* Not compatible yet */
1207 typedef struct SFVM_CUSTOMVIEWINFO_DATA
1208 {
1209     ULONG cbSize;
1210     HBITMAP hbmBack;
1211     COLORREF clrText;
1212     COLORREF clrTextBack;
1213 } SFVM_CUSTOMVIEWINFO_DATA, *LPSFVM_CUSTOMVIEWINFO_DATA;
1214 
1215 #include <poppack.h>
1216 
1217 #ifdef __cplusplus
1218 } /* extern "C" */
1219 #endif /* defined(__cplusplus) */
1220 
1221 #endif /* __WINE_UNDOCSHELL_H */
1222