[HEADERS]
[reactos.git] / reactos / include / reactos / undocshell.h
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 /****************************************************************************
27 * IDList Functions
28 */
29 BOOL WINAPI ILGetDisplayName(
30 LPCITEMIDLIST pidl,
31 LPVOID path);
32
33 /* type parameter for ILGetDisplayNameEx() */
34 #define ILGDN_FORPARSING 0
35 #define ILGDN_NORMAL 1
36 #define ILGDN_INFOLDER 2
37
38 BOOL WINAPI ILGetDisplayNameEx(
39 LPSHELLFOLDER psf,
40 LPCITEMIDLIST pidl,
41 LPVOID path,
42 DWORD type);
43
44 LPITEMIDLIST WINAPI ILGlobalClone(LPCITEMIDLIST pidl);
45 void WINAPI ILGlobalFree(LPITEMIDLIST pidl);
46 LPITEMIDLIST WINAPI SHSimpleIDListFromPathA (LPCSTR lpszPath); //FIXME
47 LPITEMIDLIST WINAPI SHSimpleIDListFromPathW (LPCWSTR lpszPath);
48
49 HRESULT WINAPI SHILCreateFromPathA (
50 LPCSTR path,
51 LPITEMIDLIST * ppidl,
52 DWORD *attributes);
53
54 HRESULT WINAPI SHILCreateFromPathW (
55 LPCWSTR path,
56 LPITEMIDLIST * ppidl,
57 DWORD *attributes);
58
59 /*
60 string functions
61 */
62 BOOL WINAPI StrRetToStrNA(LPSTR,DWORD,LPSTRRET,const ITEMIDLIST*);
63 BOOL WINAPI StrRetToStrNW(LPWSTR,DWORD,LPSTRRET,const ITEMIDLIST*);
64
65
66 /****************************************************************************
67 * SHChangeNotifyRegister API
68 */
69 #define SHCNRF_InterruptLevel 0x0001
70 #define SHCNRF_ShellLevel 0x0002
71 #define SHCNRF_RecursiveInterrupt 0x1000 /* Must be combined with SHCNRF_InterruptLevel */
72 #define SHCNRF_NewDelivery 0x8000 /* Messages use shared memory */
73
74
75 /****************************************************************************
76 * Shell Common Dialogs
77 */
78
79 /* RunFileDlg flags */
80 #define RFF_NOBROWSE 0x01
81 #define RFF_NODEFAULT 0x02
82 #define RFF_CALCDIRECTORY 0x04
83 #define RFF_NOLABEL 0x08
84 #define RFF_NOSEPARATEMEM 0x20 /* NT only */
85
86 #define DE_SAMEFILE 0x71
87 #define DE_DESTSAMETREE 0x7D
88
89 /* RunFileFlg notification structure */
90 typedef struct
91 {
92 NMHDR hdr;
93 LPCSTR lpFile;
94 LPCSTR lpDirectory;
95 int nShow;
96 } NM_RUNFILEDLG, * LPNM_RUNFILEDLG;
97
98 /* RunFileDlg notification return values */
99 #define RF_OK 0x00
100 #define RF_CANCEL 0x01
101 #define RF_RETRY 0x02
102
103 void WINAPI RunFileDlg(
104 HWND hwndOwner,
105 HICON hIcon,
106 LPCWSTR lpstrDirectory,
107 LPCWSTR lpstrTitle,
108 LPCWSTR lpstrDescription,
109 UINT uFlags);
110
111 void WINAPI ExitWindowsDialog(HWND hwndOwner);
112
113 BOOL WINAPI SHFindComputer(
114 LPCITEMIDLIST pidlRoot,
115 LPCITEMIDLIST pidlSavedSearch);
116
117 void WINAPI SHHandleDiskFull(HWND hwndOwner,
118 UINT uDrive);
119
120 int WINAPI SHOutOfMemoryMessageBox(
121 HWND hwndOwner,
122 LPCSTR lpCaption,
123 UINT uType);
124
125 DWORD WINAPI SHNetConnectionDialog(
126 HWND hwndOwner,
127 LPCWSTR lpstrRemoteName,
128 DWORD dwType);
129
130 /****************************************************************************
131 * Cabinet Window Messages
132 */
133
134 #define CWM_SETPATH (WM_USER + 2)
135 #define CWM_WANTIDLE (WM_USER + 3)
136 #define CWM_GETSETCURRENTINFO (WM_USER + 4)
137 #define CWM_SELECTITEM (WM_USER + 5)
138 #define CWM_SELECTITEMSTR (WM_USER + 6)
139 #define CWM_GETISHELLBROWSER (WM_USER + 7)
140 #define CWM_TESTPATH (WM_USER + 9)
141 #define CWM_STATECHANGE (WM_USER + 10)
142 #define CWM_GETPATH (WM_USER + 12)
143
144 #define WM_GETISHELLBROWSER CWM_GETISHELLBROWSER
145
146 /* CWM_TESTPATH types */
147 #define CWTP_ISEQUAL 0
148 #define CWTP_ISCHILD 1
149
150 /* CWM_TESTPATH structure */
151 typedef struct
152 {
153 DWORD dwType;
154 ITEMIDLIST idl;
155 } CWTESTPATHSTRUCT,* LPCWTESTPATHSTRUCT;
156
157 /****************************************************************************
158 * System Imagelist Routines
159 */
160
161 int WINAPI Shell_GetCachedImageIndexA(
162 LPCSTR lpszFileName,
163 int nIconIndex,
164 UINT bSimulateDoc);
165
166 BOOL WINAPI Shell_GetImageLists(
167 HIMAGELIST *lphimlLarge,
168 HIMAGELIST *lphimlSmall);
169
170 HICON WINAPI SHGetFileIcon(
171 DWORD dwReserved,
172 LPCSTR lpszPath,
173 DWORD dwFileAttributes,
174 UINT uFlags);
175
176 BOOL WINAPI FileIconInit(BOOL bFullInit);
177
178 /****************************************************************************
179 * File Menu Routines
180 */
181 /* FileMenu_Create nSelHeight constants */
182 #define FM_DEFAULT_SELHEIGHT -1
183 #define FM_FULL_SELHEIGHT 0
184
185 /* FileMenu_Create flags */
186 #define FMF_SMALL_ICONS 0x00
187 #define FMF_LARGE_ICONS 0x08
188 #define FMF_NO_COLUMN_BREAK 0x10
189
190 HMENU WINAPI FileMenu_Create(
191 COLORREF crBorderColor,
192 int nBorderWidth,
193 HBITMAP hBorderBmp,
194 int nSelHeight,
195 UINT uFlags);
196
197 void WINAPI FileMenu_Destroy(HMENU hMenu);
198
199 /* FileMenu_AppendItem constants */
200 #define FM_SEPARATOR (LPCSTR)1
201 #define FM_BLANK_ICON -1
202 #define FM_DEFAULT_HEIGHT 0
203
204 BOOL WINAPI FileMenu_AppendItem(
205 HMENU hMenu,
206 LPCSTR lpszText,
207 UINT uID,
208 int iIcon,
209 HMENU hMenuPopup,
210 int nItemHeight);
211
212 /* FileMenu_InsertUsingPidl flags */
213 #define FMF_NO_EMPTY_ITEM 0x01
214 #define FMF_NO_PROGRAM_GROUPS 0x04
215
216 /* FileMenu_InsertUsingPidl callback function */
217 typedef void (CALLBACK *LPFNFMCALLBACK)(LPCITEMIDLIST pidlFolder, LPCITEMIDLIST pidlFile);
218
219 int WINAPI FileMenu_InsertUsingPidl(
220 HMENU hMenu,
221 UINT uID,
222 LPCITEMIDLIST pidl,
223 UINT uFlags,
224 UINT uEnumFlags,
225 LPFNFMCALLBACK lpfnCallback);
226
227 int WINAPI FileMenu_ReplaceUsingPidl(
228 HMENU hMenu,
229 UINT uID,
230 LPCITEMIDLIST pidl,
231 UINT uEnumFlags,
232 LPFNFMCALLBACK lpfnCallback);
233
234 void WINAPI FileMenu_Invalidate(HMENU hMenu);
235
236 HMENU WINAPI FileMenu_FindSubMenuByPidl(
237 HMENU hMenu,
238 LPCITEMIDLIST pidl);
239
240 BOOL WINAPI FileMenu_TrackPopupMenuEx(
241 HMENU hMenu,
242 UINT uFlags,
243 int x,
244 int y,
245 HWND hWnd,
246 LPTPMPARAMS lptpm);
247
248 BOOL WINAPI FileMenu_GetLastSelectedItemPidls(
249 UINT uReserved,
250 LPCITEMIDLIST *ppidlFolder,
251 LPCITEMIDLIST *ppidlItem);
252
253 LRESULT WINAPI FileMenu_MeasureItem(
254 HWND hWnd,
255 LPMEASUREITEMSTRUCT lpmis);
256
257 LRESULT WINAPI FileMenu_DrawItem(
258 HWND hWnd,
259 LPDRAWITEMSTRUCT lpdis);
260
261 BOOL WINAPI FileMenu_InitMenuPopup(HMENU hMenu);
262
263 void WINAPI FileMenu_AbortInitMenu(void);
264
265 LRESULT WINAPI FileMenu_HandleMenuChar(
266 HMENU hMenu,
267 WPARAM wParam);
268
269 BOOL WINAPI FileMenu_DeleteAllItems(HMENU hMenu);
270
271 BOOL WINAPI FileMenu_DeleteItemByCmd(
272 HMENU hMenu,
273 UINT uID);
274
275 BOOL WINAPI FileMenu_DeleteItemByIndex(
276 HMENU hMenu,
277 UINT uPos);
278
279 BOOL WINAPI FileMenu_DeleteMenuItemByFirstID(
280 HMENU hMenu,
281 UINT uID);
282
283 BOOL WINAPI FileMenu_DeleteSeparator(HMENU hMenu);
284
285 BOOL WINAPI FileMenu_EnableItemByCmd(
286 HMENU hMenu,
287 UINT uID,
288 BOOL bEnable);
289
290 DWORD WINAPI FileMenu_GetItemExtent(
291 HMENU hMenu,
292 UINT uPos);
293
294 int WINAPI FileMenu_AppendFilesForPidl(
295 HMENU hMenu,
296 LPCITEMIDLIST pidl,
297 BOOL bAddSeparator);
298
299 int WINAPI FileMenu_AddFilesForPidl(
300 HMENU hMenu,
301 UINT uReserved,
302 UINT uID,
303 LPCITEMIDLIST pidl,
304 UINT uFlags,
305 UINT uEnumFlags,
306 LPFNFMCALLBACK lpfnCallback);
307
308 /****************************************************************************
309 * Drag And Drop Routines
310 */
311
312 HRESULT WINAPI SHRegisterDragDrop(
313 HWND hWnd,
314 LPDROPTARGET lpDropTarget);
315
316 HRESULT WINAPI SHRevokeDragDrop(HWND hWnd);
317
318 BOOL WINAPI DAD_DragEnter(HWND hWnd);
319
320 BOOL WINAPI DAD_SetDragImageFromListView(
321 HWND hWnd,
322 POINT pt);
323
324 BOOL WINAPI DAD_ShowDragImage(BOOL bShow);
325
326 /****************************************************************************
327 * Path Manipulation Routines
328 */
329
330 BOOL WINAPI PathAppendAW(LPVOID lpszPath1, LPCVOID lpszPath2);
331
332 LPVOID WINAPI PathCombineAW(LPVOID szDest, LPCVOID lpszDir, LPCVOID lpszFile);
333
334 LPVOID WINAPI PathAddBackslashAW(LPVOID path);
335
336 LPVOID WINAPI PathBuildRootAW(LPVOID lpszPath, int drive);
337
338 LPVOID WINAPI PathFindExtensionAW(LPCVOID path);
339
340 LPVOID WINAPI PathFindFileNameAW(LPCVOID path);
341
342 LPVOID WINAPI PathGetExtensionAW(LPCVOID lpszPath, DWORD void1, DWORD void2);
343
344 LPVOID WINAPI PathGetArgsAW(LPVOID lpszPath);
345
346 BOOL WINAPI PathRemoveFileSpecAW(LPVOID lpszPath);
347
348 void WINAPI PathRemoveBlanksAW(LPVOID lpszPath);
349
350 VOID WINAPI PathQuoteSpacesAW(LPVOID path);
351
352 void WINAPI PathUnquoteSpacesAW(LPVOID lpszPath);
353
354 BOOL WINAPI PathIsUNCAW(LPCVOID lpszPath);
355
356 BOOL WINAPI PathIsRelativeAW(LPCVOID lpszPath);
357
358 BOOL WINAPI PathIsRootAW(LPCVOID x);
359
360 BOOL WINAPI PathIsExeAW(LPCVOID lpszPath);
361
362 BOOL WINAPI PathIsDirectoryAW(LPCVOID lpszPath);
363
364 BOOL WINAPI PathFileExistsAW(LPCVOID lpszPath);
365
366 BOOL WINAPI PathMatchSpecAW(LPVOID lpszPath, LPVOID lpszSpec);
367
368 BOOL WINAPI PathMakeUniqueNameAW(
369 LPVOID lpszBuffer,
370 DWORD dwBuffSize,
371 LPCVOID lpszShortName,
372 LPCVOID lpszLongName,
373 LPCVOID lpszPathName);
374
375 BOOL WINAPI PathYetAnotherMakeUniqueName(
376 LPWSTR lpszBuffer,
377 LPCWSTR lpszPathName,
378 LPCWSTR lpszShortName,
379 LPCWSTR lpszLongName);
380
381 BOOL WINAPI PathQualifyAW(LPCVOID path);
382
383
384 /* PathResolve flags */
385 #define PRF_CHECKEXISTANCE 0x01
386 #define PRF_EXECUTABLE 0x02
387 #define PRF_QUALIFYONPATH 0x04
388 #define PRF_WINDOWS31 0x08
389
390 BOOL WINAPI PathResolveAW(LPVOID lpszPath, LPCVOID *alpszPaths, DWORD dwFlags);
391
392 VOID WINAPI PathSetDlgItemPathAW(HWND hDlg, int nIDDlgItem, LPCVOID lpszPath);
393
394 /* PathProcessCommand flags */
395 #define PPCF_QUOTEPATH 0x01 /* implies PPCF_INCLUDEARGS */
396 #define PPCF_INCLUDEARGS 0x02
397 //#define PPCF_NODIRECTORIES 0x10 move to shlobj
398 #define PPCF_DONTRESOLVE 0x20
399 #define PPCF_PATHISRELATIVE 0x40
400
401 HRESULT WINAPI PathProcessCommandAW(LPCVOID lpszPath, LPVOID lpszBuff,
402 DWORD dwBuffSize, DWORD dwFlags);
403
404 void WINAPI PathStripPathAW(LPVOID lpszPath);
405
406 BOOL WINAPI PathStripToRootAW(LPVOID lpszPath);
407
408 void WINAPI PathRemoveArgsAW(LPVOID lpszPath);
409
410 void WINAPI PathRemoveExtensionAW(LPVOID lpszPath);
411
412 int WINAPI PathParseIconLocationAW(LPVOID lpszPath);
413
414 BOOL WINAPI PathIsSameRootAW(LPCVOID lpszPath1, LPCVOID lpszPath2);
415
416 BOOL WINAPI PathFindOnPathAW(LPVOID sFile, LPCVOID *sOtherDirs);
417
418 /****************************************************************************
419 * Shell Namespace Routines
420 */
421
422 /* Generic structure used by several messages */
423 typedef struct
424 {
425 DWORD dwReserved;
426 DWORD dwReserved2;
427 LPCITEMIDLIST pidl;
428 LPDWORD lpdwUser;
429 } SFVCBINFO, * LPSFVCBINFO;
430 typedef const SFVCBINFO * LPCSFVCBINFO;
431
432 /* SFVCB_SELECTIONCHANGED structure */
433 typedef struct
434 {
435 UINT uOldState;
436 UINT uNewState;
437 LPCITEMIDLIST pidl;
438 LPDWORD lpdwUser;
439 } SFVSELECTSTATE, * LPSFVSELECTSTATE;
440 typedef const SFVSELECTSTATE * LPCSFVSELECTSTATE;
441
442 /* SFVCB_COPYHOOKCALLBACK structure */
443 typedef struct
444 {
445 HWND hwnd;
446 UINT wFunc;
447 UINT wFlags;
448 LPCSTR pszSrcFile;
449 DWORD dwSrcAttribs;
450 LPCSTR pszDestFile;
451 DWORD dwDestAttribs;
452 } SFVCOPYHOOKINFO, * LPSFVCOPYHOOKINFO;
453 typedef const SFVCOPYHOOKINFO * LPCSFVCOPYHOOKINFO;
454
455 /* SFVCB_GETDETAILSOF structure */
456 typedef struct
457 {
458 LPCITEMIDLIST pidl;
459 int fmt;
460 int cx;
461 STRRET lpText;
462 } SFVCOLUMNINFO, * LPSFVCOLUMNINFO;
463
464 /****************************************************************************
465 * Misc Stuff
466 */
467
468 /* SHWaitForFileToOpen flags */
469 #define SHWFF_ADD 0x01
470 #define SHWFF_REMOVE 0x02
471 #define SHWFF_WAIT 0x04
472
473 BOOL WINAPI SHWaitForFileToOpen(
474 LPCITEMIDLIST pidl,
475 DWORD dwFlags,
476 DWORD dwTimeout);
477
478 WORD WINAPI ArrangeWindows(
479 HWND hwndParent,
480 DWORD dwReserved,
481 LPCRECT lpRect,
482 WORD cKids,
483 CONST HWND * lpKids);
484
485 /* RegisterShellHook types */
486 #define RSH_DEREGISTER 0
487 #define RSH_REGISTER 1
488 #define RSH_REGISTER_PROGMAN 2
489 #define RSH_REGISTER_TASKMAN 3
490
491 BOOL WINAPI RegisterShellHook(
492 HWND hWnd,
493 DWORD dwType);
494
495 /* SHCreateDefClassObject callback function */
496 typedef HRESULT (CALLBACK *LPFNCDCOCALLBACK)(
497 LPUNKNOWN pUnkOuter,
498 REFIID riidObject,
499 LPVOID *ppvObject);
500
501 HRESULT WINAPI SHCreateDefClassObject(
502 REFIID riidFactory,
503 LPVOID *ppvFactory,
504 LPFNCDCOCALLBACK lpfnCallback,
505 LPDWORD lpdwUsage,
506 REFIID riidObject);
507
508 void WINAPI SHFreeUnusedLibraries(void);
509
510 /* SHCreateLinks flags */
511 #define SHCLF_PREFIXNAME 0x01
512 #define SHCLF_CREATEONDESKTOP 0x02
513
514 HRESULT WINAPI SHCreateLinks(
515 HWND hWnd,
516 LPCSTR lpszDir,
517 LPDATAOBJECT lpDataObject,
518 UINT uFlags,
519 LPITEMIDLIST *lppidlLinks);
520
521 DWORD WINAPI CheckEscapesA(LPSTR string, DWORD len);
522 DWORD WINAPI CheckEscapesW(LPWSTR string, DWORD len);
523
524 /* policy functions */
525 BOOL WINAPI SHInitRestricted(LPCVOID unused, LPCVOID inpRegKey);
526
527 #define CSIDL_FOLDER_MASK 0x00ff
528
529 /* Utility functions */
530 #include <stdio.h>
531
532 #define SMC_EXEC 4
533 INT WINAPI Shell_GetCachedImageIndex(LPCWSTR szPath, INT nIndex, UINT bSimulateDoc);
534
535 static inline ULONG
536 Win32DbgPrint(const char *filename, int line, const char *lpFormat, ...)
537 {
538 char szMsg[512];
539 char *szMsgStart;
540 const char *fname;
541 va_list vl;
542 ULONG uRet;
543
544 fname = strrchr(filename, '\\');
545 if (fname == NULL)
546 {
547 fname = strrchr(filename, '/');
548 if (fname != NULL)
549 fname++;
550 }
551 else
552 fname++;
553
554 if (fname == NULL)
555 fname = filename;
556
557 szMsgStart = szMsg + sprintf(szMsg, "%s:%d: ", fname, line);
558
559 va_start(vl, lpFormat);
560 uRet = (ULONG) vsprintf(szMsgStart, lpFormat, vl);
561 va_end(vl);
562
563 OutputDebugStringA(szMsg);
564
565 return uRet;
566 }
567
568 #define DbgPrint(fmt, ...) \
569 Win32DbgPrint(__FILE__, __LINE__, fmt, ##__VA_ARGS__)
570
571 static inline void DbgDumpMenuInternal(HMENU hmenu, char* padding, int padlevel)
572 {
573 WCHAR label[128];
574 int i;
575 int count = GetMenuItemCount(hmenu);
576
577 padding[padlevel] = '.';
578 padding[padlevel + 1] = '.';
579 padding[padlevel + 2] = 0;
580
581 for (i = 0; i < count; i++)
582 {
583 MENUITEMINFOW mii = { 0 };
584
585 mii.cbSize = sizeof(mii);
586 mii.fMask = MIIM_STRING | MIIM_FTYPE | MIIM_SUBMENU | MIIM_STATE | MIIM_ID;
587 mii.dwTypeData = label;
588 mii.cch = _countof(label);
589
590 GetMenuItemInfo(hmenu, i, TRUE, &mii);
591
592 if (mii.fType & MFT_BITMAP)
593 DbgPrint("%s%2d - %08x: BITMAP %08p (state=%d, has submenu=%s)\n", padding, i, mii.wID, mii.hbmpItem, mii.fState, mii.hSubMenu ? "TRUE" : "FALSE");
594 else if (mii.fType & MFT_SEPARATOR)
595 DbgPrint("%s%2d - %08x ---SEPARATOR---\n", padding, i, mii.wID);
596 else
597 DbgPrint("%s%2d - %08x: %S (state=%d, has submenu=%s)\n", padding, i, mii.wID, mii.dwTypeData, mii.fState, mii.hSubMenu ? "TRUE" : "FALSE");
598
599 if (mii.hSubMenu)
600 DbgDumpMenuInternal(mii.hSubMenu, padding, padlevel + 2);
601
602 }
603
604 padding[padlevel] = 0;
605 }
606
607 static __inline void DbgDumpMenu(HMENU hmenu)
608 {
609 char padding[128];
610 DbgDumpMenuInternal(hmenu, padding, 0);
611 }
612
613
614 /*****************************************************************************
615 * Shell32 resources
616 */
617 // these resources are in shell32.dll
618 #define IDB_GOBUTTON_NORMAL 0x0e6
619 #define IDB_GOBUTTON_HOT 0x0e7
620
621 // band ids in internet toolbar
622 #define ITBBID_MENUBAND 1
623 #define ITBBID_BRANDBAND 5
624 #define ITBBID_TOOLSBAND 2
625 #define ITBBID_ADDRESSBAND 4
626
627 // commands in the CGID_PrivCITCommands command group handled by the internet toolbar
628 // there seems to be some support for hiding the menubar and an auto hide feature that are
629 // unavailable in the UI
630 #define ITID_TEXTLABELS 3
631 #define ITID_TOOLBARBANDSHOWN 4
632 #define ITID_ADDRESSBANDSHOWN 5
633 #define ITID_LINKSBANDSHOWN 6
634 #define ITID_MENUBANDSHOWN 12
635 #define ITID_AUTOHIDEENABLED 13
636 #define ITID_CUSTOMIZEENABLED 20
637 #define ITID_TOOLBARLOCKED 27
638
639 // commands in the CGID_BrandCmdGroup command group handled by the brand band
640 #define BBID_STARTANIMATION 1
641 #define BBID_STOPANIMATION 2
642
643 // undocumented flags for IShellMenu::SetShellFolder
644 #define SMSET_UNKNOWN08 0x08
645 #define SMSET_UNKNOWN10 0x10
646
647 void WINAPI ShellDDEInit(BOOL bInit);
648 DWORD WINAPI WinList_Init(void);
649
650 IStream* WINAPI SHGetViewStream(LPCITEMIDLIST, DWORD, LPCTSTR, LPCTSTR, LPCTSTR);
651
652 /*****************************************************************************
653 * Shell Link
654 */
655 #include <pshpack1.h>
656
657 typedef struct tagSHELL_LINK_HEADER
658 {
659 /* The size of this structure (always 0x0000004C) */
660 DWORD dwSize;
661 /* CLSID = class identifier (always 00021401-0000-0000-C000-000000000046) */
662 CLSID clsid;
663 /* Flags (SHELL_LINK_DATA_FLAGS) */
664 DWORD dwFlags;
665 /* Informations about the link target: */
666 DWORD dwFileAttributes;
667 FILETIME ftCreationTime;
668 FILETIME ftLastAccessTime;
669 FILETIME ftLastWriteTime;
670 DWORD nFileSizeLow; /* only the least significant 32 bits */
671 /* The index of an icon (signed?) */
672 DWORD nIconIndex;
673 /* The expected window state of an application launched by the link */
674 DWORD nShowCommand;
675 /* The keystrokes used to launch the application */
676 WORD wHotKey;
677 /* Reserved (must be zero) */
678 WORD wReserved1;
679 DWORD dwReserved2;
680 DWORD dwReserved3;
681 } SHELL_LINK_HEADER, *LPSHELL_LINK_HEADER;
682
683 /*****************************************************************************
684 * SHELL_LINK_INFOA/W
685 * If cbHeaderSize == 0x0000001C then use SHELL_LINK_INFOA
686 * If cbHeaderSize >= 0x00000024 then use SHELL_LINK_INFOW
687 */
688 typedef struct tagSHELL_LINK_INFOA
689 {
690 /* Size of the link info data */
691 DWORD cbSize;
692 /* Size of this structure (ANSI: = 0x0000001C) */
693 DWORD cbHeaderSize;
694 /* Specifies which fields are present/populated (SLI_*) */
695 DWORD dwFlags;
696 /* Offset of the VolumeID field (SHELL_LINK_INFO_VOLUME_ID) */
697 DWORD cbVolumeIDOffset;
698 /* Offset of the LocalBasePath field (ANSI, NULL-terminated string) */
699 DWORD cbLocalBasePathOffset;
700 /* Offset of the CommonNetworkRelativeLink field (SHELL_LINK_INFO_CNR_LINK) */
701 DWORD cbCommonNetworkRelativeLinkOffset;
702 /* Offset of the CommonPathSuffix field (ANSI, NULL-terminated string) */
703 DWORD cbCommonPathSuffixOffset;
704 } SHELL_LINK_INFOA, *LPSHELL_LINK_INFOA;
705
706 typedef struct tagSHELL_LINK_INFOW
707 {
708 /* Size of the link info data */
709 DWORD cbSize;
710 /* Size of this structure (Unicode: >= 0x00000024) */
711 DWORD cbHeaderSize;
712 /* Specifies which fields are present/populated (SLI_*) */
713 DWORD dwFlags;
714 /* Offset of the VolumeID field (SHELL_LINK_INFO_VOLUME_ID) */
715 DWORD cbVolumeIDOffset;
716 /* Offset of the LocalBasePath field (ANSI, NULL-terminated string) */
717 DWORD cbLocalBasePathOffset;
718 /* Offset of the CommonNetworkRelativeLink field (SHELL_LINK_INFO_CNR_LINK) */
719 DWORD cbCommonNetworkRelativeLinkOffset;
720 /* Offset of the CommonPathSuffix field (ANSI, NULL-terminated string) */
721 DWORD cbCommonPathSuffixOffset;
722 /* Offset of the LocalBasePathUnicode field (Unicode, NULL-terminated string) */
723 DWORD cbLocalBasePathUnicodeOffset;
724 /* Offset of the CommonPathSuffixUnicode field (Unicode, NULL-terminated string) */
725 DWORD cbCommonPathSuffixUnicodeOffset;
726 } SHELL_LINK_INFOW, *LPSHELL_LINK_INFOW;
727
728 /* VolumeID, LocalBasePath, LocalBasePathUnicode(cbHeaderSize >= 0x24) are present */
729 #define SLI_VALID_LOCAL 0x00000001
730 /* CommonNetworkRelativeLink is present */
731 #define SLI_VALID_NETWORK 0x00000002
732
733 /*****************************************************************************
734 * SHELL_LINK_INFO_VOLUME_IDA/W
735 * If cbVolumeLabelOffset != 0x00000014 (should be 0x00000010) then use
736 * SHELL_LINK_INFO_VOLUME_IDA
737 * If cbVolumeLabelOffset == 0x00000014 then use SHELL_LINK_INFO_VOLUME_IDW
738 */
739 typedef struct tagSHELL_LINK_INFO_VOLUME_IDA
740 {
741 /* Size of the VolumeID field (> 0x00000010) */
742 DWORD cbSize;
743 /* Drive type of the drive the link target is stored on (DRIVE_*) */
744 DWORD dwDriveType;
745 /* Serial number of the volume the link target is stored on */
746 DWORD nDriveSerialNumber;
747 /* Offset of the volume label (ANSI, NULL-terminated string).
748 Must be != 0x00000014 (see tagSHELL_LINK_INFO_VOLUME_IDW) */
749 DWORD cbVolumeLabelOffset;
750 } SHELL_LINK_INFO_VOLUME_IDA, *LPSHELL_LINK_INFO_VOLUME_IDA;
751
752 typedef struct tagSHELL_LINK_INFO_VOLUME_IDW
753 {
754 /* Size of the VolumeID field (> 0x00000010) */
755 DWORD cbSize;
756 /* Drive type of the drive the link target is stored on (DRIVE_*) */
757 DWORD dwDriveType;
758 /* Serial number of the volume the link target is stored on */
759 DWORD nDriveSerialNumber;
760 /* Offset of the volume label (ANSI, NULL-terminated string).
761 If the value of this field is 0x00000014, ignore it and use
762 cbVolumeLabelUnicodeOffset! */
763 DWORD cbVolumeLabelOffset;
764 /* Offset of the volume label (Unicode, NULL-terminated string).
765 If the value of the VolumeLabelOffset field is not 0x00000014,
766 this field must be ignored (==> it doesn't exists ==> ANSI). */
767 DWORD cbVolumeLabelUnicodeOffset;
768 } SHELL_LINK_INFO_VOLUME_IDW, *LPSHELL_LINK_INFO_VOLUME_IDW;
769
770 /*****************************************************************************
771 * SHELL_LINK_INFO_CNR_LINKA/W (CNR = Common Network Relative)
772 * If cbNetNameOffset == 0x00000014 then use SHELL_LINK_INFO_CNR_LINKA
773 * If cbNetNameOffset > 0x00000014 then use SHELL_LINK_INFO_CNR_LINKW
774 */
775 typedef struct tagSHELL_LINK_INFO_CNR_LINKA
776 {
777 /* Size of the CommonNetworkRelativeLink field (>= 0x00000014) */
778 DWORD cbSize;
779 /* Specifies which fields are present/populated (SLI_CNR_*) */
780 DWORD dwFlags;
781 /* Offset of the NetName field (ANSI, NULL–terminated string) */
782 DWORD cbNetNameOffset;
783 /* Offset of the DeviceName field (ANSI, NULL–terminated string) */
784 DWORD cbDeviceNameOffset;
785 /* Type of the network provider (WNNC_NET_* defined in winnetwk.h) */
786 DWORD dwNetworkProviderType;
787 } SHELL_LINK_INFO_CNR_LINKA, *LPSHELL_LINK_INFO_CNR_LINKA;
788
789 typedef struct tagSHELL_LINK_INFO_CNR_LINKW
790 {
791 /* Size of the CommonNetworkRelativeLink field (>= 0x00000014) */
792 DWORD cbSize;
793 /* Specifies which fields are present/populated (SLI_CNR_*) */
794 DWORD dwFlags;
795 /* Offset of the NetName field (ANSI, NULL–terminated string) */
796 DWORD cbNetNameOffset;
797 /* Offset of the DeviceName field (ANSI, NULL–terminated string) */
798 DWORD cbDeviceNameOffset;
799 /* Type of the network provider (WNNC_NET_* defined in winnetwk.h) */
800 DWORD dwNetworkProviderType;
801 /* Offset of the NetNameUnicode field (Unicode, NULL–terminated string) */
802 DWORD cbNetNameUnicodeOffset;
803 /* Offset of the DeviceNameUnicode field (Unicode, NULL–terminated string) */
804 DWORD cbDeviceNameUnicodeOffset;
805 } SHELL_LINK_INFO_CNR_LINKW, *LPSHELL_LINK_INFO_CNR_LINKW;
806
807 /* DeviceName is present */
808 #define SLI_CNR_VALID_DEVICE 0x00000001
809 /* NetworkProviderType is present */
810 #define SLI_CNR_VALID_NET_TYPE 0x00000002
811
812 /*****************************************************************************
813 * Shell Link Extra Data (IShellLinkDataList)
814 */
815 typedef struct tagEXP_TRACKER
816 {
817 /* .cbSize = 0x00000060, .dwSignature = 0xa0000003 */
818 DATABLOCK_HEADER dbh;
819 /* Length >= 0x00000058 */
820 DWORD nLength;
821 /* Must be 0x00000000 */
822 DWORD nVersion;
823 /* NetBIOS name (ANSI, unused bytes are set to zero) */
824 CHAR szMachineID[16]; /* "variable" >= 16 (?) */
825 /* Some GUIDs for the Link Tracking service (from the FS?) */
826 GUID guidDroidVolume;
827 GUID guidDroidObject;
828 GUID guidDroidBirthVolume;
829 GUID guidDroidBirthObject;
830 } EXP_TRACKER, *LPEXP_TRACKER;
831
832 typedef struct tagEXP_SHIM
833 {
834 /* .cbSize >= 0x00000088, .dwSignature = 0xa0000008 */
835 DATABLOCK_HEADER dbh;
836 /* Name of a shim layer to apply (Unicode, unused bytes are set to zero) */
837 WCHAR szwLayerName[64]; /* "variable" >= 64 */
838 } EXP_SHIM, *LPEXP_SHIM;
839
840 typedef struct tagEXP_KNOWN_FOLDER
841 {
842 /* .cbSize = 0x0000001c, .dwSignature = 0xa000000b */
843 DATABLOCK_HEADER dbh;
844 /* A GUID value that identifies a known folder */
845 GUID guidKnownFolder;
846 /* Specifies the location of the ItemID of the first child
847 segment of the IDList specified by guidKnownFolder */
848 DWORD cbOffset;
849 } EXP_KNOWN_FOLDER, *LPEXP_KNOWN_FOLDER;
850
851 typedef struct tagEXP_VISTA_ID_LIST
852 {
853 /* .cbSize >= 0x0000000a, .dwSignature = 0xa000000c */
854 DATABLOCK_HEADER dbh;
855 /* Specifies an alternate IDList that can be used instead
856 of the "normal" IDList (SLDF_HAS_ID_LIST) */
857 /* LPITEMIDLIST pIDList; (variable) */
858 } EXP_VISTA_ID_LIST, *LPEXP_VISTA_ID_LIST;
859
860 #define EXP_TRACKER_SIG 0xa0000003
861 #define EXP_SHIM_SIG 0xa0000008
862 #define EXP_KNOWN_FOLDER_SIG 0xa000000b
863 #define EXP_VISTA_ID_LIST_SIG 0xa000000c
864
865 #include <poppack.h>
866
867 #ifdef __cplusplus
868 } /* extern "C" */
869 #endif /* defined(__cplusplus) */
870
871 #endif /* __WINE_UNDOCSHELL_H */