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