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