ReactOS 0.4.17-dev-970-gcf0f1a6
shellord.c
Go to the documentation of this file.
1/*
2 * The parameters of many functions changes between different OS versions
3 * (NT uses Unicode strings, 95 uses ASCII strings)
4 *
5 * Copyright 1997 Marcus Meissner
6 * 1998 Jürgen Schmied
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 */
22
23#include <wine/config.h>
24
25#define WIN32_NO_STATUS
26#define _INC_WINDOWS
27#define COBJMACROS
28
29#include <windef.h>
30#include <winbase.h>
31#include <wine/winternl.h>
32#include <shlobj.h>
33#include <undocshell.h>
34#include <shlwapi.h>
35#include <commdlg.h>
36#include <commoncontrols.h>
37#include "../shellrecyclebin/recyclebin.h"
38
39#include <wine/debug.h>
40#include <wine/unicode.h>
41
42#include "pidl.h"
43#include "shell32_main.h"
44
47
48#ifdef __REACTOS__
49#include <comctl32_undoc.h>
50#include <shlwapi_undoc.h>
51#else
52/* FIXME: !!! move CREATEMRULIST and flags to header file !!! */
53/* !!! it is in both here and comctl32undoc.c !!! */
54typedef struct tagCREATEMRULIST
55{
56 DWORD cbSize; /* size of struct */
57 DWORD nMaxItems; /* max no. of items in list */
58 DWORD dwFlags; /* see below */
59 HKEY hKey; /* root reg. key under which list is saved */
60 LPCSTR lpszSubKey; /* reg. subkey */
61 int (CALLBACK *lpfnCompare)(LPCVOID, LPCVOID, DWORD); /* item compare proc */
63
64/* dwFlags */
65#define MRUF_STRING_LIST 0 /* list will contain strings */
66#define MRUF_BINARY_LIST 1 /* list will contain binary data */
67#define MRUF_DELAYED_SAVE 2 /* only save list order to reg. is FreeMRUList */
68
70extern VOID WINAPI FreeMRUList(HANDLE hMRUList);
72extern INT WINAPI FindMRUData(HANDLE hList, LPCVOID lpData, DWORD cbData, LPINT lpRegNum);
73extern INT WINAPI EnumMRUListA(HANDLE hList, INT nItemPos, LPVOID lpBuffer, DWORD nBufferSize);
74#endif
75
79
80/*************************************************************************
81 * ParseFieldA [internal]
82 *
83 * copies a field from a ',' delimited string
84 *
85 * first field is nField = 1
86 */
88 LPCSTR src,
89 DWORD nField,
90 LPSTR dst,
91 DWORD len)
92{
93 WARN("(%s,0x%08x,%p,%d) semi-stub.\n",debugstr_a(src),nField,dst,len);
94
95 if (!src || !src[0] || !dst || !len)
96 return 0;
97
98 /* skip n fields delimited by ',' */
99 while (nField > 1)
100 {
101 if (*src=='\0') return FALSE;
102 if (*(src++)==',') nField--;
103 }
104
105 /* copy part till the next ',' to dst */
106 while ( *src!='\0' && *src!=',' && (len--)>0 ) *(dst++)=*(src++);
107
108 /* finalize the string */
109 *dst=0x0;
110
111 return TRUE;
112}
113
114/*************************************************************************
115 * ParseFieldW [internal]
116 *
117 * copies a field from a ',' delimited string
118 *
119 * first field is nField = 1
120 */
122{
123 WARN("(%s,0x%08x,%p,%d) semi-stub.\n", debugstr_w(src), nField, dst, len);
124
125 if (!src || !src[0] || !dst || !len)
126 return 0;
127
128 /* skip n fields delimited by ',' */
129 while (nField > 1)
130 {
131 if (*src == 0x0) return FALSE;
132 if (*src++ == ',') nField--;
133 }
134
135 /* copy part till the next ',' to dst */
136 while ( *src != 0x0 && *src != ',' && (len--)>0 ) *(dst++) = *(src++);
137
138 /* finalize the string */
139 *dst = 0x0;
140
141 return TRUE;
142}
143
144/*************************************************************************
145 * ParseField [SHELL32.58]
146 */
148{
149 if (SHELL_OsIsUnicode())
150 return ParseFieldW(src, nField, dst, len);
151 return ParseFieldA(src, nField, dst, len);
152}
153
154/*************************************************************************
155 * GetFileNameFromBrowse [SHELL32.63]
156 *
157 */
159 HWND hwndOwner,
160 LPWSTR lpstrFile,
161 UINT nMaxFile,
162 LPCWSTR lpstrInitialDir,
163 LPCWSTR lpstrDefExt,
164 LPCWSTR lpstrFilter,
165 LPCWSTR lpstrTitle)
166{
167typedef BOOL (WINAPI *GetOpenFileNameProc)(OPENFILENAMEW *ofn);
169 GetOpenFileNameProc pGetOpenFileNameW;
171 BOOL ret;
172
173 TRACE("%p, %s, %d, %s, %s, %s, %s)\n",
174 hwndOwner, debugstr_w(lpstrFile), nMaxFile, lpstrInitialDir, lpstrDefExt,
175 lpstrFilter, lpstrTitle);
176
177 hmodule = LoadLibraryW(L"comdlg32.dll");
178 if(!hmodule) return FALSE;
179 pGetOpenFileNameW = (GetOpenFileNameProc)GetProcAddress(hmodule, "GetOpenFileNameW");
180 if(!pGetOpenFileNameW)
181 {
183 return FALSE;
184 }
185
186 memset(&ofn, 0, sizeof(ofn));
187
188 ofn.lStructSize = sizeof(ofn);
189 ofn.hwndOwner = hwndOwner;
190 ofn.lpstrFilter = lpstrFilter;
191 ofn.lpstrFile = lpstrFile;
192 ofn.nMaxFile = nMaxFile;
193 ofn.lpstrInitialDir = lpstrInitialDir;
194 ofn.lpstrTitle = lpstrTitle;
195 ofn.lpstrDefExt = lpstrDefExt;
197 ret = pGetOpenFileNameW(&ofn);
198
200 return ret;
201}
202
203#ifdef __REACTOS__
204BOOL SHELL_GlobalCounterChanged(LONG *pCounter, SHELL_GCOUNTER_DECLAREPARAMETERS(handle, id))
205{
207 if (*pCounter == count)
208 return FALSE;
209 *pCounter = count;
210 return TRUE;
211}
212
216SHELL_GCOUNTER_DEFINE_GUID(SHGCGUID_ShellState, 0x7cb834f0, 0x527b, 0x11d2, 0x9d, 0x1f, 0x00, 0x00, 0xf8, 0x05, 0xca, 0x57);
217SHELL_GCOUNTER_DEFINE_HANDLE(g_hShellState);
218#define SHELL_GCOUNTER_SHELLSTATE SHELL_GCOUNTER_PARAMETERS(g_hShellState, GLOBALCOUNTER_SHELLSETTINGSCHANGED)
219static LONG g_ShellStateCounter = 0;
220static UINT g_CachedSSF = 0;
221static REGSHELLSTATE g_ShellState;
222enum { ssf_autocheckselect = 0x00800000, ssf_iconsonly = 0x01000000,
223 ssf_showtypeoverlay = 0x02000000, ssf_showstatusbar = 0x04000000 };
224#endif //__REACTOS__
225
226/*************************************************************************
227 * SHGetSetSettings [SHELL32.68]
228 */
230{
231#ifdef __REACTOS__
232 const DWORD inverted = SSF_SHOWEXTENSIONS;
233 LPSHELLSTATE gpss = &g_ShellState.ss;
234 HKEY hKeyAdv;
235
236 if (!SHELL_GlobalCounterIsInitialized(g_hShellState))
237 {
238 SHELL_GlobalCounterCreate(&SHGCGUID_ShellState, g_hShellState);
239 }
240
241 if (!lpss)
242 {
243 SHELL_GlobalCounterIncrement(SHELL_GCOUNTER_SHELLSTATE);
244 return;
245 }
246
247 hKeyAdv = SHGetShellKey(SHKEY_Root_HKCU | SHKEY_Key_Explorer, L"Advanced", bSet);
248 if (!hKeyAdv && bSet)
249 return;
250
251#define SSF_STRUCTONLY (SSF_NOCONFIRMRECYCLE | SSF_DOUBLECLICKINWEBVIEW | SSF_DESKTOPHTML | \
252 SSF_WIN95CLASSIC | SSF_SORTCOLUMNS | SSF_STARTPANELON)
253#define SSF_ALL (0x07FFFFFF & ~0x40)
254#define SSF_IMPLEMENTED ((SSF_ALL) & ~(SSF_SERVERADMINUI)) // SERVERADMINUI is written by Explorer and read by IsOS()
255#define SHGSS_GetSetStruct(getsetmacro) \
256 do { \
257 getsetmacro(fNoConfirmRecycle, SSF_NOCONFIRMRECYCLE); \
258 getsetmacro(fDoubleClickInWebView, SSF_DOUBLECLICKINWEBVIEW); \
259 getsetmacro(fDesktopHTML, SSF_DESKTOPHTML); \
260 getsetmacro(fWin95Classic, SSF_WIN95CLASSIC); \
261 getsetmacro(lParamSort, SSF_SORTCOLUMNS); \
262 getsetmacro(iSortDirection, SSF_SORTCOLUMNS); \
263 getsetmacro(fStartPanelOn, SSF_STARTPANELON); \
264 } while (0)
265#define SHGSS_GetSetAdv(getsetmacro) \
266 do { \
267 getsetmacro(L"HideFileExt", fShowExtensions, SSF_SHOWEXTENSIONS); \
268 getsetmacro(L"ShowCompColor", fShowCompColor, SSF_SHOWCOMPCOLOR); \
269 getsetmacro(L"DontPrettyPath", fDontPrettyPath, SSF_DONTPRETTYPATH); \
270 getsetmacro(L"ShowAttribCol", fShowAttribCol, SSF_SHOWATTRIBCOL); \
271 getsetmacro(L"MapNetDrvBtn", fMapNetDrvBtn, SSF_MAPNETDRVBUTTON); \
272 getsetmacro(L"ShowInfoTip", fShowInfoTip, SSF_SHOWINFOTIP); \
273 getsetmacro(L"HideIcons", fHideIcons, SSF_HIDEICONS); \
274 getsetmacro(L"WebView", fWebView, SSF_WEBVIEW); \
275 getsetmacro(L"Filter", fFilter, SSF_FILTER); \
276 getsetmacro(L"ShowSuperHidden", fShowSuperHidden, SSF_SHOWSUPERHIDDEN); \
277 getsetmacro(L"NoNetCrawling", fNoNetCrawling, SSF_NONETCRAWLING); \
278 getsetmacro(L"SeparateProcess", fSepProcess, SSF_SEPPROCESS); \
279 getsetmacro(L"AutoCheckSelect", fAutoCheckSelect, ssf_autocheckselect); \
280 getsetmacro(L"IconsOnly", fIconsOnly, ssf_iconsonly); \
281 getsetmacro(L"ShowTypeOverlay", fShowTypeOverlay, ssf_showtypeoverlay); \
282 getsetmacro(L"ShowStatusBar", fShowStatusBar, ssf_showstatusbar); \
283 } while (0)
284
285 if (bSet)
286 {
287 DWORD changed = 0, notcached = ~g_CachedSSF & SSF_IMPLEMENTED;
288 if (notcached & ~dwMask)
289 {
290 // All entries in gpss have to be initialized (except the item we are about to set) because we are about to write the whole struct to the registry
291 SHELLSTATE tempstate;
292 SHGetSetSettings(&tempstate, notcached & ~dwMask, FALSE); // Read entries that are not in gpss/g_CachedSSF
293 }
294
295#define SHGSS_WriteAdv(name, value, SSF) \
296 do { \
297 DWORD val = (value), cb = sizeof(DWORD); \
298 if (SHSetValueW(hKeyAdv, NULL, (name), REG_DWORD, &val, cb) == ERROR_SUCCESS) \
299 { \
300 ++changed; \
301 } \
302 } while (0)
303#define SHGSS_SetAdv(name, field, SSF) \
304 do { \
305 if ((dwMask & (SSF)) && gpss->field != lpss->field) \
306 { \
307 const DWORD bitval = (gpss->field = lpss->field); \
308 SHGSS_WriteAdv((name), ((SSF) & inverted) ? !bitval : !!bitval, (SSF)); \
309 } \
310 } while (0)
311#define SHGSS_SetStruct(field, SSF) \
312 do { \
313 if ((dwMask & (SSF)) && gpss->field != lpss->field) \
314 { \
315 gpss->field = lpss->field; \
316 ++changed; \
317 } \
318 } while (0)
319
320 if ((dwMask & SSF_SHOWALLOBJECTS) && gpss->fShowAllObjects != lpss->fShowAllObjects)
321 {
322 gpss->fShowAllObjects = lpss->fShowAllObjects;
323 SHGSS_WriteAdv(L"Hidden", lpss->fShowAllObjects ? 1 : 2, SSF_SHOWALLOBJECTS);
324 }
325 SHGSS_SetStruct(fShowSysFiles, SSF_SHOWSYSFILES);
326 SHGSS_GetSetAdv(SHGSS_SetAdv);
327 SHGSS_GetSetStruct(SHGSS_SetStruct);
328 if (changed)
329 {
330 if ((dwMask & SSF_SHOWSUPERHIDDEN) && (DLL_EXPORT_VERSION) < _WIN32_WINNT_VISTA)
331 {
332 // This is probably a Windows bug but write this alternative name just in case someone reads it
333 DWORD val = gpss->fShowSuperHidden != FALSE;
334 SHSetValueW(hKeyAdv, NULL, L"SuperHidden", REG_DWORD, &val, sizeof(val));
335 }
336 SHELL32_WriteRegShellState(&g_ShellState); // Write the new SHELLSTATE
337 SHGetSetSettings(NULL, 0, TRUE); // Invalidate counter
338 SHSendMessageBroadcastW(WM_SETTINGCHANGE, 0, (LPARAM)L"ShellState"); // Notify everyone
339 }
340 }
341 else
342 {
343 DWORD read = 0, data, cb, dummy = 0;
345 if (SHELL_GlobalCounterChanged(&g_ShellStateCounter, SHELL_GCOUNTER_SHELLSTATE))
346 g_CachedSSF = 0;
347
348#define SHGSS_ReadAdv(name, SSF) ( \
349 (g_CachedSSF & (SSF)) != (SSF) && (cb = sizeof(DWORD)) != 0 && \
350 SHQueryValueEx(hKeyAdv, (name), NULL, NULL, &data, &cb) == ERROR_SUCCESS && \
351 cb == sizeof(DWORD) && (read |= (SSF)) != 0 )
352#define SHGSS_GetFieldHelper(field, SSF, src, dst, cachevar) \
353 do { \
354 if (dwMask & (SSF)) \
355 { \
356 (dst)->field = (src)->field; \
357 cachevar |= (SSF); \
358 } \
359 } while (0)
360#define SHGSS_CacheField(field, SSF) SHGSS_GetFieldHelper(field, (SSF), &rss.ss, gpss, read)
361#define SHGSS_GetField(field, SSF) SHGSS_GetFieldHelper(field, (SSF), gpss, lpss, dummy)
362#define SHGSS_GetAdv(name, field, SSF) \
363 do { \
364 if (SHGSS_ReadAdv((name), (SSF))) \
365 gpss->field = ((SSF) & inverted) ? data == FALSE : data != FALSE; \
366 SHGSS_GetFieldHelper(field, (SSF), gpss, lpss, read); \
367 } while (0)
368
369 if (SHGSS_ReadAdv(L"Hidden", SSF_SHOWALLOBJECTS | SSF_SHOWSYSFILES))
370 {
371 gpss->fShowAllObjects = data == 1;
372 gpss->fShowSysFiles = data > 1;
373 }
374 SHGSS_GetField(fShowAllObjects, SSF_SHOWALLOBJECTS);
375 SHGSS_GetField(fShowSysFiles, SSF_SHOWSYSFILES);
376 SHGSS_GetSetAdv(SHGSS_GetAdv);
377 if (dwMask & ~(read | g_CachedSSF))
378 {
379 REGSHELLSTATE rss;
381 {
382 SHGSS_GetSetStruct(SHGSS_CacheField); // Copy the requested items to gpss
383 }
384 else
385 {
387 read = 0; // The advanced items we read are no longer valid in gpss
388 g_CachedSSF = SSF_STRUCTONLY;
389 /* HACKFIX: This should not be needed. Defaults should be used
390 * until an override option is selected. See CORE-20585. */
391 rss.ss = *gpss;
393 }
394 }
395 SHGSS_GetSetStruct(SHGSS_GetField); // Copy requested items from gpss to output
396 g_CachedSSF |= read;
397 }
398 if (hKeyAdv)
399 RegCloseKey(hKeyAdv);
400#else
401 if(bSet)
402 {
403 FIXME("%p 0x%08x TRUE\n", lpss, dwMask);
404 }
405 else
406 {
407 SHGetSettings((LPSHELLFLAGSTATE)lpss,dwMask);
408 }
409#endif //__REACTOS__
410}
411
412/*************************************************************************
413 * SHGetSettings [SHELL32.@]
414 *
415 * NOTES
416 * the registry path are for win98 (tested)
417 * and possibly are the same in nt40
418 *
419 */
421{
422#ifdef __REACTOS__
425 *lpsfs = *(LPSHELLFLAGSTATE)&ss;
426 if (dwMask & SSF_HIDEICONS)
427 lpsfs->fHideIcons = ss.fHideIcons;
428 if (dwMask & ssf_autocheckselect)
429 lpsfs->fAutoCheckSelect = ss.fAutoCheckSelect;
430 if (dwMask & ssf_iconsonly)
431 lpsfs->fIconsOnly = ss.fIconsOnly;
432#else
433 HKEY hKey;
435 DWORD dwDataSize = sizeof (DWORD);
436
437 TRACE("(%p 0x%08x)\n",lpsfs,dwMask);
438
439 if (RegCreateKeyExA(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
440 0, 0, 0, KEY_ALL_ACCESS, 0, &hKey, 0))
441 return;
442
443 if ( (SSF_SHOWEXTENSIONS & dwMask) && !RegQueryValueExA(hKey, "HideFileExt", 0, 0, (LPBYTE)&dwData, &dwDataSize))
444 lpsfs->fShowExtensions = ((dwData == 0) ? 0 : 1);
445
446 if ( (SSF_SHOWINFOTIP & dwMask) && !RegQueryValueExA(hKey, "ShowInfoTip", 0, 0, (LPBYTE)&dwData, &dwDataSize))
447 lpsfs->fShowInfoTip = ((dwData == 0) ? 0 : 1);
448
449 if ( (SSF_DONTPRETTYPATH & dwMask) && !RegQueryValueExA(hKey, "DontPrettyPath", 0, 0, (LPBYTE)&dwData, &dwDataSize))
450 lpsfs->fDontPrettyPath = ((dwData == 0) ? 0 : 1);
451
452 if ( (SSF_HIDEICONS & dwMask) && !RegQueryValueExA(hKey, "HideIcons", 0, 0, (LPBYTE)&dwData, &dwDataSize))
453 lpsfs->fHideIcons = ((dwData == 0) ? 0 : 1);
454
455 if ( (SSF_MAPNETDRVBUTTON & dwMask) && !RegQueryValueExA(hKey, "MapNetDrvBtn", 0, 0, (LPBYTE)&dwData, &dwDataSize))
456 lpsfs->fMapNetDrvBtn = ((dwData == 0) ? 0 : 1);
457
458 if ( (SSF_SHOWATTRIBCOL & dwMask) && !RegQueryValueExA(hKey, "ShowAttribCol", 0, 0, (LPBYTE)&dwData, &dwDataSize))
459 lpsfs->fShowAttribCol = ((dwData == 0) ? 0 : 1);
460
461 if (((SSF_SHOWALLOBJECTS | SSF_SHOWSYSFILES) & dwMask) && !RegQueryValueExA(hKey, "Hidden", 0, 0, (LPBYTE)&dwData, &dwDataSize))
462 { if (dwData == 0)
463 { if (SSF_SHOWALLOBJECTS & dwMask) lpsfs->fShowAllObjects = 0;
464 if (SSF_SHOWSYSFILES & dwMask) lpsfs->fShowSysFiles = 0;
465 }
466 else if (dwData == 1)
467 { if (SSF_SHOWALLOBJECTS & dwMask) lpsfs->fShowAllObjects = 1;
468 if (SSF_SHOWSYSFILES & dwMask) lpsfs->fShowSysFiles = 0;
469 }
470 else if (dwData == 2)
471 { if (SSF_SHOWALLOBJECTS & dwMask) lpsfs->fShowAllObjects = 0;
472 if (SSF_SHOWSYSFILES & dwMask) lpsfs->fShowSysFiles = 1;
473 }
474 }
476#endif //__REACTOS__
477 TRACE("-- 0x%04x\n", *(WORD*)lpsfs);
478}
479
480/*************************************************************************
481 * SHShellFolderView_Message [SHELL32.73]
482 *
483 * Send a message to an explorer cabinet window.
484 *
485 * PARAMS
486 * hwndCabinet [I] The window containing the shellview to communicate with
487 * dwMessage [I] The SFVM message to send
488 * dwParam [I] Message parameter
489 *
490 * RETURNS
491 * fixme.
492 *
493 * NOTES
494 * Message SFVM_REARRANGE = 1
495 *
496 * This message gets sent when a column gets clicked to instruct the
497 * shell view to re-sort the item list. dwParam identifies the column
498 * that was clicked.
499 */
501 HWND hwndCabinet,
502 UINT uMessage,
504{
505 FIXME("%p %08x %08lx stub\n",hwndCabinet, uMessage, lParam);
506 return 0;
507}
508
509/*************************************************************************
510 * RegisterShellHook [SHELL32.181]
511 *
512 * Register a shell hook.
513 *
514 * PARAMS
515 * hwnd [I] Window handle
516 * dwType [I] Type of hook.
517 *
518 * NOTES
519 * Exported by ordinal
520 */
522 HWND hWnd,
523 DWORD dwType)
524{
525 if (dwType == 3)
526 {
529 }
530 else if (dwType == 0)
531 {
533 }
534
535 ERR("Unsupported argument");
536 return FALSE;
537}
538
539/*************************************************************************
540 * ShellMessageBoxW [SHELL32.182]
541 *
542 * See ShellMessageBoxA.
543 *
544 */
545#ifdef __REACTOS__
546/*
547 * shell32.ShellMessageBoxW directly redirects to shlwapi.ShellMessageBoxWrapW,
548 * while shell32.ShellMessageBoxA is a copy-paste ANSI adaptation of the
549 * shlwapi.ShellMessageBoxWrapW function.
550 *
551 * From Vista+ onwards, all the implementation of ShellMessageBoxA/W that
552 * were existing in shell32 has been completely moved to shlwapi, so that
553 * shell32.ShellMessageBoxA and shell32.ShellMessageBoxW are redirections
554 * to the corresponding shlwapi functions.
555 *
556 */
557#else // !__REACTOS__
558/*
559 * NOTE:
560 * shlwapi.ShellMessageBoxWrapW is a duplicate of shell32.ShellMessageBoxW
561 * because we can't forward to it in the .spec file since it's exported by
562 * ordinal. If you change the implementation here please update the code in
563 * shlwapi as well.
564 */
565// Wine version, broken.
568 HWND hWnd,
569 LPCWSTR lpText,
570 LPCWSTR lpCaption,
571 UINT uType,
572 ...)
573{
574 WCHAR szText[100],szTitle[100];
575 LPCWSTR pszText = szText, pszTitle = szTitle;
576 LPWSTR pszTemp;
578 int ret;
579
580 __ms_va_start(args, uType);
581 /* wvsprintfA(buf,fmt, args); */
582
583 TRACE("(%p,%p,%p,%p,%08x)\n",
584 hInstance,hWnd,lpText,lpCaption,uType);
585
586 if (IS_INTRESOURCE(lpCaption))
588 else
589 pszTitle = lpCaption;
590
591 if (IS_INTRESOURCE(lpText))
592 LoadStringW(hInstance, LOWORD(lpText), szText, ARRAY_SIZE(szText));
593 else
594 pszText = lpText;
595
597 pszText, 0, 0, (LPWSTR)&pszTemp, 0, &args);
598
600
601 ret = MessageBoxW(hWnd,pszTemp,pszTitle,uType);
602 LocalFree(pszTemp);
603 return ret;
604}
605#endif
606
607/*************************************************************************
608 * ShellMessageBoxA [SHELL32.183]
609 *
610 * Format and output an error message.
611 *
612 * PARAMS
613 * hInstance [I] Instance handle of message creator
614 * hWnd [I] Window handle of message creator
615 * lpText [I] Resource Id of title or LPSTR
616 * lpCaption [I] Resource Id of title or LPSTR
617 * uType [I] Type of error message
618 *
619 * RETURNS
620 * A return value from MessageBoxA().
621 *
622 * NOTES
623 * Exported by ordinal
624 */
625#ifdef __REACTOS__
626/*
627 * Note that we cannot straightforwardly implement ShellMessageBoxA around
628 * ShellMessageBoxW, by converting some parameters from ANSI to UNICODE,
629 * because there may be some variadic ANSI strings, associated with '%s'
630 * printf-like formatters inside the format string, that would also need
631 * to be converted; however there is no way for us to find these and perform
632 * the conversion ourselves.
633 * Therefore, we re-implement ShellMessageBoxA by doing a copy-paste ANSI
634 * adaptation of the shlwapi.ShellMessageBoxWrapW function.
635 */
636#endif
639 HWND hWnd,
640 LPCSTR lpText,
641 LPCSTR lpCaption,
642 UINT uType,
643 ...)
644{
645#ifdef __REACTOS__
646 CHAR *szText = NULL, szTitle[100];
647 LPCSTR pszText, pszTitle = szTitle;
648 LPSTR pszTemp;
650 int ret;
651
652 __ms_va_start(args, uType);
653
654 TRACE("(%p,%p,%p,%p,%08x)\n", hInstance, hWnd, lpText, lpCaption, uType);
655
656 if (IS_INTRESOURCE(lpCaption))
658 else
659 pszTitle = lpCaption;
660
661 if (IS_INTRESOURCE(lpText))
662 {
663 /* Retrieve the length of the Unicode string and obtain the maximum
664 * possible length for the corresponding ANSI string (not counting
665 * any possible NULL-terminator). */
666 const WCHAR *ptr;
667 UINT len = LoadStringW(hInstance, LOWORD(lpText), (LPWSTR)&ptr, 0);
668
670 NULL, 0, NULL, NULL);
671
672 if (len)
673 {
674 szText = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(CHAR));
675 if (szText) LoadStringA(hInstance, LOWORD(lpText), szText, len + 1);
676 }
677 pszText = szText;
678 if (!pszText) {
679 WARN("Failed to load id %d\n", LOWORD(lpText));
681 return 0;
682 }
683 }
684 else
685 pszText = lpText;
686
688 pszText, 0, 0, (LPSTR)&pszTemp, 0, &args);
689
691
692 ret = MessageBoxA(hWnd, pszTemp, pszTitle, uType | MB_SETFOREGROUND);
693
694 HeapFree(GetProcessHeap(), 0, szText);
695 LocalFree(pszTemp);
696 return ret;
697
698#else // __REACTOS__
699
700// Wine version, broken.
701 char szText[100],szTitle[100];
702 LPCSTR pszText = szText, pszTitle = szTitle;
703 LPSTR pszTemp;
705 int ret;
706
707 __ms_va_start(args, uType);
708 /* wvsprintfA(buf,fmt, args); */
709
710 TRACE("(%p,%p,%p,%p,%08x)\n",
711 hInstance,hWnd,lpText,lpCaption,uType);
712
713 if (IS_INTRESOURCE(lpCaption))
714 LoadStringA(hInstance, LOWORD(lpCaption), szTitle, sizeof(szTitle));
715 else
716 pszTitle = lpCaption;
717
718 if (IS_INTRESOURCE(lpText))
719 LoadStringA(hInstance, LOWORD(lpText), szText, sizeof(szText));
720 else
721 pszText = lpText;
722
724 pszText, 0, 0, (LPSTR)&pszTemp, 0, &args);
725
727
728 ret = MessageBoxA(hWnd,pszTemp,pszTitle,uType);
729 LocalFree(pszTemp);
730 return ret;
731#endif
732}
733
734/*************************************************************************
735 * SHRegisterDragDrop [SHELL32.86]
736 *
737 * Probably equivalent to RegisterDragDrop but under Windows 95 it could use the
738 * shell32 built-in "mini-COM" without the need to load ole32.dll - see SHLoadOLE
739 * for details. Under Windows 98 this function initializes the true OLE when called
740 * the first time, on XP always returns E_OUTOFMEMORY and it got removed from Vista.
741 *
742 * We follow Windows 98 behaviour.
743 *
744 * NOTES
745 * exported by ordinal
746 *
747 * SEE ALSO
748 * RegisterDragDrop, SHLoadOLE
749 */
751 HWND hWnd,
752 LPDROPTARGET pDropTarget)
753{
754 static BOOL ole_initialized = FALSE;
755 HRESULT hr;
756
757 TRACE("(%p,%p)\n", hWnd, pDropTarget);
758
759 if (!ole_initialized)
760 {
762 if (FAILED(hr))
763 return hr;
764 ole_initialized = TRUE;
765 }
766 return RegisterDragDrop(hWnd, pDropTarget);
767}
768
769/*************************************************************************
770 * SHRevokeDragDrop [SHELL32.87]
771 *
772 * Probably equivalent to RevokeDragDrop but under Windows 95 it could use the
773 * shell32 built-in "mini-COM" without the need to load ole32.dll - see SHLoadOLE
774 * for details. Function removed from Windows Vista.
775 *
776 * We call ole32 RevokeDragDrop which seems to work even if OleInitialize was
777 * not called.
778 *
779 * NOTES
780 * exported by ordinal
781 *
782 * SEE ALSO
783 * RevokeDragDrop, SHLoadOLE
784 */
786{
787 TRACE("(%p)\n", hWnd);
788 return RevokeDragDrop(hWnd);
789}
790
791/*************************************************************************
792 * SHDoDragDrop [SHELL32.88]
793 *
794 * Probably equivalent to DoDragDrop but under Windows 9x it could use the
795 * shell32 built-in "mini-COM" without the need to load ole32.dll - see SHLoadOLE
796 * for details
797 *
798 * NOTES
799 * exported by ordinal
800 *
801 * SEE ALSO
802 * DoDragDrop, SHLoadOLE
803 */
805 HWND hWnd,
806 LPDATAOBJECT lpDataObject,
807 LPDROPSOURCE lpDropSource,
808 DWORD dwOKEffect,
809 LPDWORD pdwEffect)
810{
811 FIXME("(%p %p %p 0x%08x %p):stub.\n",
812 hWnd, lpDataObject, lpDropSource, dwOKEffect, pdwEffect);
813 return DoDragDrop(lpDataObject, lpDropSource, dwOKEffect, pdwEffect);
814}
815
816/*************************************************************************
817 * ArrangeWindows [SHELL32.184]
818 *
819 */
821 WORD cKids, const HWND *lpKids)
822{
823 /* Unimplemented in WinXP SP3 */
824 TRACE("(%p 0x%08x %p 0x%04x %p):stub.\n",
825 hwndParent, dwReserved, lpRect, cKids, lpKids);
826 return 0;
827}
828
829/*************************************************************************
830 * SignalFileOpen [SHELL32.103]
831 *
832 * NOTES
833 * exported by ordinal
834 */
837{
838 FIXME("(%p):stub.\n", pidl);
839
840 return FALSE;
841}
842
843#ifndef __REACTOS__
844
845/*************************************************************************
846 * SHADD_get_policy - helper function for SHAddToRecentDocs
847 *
848 * PARAMETERS
849 * policy [IN] policy name (null termed string) to find
850 * type [OUT] ptr to DWORD to receive type
851 * buffer [OUT] ptr to area to hold data retrieved
852 * len [IN/OUT] ptr to DWORD holding size of buffer and getting
853 * length filled
854 *
855 * RETURNS
856 * result of the SHQueryValueEx call
857 */
859{
860 HKEY Policy_basekey;
861 INT ret;
862
863 /* Get the key for the policies location in the registry
864 */
866 "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
867 0, KEY_READ, &Policy_basekey)) {
868
870 "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
871 0, KEY_READ, &Policy_basekey)) {
872 TRACE("No Explorer Policies location exists. Policy wanted=%s\n",
873 policy);
874 *len = 0;
876 }
877 }
878
879 /* Retrieve the data if it exists
880 */
881 ret = SHQueryValueExA(Policy_basekey, policy, 0, type, buffer, len);
882 RegCloseKey(Policy_basekey);
883 return ret;
884}
885
886#endif // __REACTOS__
887
888/*************************************************************************
889 * SHADD_compare_mru - helper function for SHAddToRecentDocs
890 *
891 * PARAMETERS
892 * data1 [IN] data being looked for
893 * data2 [IN] data in MRU
894 * cbdata [IN] length from FindMRUData call (not used)
895 *
896 * RETURNS
897 * position within MRU list that data was added.
898 */
900{
901#ifdef __REACTOS__
902 LPCWSTR psz1, psz2;
903 INT iCmp = lstrcmpiW(data1, data2);
904 if (iCmp != 0)
905 return iCmp;
906 psz1 = data1;
907 psz2 = data2;
908 psz1 += lstrlenW(psz1) + 1;
909 psz2 += lstrlenW(psz2) + 1;
910 return lstrcmpiW(psz1, psz2);
911#else
912 return lstrcmpiA(data1, data2);
913#endif
914}
915
916#ifdef __REACTOS__
917static BOOL
918DoStoreMRUData(LPBYTE pbBuffer, LPDWORD pcbBuffer,
919 LPCWSTR pszTargetTitle, LPCWSTR pszTargetPath, LPCWSTR pszLinkTitle)
920{
921 DWORD ib = 0, cb;
922 INT cchTargetTitle = lstrlenW(pszTargetTitle);
923 INT cchTargetPath = lstrlenW(pszTargetPath);
924 INT cchLinkTitle = lstrlenW(pszLinkTitle);
925
926 cb = (cchTargetTitle + 1 + cchTargetPath + 1 + cchLinkTitle + 2) * sizeof(WCHAR);
927 if (cb > *pcbBuffer)
928 return FALSE;
929
930 ZeroMemory(pbBuffer, *pcbBuffer);
931
932 cb = (cchTargetTitle + 1) * sizeof(WCHAR);
933 if (ib + cb > *pcbBuffer)
934 return FALSE;
935 CopyMemory(&pbBuffer[ib], pszTargetTitle, cb);
936 ib += cb;
937
938 cb = (cchTargetPath + 1) * sizeof(WCHAR);
939 if (ib + cb > *pcbBuffer)
940 return FALSE;
941 CopyMemory(&pbBuffer[ib], pszTargetPath, cb);
942 ib += cb;
943
944 cb = (cchLinkTitle + 1) * sizeof(WCHAR);
945 if (ib + cb > *pcbBuffer)
946 return FALSE;
947 CopyMemory(&pbBuffer[ib], pszLinkTitle, cb);
948 ib += cb;
949
950 *pcbBuffer = ib;
951 return TRUE;
952}
953#else
954/*************************************************************************
955 * SHADD_create_add_mru_data - helper function for SHAddToRecentDocs
956 *
957 * PARAMETERS
958 * mruhandle [IN] handle for created MRU list
959 * doc_name [IN] null termed pure doc name
960 * new_lnk_name [IN] null termed path and file name for .lnk file
961 * buffer [IN/OUT] 2048 byte area to construct MRU data
962 * len [OUT] ptr to int to receive space used in buffer
963 *
964 * RETURNS
965 * position within MRU list that data was added.
966 */
967static INT SHADD_create_add_mru_data(HANDLE mruhandle, LPCSTR doc_name, LPCSTR new_lnk_name,
969{
970 LPSTR ptr;
971 INT wlen;
972
973 /*FIXME: Document:
974 * RecentDocs MRU data structure seems to be:
975 * +0h document file name w/ terminating 0h
976 * +nh short int w/ size of remaining
977 * +n+2h 02h 30h, or 01h 30h, or 00h 30h - unknown
978 * +n+4h 10 bytes zeros - unknown
979 * +n+eh shortcut file name w/ terminating 0h
980 * +n+e+nh 3 zero bytes - unknown
981 */
982
983 /* Create the MRU data structure for "RecentDocs"
984 */
985 ptr = buffer;
986 lstrcpyA(ptr, doc_name);
987 ptr += (lstrlenA(buffer) + 1);
988 wlen= lstrlenA(new_lnk_name) + 1 + 12;
989 *((short int*)ptr) = wlen;
990 ptr += 2; /* step past the length */
991 *(ptr++) = 0x30; /* unknown reason */
992 *(ptr++) = 0; /* unknown, but can be 0x00, 0x01, 0x02 */
993 memset(ptr, 0, 10);
994 ptr += 10;
995 lstrcpyA(ptr, new_lnk_name);
996 ptr += (lstrlenA(new_lnk_name) + 1);
997 memset(ptr, 0, 3);
998 ptr += 3;
999 *len = ptr - buffer;
1000
1001 /* Add the new entry into the MRU list
1002 */
1003 return AddMRUData(mruhandle, buffer, *len);
1004}
1005#endif
1006
1007/*************************************************************************
1008 * SHAddToRecentDocs [SHELL32.@]
1009 *
1010 * Modify (add/clear) Shell's list of recently used documents.
1011 *
1012 * PARAMETERS
1013 * uFlags [IN] SHARD_PATHA, SHARD_PATHW or SHARD_PIDL
1014 * pv [IN] string or pidl, NULL clears the list
1015 *
1016 * NOTES
1017 * exported by name
1018 *
1019 * FIXME
1020 * convert to unicode
1021 */
1023{
1024#ifdef __REACTOS__
1025 INT ret;
1026 WCHAR szTargetPath[MAX_PATH], szLinkDir[MAX_PATH], szLinkFile[MAX_PATH], szDescription[80];
1028 DWORD cbBuffer;
1029 HANDLE hFind;
1031 HKEY hExplorerKey;
1032 LONG error;
1033 LPWSTR pchDotExt, pchTargetTitle, pchLinkTitle;
1034 MRUINFOW mru;
1035 HANDLE hMRUList = NULL;
1036 IShellLinkW *psl = NULL;
1037 IPersistFile *pPf = NULL;
1038 HRESULT hr;
1039 BYTE Buffer[(MAX_PATH + 64) * sizeof(WCHAR)];
1040
1041 TRACE("%04x %p\n", uFlags, pv);
1042
1043 /* check policy */
1045 TRACE("policy value for NoRecentDocsHistory = %08x\n", ret);
1046 if (ret != 0)
1047 return;
1048
1049 /* store to szTargetPath */
1050 szTargetPath[0] = 0;
1051 if (pv)
1052 {
1053 switch (uFlags)
1054 {
1055 case SHARD_PATHA:
1056 MultiByteToWideChar(CP_ACP, 0, pv, -1, szLinkDir, ARRAYSIZE(szLinkDir));
1057 GetFullPathNameW(szLinkDir, ARRAYSIZE(szTargetPath), szTargetPath, NULL);
1058 break;
1059
1060 case SHARD_PATHW:
1061 GetFullPathNameW(pv, ARRAYSIZE(szTargetPath), szTargetPath, NULL);
1062 break;
1063
1064 case SHARD_PIDL:
1065 SHGetPathFromIDListW(pv, szLinkDir);
1066 GetFullPathNameW(szLinkDir, ARRAYSIZE(szTargetPath), szTargetPath, NULL);
1067 break;
1068
1069 default:
1070 FIXME("Unsupported flags: %u\n", uFlags);
1071 return;
1072 }
1073 }
1074
1075 /* get recent folder */
1077 {
1078 ERR("serious issues 1\n");
1079 return;
1080 }
1081 TRACE("Users Recent dir %S\n", szLinkDir);
1082
1083 /* open Explorer key */
1084 error = RegCreateKeyExW(HKEY_CURRENT_USER, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer",
1085 0, NULL, 0,
1086 KEY_READ | KEY_WRITE, NULL, &hExplorerKey, NULL);
1087 if (error)
1088 {
1089 ERR("Failed to RegCreateKeyExW: 0x%08X\n", error);
1090 return;
1091 }
1092
1093 if (!pv)
1094 {
1095 TRACE("pv is NULL, so delete all shortcut files in %S\n", szLinkDir);
1096
1097 lstrcpynW(szLinkFile, szLinkDir, ARRAYSIZE(szLinkFile));
1098 PathAppendW(szLinkFile, L"*.lnk");
1099
1100 hFind = FindFirstFileW(szLinkFile, &find);
1101 if (hFind != INVALID_HANDLE_VALUE)
1102 {
1103 do
1104 {
1105 lstrcpynW(szLinkFile, szLinkDir, ARRAYSIZE(szLinkFile));
1106 PathAppendW(szLinkFile, find.cFileName);
1107 DeleteFileW(szLinkFile);
1108 } while (FindNextFile(hFind, &find));
1109 FindClose(hFind);
1110 }
1111
1112 SHDeleteKeyW(hExplorerKey, L"RecentDocs");
1113 RegCloseKey(hExplorerKey);
1114 return;
1115 }
1116
1117 if (szTargetPath[0] == 0 || !PathFileExistsW(szTargetPath) ||
1118 PathIsDirectoryW(szTargetPath))
1119 {
1120 /* path is not normal file */
1121 RegCloseKey(hExplorerKey);
1122 return;
1123 }
1124
1125 hr = CoInitialize(NULL);
1126 if (FAILED(hr))
1127 {
1128 ERR("CoInitialize: %08X\n", hr);
1129 RegCloseKey(hExplorerKey);
1130 return;
1131 }
1132
1133 /* check if file is a shortcut */
1134 ret = 0;
1135 pchDotExt = PathFindExtensionW(szTargetPath);
1136 while (lstrcmpiW(pchDotExt, L".lnk") == 0)
1137 {
1138 hr = IShellLink_ConstructFromPath(szTargetPath, &IID_IShellLinkW, (LPVOID*)&psl);
1139 if (FAILED(hr))
1140 {
1141 ERR("IShellLink_ConstructFromPath: 0x%08X\n", hr);
1142 goto Quit;
1143 }
1144
1145 IShellLinkW_GetPath(psl, szPath, ARRAYSIZE(szPath), NULL, 0);
1146 IShellLinkW_Release(psl);
1147 psl = NULL;
1148
1149 lstrcpynW(szTargetPath, szPath, ARRAYSIZE(szTargetPath));
1150 pchDotExt = PathFindExtensionW(szTargetPath);
1151
1152 if (++ret >= 8)
1153 {
1154 ERR("Link loop?\n");
1155 goto Quit;
1156 }
1157 }
1158 if (!lstrcmpiW(pchDotExt, L".exe"))
1159 {
1160 /* executables are not added */
1161 goto Quit;
1162 }
1163
1164 /* *** JOB 0: Build strings *** */
1165
1166 pchTargetTitle = PathFindFileNameW(szTargetPath);
1167
1168 lstrcpyW(szDescription, L"Shortcut to ");
1170
1171 lstrcpynW(szLinkFile, szLinkDir, ARRAYSIZE(szLinkFile));
1172 PathAppendW(szLinkFile, pchTargetTitle);
1173 StrCatBuffW(szLinkFile, L".lnk", ARRAYSIZE(szLinkFile));
1174 pchLinkTitle = PathFindFileNameW(szLinkFile);
1175
1176 /* *** JOB 1: Update registry for ...\Explorer\RecentDocs list *** */
1177
1178 /* store MRU data */
1179 cbBuffer = sizeof(Buffer);
1180 ret = DoStoreMRUData(Buffer, &cbBuffer, pchTargetTitle, szTargetPath, pchLinkTitle);
1181 if (!ret)
1182 {
1183 ERR("DoStoreMRUData failed: %d\n", ret);
1184 goto Quit;
1185 }
1186
1187 /* create MRU list */
1188 mru.cbSize = sizeof(mru);
1189 mru.uMax = 16;
1191 mru.hKey = hExplorerKey;
1192 mru.lpszSubKey = L"RecentDocs";
1193 mru.lpfnCompare = (MRUCMPPROCW)SHADD_compare_mru;
1194 hMRUList = CreateMRUListW(&mru);
1195 if (!hMRUList)
1196 {
1197 ERR("CreateMRUListW failed\n");
1198 goto Quit;
1199 }
1200
1201 /* already exists? */
1202 ret = FindMRUData(hMRUList, Buffer, cbBuffer, NULL);
1203 if (ret >= 0)
1204 {
1205 /* Just touch for speed */
1206 HANDLE hFile;
1210 {
1211 TRACE("Just touch file '%S'.\n", szLinkFile);
1213 goto Quit;
1214 }
1215 }
1216
1217 /* add MRU data */
1218 ret = AddMRUData(hMRUList, Buffer, cbBuffer);
1219 if (ret < 0)
1220 {
1221 ERR("AddMRUData failed: %d\n", ret);
1222 goto Quit;
1223 }
1224
1225 /* *** JOB 2: Create shortcut in user's "Recent" directory *** */
1226
1227 hr = CoCreateInstance(&CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
1228 &IID_IShellLinkW, (LPVOID *)&psl);
1229 if (FAILED(hr))
1230 {
1231 ERR("CoInitialize for IID_IShellLinkW: %08X\n", hr);
1232 goto Quit;
1233 }
1234
1235 hr = IShellLinkW_QueryInterface(psl, &IID_IPersistFile, (LPVOID *)&pPf);
1236 if (FAILED(hr))
1237 {
1238 ERR("IShellLinkW_QueryInterface: %08X\n", hr);
1239 goto Quit;
1240 }
1241
1242 if (uFlags == SHARD_PIDL)
1243 hr = IShellLinkW_SetIDList(psl, pv);
1244 else
1245 hr = IShellLinkW_SetPath(psl, pv);
1246
1247 IShellLinkW_SetDescription(psl, szDescription);
1248
1249 hr = IPersistFile_Save(pPf, szLinkFile, TRUE);
1250 if (FAILED(hr))
1251 {
1252 ERR("IPersistFile_Save: 0x%08X\n", hr);
1253 }
1254
1255 hr = IPersistFile_SaveCompleted(pPf, szLinkFile);
1256 if (FAILED(hr))
1257 {
1258 ERR("IPersistFile_SaveCompleted: 0x%08X\n", hr);
1259 }
1260
1261Quit:
1262 if (hMRUList)
1263 FreeMRUList(hMRUList);
1264 if (pPf)
1265 IPersistFile_Release(pPf);
1266 if (psl)
1267 IShellLinkW_Release(psl);
1269 RegCloseKey(hExplorerKey);
1270#else
1271/* If list is a string list lpfnCompare has the following prototype
1272 * int CALLBACK MRUCompareString(LPCSTR s1, LPCSTR s2)
1273 * for binary lists the prototype is
1274 * int CALLBACK MRUCompareBinary(LPCVOID data1, LPCVOID data2, DWORD cbData)
1275 * where cbData is the no. of bytes to compare.
1276 * Need to check what return value means identical - 0?
1277 */
1278
1279
1280 UINT olderrormode;
1281 HKEY HCUbasekey;
1282 CHAR doc_name[MAX_PATH];
1283 CHAR link_dir[MAX_PATH];
1284 CHAR new_lnk_filepath[MAX_PATH];
1285 CHAR new_lnk_name[MAX_PATH];
1286 CHAR * ext;
1287 IMalloc *ppM;
1288 LPITEMIDLIST pidl;
1289 HWND hwnd = 0; /* FIXME: get real window handle */
1290 INT ret;
1291 DWORD data[64], datalen, type;
1292
1293 TRACE("%04x %p\n", uFlags, pv);
1294
1295 /*FIXME: Document:
1296 * RecentDocs MRU data structure seems to be:
1297 * +0h document file name w/ terminating 0h
1298 * +nh short int w/ size of remaining
1299 * +n+2h 02h 30h, or 01h 30h, or 00h 30h - unknown
1300 * +n+4h 10 bytes zeros - unknown
1301 * +n+eh shortcut file name w/ terminating 0h
1302 * +n+e+nh 3 zero bytes - unknown
1303 */
1304
1305 /* See if we need to do anything.
1306 */
1307 datalen = 64;
1308 ret=SHADD_get_policy( "NoRecentDocsHistory", &type, data, &datalen);
1309 if ((ret > 0) && (ret != ERROR_FILE_NOT_FOUND)) {
1310 ERR("Error %d getting policy \"NoRecentDocsHistory\"\n", ret);
1311 return;
1312 }
1313 if (ret == ERROR_SUCCESS) {
1314 if (!( (type == REG_DWORD) ||
1315 ((type == REG_BINARY) && (datalen == 4)) )) {
1316 ERR("Error policy data for \"NoRecentDocsHistory\" not formatted correctly, type=%d, len=%d\n",
1317 type, datalen);
1318 return;
1319 }
1320
1321 TRACE("policy value for NoRecentDocsHistory = %08x\n", data[0]);
1322 /* now test the actual policy value */
1323 if ( data[0] != 0)
1324 return;
1325 }
1326
1327 /* Open key to where the necessary info is
1328 */
1329 /* FIXME: This should be done during DLL PROCESS_ATTACH (or THREAD_ATTACH)
1330 * and the close should be done during the _DETACH. The resulting
1331 * key is stored in the DLL global data.
1332 */
1334 "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer",
1335 0, 0, 0, KEY_READ, 0, &HCUbasekey, 0)) {
1336 ERR("Failed to create 'Software\\Microsoft\\Windows\\CurrentVersion\\Explorer'\n");
1337 return;
1338 }
1339
1340 /* Get path to user's "Recent" directory
1341 */
1342 if(SUCCEEDED(SHGetMalloc(&ppM))) {
1344 &pidl))) {
1345 SHGetPathFromIDListA(pidl, link_dir);
1346 IMalloc_Free(ppM, pidl);
1347 }
1348 else {
1349 /* serious issues */
1350 link_dir[0] = 0;
1351 ERR("serious issues 1\n");
1352 }
1353 IMalloc_Release(ppM);
1354 }
1355 else {
1356 /* serious issues */
1357 link_dir[0] = 0;
1358 ERR("serious issues 2\n");
1359 }
1360 TRACE("Users Recent dir %s\n", link_dir);
1361
1362 /* If no input, then go clear the lists */
1363 if (!pv) {
1364 /* clear user's Recent dir
1365 */
1366
1367 /* FIXME: delete all files in "link_dir"
1368 *
1369 * while( more files ) {
1370 * lstrcpyA(old_lnk_name, link_dir);
1371 * PathAppendA(old_lnk_name, filenam);
1372 * DeleteFileA(old_lnk_name);
1373 * }
1374 */
1375 FIXME("should delete all files in %s\\\n", link_dir);
1376
1377 /* clear MRU list
1378 */
1379 /* MS Bug ?? v4.72.3612.1700 of shell32 does the delete against
1380 * HKEY_LOCAL_MACHINE version of ...CurrentVersion\Explorer
1381 * and naturally it fails w/ rc=2. It should do it against
1382 * HKEY_CURRENT_USER which is where it is stored, and where
1383 * the MRU routines expect it!!!!
1384 */
1385 RegDeleteKeyA(HCUbasekey, "RecentDocs");
1386 RegCloseKey(HCUbasekey);
1387 return;
1388 }
1389
1390 /* Have data to add, the jobs to be done:
1391 * 1. Add document to MRU list in registry "HKCU\Software\
1392 * Microsoft\Windows\CurrentVersion\Explorer\RecentDocs".
1393 * 2. Add shortcut to document in the user's Recent directory
1394 * (CSIDL_RECENT).
1395 * 3. Add shortcut to Start menu's Documents submenu.
1396 */
1397
1398 /* Get the pure document name from the input
1399 */
1400 switch (uFlags)
1401 {
1402 case SHARD_PIDL:
1403 if (!SHGetPathFromIDListA(pv, doc_name))
1404 {
1405 WARN("can't get path from PIDL\n");
1406 return;
1407 }
1408 break;
1409
1410 case SHARD_PATHA:
1411 lstrcpynA(doc_name, pv, MAX_PATH);
1412 break;
1413
1414 case SHARD_PATHW:
1415 WideCharToMultiByte(CP_ACP, 0, pv, -1, doc_name, MAX_PATH, NULL, NULL);
1416 break;
1417
1418 default:
1419 FIXME("Unsupported flags: %u\n", uFlags);
1420 return;
1421 }
1422
1423 TRACE("full document name %s\n", debugstr_a(doc_name));
1424
1425 PathStripPathA(doc_name);
1426 TRACE("stripped document name %s\n", debugstr_a(doc_name));
1427
1428
1429 /* *** JOB 1: Update registry for ...\Explorer\RecentDocs list *** */
1430
1431 { /* on input needs:
1432 * doc_name - pure file-spec, no path
1433 * link_dir - path to the user's Recent directory
1434 * HCUbasekey - key of ...Windows\CurrentVersion\Explorer" node
1435 * creates:
1436 * new_lnk_name- pure file-spec, no path for new .lnk file
1437 * new_lnk_filepath
1438 * - path and file name of new .lnk file
1439 */
1440 CREATEMRULISTA mymru;
1441 HANDLE mruhandle;
1442 INT len, pos, bufused, err;
1443 INT i;
1444 DWORD attr;
1445 CHAR buffer[2048];
1446 CHAR *ptr;
1447 CHAR old_lnk_name[MAX_PATH];
1448 short int slen;
1449
1450 mymru.cbSize = sizeof(CREATEMRULISTA);
1451 mymru.nMaxItems = 15;
1453 mymru.hKey = HCUbasekey;
1454 mymru.lpszSubKey = "RecentDocs";
1455 mymru.lpfnCompare = SHADD_compare_mru;
1456 mruhandle = CreateMRUListA(&mymru);
1457 if (!mruhandle) {
1458 /* MRU failed */
1459 ERR("MRU processing failed, handle zero\n");
1460 RegCloseKey(HCUbasekey);
1461 return;
1462 }
1463 len = lstrlenA(doc_name);
1464 pos = FindMRUData(mruhandle, doc_name, len, 0);
1465
1466 /* Now get the MRU entry that will be replaced
1467 * and delete the .lnk file for it
1468 */
1469 if ((bufused = EnumMRUListA(mruhandle, (pos == -1) ? 14 : pos,
1470 buffer, 2048)) != -1) {
1471 ptr = buffer;
1472 ptr += (lstrlenA(buffer) + 1);
1473 slen = *((short int*)ptr);
1474 ptr += 2; /* skip the length area */
1475 if (bufused >= slen + (ptr-buffer)) {
1476 /* buffer size looks good */
1477 ptr += 12; /* get to string */
1478 len = bufused - (ptr-buffer); /* get length of buf remaining */
1479 if (ptr[0] && (lstrlenA(ptr) <= len-1)) {
1480 /* appears to be good string */
1481 lstrcpyA(old_lnk_name, link_dir);
1482 PathAppendA(old_lnk_name, ptr);
1483 if (!DeleteFileA(old_lnk_name)) {
1484 if ((attr = GetFileAttributesA(old_lnk_name)) == INVALID_FILE_ATTRIBUTES) {
1485 if ((err = GetLastError()) != ERROR_FILE_NOT_FOUND) {
1486 ERR("Delete for %s failed, err=%d, attr=%08x\n",
1487 old_lnk_name, err, attr);
1488 }
1489 else {
1490 TRACE("old .lnk file %s did not exist\n",
1491 old_lnk_name);
1492 }
1493 }
1494 else {
1495 ERR("Delete for %s failed, attr=%08x\n",
1496 old_lnk_name, attr);
1497 }
1498 }
1499 else {
1500 TRACE("deleted old .lnk file %s\n", old_lnk_name);
1501 }
1502 }
1503 }
1504 }
1505
1506 /* Create usable .lnk file name for the "Recent" directory
1507 */
1508 wsprintfA(new_lnk_name, "%s.lnk", doc_name);
1509 lstrcpyA(new_lnk_filepath, link_dir);
1510 PathAppendA(new_lnk_filepath, new_lnk_name);
1511 i = 1;
1512 olderrormode = SetErrorMode(SEM_FAILCRITICALERRORS);
1513 while (GetFileAttributesA(new_lnk_filepath) != INVALID_FILE_ATTRIBUTES) {
1514 i++;
1515 wsprintfA(new_lnk_name, "%s (%u).lnk", doc_name, i);
1516 lstrcpyA(new_lnk_filepath, link_dir);
1517 PathAppendA(new_lnk_filepath, new_lnk_name);
1518 }
1519 SetErrorMode(olderrormode);
1520 TRACE("new shortcut will be %s\n", new_lnk_filepath);
1521
1522 /* Now add the new MRU entry and data
1523 */
1524 pos = SHADD_create_add_mru_data(mruhandle, doc_name, new_lnk_name,
1525 buffer, &len);
1526 FreeMRUList(mruhandle);
1527 TRACE("Updated MRU list, new doc is position %d\n", pos);
1528 }
1529
1530 /* *** JOB 2: Create shortcut in user's "Recent" directory *** */
1531
1532 { /* on input needs:
1533 * doc_name - pure file-spec, no path
1534 * new_lnk_filepath
1535 * - path and file name of new .lnk file
1536 * uFlags[in] - flags on call to SHAddToRecentDocs
1537 * pv[in] - document path/pidl on call to SHAddToRecentDocs
1538 */
1539 IShellLinkA *psl = NULL;
1540 IPersistFile *pPf = NULL;
1541 HRESULT hres;
1543 WCHAR widelink[MAX_PATH];
1544
1545 CoInitialize(0);
1546
1547 hres = CoCreateInstance( &CLSID_ShellLink,
1548 NULL,
1549 CLSCTX_INPROC_SERVER,
1550 &IID_IShellLinkA,
1551 (LPVOID )&psl);
1552 if(SUCCEEDED(hres)) {
1553
1554 hres = IShellLinkA_QueryInterface(psl, &IID_IPersistFile,
1555 (LPVOID *)&pPf);
1556 if(FAILED(hres)) {
1557 /* bombed */
1558 ERR("failed QueryInterface for IPersistFile %08x\n", hres);
1559 goto fail;
1560 }
1561
1562 /* Set the document path or pidl */
1563 if (uFlags == SHARD_PIDL) {
1564 hres = IShellLinkA_SetIDList(psl, pv);
1565 } else {
1566 hres = IShellLinkA_SetPath(psl, pv);
1567 }
1568 if(FAILED(hres)) {
1569 /* bombed */
1570 ERR("failed Set{IDList|Path} %08x\n", hres);
1571 goto fail;
1572 }
1573
1574 lstrcpyA(desc, "Shortcut to ");
1575 lstrcatA(desc, doc_name);
1576 hres = IShellLinkA_SetDescription(psl, desc);
1577 if(FAILED(hres)) {
1578 /* bombed */
1579 ERR("failed SetDescription %08x\n", hres);
1580 goto fail;
1581 }
1582
1583 MultiByteToWideChar(CP_ACP, 0, new_lnk_filepath, -1,
1584 widelink, MAX_PATH);
1585 /* create the short cut */
1586 hres = IPersistFile_Save(pPf, widelink, TRUE);
1587 if(FAILED(hres)) {
1588 /* bombed */
1589 ERR("failed IPersistFile::Save %08x\n", hres);
1590 IPersistFile_Release(pPf);
1591 IShellLinkA_Release(psl);
1592 goto fail;
1593 }
1594 hres = IPersistFile_SaveCompleted(pPf, widelink);
1595 IPersistFile_Release(pPf);
1596 IShellLinkA_Release(psl);
1597 TRACE("shortcut %s has been created, result=%08x\n",
1598 new_lnk_filepath, hres);
1599 }
1600 else {
1601 ERR("CoCreateInstance failed, hres=%08x\n", hres);
1602 }
1603 }
1604
1605 fail:
1607
1608 /* all done */
1609 RegCloseKey(HCUbasekey);
1610 return;
1611#endif
1612}
1613
1614/*************************************************************************
1615 * SHCreateShellFolderViewEx [SHELL32.174]
1616 *
1617 * Create a new instance of the default Shell folder view object.
1618 *
1619 * RETURNS
1620 * Success: S_OK
1621 * Failure: error value
1622 *
1623 * NOTES
1624 * see IShellFolder::CreateViewObject
1625 */
1626 #ifndef __REACTOS__
1627
1629 LPCSFV psvcbi, /* [in] shelltemplate struct */
1630 IShellView **ppv) /* [out] IShellView pointer */
1631{
1632 IShellView * psf;
1633 HRESULT hRes;
1634
1635 TRACE("sf=%p pidl=%p cb=%p mode=0x%08x parm=%p\n",
1636 psvcbi->pshf, psvcbi->pidl, psvcbi->pfnCallback,
1637 psvcbi->fvm, psvcbi->psvOuter);
1638
1639 *ppv = NULL;
1640 hRes = IShellView_Constructor(psvcbi->pshf, &psf);
1641
1642 if (FAILED(hRes))
1643 return hRes;
1644
1645 hRes = IShellView_QueryInterface(psf, &IID_IShellView, (LPVOID *)ppv);
1646 IShellView_Release(psf);
1647
1648 return hRes;
1649}
1650#endif
1651
1652/*************************************************************************
1653 * SHWinHelp [SHELL32.127]
1654 *
1655 */
1657{
1658 TRACE("(%p, %s, 0x%08x, %p)\n", hwnd, debugstr_w(pszHelp), uCommand, dwData);
1659 if (!WinHelpW(hwnd, pszHelp, uCommand, dwData))
1660 {
1661#if 0
1664#endif
1665 return FALSE;
1666 }
1667 return TRUE;
1668}
1669/*************************************************************************
1670 * SHRunControlPanel [SHELL32.161]
1671 *
1672 */
1673#ifdef __REACTOS__
1676{
1677 /*
1678 * TODO: Run in-process when possible, using
1679 * HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel\InProcCPLs
1680 * and possibly some extra rules.
1681 * See also https://docs.microsoft.com/en-us/windows/win32/api/shlobj/nf-shlobj-shruncontrolpanel
1682 * "If the specified Control Panel item is already running, SHRunControlPanel
1683 * attempts to switch to that instance rather than opening a new instance."
1684 * This function is not supported as of Windows Vista, where it always returns FALSE.
1685 * However we need to keep it "alive" even when ReactOS is compliled as NT6+
1686 * in order to keep control panel elements launch commands.
1687 */
1688 WCHAR parameters[MAX_PATH] = L"shell32.dll,Control_RunDLL ";
1689 if (!commandLine)
1690 return FALSE;
1691 wcscat(parameters, commandLine);
1692 return ((INT_PTR)ShellExecuteW(parent, L"open", L"rundll32.exe", parameters, NULL, SW_SHOWNORMAL) > 32);
1693}
1694#endif
1695
1697{
1698#ifdef __REACTOS__
1699 TRACE("(%s, %p)n", debugstr_w(commandLine), parent);
1700 /* MSDN indicates that ROS should have a version check here but Vista+ just forwards to SHUNIMPL
1701 if (LOBYTE(GetVersion()) >= 6)
1702 return FALSE;
1703 */
1704 return SHELL32_RunControlPanel(commandLine, parent);
1705#else
1706 FIXME("(%s, %p): stub\n", debugstr_w(commandLine), parent);
1707 return FALSE;
1708#endif
1709}
1710
1712/*************************************************************************
1713 * SHSetInstanceExplorer [SHELL32.176]
1714 *
1715 * NOTES
1716 * Sets the interface
1717 */
1719{ TRACE("%p\n", lpUnknown);
1720 SHELL32_IExplorerInterface = lpUnknown;
1721}
1722/*************************************************************************
1723 * SHGetInstanceExplorer [SHELL32.@]
1724 *
1725 * NOTES
1726 * gets the interface pointer of the explorer and a reference
1727 */
1729{ TRACE("%p\n", lpUnknown);
1730
1731 *lpUnknown = SHELL32_IExplorerInterface;
1732
1734 return E_FAIL;
1735
1736 IUnknown_AddRef(SHELL32_IExplorerInterface);
1737 return S_OK;
1738}
1739/*************************************************************************
1740 * SHFreeUnusedLibraries [SHELL32.123]
1741 *
1742 * Probably equivalent to CoFreeUnusedLibraries but under Windows 9x it could use
1743 * the shell32 built-in "mini-COM" without the need to load ole32.dll - see SHLoadOLE
1744 * for details
1745 *
1746 * NOTES
1747 * exported by ordinal
1748 *
1749 * SEE ALSO
1750 * CoFreeUnusedLibraries, SHLoadOLE
1751 */
1753{
1754 FIXME("stub\n");
1756}
1757/*************************************************************************
1758 * DAD_AutoScroll [SHELL32.129]
1759 *
1760 */
1762{
1763 FIXME("hwnd = %p %p %p\n",hwnd,samples,pt);
1764 return FALSE;
1765}
1766/*************************************************************************
1767 * DAD_DragEnter [SHELL32.130]
1768 *
1769 * @param[in] hwnd
1770 * Window to receive the drag image.
1771 *
1772 * @return
1773 * TRUE on success, FALSE on failure.
1774 *
1775 */
1777{
1778 POINT p;
1779
1780 GetCursorPos(&p);
1781 return DAD_DragEnterEx(hwnd, p);
1782}
1783
1784/*************************************************************************
1785 * DAD_DragEnterEx [SHELL32.131]
1786 *
1787 * @param[in] hwnd
1788 * Window to receive the drag image
1789 *
1790 * @param[in] p
1791 * Initial position of the drag image
1792 *
1793 * @return
1794 * TRUE on success, FALSE on failure
1795 */
1797{
1798 if (!DAD_himlTrack)
1799 return FALSE;
1800
1802 return FALSE;
1803
1804 if (!ImageList_DragEnter(hwnd, p.x, p.y))
1805 {
1807 return FALSE;
1808 }
1809
1811 return TRUE;
1812}
1813
1814/*************************************************************************
1815 * DAD_DragMove [SHELL32.134]
1816 *
1817 * @param[in] p
1818 * New position of the drag image
1819 *
1820 * @return
1821 * TRUE on success, FALSE on failure.
1822 *
1823 */
1825{
1826 if (!DAD_bDragging)
1827 return FALSE;
1828
1829 return ImageList_DragMove(p.x, p.y);
1830}
1831
1832/*************************************************************************
1833 * DAD_DragLeave [SHELL32.132]
1834 *
1835 * @return
1836 * TRUE on success, FALSE on failure
1837 *
1838 */
1840{
1841 if (!DAD_bDragging)
1842 return FALSE;
1843
1847 return TRUE;
1848}
1849
1850/*************************************************************************
1851 * DAD_SetDragImage [SHELL32.136]
1852 *
1853 * @param[in] himlTrack
1854 * Image list containing the drag image or (HIMAGELIST)-1 to clear it
1855 *
1856 * @param[in] lppt
1857 * Hotspot offset within the image or NULL for (0,0)
1858 *
1859 * @return
1860 * TRUE on success, FALSE on failure
1861 *
1862 * @note
1863 * Exported by name
1864 *
1865 */
1867 _In_ HIMAGELIST himlTrack,
1868 _In_opt_ LPPOINT lppt)
1869{
1870 if (himlTrack == (HIMAGELIST)(ULONG_PTR)-1)
1871 {
1872 if (DAD_bDragging)
1873 DAD_DragLeave();
1875 return TRUE;
1876 }
1877
1878 if (!himlTrack)
1879 return FALSE;
1880
1881 DAD_himlTrack = himlTrack;
1882 if (lppt)
1883 DAD_ptHotspot = *lppt;
1884 else
1886
1887 return TRUE;
1888}
1889
1890/*************************************************************************
1891 * DAD_ShowDragImage [SHELL32.137]
1892 *
1893 * @param[in] bShow
1894 * TRUE to show the drag image, FALSE to hide it
1895 *
1896 * @return
1897 * TRUE on success, FALSE on failure
1898 *
1899 * @note
1900 * Exported by name
1901 *
1902 */
1904{
1905 if (!DAD_bDragging)
1906 return FALSE;
1907
1908 return ImageList_DragShowNolock(bShow);
1909}
1910
1911/*************************************************************************
1912 * ReadCabinetState [SHELL32.651] NT 4.0
1913 *
1914 */
1916{
1917 HKEY hkey = 0;
1918 DWORD type, r;
1919 C_ASSERT(sizeof(*cs) == FIELD_OFFSET(CABINETSTATE, fMenuEnumFilter) + sizeof(UINT));
1920
1921 TRACE("%p %d\n", cs, length);
1922
1923 if( (cs == NULL) || (length < (int)sizeof(*cs)) )
1924 return FALSE;
1925
1926 r = RegOpenKeyW( HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CabinetState", &hkey );
1927 if( r == ERROR_SUCCESS )
1928 {
1929 type = REG_BINARY;
1930 r = RegQueryValueExW( hkey, L"Settings",
1931 NULL, &type, (LPBYTE)cs, (LPDWORD)&length );
1932 RegCloseKey( hkey );
1933
1934 }
1935
1936 /* if we can't read from the registry, create default values */
1937 if ( (r != ERROR_SUCCESS) || (cs->cLength < sizeof(*cs)) ||
1938 (cs->cLength != length) )
1939 {
1940 SHELLSTATE shellstate;
1941 shellstate.fWin95Classic = FALSE;
1943
1944 TRACE("Initializing shell cabinet settings\n");
1945 memset(cs, 0, sizeof(*cs));
1946 cs->cLength = sizeof(*cs);
1947 cs->nVersion = 2;
1948 cs->fFullPathTitle = FALSE;
1949 cs->fSaveLocalView = TRUE;
1950 cs->fNotShell = FALSE;
1951 cs->fSimpleDefault = TRUE;
1952 cs->fDontShowDescBar = FALSE;
1953 cs->fNewWindowMode = shellstate.fWin95Classic;
1954 cs->fShowCompColor = FALSE;
1955 cs->fDontPrettyNames = FALSE;
1956 cs->fAdminsCreateCommonGroups = TRUE;
1957 cs->fMenuEnumFilter = SHCONTF_FOLDERS | SHCONTF_NONFOLDERS;
1958 }
1959
1960 return TRUE;
1961}
1962
1963/*************************************************************************
1964 * WriteCabinetState [SHELL32.652] NT 4.0
1965 *
1966 */
1968{
1969 DWORD r;
1970 HKEY hkey = 0;
1971
1972 TRACE("%p\n",cs);
1973
1974 if( cs == NULL )
1975 return FALSE;
1976
1977 r = RegCreateKeyExW( HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CabinetState", 0,
1978 NULL, 0, KEY_ALL_ACCESS, NULL, &hkey, NULL);
1979 if( r == ERROR_SUCCESS )
1980 {
1981 r = RegSetValueExW( hkey, L"Settings", 0,
1982 REG_BINARY, (LPBYTE) cs, cs->cLength);
1983
1984 RegCloseKey( hkey );
1985 }
1986
1987#ifdef __REACTOS__
1988 /* TODO: if (r==ERROR_SUCCESS) Increment GLOBALCOUNTER_FOLDERSETTINGSCHANGE */
1989#endif
1990 return (r==ERROR_SUCCESS);
1991}
1992
1993/*************************************************************************
1994 * FileIconInit [SHELL32.660]
1995 *
1996 */
1998{
1999 return SIC_Initialize();
2000}
2001
2002/*************************************************************************
2003 * SetAppStartingCursor [SHELL32.99]
2004 */
2006{ FIXME("hwnd=%p 0x%04x stub\n",u,v );
2007 return 0;
2008}
2009
2010/*************************************************************************
2011 * SHLoadOLE [SHELL32.151]
2012 *
2013 * To reduce the memory usage of Windows 95, its shell32 contained an
2014 * internal implementation of a part of COM (see e.g. SHGetMalloc, SHCoCreateInstance,
2015 * SHRegisterDragDrop etc.) that allowed to use in-process STA objects without
2016 * the need to load OLE32.DLL. If OLE32.DLL was already loaded, the SH* function
2017 * would just call the Co* functions.
2018 *
2019 * The SHLoadOLE was called when OLE32.DLL was being loaded to transfer all the
2020 * information from the shell32 "mini-COM" to ole32.dll.
2021 *
2022 * See https://devblogs.microsoft.com/oldnewthing/20040705-00/?p=38573 for a
2023 * detailed description.
2024 *
2025 * Under wine ole32.dll is always loaded as it is imported by shlwapi.dll which is
2026 * imported by shell32 and no "mini-COM" is used (except for the "LoadWithoutCOM"
2027 * hack in SHCoCreateInstance)
2028 */
2030{ FIXME("0x%08lx stub\n",lParam);
2031 return S_OK;
2032}
2033/*************************************************************************
2034 * DriveType [SHELL32.64]
2035 *
2036 */
2038{
2039 WCHAR root[] = L"A:\\";
2040 root[0] = L'A' + DriveType;
2041 return GetDriveTypeW(root);
2042}
2043/*************************************************************************
2044 * InvalidateDriveType [SHELL32.65]
2045 * Unimplemented in XP SP3
2046 */
2048{
2049 TRACE("0x%08x stub\n",u);
2050 return 0;
2051}
2052/*************************************************************************
2053 * SHAbortInvokeCommand [SHELL32.198]
2054 *
2055 */
2057{ FIXME("stub\n");
2058 return 1;
2059}
2060/*************************************************************************
2061 * SHOutOfMemoryMessageBox [SHELL32.126]
2062 *
2063 */
2065 HWND hwndOwner,
2066 LPCSTR lpCaption,
2067 UINT uType)
2068{
2069 FIXME("%p %s 0x%08x stub\n",hwndOwner, lpCaption, uType);
2070 return 0;
2071}
2072/*************************************************************************
2073 * SHFlushClipboard [SHELL32.121]
2074 *
2075 */
2077{
2078 return OleFlushClipboard();
2079}
2080
2081/*************************************************************************
2082 * SHWaitForFileToOpen [SHELL32.97]
2083 *
2084 */
2086 LPCITEMIDLIST pidl,
2087 DWORD dwFlags,
2088 DWORD dwTimeout)
2089{
2090 FIXME("%p 0x%08x 0x%08x stub\n", pidl, dwFlags, dwTimeout);
2091 return FALSE;
2092}
2093
2094/************************************************************************
2095 * RLBuildListOfPaths [SHELL32.146]
2096 *
2097 * NOTES
2098 * builds a DPA
2099 */
2101{ FIXME("stub\n");
2102 return 0;
2103}
2104/************************************************************************
2105 * SHValidateUNC [SHELL32.173]
2106 *
2107 */
2108BOOL WINAPI SHValidateUNC (HWND hwndOwner, PWSTR pszFile, UINT fConnect)
2109{
2110 FIXME("(%p, %s, 0x%08x): stub\n", hwndOwner, debugstr_w(pszFile), fConnect);
2111 return FALSE;
2112}
2113
2114/************************************************************************
2115 * DoEnvironmentSubstA [SHELL32.@]
2116 *
2117 * See DoEnvironmentSubstW.
2118 */
2120{
2121 LPSTR dst;
2122 BOOL res = FALSE;
2123 DWORD len = cchString;
2124
2125 TRACE("(%s, %d)\n", debugstr_a(pszString), cchString);
2126 if (pszString == NULL) /* Really return 0? */
2127 return 0;
2128 if ((dst = (LPSTR)HeapAlloc(GetProcessHeap(), 0, cchString * sizeof(CHAR))))
2129 {
2130 len = ExpandEnvironmentStringsA(pszString, dst, cchString);
2131 /* len includes the terminating 0 */
2132 if (len && len < cchString)
2133 {
2134 res = TRUE;
2135 memcpy(pszString, dst, len);
2136 }
2137 else
2138 len = cchString;
2139
2141 }
2142 return MAKELONG(len, res);
2143}
2144
2145/************************************************************************
2146 * DoEnvironmentSubstW [SHELL32.@]
2147 *
2148 * Replace all %KEYWORD% in the string with the value of the named
2149 * environment variable. If the buffer is too small, the string is not modified.
2150 *
2151 * PARAMS
2152 * pszString [I] '\0' terminated string with %keyword%.
2153 * [O] '\0' terminated string with %keyword% substituted.
2154 * cchString [I] size of str.
2155 *
2156 * RETURNS
2157 * Success: The string in the buffer is updated
2158 * HIWORD: TRUE
2159 * LOWORD: characters used in the buffer, including space for the terminating 0
2160 * Failure: buffer too small. The string is not modified.
2161 * HIWORD: FALSE
2162 * LOWORD: provided size of the buffer in characters
2163 */
2165{
2166 LPWSTR dst;
2167 BOOL res = FALSE;
2168 DWORD len = cchString;
2169
2170 TRACE("(%s, %d)\n", debugstr_w(pszString), cchString);
2171
2172 if ((cchString < MAXLONG) && (dst = HeapAlloc(GetProcessHeap(), 0, cchString * sizeof(WCHAR))))
2173 {
2174 len = ExpandEnvironmentStringsW(pszString, dst, cchString);
2175 /* len includes the terminating 0 */
2176 if (len && len <= cchString)
2177 {
2178 res = TRUE;
2179 memcpy(pszString, dst, len * sizeof(WCHAR));
2180 }
2181 else
2182 len = cchString;
2183
2185 }
2186 return MAKELONG(len, res);
2187}
2188
2189/************************************************************************
2190 * DoEnvironmentSubst [SHELL32.53]
2191 *
2192 * See DoEnvironmentSubstA.
2193 */
2195{
2196 if (SHELL_OsIsUnicode())
2197 return DoEnvironmentSubstW(x, y);
2198 return DoEnvironmentSubstA(x, y);
2199}
2200
2201/*************************************************************************
2202 * GUIDFromStringA [SHELL32.703]
2203 */
2205{
2206 ANSI_STRING ansi_str;
2207 WCHAR szWide[40];
2208 UNICODE_STRING guid_str = { 0, sizeof(szWide), szWide };
2209 if (*str != '{')
2210 return FALSE;
2211 RtlInitAnsiString(&ansi_str, str);
2212 return !RtlAnsiStringToUnicodeString(&guid_str, &ansi_str, FALSE) &&
2213 !RtlGUIDFromString(&guid_str, guid);
2214}
2215
2216/*************************************************************************
2217 * GUIDFromStringW [SHELL32.704]
2218 */
2220{
2221 UNICODE_STRING guid_str;
2222 if (!str || *str != L'{')
2223 return FALSE;
2224 RtlInitUnicodeString(&guid_str, str);
2225 return !RtlGUIDFromString(&guid_str, guid);
2226}
2227
2228/*************************************************************************
2229 * PathIsTemporaryA [SHELL32.713]
2230 */
2231#ifdef __REACTOS__
2234#else
2236#endif
2237{
2238#ifdef __REACTOS__
2239 WCHAR szWide[MAX_PATH];
2240
2241 TRACE("(%s)\n", debugstr_a(Str));
2242
2243 SHAnsiToUnicode(Str, szWide, _countof(szWide));
2244 return PathIsTemporaryW(szWide);
2245#else
2246 FIXME("(%s)stub\n", debugstr_a(Str));
2247 return FALSE;
2248#endif
2249}
2250
2251/*************************************************************************
2252 * PathIsTemporaryW [SHELL32.714]
2253 */
2254#ifdef __REACTOS__
2257#else
2259#endif
2260{
2261#ifdef __REACTOS__
2262 WCHAR szLongPath[MAX_PATH], szTempPath[MAX_PATH];
2263 DWORD attrs;
2264 LPCWSTR pszTarget = Str;
2265
2266 TRACE("(%s)\n", debugstr_w(Str));
2267
2268 attrs = GetFileAttributesW(Str);
2269 if (attrs != INVALID_FILE_ATTRIBUTES && (attrs & FILE_ATTRIBUTE_TEMPORARY))
2270 return TRUE;
2271
2274 {
2275 return FALSE;
2276 }
2277
2278 if (GetLongPathNameW(Str, szLongPath, _countof(szLongPath)))
2279 pszTarget = szLongPath;
2280
2281 return (PathIsEqualOrSubFolder(szTempPath, pszTarget) ||
2284#else
2285 FIXME("(%s)stub\n", debugstr_w(Str));
2286 return FALSE;
2287#endif
2288}
2289
2290typedef struct _PSXA
2291{
2296
2297typedef struct _PSXA_CALL
2298{
2305
2307{
2309
2310 if (Call != NULL)
2311 {
2312 if ((Call->bMultiple || !Call->bCalled) &&
2313 Call->lpfnAddReplaceWith(hpage, Call->lParam))
2314 {
2315 Call->bCalled = TRUE;
2316 Call->uiCount++;
2317 return TRUE;
2318 }
2319 }
2320
2321 return FALSE;
2322}
2323
2324/*************************************************************************
2325 * SHAddFromPropSheetExtArray [SHELL32.167]
2326 */
2328{
2329 PSXA_CALL Call;
2330 UINT i;
2331 PPSXA psxa = (PPSXA)hpsxa;
2332
2333 TRACE("(%p,%p,%08lx)\n", hpsxa, lpfnAddPage, lParam);
2334
2335 if (psxa)
2336 {
2337 ZeroMemory(&Call, sizeof(Call));
2338 Call.lpfnAddReplaceWith = lpfnAddPage;
2339 Call.lParam = lParam;
2340 Call.bMultiple = TRUE;
2341
2342 /* Call the AddPage method of all registered IShellPropSheetExt interfaces */
2343 for (i = 0; i != psxa->uiCount; i++)
2344 {
2345 psxa->pspsx[i]->lpVtbl->AddPages(psxa->pspsx[i], PsxaCall, (LPARAM)&Call);
2346 }
2347
2348 return Call.uiCount;
2349 }
2350
2351 return 0;
2352}
2353
2354/*************************************************************************
2355 * SHCreatePropSheetExtArray [SHELL32.168]
2356 */
2358{
2359 return SHCreatePropSheetExtArrayEx(hKey, pszSubKey, max_iface, NULL);
2360}
2361
2362/*************************************************************************
2363 * SHCreatePropSheetExtArrayEx [SHELL32.194]
2364 */
2366{
2367 WCHAR szHandler[64];
2368 DWORD dwHandlerLen;
2369 WCHAR szClsidHandler[39];
2370 DWORD dwClsidSize;
2371 CLSID clsid;
2372 LONG lRet;
2373 DWORD dwIndex;
2374 IShellExtInit *psxi;
2375 IShellPropSheetExt *pspsx;
2376 HKEY hkBase, hkPropSheetHandlers;
2377 PPSXA psxa = NULL;
2378
2379 TRACE("(%p,%s,%u)\n", hKey, debugstr_w(pszSubKey), max_iface);
2380
2381 if (max_iface == 0)
2382 return NULL;
2383
2384 /* Open the registry key */
2385 lRet = RegOpenKeyW(hKey, pszSubKey, &hkBase);
2386 if (lRet != ERROR_SUCCESS)
2387 return NULL;
2388
2389 lRet = RegOpenKeyExW(hkBase, L"shellex\\PropertySheetHandlers", 0, KEY_ENUMERATE_SUB_KEYS, &hkPropSheetHandlers);
2390 RegCloseKey(hkBase);
2391 if (lRet == ERROR_SUCCESS)
2392 {
2393 /* Create and initialize the Property Sheet Extensions Array */
2394 psxa = LocalAlloc(LMEM_FIXED, FIELD_OFFSET(PSXA, pspsx[max_iface]));
2395 if (psxa)
2396 {
2397 ZeroMemory(psxa, FIELD_OFFSET(PSXA, pspsx[max_iface]));
2398 psxa->uiAllocated = max_iface;
2399
2400 /* Enumerate all subkeys and attempt to load the shell extensions */
2401 dwIndex = 0;
2402 do
2403 {
2404 dwHandlerLen = sizeof(szHandler) / sizeof(szHandler[0]);
2405 lRet = RegEnumKeyExW(hkPropSheetHandlers, dwIndex++, szHandler, &dwHandlerLen, NULL, NULL, NULL, NULL);
2406 if (lRet != ERROR_SUCCESS)
2407 {
2408 if (lRet == ERROR_MORE_DATA)
2409 continue;
2410
2411 if (lRet == ERROR_NO_MORE_ITEMS)
2412 lRet = ERROR_SUCCESS;
2413 break;
2414 }
2415
2416 /* The CLSID is stored either in the key itself or in its default value. */
2417 if (FAILED(lRet = SHCLSIDFromStringW(szHandler, &clsid)))
2418 {
2419 dwClsidSize = sizeof(szClsidHandler);
2420 if (SHGetValueW(hkPropSheetHandlers, szHandler, NULL, NULL, szClsidHandler, &dwClsidSize) == ERROR_SUCCESS)
2421 {
2422 /* Force a NULL-termination and convert the string */
2423 szClsidHandler[(sizeof(szClsidHandler) / sizeof(szClsidHandler[0])) - 1] = 0;
2424 lRet = SHCLSIDFromStringW(szClsidHandler, &clsid);
2425 }
2426 }
2427
2428 if (SUCCEEDED(lRet))
2429 {
2430 /* Attempt to get an IShellPropSheetExt and an IShellExtInit instance.
2431 Only if both interfaces are supported it's a real shell extension.
2432 Then call IShellExtInit's Initialize method. */
2433 if (SUCCEEDED(CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER/* | CLSCTX_NO_CODE_DOWNLOAD */, &IID_IShellPropSheetExt, (LPVOID *)&pspsx)))
2434 {
2435 if (SUCCEEDED(pspsx->lpVtbl->QueryInterface(pspsx, &IID_IShellExtInit, (PVOID *)&psxi)))
2436 {
2437 if (SUCCEEDED(psxi->lpVtbl->Initialize(psxi, NULL, pDataObj, hKey)))
2438 {
2439 /* Add the IShellPropSheetExt instance to the array */
2440 psxa->pspsx[psxa->uiCount++] = pspsx;
2441 }
2442 else
2443 {
2444 psxi->lpVtbl->Release(psxi);
2445 pspsx->lpVtbl->Release(pspsx);
2446 }
2447 }
2448 else
2449 pspsx->lpVtbl->Release(pspsx);
2450 }
2451 }
2452
2453 } while (psxa->uiCount != psxa->uiAllocated);
2454 }
2455 else
2457
2458 RegCloseKey(hkPropSheetHandlers);
2459 }
2460
2461 if (lRet != ERROR_SUCCESS && psxa)
2462 {
2463 SHDestroyPropSheetExtArray((HPSXA)psxa);
2464 psxa = NULL;
2465 }
2466
2467 return (HPSXA)psxa;
2468}
2469
2470/*************************************************************************
2471 * SHReplaceFromPropSheetExtArray [SHELL32.170]
2472 */
2474{
2475 PSXA_CALL Call;
2476 UINT i;
2477 PPSXA psxa = (PPSXA)hpsxa;
2478
2479 TRACE("(%p,%u,%p,%08lx)\n", hpsxa, uPageID, lpfnReplaceWith, lParam);
2480
2481 if (psxa)
2482 {
2483 ZeroMemory(&Call, sizeof(Call));
2484 Call.lpfnAddReplaceWith = lpfnReplaceWith;
2485 Call.lParam = lParam;
2486
2487 /* Call the ReplacePage method of all registered IShellPropSheetExt interfaces.
2488 Each shell extension is only allowed to call the callback once during the callback. */
2489 for (i = 0; i != psxa->uiCount; i++)
2490 {
2491 Call.bCalled = FALSE;
2492 psxa->pspsx[i]->lpVtbl->ReplacePage(psxa->pspsx[i], uPageID, PsxaCall, (LPARAM)&Call);
2493 }
2494
2495 return Call.uiCount;
2496 }
2497
2498 return 0;
2499}
2500
2501/*************************************************************************
2502 * SHDestroyPropSheetExtArray [SHELL32.169]
2503 */
2505{
2506 UINT i;
2507 PPSXA psxa = (PPSXA)hpsxa;
2508
2509 TRACE("(%p)\n", hpsxa);
2510
2511 if (psxa)
2512 {
2513 for (i = 0; i != psxa->uiCount; i++)
2514 {
2515 psxa->pspsx[i]->lpVtbl->Release(psxa->pspsx[i]);
2516 }
2517
2518 LocalFree(psxa);
2519 }
2520}
2521
2522/*************************************************************************
2523 * CIDLData_CreateFromIDArray [SHELL32.83]
2524 *
2525 * Create IDataObject from PIDLs??
2526 */
2528 PCIDLIST_ABSOLUTE pidlFolder,
2529 UINT cpidlFiles,
2530 PCUIDLIST_RELATIVE_ARRAY lppidlFiles,
2531 LPDATAOBJECT *ppdataObject)
2532{
2533 UINT i;
2534 HWND hwnd = 0; /*FIXME: who should be hwnd of owner? set to desktop */
2535 HRESULT hResult;
2536
2537 TRACE("(%p, %d, %p, %p)\n", pidlFolder, cpidlFiles, lppidlFiles, ppdataObject);
2538 if (TRACE_ON(pidl))
2539 {
2540 pdump (pidlFolder);
2541 for (i=0; i<cpidlFiles; i++) pdump (lppidlFiles[i]);
2542 }
2543 hResult = IDataObject_Constructor(hwnd, pidlFolder, lppidlFiles, cpidlFiles, FALSE, ppdataObject);
2544 return hResult;
2545}
2546
2547/*************************************************************************
2548 * SHCreateStdEnumFmtEtc [SHELL32.74]
2549 *
2550 * NOTES
2551 *
2552 */
2554 UINT cFormats,
2555 const FORMATETC *lpFormats,
2556 LPENUMFORMATETC *ppenumFormatetc)
2557{
2558 IEnumFORMATETC *pef;
2559 HRESULT hRes;
2560 TRACE("cf=%d fe=%p pef=%p\n", cFormats, lpFormats, ppenumFormatetc);
2561
2562 hRes = IEnumFORMATETC_Constructor(cFormats, lpFormats, &pef);
2563 if (FAILED(hRes))
2564 return hRes;
2565
2566 IEnumFORMATETC_AddRef(pef);
2567 hRes = IEnumFORMATETC_QueryInterface(pef, &IID_IEnumFORMATETC, (LPVOID*)ppenumFormatetc);
2568 IEnumFORMATETC_Release(pef);
2569
2570 return hRes;
2571}
2572
2573/*************************************************************************
2574 * SHFindFiles (SHELL32.90)
2575 */
2577{
2578 FIXME("params ignored: %p %p\n", pidlFolder, pidlSaveFile);
2580 {
2581 return FALSE;
2582 }
2583 /* Open the search results folder */
2584 /* FIXME: CSearchBar should be opened as well */
2585 return ShellExecuteW(NULL, NULL, L"explorer.exe", L"::{E17D4FC0-5564-11D1-83F2-00A0C90DC849}", NULL, SW_SHOWNORMAL) > (HINSTANCE)32;
2586}
2587
2588/*************************************************************************
2589 * SHUpdateImageW (SHELL32.192)
2590 *
2591 * Notifies the shell that an icon in the system image list has been changed.
2592 *
2593 * PARAMS
2594 * pszHashItem [I] Path to file that contains the icon.
2595 * iIndex [I] Zero-based index of the icon in the file.
2596 * uFlags [I] Flags determining the icon attributes. See notes.
2597 * iImageIndex [I] Index of the icon in the system image list.
2598 *
2599 * RETURNS
2600 * Nothing
2601 *
2602 * NOTES
2603 * uFlags can be one or more of the following flags:
2604 * GIL_NOTFILENAME - pszHashItem is not a file name.
2605 * GIL_SIMULATEDOC - Create a document icon using the specified icon.
2606#ifdef __REACTOS__
2607 * https://learn.microsoft.com/en-us/windows/win32/api/shlobj_core/nf-shlobj_core-shupdateimagew
2608#endif
2609 */
2610void WINAPI SHUpdateImageW(LPCWSTR pszHashItem, int iIndex, UINT uFlags, int iImageIndex)
2611{
2612#ifdef __REACTOS__
2613 // If iImageIndex == -1 (undetermined), it will fall back to the default value of 1.
2614 INT iEffectiveImageIndex = (iImageIndex == -1) ? 1 : iImageIndex;
2615
2617 item1.cbSize = sizeof(item1);
2618 item1.iIndex = iIndex;
2619 item1.iEffective = iEffectiveImageIndex;
2620 item1.uFlags = uFlags;
2621 item1.iEffective2 = iEffectiveImageIndex;
2622 item1.terminator = 0;
2623
2625
2626 LPWSTR pEnd = StrCpyNXW(item2.szHashItem, pszHashItem, _countof(item2.szHashItem));
2627 *pEnd = UNICODE_NULL;
2628
2629 item2.cbOffset = (WORD)((PBYTE)pEnd - (PBYTE)&item2);
2630 item2.iIndex = iIndex;
2631 item2.iEffectiveImageIndex = iEffectiveImageIndex;
2632 item2.uFlags = uFlags;
2633 item2.dwProcessId = GetCurrentProcessId();
2634 item2.terminator = 0;
2635
2637#else
2638 FIXME("%s, %d, 0x%x, %d - stub\n", debugstr_w(pszHashItem), iIndex, uFlags, iImageIndex);
2639#endif
2640}
2641
2642/*************************************************************************
2643 * SHUpdateImageA (SHELL32.191)
2644 *
2645 * See SHUpdateImageW.
2646#ifdef __REACTOS__
2647 * https://learn.microsoft.com/en-us/windows/win32/api/shlobj_core/nf-shlobj_core-shupdateimagea
2648#endif
2649 */
2650VOID WINAPI SHUpdateImageA(LPCSTR pszHashItem, INT iIndex, UINT uFlags, INT iImageIndex)
2651{
2652#ifdef __REACTOS__
2653 WCHAR szHashItem[MAX_PATH];
2654 SHAnsiToUnicode(pszHashItem, szHashItem, _countof(szHashItem));
2655 SHUpdateImageW(szHashItem, iIndex, uFlags, iImageIndex);
2656#else
2657 FIXME("%s, %d, 0x%x, %d - stub\n", debugstr_a(pszHashItem), iIndex, uFlags, iImageIndex);
2658#endif
2659}
2660
2661#ifdef __REACTOS__
2667#endif
2669{
2670#ifdef __REACTOS__
2671 if (!pidlExtra)
2672 return -1;
2673
2675 (UNALIGNED const SHCNF_UPDATEIMAGE_DATA_2*)pidlExtra;
2676 if (pData->dwProcessId == GetCurrentProcessId())
2677 return pData->iEffectiveImageIndex;
2678
2679 WCHAR szHashItem[MAX_PATH];
2680 StrCpyNW(szHashItem, pData->szHashItem, _countof(szHashItem));
2681
2682 return SHLookupIconIndexW(szHashItem, pData->iIndex, pData->uFlags);
2683#else
2684 FIXME("%p - stub\n", pidlExtra);
2685
2686 return -1;
2687#endif
2688}
2689
2691{
2692 LPITEMIDLIST pidl = NULL;
2693 switch (dwType)
2694 {
2695 case SHOP_FILEPATH:
2696 pidl = ILCreateFromPathW(szObject);
2697 break;
2698 }
2699 if (pidl)
2700 {
2701 SHELLEXECUTEINFOW sei = { sizeof(sei), SEE_MASK_INVOKEIDLIST, hwnd, L"properties",
2702 NULL, szPage, NULL, SW_SHOWNORMAL, NULL, pidl };
2703 BOOL result = ShellExecuteExW(&sei);
2704 ILFree(pidl);
2705 return result;
2706 }
2707
2708 FIXME("%p, 0x%08x, %s, %s - stub\n", hwnd, dwType, debugstr_w(szObject), debugstr_w(szPage));
2709
2710 return TRUE;
2711}
2712
2714 UINT uFlags)
2715{
2716 WCHAR wszLinkTo[MAX_PATH];
2717 WCHAR wszDir[MAX_PATH];
2718 WCHAR wszName[MAX_PATH];
2719 BOOL res;
2720
2721 MultiByteToWideChar(CP_ACP, 0, pszLinkTo, -1, wszLinkTo, MAX_PATH);
2722 MultiByteToWideChar(CP_ACP, 0, pszDir, -1, wszDir, MAX_PATH);
2723
2724 res = SHGetNewLinkInfoW(wszLinkTo, wszDir, wszName, pfMustCopy, uFlags);
2725
2726 if (res)
2727 WideCharToMultiByte(CP_ACP, 0, wszName, -1, pszName, MAX_PATH, NULL, NULL);
2728
2729 return res;
2730}
2731
2733 UINT uFlags)
2734{
2735 const WCHAR *basename;
2736 WCHAR *dst_basename;
2737 int i=2;
2738
2739 TRACE("(%s, %s, %p, %p, 0x%08x)\n", debugstr_w(pszLinkTo), debugstr_w(pszDir),
2740 pszName, pfMustCopy, uFlags);
2741
2742 *pfMustCopy = FALSE;
2743
2744 if (uFlags & SHGNLI_PIDL)
2745 {
2746 FIXME("SHGNLI_PIDL flag unsupported\n");
2747 return FALSE;
2748 }
2749
2750 if (uFlags)
2751 FIXME("ignoring flags: 0x%08x\n", uFlags);
2752
2753 /* FIXME: should test if the file is a shortcut or DOS program */
2755 return FALSE;
2756
2757 basename = strrchrW(pszLinkTo, '\\');
2758 if (basename)
2759 basename = basename+1;
2760 else
2761 basename = pszLinkTo;
2762
2763 lstrcpynW(pszName, pszDir, MAX_PATH);
2764 if (!PathAddBackslashW(pszName))
2765 return FALSE;
2766
2767 dst_basename = pszName + strlenW(pszName);
2768
2769 snprintfW(dst_basename, pszName + MAX_PATH - dst_basename, L"%s.lnk", basename);
2770
2772 {
2773 snprintfW(dst_basename, pszName + MAX_PATH - dst_basename, L"%s (%d).lnk", basename, i);
2774 i++;
2775 }
2776
2777 return TRUE;
2778}
2779
2781{
2782#ifdef __REACTOS__
2783 if (SHELL_OsIsUnicode())
2784 return SHStartNetConnectionDialogW(hwnd, (LPCWSTR)pszRemoteName, dwType);
2785 return SHStartNetConnectionDialogA(hwnd, pszRemoteName, dwType);
2786#else
2787 FIXME("%p, %s, 0x%08x - stub\n", hwnd, debugstr_a(pszRemoteName), dwType);
2788
2789 return S_OK;
2790#endif
2791}
2792
2793#ifndef __REACTOS__ /* See ../utils.cpp */
2794/*************************************************************************
2795 * SHSetLocalizedName (SHELL32.@)
2796 */
2797HRESULT WINAPI SHSetLocalizedName(LPCWSTR pszPath, LPCWSTR pszResModule, int idsRes)
2798{
2799 FIXME("%p, %s, %d - stub\n", pszPath, debugstr_w(pszResModule), idsRes);
2800
2801 return S_OK;
2802}
2803#endif
2804
2805#ifndef __REACTOS__ // See ../utils.cpp
2806/*************************************************************************
2807 * LinkWindow_RegisterClass (SHELL32.258)
2808 */
2810{
2811 FIXME("()\n");
2812 return TRUE;
2813}
2814
2815/*************************************************************************
2816 * LinkWindow_UnregisterClass (SHELL32.259)
2817 */
2819{
2820 FIXME("()\n");
2821 return TRUE;
2822}
2823#endif
2824
2825/*************************************************************************
2826 * SHFlushSFCache (SHELL32.526)
2827 *
2828 * Notifies the shell that a user-specified special folder location has changed.
2829 *
2830 * NOTES
2831 * In Wine, the shell folder registry values are not cached, so this function
2832 * has no effect.
2833 */
2835{
2836}
2837
2838/*************************************************************************
2839 * SHGetImageList (SHELL32.727)
2840 *
2841 * Returns a copy of a shell image list.
2842 *
2843 * NOTES
2844 * Windows XP features 4 sizes of image list, and Vista 5. Wine currently
2845 * only supports the traditional small and large image lists, so requests
2846 * for the others will currently fail.
2847 */
2848HRESULT WINAPI SHGetImageList(int iImageList, REFIID riid, void **ppv)
2849{
2850 HIMAGELIST hLarge, hSmall;
2851 HIMAGELIST hNew;
2852 HRESULT ret = E_FAIL;
2853
2854 /* Wine currently only maintains large and small image lists */
2855 if ((iImageList != SHIL_LARGE) && (iImageList != SHIL_SMALL) && (iImageList != SHIL_SYSSMALL))
2856 {
2857 FIXME("Unsupported image list %i requested\n", iImageList);
2858 return E_FAIL;
2859 }
2860
2861 Shell_GetImageLists(&hLarge, &hSmall);
2862#ifndef __REACTOS__
2863 hNew = ImageList_Duplicate(iImageList == SHIL_LARGE ? hLarge : hSmall);
2864
2865 /* Get the interface for the new image list */
2866 if (hNew)
2867 {
2869 ImageList_Destroy(hNew);
2870 }
2871#else
2872 /* Duplicating the imagelist causes the start menu items not to draw on
2873 * the first show. Was the Duplicate necessary for some reason? I believe
2874 * Windows returns the raw pointer here. */
2875 hNew = (iImageList == SHIL_LARGE ? hLarge : hSmall);
2876 ret = IImageList2_QueryInterface((IImageList2 *) hNew, riid, ppv);
2877#endif
2878
2879 return ret;
2880}
2881
2882#ifndef __REACTOS__
2883
2884/*************************************************************************
2885 * SHCreateShellFolderView [SHELL32.256]
2886 *
2887 * Create a new instance of the default Shell folder view object.
2888 *
2889 * RETURNS
2890 * Success: S_OK
2891 * Failure: error value
2892 *
2893 * NOTES
2894 * see IShellFolder::CreateViewObject
2895 */
2897 IShellView **ppsv)
2898{
2899 IShellView * psf;
2900 HRESULT hRes;
2901
2902 *ppsv = NULL;
2903 if (!pcsfv || pcsfv->cbSize != sizeof(*pcsfv))
2904 return E_INVALIDARG;
2905
2906 TRACE("sf=%p outer=%p callback=%p\n",
2907 pcsfv->pshf, pcsfv->psvOuter, pcsfv->psfvcb);
2908
2909 hRes = IShellView_Constructor(pcsfv->pshf, &psf);
2910 if (FAILED(hRes))
2911 return hRes;
2912
2913 hRes = IShellView_QueryInterface(psf, &IID_IShellView, (LPVOID *)ppsv);
2914 IShellView_Release(psf);
2915
2916 return hRes;
2917}
2918#endif
2919
2920
2921/*************************************************************************
2922 * SHTestTokenMembership [SHELL32.245]
2923 *
2924 * Checks whether a given token is a mamber of a local group with the
2925 * specified RID.
2926 *
2927 */
2929WINAPI
2931{
2933 DWORD nSubAuthority0, nSubAuthority1;
2934 DWORD nSubAuthorityCount;
2935 PSID SidToCheck;
2936 BOOL IsMember = FALSE;
2937
2938 if ((ulRID == SECURITY_SERVICE_RID) || ulRID == SECURITY_LOCAL_SYSTEM_RID)
2939 {
2940 nSubAuthority0 = ulRID;
2941 nSubAuthority1 = 0;
2942 nSubAuthorityCount= 1;
2943 }
2944 else
2945 {
2946 nSubAuthority0 = SECURITY_BUILTIN_DOMAIN_RID;
2947 nSubAuthority1 = ulRID;
2948 nSubAuthorityCount= 2;
2949 }
2950
2951 if (!AllocateAndInitializeSid(&ntAuth,
2952 nSubAuthorityCount,
2953 nSubAuthority0,
2954 nSubAuthority1,
2955 0, 0, 0, 0, 0, 0,
2956 &SidToCheck))
2957 {
2958 return FALSE;
2959 }
2960
2961 if (!CheckTokenMembership(TokenHandle, SidToCheck, &IsMember))
2962 {
2963 IsMember = FALSE;
2964 }
2965
2966 FreeSid(SidToCheck);
2967 return IsMember;
2968}
2969
2970/*************************************************************************
2971 * IsUserAnAdmin [SHELL32.680] NT 4.0
2972 *
2973 * Checks whether the current user is a member of the Administrators group.
2974 *
2975 * PARAMS
2976 * None
2977 *
2978 * RETURNS
2979 * Success: TRUE
2980 * Failure: FALSE
2981 */
2983{
2985}
2986
2987/*************************************************************************
2988 * SHLimitInputEdit(SHELL32.@)
2989 */
2990
2991/* TODO: Show baloon popup window with TTS_BALLOON */
2992
2993typedef struct UxSubclassInfo
2994{
3000
3001static void
3003{
3004 if (!pInfo)
3005 return;
3006
3007 RemovePropW(pInfo->hwnd, L"UxSubclassInfo");
3008
3011
3013
3014 HeapFree(GetProcessHeap(), 0, pInfo);
3015}
3016
3017static BOOL
3018DoSanitizeText(LPWSTR pszSanitized, LPCWSTR pszInvalidChars, LPCWSTR pszValidChars)
3019{
3020 LPWSTR pch1, pch2;
3021 BOOL bFound = FALSE;
3022
3023 for (pch1 = pch2 = pszSanitized; *pch1; ++pch1)
3024 {
3025 if (pszInvalidChars)
3026 {
3027 if (wcschr(pszInvalidChars, *pch1) != NULL)
3028 {
3029 bFound = TRUE;
3030 continue;
3031 }
3032 }
3033 else if (pszValidChars)
3034 {
3035 if (wcschr(pszValidChars, *pch1) == NULL)
3036 {
3037 bFound = TRUE;
3038 continue;
3039 }
3040 }
3041
3042 *pch2 = *pch1;
3043 ++pch2;
3044 }
3045 *pch2 = 0;
3046
3047 return bFound;
3048}
3049
3050static void
3052{
3053 HGLOBAL hData;
3054 LPWSTR pszText, pszSanitized;
3055 DWORD cbData;
3056
3058 return;
3059 if (!OpenClipboard(hwnd))
3060 return;
3061
3063 pszText = GlobalLock(hData);
3064 if (!pszText)
3065 {
3067 return;
3068 }
3069 SHStrDupW(pszText, &pszSanitized);
3070 GlobalUnlock(hData);
3071
3072 if (pszSanitized &&
3073 DoSanitizeText(pszSanitized, pInfo->pwszInvalidChars, pInfo->pwszValidChars))
3074 {
3075 MessageBeep(0xFFFFFFFF);
3076
3077 /* Update clipboard text */
3078 cbData = (lstrlenW(pszSanitized) + 1) * sizeof(WCHAR);
3080 pszText = GlobalLock(hData);
3081 if (pszText)
3082 {
3083 CopyMemory(pszText, pszSanitized, cbData);
3084 GlobalUnlock(hData);
3085
3087 }
3088 }
3089
3090 CoTaskMemFree(pszSanitized);
3092}
3093
3094static LRESULT CALLBACK
3096{
3097 WNDPROC fnWndProc;
3098 WCHAR wch;
3099 UxSubclassInfo *pInfo = GetPropW(hwnd, L"UxSubclassInfo");
3100 if (!pInfo)
3101 return DefWindowProcW(hwnd, uMsg, wParam, lParam);
3102
3103 fnWndProc = pInfo->fnWndProc;
3104
3105 switch (uMsg)
3106 {
3107 case WM_KEYDOWN:
3108 if (GetKeyState(VK_SHIFT) < 0 && wParam == VK_INSERT)
3109 DoSanitizeClipboard(hwnd, pInfo);
3110 else if (GetKeyState(VK_CONTROL) < 0 && wParam == L'V')
3111 DoSanitizeClipboard(hwnd, pInfo);
3112
3113 return CallWindowProcW(fnWndProc, hwnd, uMsg, wParam, lParam);
3114
3115 case WM_PASTE:
3116 DoSanitizeClipboard(hwnd, pInfo);
3117 return CallWindowProcW(fnWndProc, hwnd, uMsg, wParam, lParam);
3118
3119 case WM_CHAR:
3120 if (GetKeyState(VK_CONTROL) < 0 && wParam == L'V')
3121 break;
3122
3123 if (pInfo->pwszInvalidChars)
3124 {
3125 if (wcschr(pInfo->pwszInvalidChars, (WCHAR)wParam) != NULL)
3126 {
3127 MessageBeep(0xFFFFFFFF);
3128 break;
3129 }
3130 }
3131 else if (pInfo->pwszValidChars)
3132 {
3133 if (wcschr(pInfo->pwszValidChars, (WCHAR)wParam) == NULL)
3134 {
3135 MessageBeep(0xFFFFFFFF);
3136 break;
3137 }
3138 }
3139 return CallWindowProcW(fnWndProc, hwnd, uMsg, wParam, lParam);
3140
3141 case WM_UNICHAR:
3142 if (wParam == UNICODE_NOCHAR)
3143 return TRUE;
3144
3145 /* FALL THROUGH */
3146
3147 case WM_IME_CHAR:
3148 wch = (WCHAR)wParam;
3149 if (GetKeyState(VK_CONTROL) < 0 && wch == L'V')
3150 break;
3151
3152 if (!IsWindowUnicode(hwnd) && HIBYTE(wch) != 0)
3153 {
3154 CHAR data[] = {HIBYTE(wch), LOBYTE(wch)};
3155 MultiByteToWideChar(CP_ACP, 0, data, 2, &wch, 1);
3156 }
3157
3158 if (pInfo->pwszInvalidChars)
3159 {
3160 if (wcschr(pInfo->pwszInvalidChars, wch) != NULL)
3161 {
3162 MessageBeep(0xFFFFFFFF);
3163 break;
3164 }
3165 }
3166 else if (pInfo->pwszValidChars)
3167 {
3168 if (wcschr(pInfo->pwszValidChars, wch) == NULL)
3169 {
3170 MessageBeep(0xFFFFFFFF);
3171 break;
3172 }
3173 }
3174 return CallWindowProcW(fnWndProc, hwnd, uMsg, wParam, lParam);
3175
3176 case WM_NCDESTROY:
3178 return CallWindowProcW(fnWndProc, hwnd, uMsg, wParam, lParam);
3179
3180 default:
3181 return CallWindowProcW(fnWndProc, hwnd, uMsg, wParam, lParam);
3182 }
3183
3184 return 0;
3185}
3186
3187static UxSubclassInfo *
3189{
3190 UxSubclassInfo *pInfo;
3192 if (!pInfo)
3193 {
3194 ERR("HeapAlloc failed.\n");
3196 CoTaskMemFree(invalid);
3197 return NULL;
3198 }
3199
3201 if (!pInfo->fnWndProc)
3202 {
3203 ERR("SetWindowLongPtrW failed\n");
3205 CoTaskMemFree(invalid);
3206 HeapFree(GetProcessHeap(), 0, pInfo);
3207 return NULL;
3208 }
3209
3210 pInfo->hwnd = hwnd;
3211 pInfo->pwszValidChars = valid;
3212 pInfo->pwszInvalidChars = invalid;
3213 if (!SetPropW(hwnd, L"UxSubclassInfo", pInfo))
3214 {
3216 pInfo = NULL;
3217 }
3218 return pInfo;
3219}
3220
3223{
3224 IItemNameLimits *pLimits;
3225 HRESULT hr;
3226 LPWSTR pwszValidChars, pwszInvalidChars;
3227 UxSubclassInfo *pInfo;
3228
3229 pInfo = GetPropW(hWnd, L"UxSubclassInfo");
3230 if (pInfo)
3231 {
3233 pInfo = NULL;
3234 }
3235
3236 hr = psf->lpVtbl->QueryInterface(psf, &IID_IItemNameLimits, (LPVOID *)&pLimits);
3237 if (FAILED(hr))
3238 {
3239 ERR("hr: %x\n", hr);
3240 return hr;
3241 }
3242
3243 pwszValidChars = pwszInvalidChars = NULL;
3244 hr = pLimits->lpVtbl->GetValidCharacters(pLimits, &pwszValidChars, &pwszInvalidChars);
3245 if (FAILED(hr))
3246 {
3247 ERR("hr: %x\n", hr);
3248 pLimits->lpVtbl->Release(pLimits);
3249 return hr;
3250 }
3251
3252 pInfo = UxSubclassInfo_Create(hWnd, pwszValidChars, pwszInvalidChars);
3253 if (!pInfo)
3254 hr = E_FAIL;
3255
3256 pLimits->lpVtbl->Release(pLimits);
3257
3258 return hr;
3259}
3260
3261#ifdef __REACTOS__
3262/*************************************************************************
3263 * SHLimitInputCombo [SHELL32.748]
3264 *
3265 * Sets limits on valid characters for a combobox control.
3266 * This function works like SHLimitInputEdit, but the target is a combobox
3267 * instead of a textbox.
3268 */
3271{
3272 HWND hwndEdit;
3273
3274 TRACE("%p %p\n", hWnd, psf);
3275
3277 if (!hwndEdit)
3278 return E_FAIL;
3279
3280 return SHLimitInputEdit(hwndEdit, psf);
3281}
3282#endif
HRESULT IDataObject_Constructor(HWND hwndOwner, PCIDLIST_ABSOLUTE pMyPidl, PCUIDLIST_RELATIVE_ARRAY apidl, UINT cidl, BOOL bExtendedObject, IDataObject **dataObject)
HRESULT IEnumFORMATETC_Constructor(UINT cfmt, const FORMATETC afmt[], IEnumFORMATETC **ppFormat)
UINT DriveType
#define shell32_hInstance
#define read
Definition: acwin.h:97
WINBASEAPI _Check_return_ _Out_ AppPolicyProcessTerminationMethod * policy
Definition: appmodel.h:78
HWND hWnd
Definition: settings.c:17
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define CF_UNICODETEXT
Definition: constants.h:408
void shell(int argc, const char *argv[])
Definition: cmds.c:1231
#define ARRAY_SIZE(A)
Definition: main.h:20
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
#define ERR(fmt,...)
Definition: precomp.h:57
#define EXTERN_C
Definition: basetyps.h:12
#define RegCloseKey(hKey)
Definition: registry.h:49
#define ARRAYSIZE(a)
Definition: cat.c:25
EXTERN_C void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2)
HINSTANCE hInstance
Definition: charmap.c:19
Definition: bufpool.h:45
WPARAM wParam
Definition: combotst.c:138
HWND hwndEdit
Definition: combotst.c:65
LPARAM lParam
Definition: combotst.c:139
INT(CALLBACK * MRUCMPPROCW)(LPCWSTR, LPCWSTR)
#define MRU_BINARY
HANDLE WINAPI CreateMRUListW(const MRUINFOW *infoW)
#define MRU_CACHEWRITE
#define OFN_EXPLORER
Definition: commdlg.h:104
#define OFN_HIDEREADONLY
Definition: commdlg.h:107
#define OFN_FILEMUSTEXIST
Definition: commdlg.h:106
static HWND hwndParent
Definition: cryptui.c:299
static TAGID TAGID find
Definition: db.cpp:156
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_FAIL
Definition: ddrawi.h:102
void pdump(LPCITEMIDLIST pidl)
Definition: debughlp.cpp:322
HRESULT hr
Definition: delayimp.cpp:582
#define ERROR_SUCCESS
Definition: deptool.c:10
static LPVOID LPUNKNOWN
Definition: dinput.c:53
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1096
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
Definition: reg.c:3298
LONG WINAPI RegEnumKeyExW(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPWSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPWSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
Definition: reg.c:2504
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3268
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4882
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
Definition: reg.c:4009
LONG WINAPI RegCreateKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD Reserved, _In_ LPSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_ LPDWORD lpdwDisposition)
Definition: reg.c:1034
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
LONG WINAPI RegDeleteKeyA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey)
Definition: reg.c:1224
BOOL WINAPI CheckTokenMembership(IN HANDLE ExistingTokenHandle, IN PSID SidToCheck, OUT PBOOL IsMember)
Definition: token.c:21
BOOL WINAPI AllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority, BYTE nSubAuthorityCount, DWORD nSubAuthority0, DWORD nSubAuthority1, DWORD nSubAuthority2, DWORD nSubAuthority3, DWORD nSubAuthority4, DWORD nSubAuthority5, DWORD nSubAuthority6, DWORD nSubAuthority7, PSID *pSid)
Definition: security.c:674
PVOID WINAPI FreeSid(PSID pSid)
Definition: security.c:698
UINT uFlags
Definition: api.c:59
void WINAPI DECLSPEC_HOTPATCH CoFreeUnusedLibraries(void)
Definition: combase.c:1936
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: combase.c:2842
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, IUnknown *outer, DWORD cls_context, REFIID riid, void **obj)
Definition: combase.c:1685
void WINAPI CoTaskMemFree(void *ptr)
Definition: malloc.c:389
HRESULT WINAPI HIMAGELIST_QueryInterface(HIMAGELIST himl, REFIID riid, void **ppv)
Definition: imagelist.c:4132
HIMAGELIST WINAPI ImageList_Duplicate(HIMAGELIST himlSrc)
Definition: imagelist.c:1819
VOID WINAPI ImageList_EndDrag(void)
Definition: imagelist.c:1865
BOOL WINAPI ImageList_DragEnter(HWND hwndLock, INT x, INT y)
Definition: imagelist.c:976
BOOL WINAPI ImageList_DragMove(INT x, INT y)
Definition: imagelist.c:1088
BOOL WINAPI ImageList_DragLeave(HWND hwndLock)
Definition: imagelist.c:1010
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:941
BOOL WINAPI ImageList_BeginDrag(HIMAGELIST himlTrack, INT iTrack, INT dxHotspot, INT dyHotspot)
Definition: imagelist.c:648
BOOL WINAPI ImageList_DragShowNolock(BOOL bShow)
Definition: imagelist.c:1171
#define CloseHandle
Definition: compat.h:739
#define wcschr
Definition: compat.h:17
#define GetProcessHeap()
Definition: compat.h:736
#define CP_ACP
Definition: compat.h:109
#define OPEN_EXISTING
Definition: compat.h:775
#define lstrcpynA
Definition: compat.h:751
#define GetProcAddress(x, y)
Definition: compat.h:753
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define HeapAlloc
Definition: compat.h:733
#define FreeLibrary(x)
Definition: compat.h:748
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:105
#define GENERIC_READ
Definition: compat.h:135
#define TRACE_ON(x)
Definition: compat.h:75
#define MAX_PATH
Definition: compat.h:34
#define HeapFree(x, y, z)
Definition: compat.h:735
#define CreateFileW
Definition: compat.h:741
#define WINE_DECLARE_DEBUG_CHANNEL(x)
Definition: compat.h:45
#define CALLBACK
Definition: compat.h:35
#define lstrcpyW
Definition: compat.h:749
#define WideCharToMultiByte
Definition: compat.h:111
#define MultiByteToWideChar
Definition: compat.h:110
#define LoadLibraryW(x)
Definition: compat.h:747
#define FILE_SHARE_READ
Definition: compat.h:136
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define lstrcpynW
Definition: compat.h:738
#define lstrlenW
Definition: compat.h:750
static const WCHAR *const ext[]
Definition: module.c:53
DWORD WINAPI ExpandEnvironmentStringsA(IN LPCSTR lpSrc, IN LPSTR lpDst, IN DWORD nSize)
Definition: environ.c:372
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
Definition: environ.c:492
UINT WINAPI SetErrorMode(IN UINT uMode)
Definition: except.c:751
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
UINT WINAPI GetDriveTypeW(IN LPCWSTR lpRootPathName)
Definition: disk.c:497
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:636
DWORD WINAPI GetFileAttributesA(LPCSTR lpFileName)
Definition: fileinfo.c:620
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:320
BOOL WINAPI FindClose(HANDLE hFindFile)
Definition: find.c:502
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
Definition: path.c:2098
DWORD WINAPI GetLongPathNameW(IN LPCWSTR lpszShortPath, OUT LPWSTR lpszLongPath, IN DWORD cchBuffer)
Definition: path.c:1555
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
Definition: path.c:1164
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:583
DWORD WINAPI FormatMessageA(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:483
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4171
int WINAPI lstrcmpiA(LPCSTR str1, LPCSTR str2)
Definition: locale.c:4133
#define IS_INTRESOURCE(x)
Definition: loader.c:613
WCHAR *WINAPI PathFindFileNameW(const WCHAR *path)
Definition: path.c:1677
void WINAPI PathStripPathA(char *path)
Definition: path.c:2292
LPWSTR WINAPI PathFindExtensionW(const WCHAR *path)
Definition: path.c:1250
BOOL WINAPI PathFileExistsW(const WCHAR *path)
Definition: path.c:2583
WCHAR *WINAPI StrCatBuffW(WCHAR *str, const WCHAR *cat, INT max_len)
Definition: string.c:1434
WCHAR *WINAPI StrCpyNXW(WCHAR *dst, const WCHAR *src, int len)
Definition: string.c:1072
INT WINAPI DECLSPEC_HOTPATCH LoadStringA(HINSTANCE instance, UINT resource_id, LPSTR buffer, INT buflen)
Definition: string.c:1307
WCHAR *WINAPI StrCpyNW(WCHAR *dst, const WCHAR *src, int count)
Definition: string.c:470
GUID guid
Definition: version.c:147
static void basename(LPCWSTR path, LPWSTR name)
Definition: profile.c:38
static MonoProfilerRuntimeShutdownBeginCallback cb
Definition: metahost.c:118
HRESULT WINAPI OleFlushClipboard(void)
Definition: clipboard.c:2290
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:531
HRESULT WINAPI DECLSPEC_HOTPATCH OleInitialize(LPVOID reserved)
Definition: ole2.c:162
HRESULT WINAPI RegisterDragDrop(HWND hwnd, LPDROPTARGET pDropTarget)
Definition: ole2.c:547
HRESULT WINAPI DoDragDrop(IDataObject *pDataObject, IDropSource *pDropSource, DWORD dwOKEffect, DWORD *pdwEffect)
Definition: ole2.c:737
HRESULT WINAPI RevokeDragDrop(HWND hwnd)
Definition: ole2.c:629
HRESULT WINAPI SHStrDupW(const WCHAR *src, WCHAR **dest)
Definition: main.c:1692
DWORD WINAPI SHGetValueW(HKEY hkey, const WCHAR *subkey, const WCHAR *value, DWORD *type, void *data, DWORD *data_len)
Definition: main.c:2222
DWORD WINAPI SHQueryValueExA(HKEY hkey, const char *name, DWORD *reserved, DWORD *type, void *buff, DWORD *buff_len)
Definition: main.c:2149
DWORD WINAPI SHAnsiToUnicode(const char *src, WCHAR *dest, int dest_len)
Definition: main.c:1801
DWORD WINAPI SHSetValueW(HKEY hkey, const WCHAR *subkey, const WCHAR *value, DWORD type, const void *data, DWORD data_len)
Definition: main.c:2292
DWORD WINAPI SHDeleteKeyW(HKEY hkey, const WCHAR *subkey)
Definition: main.c:1886
#define ShellMessageBoxW
Definition: precomp.h:63
EXTERN_C BOOL WINAPI SHELL32_RunControlPanel(_In_ PCWSTR commandLine, _In_opt_ HWND parent)
EXTERN_C HRESULT WINAPI SHStartNetConnectionDialogW(_In_ HWND hwnd, _In_ LPCWSTR pszRemoteName, _In_ DWORD dwType)
Definition: stubs.cpp:457
EXTERN_C INT WINAPI SHLookupIconIndexW(LPCWSTR lpName, INT iIndex, UINT uFlags)
Definition: stubs.cpp:413
EXTERN_C BOOL WINAPI PathIsEqualOrSubFolder(_In_ LPCWSTR pszPath1OrCSIDL, _In_ LPCWSTR pszPath2)
Definition: utils.cpp:1718
EXTERN_C HRESULT WINAPI SHStartNetConnectionDialogA(_In_ HWND hwnd, _In_ LPCSTR pszRemoteName, _In_ DWORD dwType)
Definition: utils.cpp:1609
HRESULT WINAPI SHGetMalloc(LPMALLOC *lpmal)
Definition: shellole.c:329
DWORD WINAPI SHCLSIDFromStringW(LPCWSTR clsid, CLSID *id)
Definition: shellole.c:300
HRESULT WINAPI SHGetSpecialFolderLocation(HWND hwndOwner, INT nFolder, LPITEMIDLIST *ppidl)
Definition: shellpath.c:3385
BOOL WINAPI SHGetSpecialFolderPathW(HWND hwndOwner, LPWSTR szPath, int nFolder, BOOL bCreate)
Definition: shellpath.c:3220
DWORD WINAPI SHSendMessageBroadcastW(UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: ordinal.c:3616
HKEY WINAPI SHGetShellKey(DWORD flags, LPCWSTR sub_key, BOOL create)
Definition: ordinal.c:4049
BOOL WINAPI PathIsDirectoryW(LPCWSTR lpszPath)
Definition: path.c:669
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
#define pt(x, y)
Definition: drawing.c:79
return ret
Definition: mutex.c:147
#define L(x)
Definition: resources.c:13
r parent
Definition: btrfs.c:3010
#define UlongToPtr(u)
Definition: config.h:106
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
FxAutoRegKey hKey
BOOLEAN valid
EXTERN_C BOOL SHELL32_ReadRegShellState(PREGSHELLSTATE prss)
Definition: general.cpp:79
EXTERN_C void SHELL32_GetDefaultShellState(LPSHELLSTATE pss)
Definition: general.cpp:34
EXTERN_C LSTATUS SHELL32_WriteRegShellState(PREGSHELLSTATE prss)
Definition: general.cpp:52
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
const GLdouble * v
Definition: gl.h:2040
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLsizei samples
Definition: glext.h:7006
GLuint res
Definition: glext.h:9613
GLenum src
Definition: glext.h:6340
GLuint buffer
Definition: glext.h:5915
GLenum GLenum dst
Definition: glext.h:6340
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
GLuint GLfloat * val
Definition: glext.h:7180
GLuint64EXT * result
Definition: glext.h:11304
GLfloat GLfloat p
Definition: glext.h:8902
GLenum GLsizei len
Definition: glext.h:6722
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
unsigned int UINT
Definition: sysinfo.c:13
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:1390
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
#define ss
Definition: i386-dis.c:441
#define cs
Definition: i386-dis.c:442
BOOL SIC_Initialize(void)
Definition: iconcache.cpp:515
BOOL WINAPI Shell_GetImageLists(HIMAGELIST *lpBigList, HIMAGELIST *lpSmallList)
Definition: iconcache.cpp:689
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
HRESULT GetValidCharacters([out, string] LPWSTR *ppwszValidChars, [out, string] LPWSTR *ppwszInvalidChars)
HRESULT ReplacePage([in] EXPPS uPageID, [in] LPFNSVADDPROPSHEETPAGE pfnReplaceWith, [in] LPARAM lParam)
HRESULT AddPages([in] LPFNSVADDPROPSHEETPAGE pfnAddPage, [in] LPARAM lParam)
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
ULONG Release()
nsresult QueryInterface(nsIIDRef riid, void **result)
nsrefcnt Release()
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
#define C_ASSERT(e)
Definition: intsafe.h:73
static ERESOURCE GlobalLock
Definition: sys_arch.c:8
#define LOBYTE(W)
Definition: jmemdos.c:487
#define HIBYTE(W)
Definition: jmemdos.c:486
int const JOCTET unsigned int datalen
Definition: jpeglib.h:1033
#define debugstr_a
Definition: kernel32.h:31
#define debugstr_w
Definition: kernel32.h:32
HWND hList
Definition: livecd.c:10
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:123
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
TCHAR szTitle[MAX_LOADSTRING]
Definition: magnifier.c:35
#define ZeroMemory
Definition: minwinbase.h:31
#define CopyMemory
Definition: minwinbase.h:29
#define LMEM_FIXED
Definition: minwinbase.h:81
LONG_PTR LPARAM
Definition: minwindef.h:175
LONG_PTR LRESULT
Definition: minwindef.h:176
UINT_PTR WPARAM
Definition: minwindef.h:174
int * LPINT
Definition: minwindef.h:151
CONST void * LPCVOID
Definition: minwindef.h:164
#define error(str)
Definition: mkdosfs.c:1605
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
LPCWSTR szPath
Definition: env.c:37
static PVOID ptr
Definition: dispmode.c:27
static char szTempPath[MAX_PATH]
Definition: data.c:16
D3D11_SHADER_VARIABLE_DESC desc
Definition: reflection.c:1683
HRESULT hres
Definition: protocol.c:432
static HMODULE hmodule
Definition: rasapi.c:29
@ SHKEY_Key_Explorer
Definition: ordinal.c:2807
@ SHKEY_Root_HKCU
Definition: ordinal.c:2805
static const struct metadata_item item1[]
Definition: metadata.c:3603
static const struct metadata_item item2[]
Definition: metadata.c:3608
static BYTE parameters[]
Definition: asn.c:558
const CLSID * clsid
Definition: msctf.cpp:50
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
_In_ HANDLE hFile
Definition: mswsock.h:90
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:95
_In_ ACCESS_MASK _In_ ULONG _Out_ PHANDLE TokenHandle
Definition: psfuncs.h:749
#define SEM_FAILCRITICALERRORS
Definition: rtltypes.h:69
_In_ LPWSTR _In_ DWORD _In_ DWORD _In_ DWORD dwFlags
Definition: netsh.h:141
_Out_ LPWSTR lpBuffer
Definition: netsh.h:68
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
#define REG_BINARY
Definition: nt_native.h:1499
#define KEY_ALL_ACCESS
Definition: nt_native.h:1044
#define KEY_READ
Definition: nt_native.h:1026
NTSYSAPI NTSTATUS NTAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, PANSI_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define KEY_ENUMERATE_SUB_KEYS
Definition: nt_native.h:1022
#define BOOL
Definition: nt_native.h:43
#define KEY_WRITE
Definition: nt_native.h:1034
#define DWORD
Definition: nt_native.h:44
#define GENERIC_WRITE
Definition: nt_native.h:90
NTSYSAPI VOID NTAPI RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString)
#define FILE_ATTRIBUTE_TEMPORARY
Definition: nt_native.h:708
#define DBG_UNREFERENCED_LOCAL_VARIABLE(L)
Definition: ntbasedef.h:331
#define UNICODE_NULL
static HANDLE ULONG_PTR dwData
Definition: pipe.c:111
interface IEnumFORMATETC * LPENUMFORMATETC
Definition: objfwd.h:24
interface IDataObject * LPDATAOBJECT
Definition: objfwd.h:21
const GUID IID_IEnumFORMATETC
const GUID IID_IPersistFile
#define PathAppendA
Definition: pathcch.h:309
#define PathAddBackslashW
Definition: pathcch.h:302
#define PathAppendW
Definition: pathcch.h:310
#define UNALIGNED
Definition: pecoff.h:347
#define LOWORD(l)
Definition: pedump.c:82
#define ES_READONLY
Definition: pedump.c:675
BYTE * PBYTE
Definition: pedump.c:66
short WCHAR
Definition: pedump.c:58
long LONG
Definition: pedump.c:60
char CHAR
Definition: pedump.c:57
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:1051
BOOL WINAPI SHGetPathFromIDListA(LPCITEMIDLIST pidl, LPSTR pszPath)
Definition: pidl.c:1434
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
Definition: pidl.c:1496
LPITEMIDLIST WINAPI ILCreateFromPathW(LPCWSTR path)
Definition: pidl.c:1108
static const WCHAR szDescription[]
Definition: powrprof.c:46
BOOL(CALLBACK * LPFNADDPROPSHEETPAGE)(HPROPSHEETPAGE, LPARAM)
Definition: prsht.h:327
#define REFIID
Definition: guiddef.h:118
_In_opt_ _In_opt_ _In_ _In_ DWORD cbData
Definition: shlwapi.h:761
_In_opt_ LPCSTR pszSubKey
Definition: shlwapi.h:783
#define SW_SHOWNORMAL
Definition: winuser.h:781
BOOL WINAPI DeregisterShellHookWindow(_In_ HWND)
#define MB_SETFOREGROUND
Definition: winuser.h:825
#define GetWindowLongPtrW
Definition: winuser.h:4983
#define WM_PASTE
Definition: winuser.h:1891
HANDLE WINAPI RemovePropW(_In_ HWND, _In_ LPCWSTR)
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI RegisterShellHookWindow(_In_ HWND)
int WINAPI MessageBoxA(_In_opt_ HWND hWnd, _In_opt_ LPCSTR lpText, _In_opt_ LPCSTR lpCaption, _In_ UINT uType)
HANDLE WINAPI SetClipboardData(_In_ UINT, _In_opt_ HANDLE)
HWND WINAPI GetTopWindow(_In_opt_ HWND)
BOOL WINAPI CloseClipboard(void)
Definition: ntwrapper.h:178
BOOL WINAPI WinHelpW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_ UINT, _In_ ULONG_PTR)
#define VK_CONTROL
Definition: winuser.h:2239
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:3074
BOOL WINAPI OpenClipboard(_In_opt_ HWND)
BOOL WINAPI MessageBeep(_In_ UINT uType)
HANDLE WINAPI GetClipboardData(_In_ UINT)
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
int WINAPIV wsprintfA(_Out_ LPSTR, _In_ _Printf_format_string_ LPCSTR,...)
#define WM_SETTINGCHANGE
Definition: winuser.h:1657
BOOL WINAPI IsWindowUnicode(_In_ HWND)
#define WM_IME_CHAR
Definition: winuser.h:1862
BOOL WINAPI SetPropW(_In_ HWND, _In_ LPCWSTR, _In_opt_ HANDLE)
#define WM_CHAR
Definition: winuser.h:1745
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
#define WM_NCDESTROY
Definition: winuser.h:1712
#define MB_ICONSTOP
Definition: winuser.h:814
#define VK_SHIFT
Definition: winuser.h:2238
#define WM_KEYDOWN
Definition: winuser.h:1743
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:3014
#define SetWindowLongPtrW
Definition: winuser.h:5512
LRESULT WINAPI CallWindowProcW(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define GWL_STYLE
Definition: winuser.h:863
#define VK_INSERT
Definition: winuser.h:2268
SHORT WINAPI GetKeyState(_In_ int)
#define err(...)
#define WM_UNICHAR
Definition: richedit.h:67
const WCHAR * str
#define REG_DWORD
Definition: sdbapi.c:615
wcscat
#define LoadStringW
Definition: utils.h:64
#define memset(x, y, z)
Definition: compat.h:39
#define args
Definition: format.c:66
#define _WIN32_WINNT_VISTA
Definition: sdkddkver.h:25
static __inline BOOL SHELL_OsIsUnicode(void)
Definition: shell32_main.h:197
#define SHIL_SYSSMALL
Definition: shellapi.h:187
#define SHIL_SMALL
Definition: shellapi.h:185
_In_ LPCSTR pszDir
Definition: shellapi.h:609
#define SHIL_LARGE
Definition: shellapi.h:184
#define SEE_MASK_INVOKEIDLIST
Definition: shellapi.h:28
_In_ LPCSTR _Out_ BOOL * pfMustCopy
Definition: shellapi.h:611
#define SHGNLI_PIDL
Definition: shellapi.h:416
BOOL WINAPI SignalFileOpen(PCIDLIST_ABSOLUTE pidl)
Definition: shellord.c:836
struct _PSXA_CALL * PPSXA_CALL
HRESULT WINAPI SHLoadOLE(LPARAM lParam)
Definition: shellord.c:2029
static INT CALLBACK SHADD_compare_mru(LPCVOID data1, LPCVOID data2, DWORD cbData)
Definition: shellord.c:899
DWORD WINAPI DoEnvironmentSubstAW(LPVOID x, UINT y)
Definition: shellord.c:2194
static BOOL DoSanitizeText(LPWSTR pszSanitized, LPCWSTR pszInvalidChars, LPCWSTR pszValidChars)
Definition: shellord.c:3018
HRESULT WINAPI SHRegisterDragDrop(HWND hWnd, LPDROPTARGET pDropTarget)
Definition: shellord.c:750
WORD WINAPI ArrangeWindows(HWND hwndParent, DWORD dwReserved, const RECT *lpRect, WORD cKids, const HWND *lpKids)
Definition: shellord.c:820
DWORD WINAPI DoEnvironmentSubstW(LPWSTR pszString, UINT cchString)
Definition: shellord.c:2164
HRESULT WINAPI SHAbortInvokeCommand(void)
Definition: shellord.c:2056
BOOL WINAPI DAD_AutoScroll(HWND hwnd, AUTO_SCROLL_DATA *samples, const POINT *pt)
Definition: shellord.c:1761
BOOL WINAPI DAD_DragEnterEx(_In_ HWND hwnd, _In_ POINT p)
Definition: shellord.c:1796
void WINAPI SHUpdateImageW(LPCWSTR pszHashItem, int iIndex, UINT uFlags, int iImageIndex)
Definition: shellord.c:2610
void WINAPI SHAddToRecentDocs(UINT uFlags, LPCVOID pv)
Definition: shellord.c:1022
HRESULT WINAPI SHStartNetConnectionDialog(HWND hwnd, LPCSTR pszRemoteName, DWORD dwType)
Definition: shellord.c:2780
int WINAPI InvalidateDriveType(int u)
Definition: shellord.c:2047
VOID WINAPI SHGetSettings(LPSHELLFLAGSTATE lpsfs, DWORD dwMask)
Definition: shellord.c:420
BOOL WINAPI RegisterShellHook(HWND hWnd, DWORD dwType)
Definition: shellord.c:521
BOOL WINAPI SHObjectProperties(HWND hwnd, DWORD dwType, LPCWSTR szObject, LPCWSTR szPage)
Definition: shellord.c:2690
#define MRUF_BINARY_LIST
Definition: shellord.c:66
void WINAPI SHFreeUnusedLibraries(void)
Definition: shellord.c:1752
static BOOL CALLBACK PsxaCall(HPROPSHEETPAGE hpage, LPARAM lParam)
Definition: shellord.c:2306
static HIMAGELIST DAD_himlTrack
Definition: shellord.c:76
struct _PSXA PSXA
#define MRUF_DELAYED_SAVE
Definition: shellord.c:67
static BOOL DAD_bDragging
Definition: shellord.c:78
INT WINAPI SHHandleUpdateImage(PCIDLIST_ABSOLUTE pidlExtra)
Definition: shellord.c:2668
void WINAPI SHDestroyPropSheetExtArray(HPSXA hpsxa)
Definition: shellord.c:2504
HRESULT WINAPI SHCreateStdEnumFmtEtc(UINT cFormats, const FORMATETC *lpFormats, LPENUMFORMATETC *ppenumFormatetc)
Definition: shellord.c:2553
EXTERN_C BOOL WINAPI SHTestTokenMembership(HANDLE TokenHandle, ULONG ulRID)
Definition: shellord.c:2930
INT WINAPI FindMRUData(HANDLE hList, LPCVOID lpData, DWORD cbData, LPINT lpRegNum)
struct _PSXA * PPSXA
HRESULT WINAPI SHGetImageList(int iImageList, REFIID riid, void **ppv)
Definition: shellord.c:2848
static void DoSanitizeClipboard(HWND hwnd, UxSubclassInfo *pInfo)
Definition: shellord.c:3051
HANDLE WINAPI CreateMRUListA(LPCREATEMRULISTA lpcml)
BOOL WINAPI DAD_SetDragImage(_In_ HIMAGELIST himlTrack, _In_opt_ LPPOINT lppt)
Definition: shellord.c:1866
BOOL WINAPI DAD_DragEnter(_In_ HWND hwnd)
Definition: shellord.c:1776
DWORD WINAPI ParseFieldAW(LPCVOID src, DWORD nField, LPVOID dst, DWORD len)
Definition: shellord.c:147
void WINAPI SHFlushSFCache(void)
Definition: shellord.c:2834
BOOL WINAPI LinkWindow_RegisterClass(void)
Definition: shellord.c:2809
static POINT DAD_ptHotspot
Definition: shellord.c:77
BOOL WINAPI GUIDFromStringA(LPCSTR str, LPGUID guid)
Definition: shellord.c:2204
BOOL WINAPI PathIsTemporaryW(LPWSTR Str)
Definition: shellord.c:2258
struct tagCREATEMRULIST * LPCREATEMRULISTA
BOOL WINAPI GUIDFromStringW(LPCWSTR str, LPGUID guid)
Definition: shellord.c:2219
BOOL WINAPI LinkWindow_UnregisterClass(DWORD dwUnused)
Definition: shellord.c:2818
VOID WINAPI SHUpdateImageA(LPCSTR pszHashItem, INT iIndex, UINT uFlags, INT iImageIndex)
Definition: shellord.c:2650
HRESULT WINAPI SHWinHelp(HWND hwnd, LPCWSTR pszHelp, UINT uCommand, ULONG_PTR dwData)
Definition: shellord.c:1656
HPSXA WINAPI SHCreatePropSheetExtArrayEx(HKEY hKey, LPCWSTR pszSubKey, UINT max_iface, LPDATAOBJECT pDataObj)
Definition: shellord.c:2365
DWORD WINAPI ParseFieldW(LPCWSTR src, DWORD nField, LPWSTR dst, DWORD len)
Definition: shellord.c:121
static LRESULT CALLBACK LimitEditWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: shellord.c:3095
BOOL WINAPI ReadCabinetState(CABINETSTATE *cs, int length)
Definition: shellord.c:1915
BOOL WINAPI FileIconInit(BOOL bFullInit)
Definition: shellord.c:1997
int ShellMessageBoxA(HINSTANCE hInstance, HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType,...)
Definition: shellord.c:637
BOOL WINAPI DAD_ShowDragImage(_In_ BOOL bShow)
Definition: shellord.c:1903
DWORD WINAPI RLBuildListOfPaths(void)
Definition: shellord.c:2100
VOID WINAPI FreeMRUList(HANDLE hMRUList)
BOOL WINAPI SHGetNewLinkInfoW(LPCWSTR pszLinkTo, LPCWSTR pszDir, LPWSTR pszName, BOOL *pfMustCopy, UINT uFlags)
Definition: shellord.c:2732
static INT SHADD_create_add_mru_data(HANDLE mruhandle, LPCSTR doc_name, LPCSTR new_lnk_name, LPSTR buffer, INT *len)
Definition: shellord.c:967
DWORD WINAPI DoEnvironmentSubstA(LPSTR pszString, UINT cchString)
Definition: shellord.c:2119
VOID WINAPI SHGetSetSettings(LPSHELLSTATE lpss, DWORD dwMask, BOOL bSet)
Definition: shellord.c:229
static INT SHADD_get_policy(LPCSTR policy, LPDWORD type, LPVOID buffer, LPDWORD len)
Definition: shellord.c:858
HRESULT WINAPI SetAppStartingCursor(HWND u, DWORD v)
Definition: shellord.c:2005
HRESULT WINAPI SHRevokeDragDrop(HWND hWnd)
Definition: shellord.c:785
BOOL WINAPI SHRunControlPanel(_In_ LPCWSTR commandLine, _In_opt_ HWND parent)
Definition: shellord.c:1696
HRESULT WINAPI SHLimitInputEdit(HWND hWnd, IShellFolder *psf)
Definition: shellord.c:3222
struct _PSXA_CALL PSXA_CALL
BOOL WINAPI SHValidateUNC(HWND hwndOwner, PWSTR pszFile, UINT fConnect)
Definition: shellord.c:2108
BOOL WINAPI SHWaitForFileToOpen(LPCITEMIDLIST pidl, DWORD dwFlags, DWORD dwTimeout)
Definition: shellord.c:2085
HRESULT WINAPI SHGetInstanceExplorer(IUnknown **lpUnknown)
Definition: shellord.c:1728
static UxSubclassInfo * UxSubclassInfo_Create(HWND hwnd, LPWSTR valid, LPWSTR invalid)
Definition: shellord.c:3188
INT WINAPI EnumMRUListA(HANDLE hList, INT nItemPos, LPVOID lpBuffer, DWORD nBufferSize)
UINT WINAPI SHReplaceFromPropSheetExtArray(HPSXA hpsxa, UINT uPageID, LPFNADDPROPSHEETPAGE lpfnReplaceWith, LPARAM lParam)
Definition: shellord.c:2473
BOOL WINAPI SHGetNewLinkInfoA(LPCSTR pszLinkTo, LPCSTR pszDir, LPSTR pszName, BOOL *pfMustCopy, UINT uFlags)
Definition: shellord.c:2713
struct tagCREATEMRULIST CREATEMRULISTA
HRESULT WINAPI SHSetLocalizedName(LPCWSTR pszPath, LPCWSTR pszResModule, int idsRes)
Definition: shellord.c:2797
HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv, IShellView **ppsv)
Definition: shellord.c:2896
VOID WINAPI SHSetInstanceExplorer(LPUNKNOWN lpUnknown)
Definition: shellord.c:1718
BOOL WINAPI DAD_DragMove(_In_ POINT p)
Definition: shellord.c:1824
HRESULT WINAPI SHCreateShellFolderViewEx(LPCSFV psvcbi, IShellView **ppv)
Definition: shellord.c:1628
BOOL WINAPI SHFindFiles(PCIDLIST_ABSOLUTE pidlFolder, PCIDLIST_ABSOLUTE pidlSaveFile)
Definition: shellord.c:2576
LRESULT WINAPI SHShellFolderView_Message(HWND hwndCabinet, UINT uMessage, LPARAM lParam)
Definition: shellord.c:500
static void UxSubclassInfo_Destroy(UxSubclassInfo *pInfo)
Definition: shellord.c:3002
BOOL WINAPI GetFileNameFromBrowse(HWND hwndOwner, LPWSTR lpstrFile, UINT nMaxFile, LPCWSTR lpstrInitialDir, LPCWSTR lpstrDefExt, LPCWSTR lpstrFilter, LPCWSTR lpstrTitle)
Definition: shellord.c:158
HRESULT WINAPI CIDLData_CreateFromIDArray(PCIDLIST_ABSOLUTE pidlFolder, UINT cpidlFiles, PCUIDLIST_RELATIVE_ARRAY lppidlFiles, LPDATAOBJECT *ppdataObject)
Definition: shellord.c:2527
UINT WINAPI SHAddFromPropSheetExtArray(HPSXA hpsxa, LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam)
Definition: shellord.c:2327
int WINAPI SHOutOfMemoryMessageBox(HWND hwndOwner, LPCSTR lpCaption, UINT uType)
Definition: shellord.c:2064
static LPUNKNOWN SHELL32_IExplorerInterface
Definition: shellord.c:1711
INT WINAPI AddMRUData(HANDLE hList, LPCVOID lpData, DWORD cbData)
BOOL WINAPI PathIsTemporaryA(LPSTR Str)
Definition: shellord.c:2235
HPSXA WINAPI SHCreatePropSheetExtArray(HKEY hKey, LPCWSTR pszSubKey, UINT max_iface)
Definition: shellord.c:2357
BOOL WINAPI WriteCabinetState(CABINETSTATE *cs)
Definition: shellord.c:1967
HRESULT WINAPI SHDoDragDrop(HWND hWnd, LPDATAOBJECT lpDataObject, LPDROPSOURCE lpDropSource, DWORD dwOKEffect, LPDWORD pdwEffect)
Definition: shellord.c:804
DWORD WINAPI ParseFieldA(LPCSTR src, DWORD nField, LPSTR dst, DWORD len)
Definition: shellord.c:87
HRESULT WINAPI SHFlushClipboard(void)
Definition: shellord.c:2076
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2787
BOOL WINAPI DECLSPEC_HOTPATCH ShellExecuteExW(LPSHELLEXECUTEINFOW sei)
Definition: shlexec.cpp:2732
static IMalloc * ppM
Definition: shlfolder.c:47
#define CSIDL_INTERNET_CACHE
Definition: shlobj.h:2222
#define SSF_FILTER
Definition: shlobj.h:1636
#define CSIDL_RECENT
Definition: shlobj.h:2199
#define SSF_DONTPRETTYPATH
Definition: shlobj.h:1631
#define SSF_SORTCOLUMNS
Definition: shlobj.h:1625
#define CSIDL_CDBURN_AREA
Definition: shlobj.h:2246
struct SHELLFLAGSTATE * LPSHELLFLAGSTATE
#define SHCNE_UPDATEIMAGE
Definition: shlobj.h:1922
#define SSF_WIN95CLASSIC
Definition: shlobj.h:1630
#define SSF_SHOWATTRIBCOL
Definition: shlobj.h:1628
#define SSF_SHOWSYSFILES
Definition: shlobj.h:1626
BOOL WINAPI IsUserAnAdmin(void)
Definition: shellord.c:2982
#define SHARD_PATHW
Definition: shlobj.h:1192
#define SHARD_PIDL
Definition: shlobj.h:1190
#define SSF_MAPNETDRVBUTTON
Definition: shlobj.h:1632
#define SSF_SHOWEXTENSIONS
Definition: shlobj.h:1622
#define SSF_SHOWSUPERHIDDEN
Definition: shlobj.h:1638
#define SSF_SHOWALLOBJECTS
Definition: shlobj.h:1621
#define SHARD_PATHA
Definition: shlobj.h:1191
@ REST_NORECENTDOCSHISTORY
Definition: shlobj.h:1691
@ REST_NOFIND
Definition: shlobj.h:1667
BOOL WINAPI DAD_DragLeave(void)
Definition: shellord.c:1839
#define SSF_SHOWINFOTIP
Definition: shlobj.h:1633
#define SHCNF_IDLIST
Definition: shlobj.h:1939
#define SSF_HIDEICONS
Definition: shlobj.h:1634
#define SHELL_GlobalCounterIncrement(handle)
Definition: shlwapi_undoc.h:54
#define SHELL_GlobalCounterIsInitialized(handle)
Definition: shlwapi_undoc.h:52
#define SHELL_GCOUNTER_DEFINE_GUID(name, a, b, c, d, e, f, g, h, i, j, k)
Definition: shlwapi_undoc.h:44
#define SHELL_GCOUNTER_PARAMETERS(handle, id)
Definition: shlwapi_undoc.h:46
#define SHELL_GCOUNTER_DECLAREPARAMETERS(handle, id)
Definition: shlwapi_undoc.h:56
#define SHELL_GlobalCounterGet(handle)
Definition: shlwapi_undoc.h:53
#define SHELL_GCOUNTER_DEFINE_HANDLE(name)
Definition: shlwapi_undoc.h:45
#define SHELL_GlobalCounterCreate(refguid, handle)
Definition: shlwapi_undoc.h:47
DWORD WINAPI SHRestricted(RESTRICTIONS rest)
Definition: shpolicy.c:166
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
const PCUIDLIST_RELATIVE * PCUIDLIST_RELATIVE_ARRAY
Definition: shtypes.idl:58
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
OPENFILENAME ofn
Definition: sndrec32.cpp:56
#define _countof(array)
Definition: sndvol32.h:70
#define TRACE(s)
Definition: solgame.cpp:4
long y
Definition: dcommon.idl:24
long x
Definition: dcommon.idl:24
Definition: dcommon.idl:28
SHELLSTATE ss
Definition: ShellState.cpp:22
BOOL fMapNetDrvBtn
Definition: shlobj.h:1610
BOOL fShowInfoTip
Definition: shlobj.h:1611
BOOL fHideIcons
Definition: shlobj.h:1612
BOOL fIconsOnly
Definition: shlobj.h:1614
BOOL fShowExtensions
Definition: shlobj.h:1601
BOOL fAutoCheckSelect
Definition: shlobj.h:1613
BOOL fShowSysFiles
Definition: shlobj.h:1603
BOOL fDontPrettyPath
Definition: shlobj.h:1608
BOOL fShowAllObjects
Definition: shlobj.h:1600
BOOL fShowAttribCol
Definition: shlobj.h:1609
BOOL fShowSysFiles
Definition: shlobj.h:1561
BOOL fWin95Classic
Definition: shlobj.h:1565
BOOL fShowSuperHidden
Definition: shlobj.h:1573
BOOL fShowAllObjects
Definition: shlobj.h:1557
LPWSTR pwszValidChars
Definition: shellord.c:2997
LPWSTR pwszInvalidChars
Definition: shellord.c:2998
WNDPROC fnWndProc
Definition: shellord.c:2996
Definition: shlobj.h:1291
FOLDERVIEWMODE fvm
Definition: shlobj.h:1298
IShellView * psvOuter
Definition: shlobj.h:1294
LPFNVIEWCALLBACK pfnCallback
Definition: shlobj.h:1297
PCIDLIST_ABSOLUTE pidl
Definition: shlobj.h:1295
IShellFolder * pshf
Definition: shlobj.h:1293
Definition: mmc.idl:376
LPFNADDPROPSHEETPAGE lpfnAddReplaceWith
Definition: shellord.c:2299
LPARAM lParam
Definition: shellord.c:2300
BOOL bCalled
Definition: shellord.c:2301
BOOL bMultiple
Definition: shellord.c:2302
UINT uiCount
Definition: shellord.c:2303
UINT uiCount
Definition: shellord.c:2292
IShellPropSheetExt * pspsx[1]
Definition: shellord.c:2294
UINT uiAllocated
Definition: shellord.c:2293
IShellFolderViewCB * psfvcb
Definition: shlobj.h:1376
IShellView * psvOuter
Definition: shlobj.h:1375
UINT cbSize
Definition: shlobj.h:1373
IShellFolder * pshf
Definition: shlobj.h:1374
Definition: match.c:390
Definition: cookie.c:202
Definition: tftpd.h:126
Definition: tftpd.h:138
LPCSTR lpszSubKey
Definition: shellord.c:60
DWORD nMaxItems
Definition: shellord.c:57
LPWSTR lpszSubKey
LPCSTR lpstrDefExt
Definition: commdlg.h:345
HWND hwndOwner
Definition: commdlg.h:330
LPCSTR lpstrTitle
Definition: commdlg.h:341
LPSTR lpstrFile
Definition: commdlg.h:336
DWORD Flags
Definition: commdlg.h:342
LPCSTR lpstrInitialDir
Definition: commdlg.h:340
DWORD lStructSize
Definition: commdlg.h:329
LPCSTR lpstrFilter
Definition: commdlg.h:332
DWORD nMaxFile
Definition: commdlg.h:337
#define GWLP_WNDPROC
Definition: treelist.c:66
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1830
HANDLE HINSTANCE
Definition: typedefs.h:77
uint16_t * PWSTR
Definition: typedefs.h:56
const char * LPCSTR
Definition: typedefs.h:52
int32_t INT_PTR
Definition: typedefs.h:64
const uint16_t * PCWSTR
Definition: typedefs.h:57
const uint16_t * LPCWSTR
Definition: typedefs.h:57
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
unsigned char * LPBYTE
Definition: typedefs.h:53
uint16_t * LPWSTR
Definition: typedefs.h:56
uint32_t * LPDWORD
Definition: typedefs.h:59
char * LPSTR
Definition: typedefs.h:51
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define MAKELONG(a, b)
Definition: typedefs.h:249
uint32_t ULONG
Definition: typedefs.h:59
#define MAXLONG
Definition: umtypes.h:116
HRESULT WINAPI SHLimitInputCombo(HWND hWnd, IShellFolder *psf)
HWND WINAPI SetTaskmanWindow(HWND)
Definition: window.c:1902
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
#define SHOP_FILEPATH
Definition: vfdshmenu.cpp:36
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define FORMAT_MESSAGE_FROM_STRING
Definition: winbase.h:398
DWORD WINAPI GetCurrentProcessId(void)
Definition: proc.c:1205
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:396
#define FindNextFile
Definition: winbase.h:3511
#define GMEM_MOVEABLE
Definition: winbase.h:318
#define GMEM_SHARE
Definition: winbase.h:329
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define __ms_va_list
Definition: windef.h:250
#define __ms_va_end(list)
Definition: windef.h:252
#define __ms_va_start(list, arg)
Definition: windef.h:251
#define WINAPI
Definition: msvc.h:6
#define strlenW(s)
Definition: unicode.h:28
#define strrchrW(s, c)
Definition: unicode.h:35
#define snprintfW
Definition: unicode.h:60
NTSYSAPI NTSTATUS WINAPI RtlGUIDFromString(PUNICODE_STRING, GUID *)
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define SECURITY_BUILTIN_DOMAIN_RID
Definition: setypes.h:581
#define SECURITY_SERVICE_RID
Definition: setypes.h:562
#define SECURITY_LOCAL_SYSTEM_RID
Definition: setypes.h:574
#define SECURITY_NT_AUTHORITY
Definition: setypes.h:554
#define DOMAIN_ALIAS_RID_ADMINS
Definition: setypes.h:652
unsigned char BYTE
Definition: xxhash.c:193