ReactOS 0.4.15-dev-7918-g2a2556c
shlextdbg.cpp
Go to the documentation of this file.
1/*
2 * PROJECT: shlextdbg
3 * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4 * PURPOSE: Shell extension debug utility
5 * COPYRIGHT: Copyright 2017 Mark Jansen (mark.jansen@reactos.org)
6 */
7
8#include <windows.h>
9#include <shlobj.h>
10#include <shlwapi.h>
11#include <atlbase.h> // thanks gcc
12#include <atlcom.h> // thanks gcc
13#include <atlstr.h>
14#include <atlsimpcoll.h>
15#include <conio.h>
16#include <shellutils.h>
17#include <shlwapi_undoc.h>
18
19static void PrintHelp(PCWSTR ExtraLine = NULL)
20{
21 if (ExtraLine)
22 wprintf(L"%s\n\n", ExtraLine);
23
24 wprintf(L"shlextdbg /clsid={clsid} [/dll=dllname] /IShellExtInit=filename |shlextype| |waitoptions|\n");
25 wprintf(L" {clsid}: The CLSID or ProgID of the object to create\n");
26 wprintf(L" dll: Optional dllname to create the object from, instead of CoCreateInstance\n");
27 wprintf(L" filename: The filename to pass to IShellExtInit->Initialze\n");
28 wprintf(L" shlextype: The type of shell extention to run:\n");
29 wprintf(L" /IShellPropSheetExt to create a property sheet\n");
30 wprintf(L" /IContextMenu=verb to activate the specified verb\n");
31 wprintf(L" waitoptions: Specify how to wait:\n");
32 wprintf(L" /explorerinstance: Wait for SHGetInstanceExplorer (Default)\n");
33 wprintf(L" /infinite: Keep on waiting infinitely\n");
34 wprintf(L" /openwindows: Wait for all windows from the current application to close\n");
35 wprintf(L" /input: Wait for input\n");
36 wprintf(L" /nowait\n");
37 wprintf(L"\n");
38 wprintf(L"shlextdbg /shgfi=path\n");
39 wprintf(L" Call SHGetFileInfo. Prefix path with $ to parse as a pidl.\n");
40 wprintf(L"\n");
41 wprintf(L"shlextdbg /assocq <[{bhid}]path> <string|data|key> <type> <initflags> <queryflags> <initstring> [extra] [maxsize]\n");
42 wprintf(L" Uses the default implementation from AssocCreate if path is empty.\n");
43 wprintf(L"\n");
44 wprintf(L"shlextdbg /shellexec=path [/see] [verb] [class]\n");
45 wprintf(L"\n");
46 wprintf(L"shlextdbg /dumpmenu=[{clsid}]path [/cmf]\n");
47}
48
49/*
50Examples:
51
52/clsid={513D916F-2A8E-4F51-AEAB-0CBC76FB1AF8} /IShellExtInit=C:\RosBE\Uninstall.exe /IShellPropSheetExt
53/clsid=CompressedFolder /IShellExtInit=e:\test.zip /IContextMenu=extract /openwindows
54/clsid=CompressedFolder /IShellExtInit=e:\test.zip /IContextMenu=extract /openwindows /dll=R:\build\dev\devenv\dll\shellext\zipfldr\Debug\zipfldr.dll
55/shgfi=c:\freeldr.ini
56/assocq "" string 1 0 0 .txt
57/assocq "" string friendlytypename 0x400 0 .txt "" 10
58/openwindows /shellexec=c: /invoke properties
59/dumpmenu=%windir%\explorer.exe /extended
60/dumpmenu {D969A300-E7FF-11d0-A93B-00A0C90F2719}c:
61
62*/
63
65{
66 PWCHAR end;
67 LONG v = wcstol(in, &end, 0);
68 return (end > in) ? v : 0;
69}
70
71static int ErrMsg(int Error)
72{
73 WCHAR buf[400];
74 for (UINT e = Error, cch; ;)
75 {
76 lstrcpynW(buf, L"?", _countof(buf));
78 while (cch && buf[cch - 1] <= ' ')
79 buf[--cch] = UNICODE_NULL; // Remove trailing newlines
80 if (cch || HIWORD(e) != HIWORD(HRESULT_FROM_WIN32(1)))
81 break;
82 e = HRESULT_CODE(e); // "WIN32_FROM_HRESULT"
83 }
84 wprintf(Error < 0 ? L"Error 0x%.8X %s\n" : L"Error %d %s\n", Error, buf);
85 return Error;
86}
87
88template<class T>
89static bool CLSIDPrefix(T& String, CLSID& Clsid)
90{
91 WCHAR buf[38 + 1];
92 if (String[0] == '{')
93 {
95 if (SUCCEEDED(CLSIDFromString(buf, &Clsid)))
96 {
97 String = String + 38;
98 return true;
99 }
100 }
101 return false;
102}
103
105{
106 CComPtr<IShellFolder> shellFolder;
108 HRESULT hr = SHBindToParent(pidl, IID_PPV_ARG(IShellFolder, &shellFolder), &child);
109 if (SUCCEEDED(hr))
110 hr = shellFolder->GetUIObjectOf(NULL, 1, &child, riid, NULL, ppv);
111 return hr;
112}
113
115{
116 PIDLIST_ABSOLUTE pidl = NULL;
117 HRESULT hr = SHParseDisplayName(Path, NULL, &pidl, 0, NULL);
118 if (SUCCEEDED(hr))
119 {
120 hr = SHCreateShellItem(NULL, NULL, pidl, ppSI);
121 SHFree(pidl);
122 }
123 return hr;
124}
125
127{
128 hKey = NULL;
129 IQueryAssociations* pQA;
130 if (SUCCEEDED(GetUIObjectOfAbsolute(pidl, IID_PPV_ARG(IQueryAssociations, &pQA))))
131 {
132 pQA->GetKey(0, ASSOCKEY_CLASS, NULL, &hKey); // Not implemented in ROS
133 pQA->Release();
134 }
135 if (!hKey)
136 {
137 DWORD cb;
141 info.dwAttributes = 0;
143 if (info.dwAttributes & SFGAO_FOLDER)
144 {
145 ext = const_cast<LPWSTR>(L"Directory");
146 }
147 else if (info.dwAttributes & SFGAO_BROWSABLE)
148 {
149 ext = const_cast<LPWSTR>(L"Folder"); // Best guess
150 }
151 else
152 {
153 cb = sizeof(buf);
155 {
157 }
158 }
159 if (!hKey)
160 {
162 }
163 }
164}
165
166static void DumpBytes(const void *Data, SIZE_T cb)
167{
168 for (SIZE_T i = 0; i < cb; ++i)
169 {
170 wprintf(L"%s%.2X", i ? L" " : L"", ((LPCBYTE)Data)[i]);
171 }
172 wprintf(L"\n");
173}
174
176{
177 if (cchMax < 1) return E_INVALIDARG;
178 *buf = UNICODE_NULL;
179
180 // First try to retrieve the UNICODE string directly
181 HRESULT hr = CM.GetCommandString(Id, Type | GCS_UNICODE, 0, (char*)buf, cchMax);
182 if (FAILED(hr))
183 {
184 // It failed, try to retrieve an ANSI string instead then convert it to UNICODE
185 STRRET sr;
186 sr.uType = STRRET_CSTR;
187 hr = CM.GetCommandString(Id, Type & ~GCS_UNICODE, 0, sr.cStr, _countof(sr.cStr));
188 if (SUCCEEDED(hr))
189 hr = StrRetToBufW(&sr, NULL, buf, cchMax);
190 }
191 return hr;
192}
193
194static void DumpMenu(HMENU hMenu, UINT IdOffset, IContextMenu* pCM, BOOL FakeInit, UINT Indent)
195{
196 bool recurse = Indent != UINT(-1);
198 MENUITEMINFOW mii;
199 mii.cbSize = FIELD_OFFSET(MENUITEMINFOW, hbmpItem);
200
201 for (UINT i = 0, defid = GetMenuDefaultItem(hMenu, FALSE, 0); ; ++i)
202 {
203 mii.fMask = MIIM_STRING;
204 mii.dwTypeData = buf;
205 mii.cch = _countof(buf);
206 *buf = UNICODE_NULL;
207 if (!GetMenuItemInfo(hMenu, i, TRUE, &mii))
208 lstrcpynW(buf, L"?", _countof(buf)); // Tolerate string failure
210 mii.hSubMenu = NULL;
211 mii.dwTypeData = NULL;
212 mii.cch = 0;
213 if (!GetMenuItemInfo(hMenu, i, TRUE, &mii))
214 break;
215
216 BOOL sep = mii.fType & MFT_SEPARATOR;
217 wprintf(L"%-4d", (sep || mii.wID == UINT(-1)) ? mii.wID : (mii.wID - IdOffset));
218 for (UINT j = 0; j < Indent && recurse; ++j)
219 wprintf(L" ");
220 wprintf(L"%s%s", mii.hSubMenu ? L">" : L"|", sep ? L"----------" : buf);
221 if (!sep && pCM && SUCCEEDED(GetCommandString(*pCM, mii.wID - IdOffset,
222 GCS_VERB, buf, _countof(buf))))
223 {
224 wprintf(L" [%s]", buf);
225 }
226 wprintf(L"%s\n", (defid == mii.wID && defid != UINT(-1)) ? L" (Default)" : L"");
227 if (mii.hSubMenu && recurse)
228 {
229 if (FakeInit)
231 DumpMenu(mii.hSubMenu, IdOffset, pCM, FakeInit, Indent + 1);
232 }
233 }
234}
235
236static int SHGFI(PCWSTR Path)
237{
238 PIDLIST_ABSOLUTE pidl = NULL;
239 UINT flags = 0, ret = 0;
240
241 if (*Path == L'$')
242 {
243 HRESULT hr = SHParseDisplayName(++Path, NULL, &pidl, 0, NULL);
244 if (FAILED(hr))
245 return ErrMsg(hr);
246 flags |= SHGFI_PIDL;
247 Path = (LPCWSTR)pidl;
248 }
250 {
252 }
254 if (!SHGetFileInfoW(Path, 0, &info, sizeof(info), flags |
256 {
257 info.szDisplayName[0] = info.szTypeName[0] = UNICODE_NULL;
258 info.dwAttributes = 0;
260 }
261 wprintf(L"Display: %s\n", info.szDisplayName);
262 wprintf(L"Attributes: 0x%x\n", info.dwAttributes);
263 wprintf(L"Type: %s\n", info.szTypeName);
264
265 if (!SHGetFileInfoW(Path, 0, &info, sizeof(info), flags | SHGFI_ICONLOCATION))
266 {
267 info.szDisplayName[0] = UNICODE_NULL;
268 info.iIcon = -1;
269 }
270 wprintf(L"Icon: %s,%d\n", info.szDisplayName, info.iIcon);
271
272 if (!SHGetFileInfoW(Path, 0, &info, sizeof(info), flags | SHGFI_SYSICONINDEX))
273 {
274 info.iIcon = -1;
275 }
276 wprintf(L"Index: %d\n", info.iIcon);
277 SHFree(pidl);
278 return ret;
279}
280
282{
283 UINT qtype = StrToNum(argv[2]);
284 ASSOCF iflags = StrToNum(argv[3]);
285 ASSOCF qflags = StrToNum(argv[4]);
286 PCWSTR extra = (argc > 6 && *argv[6]) ? argv[6] : NULL;
287 WCHAR buf[MAX_PATH * 2];
288 DWORD maxSize = (argc > 7 && *argv[7]) ? StrToNum(argv[7]) : sizeof(buf);
289
290 HRESULT hr;
292 PWSTR path = argv[0];
293 if (*path)
294 {
295 CLSID clsid, *pclsid = NULL;
296 if (CLSIDPrefix(path, clsid))
297 pclsid = &clsid;
300 {
301 hr = si->BindToHandler(NULL, pclsid ? *pclsid : BHID_AssociationArray, IID_PPV_ARG(IQueryAssociations, &qa));
302 if (FAILED(hr) && !pclsid)
303 hr = si->BindToHandler(NULL, BHID_SFUIObject, IID_PPV_ARG(IQueryAssociations, &qa));
304 }
305 }
306 else
307 {
308 hr = AssocCreate(CLSID_QueryAssociations, IID_PPV_ARG(IQueryAssociations, &qa));
309 }
310 if (FAILED(hr))
311 return ErrMsg(hr);
312 hr = qa->Init(iflags, argv[5], NULL, NULL);
313 if (FAILED(hr))
314 return ErrMsg(hr);
315
316 DWORD size = maxSize;
317 if (!wcsicmp(argv[1], L"string"))
318 {
319 if (!wcsicmp(argv[2], L"COMMAND"))
320 qtype = ASSOCSTR_COMMAND;
321 if (!wcsicmp(argv[2], L"EXECUTABLE"))
322 qtype = ASSOCSTR_EXECUTABLE;
323 if (!wcsicmp(argv[2], L"FRIENDLYDOCNAME") || !wcsicmp(argv[2], L"FriendlyTypeName"))
325 if (!wcsicmp(argv[2], L"DEFAULTICON"))
326 qtype = ASSOCSTR_DEFAULTICON;
327
328 buf[0] = UNICODE_NULL;
329 size /= sizeof(buf[0]); // Convert to number of characters
330 hr = qa->GetString(qflags, (ASSOCSTR)qtype, extra, buf, &size);
331 size *= sizeof(buf[0]); // Convert back to bytes
332 if (SUCCEEDED(hr) ||
334 {
335 wprintf(L"0x%.8X: %s\n", hr, buf);
336 }
337 else
338 {
339 wprintf(size != maxSize ? L"%u " : L"", size);
340 ErrMsg(hr);
341 }
342 }
343 else if (!wcsicmp(argv[1], L"data"))
344 {
345 if (!wcsicmp(argv[2], L"EDITFLAGS"))
346 qtype = ASSOCDATA_EDITFLAGS;
347 if (!wcsicmp(argv[2], L"VALUE"))
348 qtype = ASSOCDATA_VALUE;
349
350 hr = qa->GetData(qflags, (ASSOCDATA)qtype, extra, buf, &size);
351 if (SUCCEEDED(hr))
352 {
353 wprintf(L"0x%.8X: %u byte(s) ", hr, size);
354 DumpBytes(buf, min(size, maxSize));
355 }
356 else
357 {
358 wprintf(size != maxSize ? L"%u " : L"", size);
359 ErrMsg(hr);
360 }
361 }
362 else if (!wcsicmp(argv[1], L"key"))
363 {
364 HKEY hKey = NULL;
365 hr = qa->GetKey(qflags, (ASSOCKEY)qtype, extra, &hKey);
366 if (SUCCEEDED(hr))
367 {
368 wprintf(L"0x%.8X: hKey %p\n", hr, hKey);
369 RegQueryValueExW(hKey, L"shlextdbg", 0, NULL, NULL, NULL); // Filter by this in Process Monitor
371 }
372 else
373 {
374 ErrMsg(hr);
375 }
376 }
377 else
378 {
379 PrintHelp(L"Unknown query");
381 }
382 return hr;
383}
384
386{
392};
393
400
402{
404 if (!SUCCEEDED(hr))
405 {
406 wprintf(L"Failed to create pidl from '%s': 0x%x\n", FileName, hr);
407 return hr;
408 }
409
410 CComPtr<IShellFolder> shellFolder;
411 PCUITEMID_CHILD childs;
412 hr = SHBindToParent(pidl, IID_PPV_ARG(IShellFolder, &shellFolder), &childs);
413 if (!SUCCEEDED(hr))
414 {
415 wprintf(L"Failed to bind to parent: 0x%x\n", hr);
416 return hr;
417 }
418 hr = shellFolder->GetUIObjectOf(NULL, 1, &childs, IID_IDataObject, NULL, (PVOID*)&dataObject);
419 if (!SUCCEEDED(hr))
420 {
421 wprintf(L"Failed to query IDataObject: 0x%x\n", hr);
422 }
423 return hr;
424}
425
427{
428 CComPtr<IShellExtInit> spShellExtInit;
429 HRESULT hr;
430 if (g_DLL.IsEmpty())
431 {
432 hr = CoCreateInstance(g_CLSID, NULL, CLSCTX_ALL, IID_PPV_ARG(IShellExtInit, &spShellExtInit));
433 if (!SUCCEEDED(hr))
434 {
435 WCHAR Buffer[100];
437 wprintf(L"Failed to Create %s:IShellExtInit: 0x%x\n", Buffer, hr);
438 return hr;
439 }
440 }
441 else
442 {
443 typedef HRESULT (STDAPICALLTYPE *tDllGetClassObject)(REFCLSID rclsid, REFIID riid, LPVOID *ppv);
445 if (!mod)
446 {
447 wprintf(L"Failed to Load %s:(0x%x)\n", g_DLL.GetString(), GetLastError());
448 return E_FAIL;
449 }
450 tDllGetClassObject DllGet = (tDllGetClassObject)GetProcAddress(mod, "DllGetClassObject");
451 if (!DllGet)
452 {
453 wprintf(L"%s does not export DllGetClassObject\n", g_DLL.GetString());
454 return E_FAIL;
455 }
456 CComPtr<IClassFactory> spClassFactory;
457 hr = DllGet(g_CLSID, IID_PPV_ARG(IClassFactory, &spClassFactory));
458 if (!SUCCEEDED(hr))
459 {
460 wprintf(L"Failed to create IClassFactory: 0x%x\n", hr);
461 return hr;
462 }
463 hr = spClassFactory->CreateInstance(NULL, IID_PPV_ARG(IShellExtInit, &spShellExtInit));
464 if (!SUCCEEDED(hr))
465 {
466 wprintf(L"Failed to Request IShellExtInit from IClassFactory: 0x%x\n", hr);
467 return hr;
468 }
469 }
470
471 CComPtr<IDataObject> spDataObject;
473 hr = CreateIDataObject(pidl, spDataObject, g_ShellExtInit.GetString());
474 if (!SUCCEEDED(hr))
475 return hr;
476
477 HKEY hKey = NULL;
479 hr = spShellExtInit->Initialize(pidl, spDataObject, hKey);
480 if (hKey)
482 if (!SUCCEEDED(hr))
483 {
484 wprintf(L"IShellExtInit->Initialize failed: 0x%x\n", hr);
485 return hr;
486 }
487 hr = spShellExtInit->QueryInterface(riid, ppv);
488 if (!SUCCEEDED(hr))
489 {
490 WCHAR Buffer[100];
492 wprintf(L"Failed to query %s from IShellExtInit: 0x%x\n", Buffer, hr);
493 }
494 return hr;
495}
496
497
501{
502 if (hwnd != g_ConsoleWindow)
503 {
504 DWORD pid = 0;
506 if (pid == GetCurrentProcessId())
507 {
508 g_Windows.Add(hwnd);
509 }
510 }
511 return TRUE;
512}
513
515{
516 /* Give the windows some time to spawn */
517 Sleep(2000);
519 while (true)
520 {
521 g_Windows.RemoveAll();
523 if (g_Windows.GetSize() == 0)
524 break;
525 Sleep(500);
526 }
527 wprintf(L"All windows closed (ignoring console window)\n");
528}
529
531{
533 volatile LONG m_rc;
534
537 {
538 static const QITAB rgqit[] = { { 0 } };
539 return QISearch(this, rgqit, riid, ppv);
540 }
542 {
544 wprintf(L"INFO: SHGetInstanceExplorer\n");
545 return InterlockedIncrement(&m_rc);
546 }
548 {
550 wprintf(L"INFO: Release ExplorerInstance\n");
552 if (!r)
554 return r;
555 }
556 void Wait()
557 {
560 0, 0, 0, 0, HWND_MESSAGE, NULL, NULL, NULL);
561 BOOL loop = InterlockedDecrement(&m_rc) != 0;
562 MSG msg;
563 while (loop && (int)GetMessage(&msg, NULL, 0, 0) > 0)
564 {
565 if (msg.hwnd == m_hWnd && msg.message == WM_CLOSE)
566 PostMessage(m_hWnd, WM_QUIT, 0, 0);
568 }
569 }
571
572static void Wait()
573{
574 LPCWSTR nag = L"(Please use SHGetInstanceExplorer in your code instead)";
575 switch (g_Wait)
576 {
577 case Wait_None:
578 break;
579 case Wait_Infinite:
580 _putws(nag);
581 while (true)
582 Sleep(1000);
583 break;
584 case Wait_OpenWindows:
585 _putws(nag);
586 WaitWindows();
587 break;
588 case Wait_Input:
589 wprintf(L"Press any key to continue... %s\n", nag);
590 _getch();
591 break;
593 g_EI.Wait();
594 break;
595 }
596}
597
600{
601 g_Pages.Add(page);
602 if (lParam != (LPARAM)&g_Pages)
603 {
604 wprintf(L"Propsheet failed to pass lParam, got: 0x%Ix\n", lParam);
605 }
606 return TRUE;
607}
608
609static bool isCmdWithArg(int argc, WCHAR** argv, int& n, PCWSTR check, PCWSTR &arg)
610{
611 arg = NULL;
612 size_t len = wcslen(check);
613 if (!_wcsnicmp(argv[n] + 1, check, len))
614 {
615 PCWSTR cmd = argv[n] + len + 1;
616 if (*cmd == ':' || *cmd == '=')
617 {
618 arg = cmd + 1;
619 return true;
620 }
621 if (n + 1 < argc)
622 {
623 arg = argv[n+1];
624 n++;
625 return true;
626 }
627 wprintf(L"Command %s has no required argument!\n", check);
628 return false;
629 }
630 return false;
631}
632
633static bool isCmd(int argc, WCHAR** argv, int n, PCWSTR check)
634{
635 return !wcsicmp(argv[n] + 1, check);
636}
637
638extern "C" // and another hack for gcc
639int wmain(int argc, WCHAR **argv)
640{
644 SHSetInstanceExplorer(static_cast<IUnknown*>(&g_EI));
645
646 bool failArgs = false;
647 for (int n = 1; n < argc; ++n)
648 {
649 WCHAR* cmd = argv[n];
650 if (cmd[0] == '-' || cmd[0] == '/')
651 {
652 PCWSTR arg;
653 if (isCmdWithArg(argc, argv, n, L"shgfi", arg))
654 {
655 failArgs = true;
656 if (*arg)
657 return SHGFI(arg);
658 }
659 else if (isCmd(argc, argv, n, L"assocq"))
660 {
661 failArgs = true;
662 if (argc - (n + 1) >= 6 && argc - (n + 1) <= 8)
663 return AssocQ(argc - (n + 1), &argv[(n + 1)]);
664 }
665 else if (isCmdWithArg(argc, argv, n, L"shellexec", arg))
666 {
667 PIDLIST_ABSOLUTE pidl = NULL;
668 HRESULT hr = SHParseDisplayName(arg, NULL, &pidl, 0, NULL);
669 if (FAILED(hr))
670 return ErrMsg(hr);
671 SHELLEXECUTEINFOW sei = { sizeof(sei), SEE_MASK_IDLIST | SEE_MASK_UNICODE };
672 sei.lpIDList = pidl;
673 sei.nShow = SW_SHOW;
674 while (++n < argc)
675 {
676 if (argv[n][0] != '-' && argv[n][0] != '/')
677 break;
678 else if (isCmd(argc, argv, n, L"INVOKE"))
680 else if (isCmd(argc, argv, n, L"NOUI"))
682 else if (isCmd(argc, argv, n, L"ASYNCOK"))
683 sei.fMask |= SEE_MASK_ASYNCOK ;
684 else if (isCmd(argc, argv, n, L"NOASYNC"))
685 sei.fMask |= SEE_MASK_NOASYNC;
686 else
687 wprintf(L"WARN: Ignoring switch %s\n", argv[n]);
688 }
689 if (n < argc && *argv[n++])
690 {
691 sei.lpVerb = argv[n - 1];
692 }
693 if (n < argc && *argv[n++])
694 {
695 sei.lpClass = argv[n - 1];
697 }
698 UINT succ = ShellExecuteExW(&sei), gle = GetLastError();
699 SHFree(pidl);
700 if (!succ)
701 return ErrMsg(gle);
702 Wait();
703 return 0;
704 }
705 else if (isCmdWithArg(argc, argv, n, L"dumpmenu", arg))
706 {
707 HRESULT hr;
709 if (CLSIDPrefix(arg, g_CLSID))
710 {
713 }
714 else
715 {
718 if (SUCCEEDED(hr))
719 hr = si->BindToHandler(NULL, BHID_SFUIObject, IID_PPV_ARG(IContextMenu, &cm));
720 }
721 if (SUCCEEDED(hr))
722 {
723 UINT first = 10, last = 9000;
724 UINT cmf = 0, nosub = 0, fakeinit = 0;
725 while (++n < argc)
726 {
727 if (argv[n][0] != '-' && argv[n][0] != '/')
728 break;
729 else if (isCmd(argc, argv, n, L"DEFAULTONLY"))
730 cmf |= CMF_DEFAULTONLY;
731 else if (isCmd(argc, argv, n, L"NODEFAULT"))
732 cmf |= CMF_NODEFAULT;
733 else if (isCmd(argc, argv, n, L"DONOTPICKDEFAULT"))
734 cmf |= CMF_DONOTPICKDEFAULT;
735 else if (isCmd(argc, argv, n, L"EXTENDED") || isCmd(argc, argv, n, L"EXTENDEDVERBS"))
736 cmf |= CMF_EXTENDEDVERBS;
737 else if (isCmd(argc, argv, n, L"SYNCCASCADEMENU"))
738 cmf |= CMF_SYNCCASCADEMENU;
739 else if (isCmd(argc, argv, n, L"EXPLORE"))
740 cmf |= CMF_EXPLORE;
741 else if (isCmd(argc, argv, n, L"VERBSONLY"))
742 cmf |= CMF_VERBSONLY;
743 else if (isCmd(argc, argv, n, L"NOVERBS"))
744 cmf |= CMF_NOVERBS;
745 else if (isCmd(argc, argv, n, L"DISABLEDVERBS"))
746 cmf |= CMF_DISABLEDVERBS;
747 else if (isCmd(argc, argv, n, L"OPTIMIZEFORINVOKE"))
748 cmf |= CMF_OPTIMIZEFORINVOKE;
749 else if (isCmd(argc, argv, n, L"CANRENAME"))
750 cmf |= CMF_CANRENAME;
751 else if (isCmd(argc, argv, n, L"NOSUBMENU"))
752 nosub++;
753 else if (isCmd(argc, argv, n, L"INITMENUPOPUP"))
754 fakeinit++; // Tickle async submenus
755 else
756 wprintf(L"WARN: Ignoring switch %s\n", argv[n]);
757 }
758 HMENU hMenu = CreatePopupMenu();
759 hr = cm->QueryContextMenu(hMenu, 0, first, last, cmf);
760 if (SUCCEEDED(hr))
761 {
762 DumpMenu(hMenu, first, cm, fakeinit, nosub ? -1 : 0);
763 }
764 DestroyMenu(hMenu);
765 }
766 if (FAILED(hr))
767 return ErrMsg(hr);
768 return 0;
769 }
770 else if (isCmdWithArg(argc, argv, n, L"clsid", arg))
771 {
773 if (!SUCCEEDED(hr))
774 {
775 wprintf(L"Failed to convert %s to CLSID\n", arg);
776 failArgs = true;
777 }
778 }
779 else if (isCmdWithArg(argc, argv, n, L"dll", arg))
780 {
781 g_DLL = arg;
782 }
783 else if (isCmdWithArg(argc, argv, n, L"IShellExtInit", arg))
784 {
786 }
787 else if (isCmd(argc, argv, n, L"IShellPropSheetExt"))
788 {
790 }
791 else if (isCmdWithArg(argc, argv, n, L"IContextMenu", arg))
792 {
794 }
795 else if (isCmd(argc, argv, n, L"infinite"))
796 {
798 }
799 else if (isCmd(argc, argv, n, L"openwindows"))
800 {
802 }
803 else if (isCmd(argc, argv, n, L"input"))
804 {
806 }
807 else if (isCmd(argc, argv, n, L"explorerinstance"))
808 {
810 }
811 else if (isCmd(argc, argv, n, L"nowait"))
812 {
814 }
815 else
816 {
817 wprintf(L"Unknown argument: %s\n", cmd);
818 failArgs = true;
819 }
820 }
821 }
822
823 if (failArgs)
824 {
826 return E_INVALIDARG;
827 }
828
829 CLSID EmptyCLSID = { 0 };
830 if (EmptyCLSID == g_CLSID)
831 {
832 PrintHelp(L"No CLSID specified");
833 return E_INVALIDARG;
834 }
835
837 {
838 PrintHelp(L"No filename specified");
839 return E_INVALIDARG;
840 }
841
842 HRESULT hr;
844 {
847 if (!SUCCEEDED(hr))
848 return hr;
849
850 hr = spSheetExt->AddPages(cb_AddPage, (LPARAM)&g_Pages);
851 if (!SUCCEEDED(hr))
852 {
853 wprintf(L"IShellPropSheetExt->AddPages failed: 0x%x\n", hr);
854 return hr;
855 }
856
857 USHORT ActivePage = HRESULT_CODE(hr);
858 PROPSHEETHEADERW psh = { 0 };
859
860 psh.dwSize = sizeof(psh);
862 psh.pszCaption = L"shlextdbg";
863 psh.phpage = g_Pages.GetData();
864 psh.nPages = g_Pages.GetSize();
865 psh.nStartPage = ActivePage ? (ActivePage-1) : 0;
866 hr = PropertySheetW(&psh);
867
868 wprintf(L"PropertySheetW returned: 0x%x\n", hr);
869 }
870 if (!g_ContextMenu.IsEmpty())
871 {
872 CComPtr<IContextMenu> spContextMenu;
873 hr = LoadAndInitialize(IID_PPV_ARG(IContextMenu, &spContextMenu));
874 if (!SUCCEEDED(hr))
875 return hr;
876
877 // FIXME: Must call QueryContextMenu before InvokeCommand?
878
879 CMINVOKECOMMANDINFO cm = { sizeof(cm), 0 };
880 cm.lpVerb = g_ContextMenu.GetString();
881 cm.nShow = SW_SHOW;
882 hr = spContextMenu->InvokeCommand(&cm);
883
884 if (!SUCCEEDED(hr))
885 {
886 wprintf(L"IContextMenu->InvokeCommand failed: 0x%x\n", hr);
887 return hr;
888 }
889 wprintf(L"IContextMenu->InvokeCommand returned: 0x%x\n", hr);
890 }
891
892 Wait();
893 return 0;
894}
DWORD Id
EXTERN_C HRESULT WINAPI SHCreateShellItem(PCIDLIST_ABSOLUTE pidlParent, IShellFolder *psfParent, PCUITEMID_CHILD pidl, IShellItem **ppsi)
Definition: CShellItem.cpp:264
PRTL_UNICODE_STRING_BUFFER Path
static int argc
Definition: ServiceArgs.c:12
UINT cchMax
Type
Definition: Type.h:7
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define msg(x)
Definition: auth_time.c:54
BOOL Error
Definition: chkdsk.c:66
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
#define RegCloseKey(hKey)
Definition: registry.h:49
bool IsEmpty() const noexcept
Definition: atlsimpstr.h:394
PXSTR GetString() noexcept
Definition: atlsimpstr.h:367
Definition: bufpool.h:45
LPARAM lParam
Definition: combotst.c:139
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:893
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_FAIL
Definition: ddrawi.h:102
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
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
INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
Definition: propsheet.c:2913
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define GetProcAddress(x, y)
Definition: compat.h:753
#define MAX_PATH
Definition: compat.h:34
#define CALLBACK
Definition: compat.h:35
#define LoadLibraryW(x)
Definition: compat.h:747
#define wcsicmp
Definition: compat.h:15
#define lstrcpynW
Definition: compat.h:738
static const WCHAR *const ext[]
Definition: module.c:53
HWND WINAPI DECLSPEC_HOTPATCH GetConsoleWindow(VOID)
Definition: console.c:2729
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id)
Definition: compobj.c:2338
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2434
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:326
HRESULT WINAPI AssocCreate(CLSID clsid, REFIID refiid, void **lpInterface)
Definition: assoc.c:98
HRESULT WINAPI QISearch(void *base, const QITAB *table, REFIID riid, void **ppv)
Definition: ordinal.c:2392
LPWSTR WINAPI PathFindExtensionW(LPCWSTR lpszPath)
Definition: path.c:447
DWORD WINAPI SHGetValueW(HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
Definition: reg.c:1236
HRESULT WINAPI StrRetToBufW(LPSTRRET src, const ITEMIDLIST *pidl, LPWSTR dest, UINT len)
Definition: string.c:1530
#define check(expected, result)
Definition: dplayx.c:32
#define STDAPICALLTYPE
Definition: guid.c:3
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
FxAutoRegKey hKey
const GLdouble * v
Definition: gl.h:2040
GLuint GLuint end
Definition: gl.h:1545
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLsizeiptr size
Definition: glext.h:5919
GLdouble n
Definition: glext.h:7729
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLuint in
Definition: glext.h:9616
GLbitfield flags
Definition: glext.h:7161
const GLint * first
Definition: glext.h:5794
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 const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
static int mod
Definition: i386-dis.c:1288
@ extra
Definition: id3.c:95
_Check_return_opt_ _CRTIMP int __cdecl _putws(_In_z_ const wchar_t *_Str)
_Check_return_ long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
HRESULT GetCommandString([in] UINT_PTR idCmd, [in] UINT uType, [out] UINT *pwReserved, [out, size_is(cchMax)] LPSTR pszName, [in] UINT cchMax)
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
#define TEXT(s)
Definition: k32.h:26
#define e
Definition: ke_i.h:82
if(dx< 0)
Definition: linetemp.h:194
void PrintHelp()
Definition: appwiz.c:21
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
static DWORD DWORD void LPSTR DWORD cch
Definition: str.c:202
static UINT UINT last
Definition: font.c:45
static HMODULE MODULEINFO DWORD cb
Definition: module.c:33
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
static HWND child
Definition: cursoricon.c:298
#define min(a, b)
Definition: monoChain.cc:55
#define argv
Definition: mplay32.c:18
REFCLSID clsid
Definition: msctf.c:82
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
unsigned int UINT
Definition: ndis.h:50
#define KEY_READ
Definition: nt_native.h:1023
#define UNICODE_NULL
#define L(x)
Definition: ntvdm.h:50
const GUID IID_IDataObject
#define LOWORD(l)
Definition: pedump.c:82
#define WS_POPUP
Definition: pedump.c:616
long LONG
Definition: pedump.c:60
unsigned short USHORT
Definition: pedump.c:61
HRESULT WINAPI SHParseDisplayName(LPCWSTR pszName, IBindCtx *pbc, LPITEMIDLIST *ppidl, SFGAOF sfgaoIn, SFGAOF *psfgaoOut)
Definition: pidl.c:1405
HRESULT WINAPI SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv, LPCITEMIDLIST *ppidlLast)
Definition: pidl.c:1361
#define PSH_PROPTITLE
Definition: prsht.h:40
#define ICC_STANDARD_CLASSES
Definition: commctrl.h:73
#define ICC_LINK_CLASS
Definition: commctrl.h:74
#define REFIID
Definition: guiddef.h:118
#define REFCLSID
Definition: guiddef.h:117
int wmain()
HRESULT WINAPI SHForwardContextMenuMsg(IUnknown *pUnk, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *pResult, BOOL useIContextMenu2)
Definition: rosordinal.c:11
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path, DWORD dwFileAttributes, SHFILEINFOW *psfi, UINT sizeofpsfi, UINT flags)
Definition: shell32_main.c:415
#define SHGFI_SYSICONINDEX
Definition: shellapi.h:171
#define SHGFI_ICONLOCATION
Definition: shellapi.h:169
#define SHGFI_DISPLAYNAME
Definition: shellapi.h:166
#define SEE_MASK_UNICODE
Definition: shellapi.h:37
#define SHGFI_TYPENAME
Definition: shellapi.h:167
#define SHGFI_USEFILEATTRIBUTES
Definition: shellapi.h:181
#define SEE_MASK_CLASSNAME
Definition: shellapi.h:25
#define SHGFI_ATTRIBUTES
Definition: shellapi.h:168
#define SEE_MASK_ASYNCOK
Definition: shellapi.h:54
#define SEE_MASK_IDLIST
Definition: shellapi.h:27
#define SEE_MASK_NOASYNC
Definition: shellapi.h:33
#define SHGFI_PIDL
Definition: shellapi.h:180
#define SEE_MASK_INVOKEIDLIST
Definition: shellapi.h:28
#define SEE_MASK_FLAG_NO_UI
Definition: shellapi.h:36
VOID WINAPI SHSetInstanceExplorer(LPUNKNOWN lpUnknown)
Definition: shellord.c:1496
int _getch()
Definition: getch.c:16
BOOL WINAPI DECLSPEC_HOTPATCH ShellExecuteExW(LPSHELLEXECUTEINFOW sei)
Definition: shlexec.cpp:2391
CLSID g_CLSID
Definition: shlextdbg.cpp:394
CStringA g_ContextMenu
Definition: shlextdbg.cpp:398
static BOOL CALLBACK cb_AddPage(HPROPSHEETPAGE page, LPARAM lParam)
Definition: shlextdbg.cpp:599
BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam)
Definition: shlextdbg.cpp:500
static void Wait()
Definition: shlextdbg.cpp:572
WaitType g_Wait
Definition: shlextdbg.cpp:399
ExplorerInstance g_EI
static void GetAssocClass(LPCWSTR Path, LPCITEMIDLIST pidl, HKEY &hKey)
Definition: shlextdbg.cpp:126
WaitType
Definition: shlextdbg.cpp:386
@ Wait_OpenWindows
Definition: shlextdbg.cpp:389
@ Wait_Input
Definition: shlextdbg.cpp:390
@ Wait_Infinite
Definition: shlextdbg.cpp:388
@ Wait_ExplorerInstance
Definition: shlextdbg.cpp:391
@ Wait_None
Definition: shlextdbg.cpp:387
static HRESULT GetCommandString(IContextMenu &CM, UINT Id, UINT Type, LPWSTR buf, UINT cchMax)
Definition: shlextdbg.cpp:175
static bool isCmdWithArg(int argc, WCHAR **argv, int &n, PCWSTR check, PCWSTR &arg)
Definition: shlextdbg.cpp:609
static void DumpMenu(HMENU hMenu, UINT IdOffset, IContextMenu *pCM, BOOL FakeInit, UINT Indent)
Definition: shlextdbg.cpp:194
static HRESULT GetUIObjectOfAbsolute(LPCITEMIDLIST pidl, REFIID riid, void **ppv)
Definition: shlextdbg.cpp:104
CSimpleArray< HWND > g_Windows
Definition: shlextdbg.cpp:498
static bool CLSIDPrefix(T &String, CLSID &Clsid)
Definition: shlextdbg.cpp:89
static bool isCmd(int argc, WCHAR **argv, int n, PCWSTR check)
Definition: shlextdbg.cpp:633
static LONG StrToNum(PCWSTR in)
Definition: shlextdbg.cpp:64
CStringW g_ShellExtInit
Definition: shlextdbg.cpp:396
HRESULT LoadAndInitialize(REFIID riid, LPVOID *ppv)
Definition: shlextdbg.cpp:426
static void DumpBytes(const void *Data, SIZE_T cb)
Definition: shlextdbg.cpp:166
bool g_bIShellPropSheetExt
Definition: shlextdbg.cpp:397
static HRESULT CreateShellItemFromParse(PCWSTR Path, IShellItem **ppSI)
Definition: shlextdbg.cpp:114
HWND g_ConsoleWindow
Definition: shlextdbg.cpp:499
HRESULT CreateIDataObject(CComHeapPtr< ITEMIDLIST > &pidl, CComPtr< IDataObject > &dataObject, PCWSTR FileName)
Definition: shlextdbg.cpp:401
CSimpleArray< HPROPSHEETPAGE > g_Pages
Definition: shlextdbg.cpp:598
static int SHGFI(PCWSTR Path)
Definition: shlextdbg.cpp:236
static int ErrMsg(int Error)
Definition: shlextdbg.cpp:71
CStringW g_DLL
Definition: shlextdbg.cpp:395
void WaitWindows()
Definition: shlextdbg.cpp:514
static HRESULT AssocQ(int argc, WCHAR **argv)
Definition: shlextdbg.cpp:281
HRESULT hr
Definition: shlfolder.c:183
ASSOCDATA
Definition: shlwapi.h:632
@ ASSOCDATA_EDITFLAGS
Definition: shlwapi.h:637
@ ASSOCDATA_VALUE
Definition: shlwapi.h:638
ASSOCSTR
Definition: shlwapi.h:602
@ ASSOCSTR_COMMAND
Definition: shlwapi.h:603
@ ASSOCSTR_FRIENDLYDOCNAME
Definition: shlwapi.h:605
@ ASSOCSTR_EXECUTABLE
Definition: shlwapi.h:604
@ ASSOCSTR_DEFAULTICON
Definition: shlwapi.h:617
ASSOCKEY
Definition: shlwapi.h:623
@ ASSOCKEY_CLASS
Definition: shlwapi.h:626
DWORD ASSOCF
Definition: shlwapi.h:599
@ STRRET_CSTR
Definition: shtypes.idl:87
const ITEMID_CHILD UNALIGNED * PCUITEMID_CHILD
Definition: shtypes.idl:70
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
#define _countof(array)
Definition: sndvol32.h:68
volatile LONG m_rc
Definition: shlextdbg.cpp:533
virtual ULONG STDMETHODCALLTYPE AddRef()
Definition: shlextdbg.cpp:541
virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppv)
Definition: shlextdbg.cpp:536
virtual ULONG STDMETHODCALLTYPE Release()
Definition: shlextdbg.cpp:547
DWORD dwSize
Definition: prsht.h:293
DWORD dwFlags
Definition: prsht.h:294
HPROPSHEETPAGE * phpage
Definition: prsht.h:309
UINT nStartPage
Definition: prsht.h:304
LPCWSTR pszCaption
Definition: prsht.h:301
char cStr[MAX_PATH]
Definition: shtypes.idl:98
UINT uType
Definition: shtypes.idl:93
Definition: ftp_var.h:139
Definition: module.h:576
LPWSTR dwTypeData
Definition: winuser.h:3269
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
uint16_t * PWSTR
Definition: typedefs.h:56
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
ULONG_PTR SIZE_T
Definition: typedefs.h:80
uint16_t * PWCHAR
Definition: typedefs.h:56
uint32_t ULONG
Definition: typedefs.h:59
#define HIWORD(l)
Definition: typedefs.h:247
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
int ret
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2433
#define wprintf(...)
Definition: whoami.c:18
#define FormatMessage
Definition: winbase.h:3795
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define GetFileAttributes
Definition: winbase.h:3815
#define FORMAT_MESSAGE_IGNORE_INSERTS
Definition: winbase.h:420
DWORD WINAPI GetCurrentProcessId(void)
Definition: proc.c:1158
DWORD WINAPI GetWindowThreadProcessId(HWND hWnd, PDWORD lpdwProcessId)
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:423
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
Definition: winddi.h:3837
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
void * arg
Definition: msvc.h:10
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define HRESULT_CODE(hr)
Definition: winerror.h:76
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
const BYTE * LPCBYTE
Definition: winscard.h:34
#define HWND_MESSAGE
Definition: winuser.h:1210
#define CreateWindowEx
Definition: winuser.h:5755
HMENU WINAPI CreatePopupMenu(void)
Definition: menu.c:838
UINT WINAPI GetMenuDefaultItem(_In_ HMENU hMenu, _In_ UINT fByPos, _In_ UINT gmdiFlags)
#define WM_CLOSE
Definition: winuser.h:1621
#define MIIM_STRING
Definition: winuser.h:727
#define WM_QUIT
Definition: winuser.h:1623
#define MIIM_ID
Definition: winuser.h:722
#define MIIM_FTYPE
Definition: winuser.h:729
#define WS_EX_TOOLWINDOW
Definition: winuser.h:404
#define MFT_SEPARATOR
Definition: winuser.h:744
#define GetMessage
Definition: winuser.h:5790
#define MIIM_SUBMENU
Definition: winuser.h:723
#define WM_INITMENUPOPUP
Definition: winuser.h:1746
BOOL WINAPI EnumWindows(_In_ WNDENUMPROC lpEnumFunc, _In_ LPARAM lParam)
#define PostMessage
Definition: winuser.h:5832
BOOL WINAPI DestroyMenu(_In_ HMENU)
#define SW_SHOW
Definition: winuser.h:775
#define DispatchMessage
Definition: winuser.h:5765
#define GetMenuItemInfo
Definition: winuser.h:5788
#define IID_PPV_ARG(Itype, ppType)
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185