ReactOS 0.4.17-dev-573-g8315b8c
CFindFolder.cpp
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Search Shell Extension
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: Search results folder
5 * COPYRIGHT: Copyright 2019 Brock Mammen
6 */
7
8#include "CFindFolder.h"
9#include <exdispid.h>
10
12
13#ifndef _SHELL32_
14
17{
18 *pszBuf = UNICODE_NULL;
19 STRRET sr;
20 HRESULT hr = psf->GetDisplayNameOf(pidl, dwFlags, &sr);
21 return FAILED(hr) ? hr : StrRetToBufW(&sr, pidl, pszBuf, cchBuf);
22}
23
24static HRESULT
27{
28 HRESULT hr = pCM->GetCommandString(Id, GCS & ~GCS_UNICODE, NULL, Buf, cchMax);
29 if (FAILED(hr))
30 {
32 hr = pCM->GetCommandString(Id, GCS | GCS_UNICODE, NULL, (LPSTR)buf, _countof(buf));
33 if (SUCCEEDED(hr))
34 hr = SHUnicodeToAnsi(buf, Buf, cchMax) > 0 ? S_OK : E_FAIL;
35 }
36 return hr;
37}
38
39static HRESULT SHELL32_CoCreateInitSF(LPCITEMIDLIST pidlRoot, PERSIST_FOLDER_TARGET_INFO* ppfti,
40 LPCITEMIDLIST pidlChild, const GUID* clsid, REFIID riid, LPVOID *ppvOut)
41{
42 HRESULT hr;
43 CComPtr<IShellFolder> pShellFolder;
44
46 if (FAILED(hr))
47 return hr;
48
49 LPITEMIDLIST pidlAbsolute = ILCombine (pidlRoot, pidlChild);
52
53 if (ppfti && SUCCEEDED(pShellFolder->QueryInterface(IID_PPV_ARG(IPersistFolder3, &ppf3))))
54 {
55 ppf3->InitializeEx(NULL, pidlAbsolute, ppfti);
56 }
57 else if (SUCCEEDED(pShellFolder->QueryInterface(IID_PPV_ARG(IPersistFolder, &ppf))))
58 {
59 ppf->Initialize(pidlAbsolute);
60 }
61 ILFree (pidlAbsolute);
62
63 return pShellFolder->QueryInterface(riid, ppvOut);
64}
65
66#endif // _SHELL32_
67
69 HMENU hMenu,
70 UINT indexMenu,
71 BOOL fByPosition,
72 UINT wID,
73 UINT fType,
74 LPCWSTR dwTypeData,
75 UINT fState)
76{
77 MENUITEMINFOW mii;
78 WCHAR wszText[100];
79
80 ZeroMemory(&mii, sizeof(mii));
81 mii.cbSize = sizeof(mii);
82 if (fType == MFT_SEPARATOR)
83 mii.fMask = MIIM_ID | MIIM_TYPE;
84 else if (fType == MFT_STRING)
85 {
87 if (IS_INTRESOURCE(dwTypeData))
88 {
89 if (LoadStringW(_AtlBaseModule.GetResourceInstance(), LOWORD((ULONG_PTR)dwTypeData), wszText, _countof(wszText)))
90 mii.dwTypeData = wszText;
91 else
92 {
93 ERR("failed to load string %p\n", dwTypeData);
94 return;
95 }
96 }
97 else
98 mii.dwTypeData = (LPWSTR)dwTypeData;
99 mii.fState = fState;
100 }
101
102 mii.wID = wID;
103 mii.fType = fType;
104 InsertMenuItemW(hMenu, indexMenu, fByPosition, &mii);
105}
106
107static HRESULT QueryActiveShellView(IUnknown *pUnkSite, REFGUID rService, IShellView **ppSV)
108{
110 HRESULT hr = IUnknown_QueryService(pUnkSite, rService, IID_PPV_ARG(IShellBrowser, &pSB));
111 return SUCCEEDED(hr) ? pSB->QueryActiveShellView(ppSV) : hr;
112}
113
115{
118 if (FAILED(hr))
119 return hr;
121 if (SUCCEEDED(hr = pSV->QueryInterface(IID_PPV_ARG(IFolderView2, &pFV2))))
122 return pFV2->DoRename();
124 if (SUCCEEDED(hr = pSV->QueryInterface(IID_PPV_ARG(IShellView2, &pSV2))))
125 return pSV2->HandleRename(NULL);
126 return hr;
127}
128
130{
131 int iResource;
133 int fmt;
134 int cxChar;
135};
136
138{
142};
143
145 m_pidl(NULL),
146 m_hStopEvent(NULL)
147{
148}
149
151{
152 CComHeapPtr<ITEMIDLIST> lpFSPidl(ILCreateFromPathW(lpszPath));
153 if (!lpFSPidl)
154 {
155 ERR("Failed to create pidl from path\n");
156 return NULL;
157 }
158 LPITEMIDLIST lpLastFSPidl = ILFindLastID(lpFSPidl);
159
160 SIZE_T cbPath = (PathFindFileNameW(lpszPath) - lpszPath + 1) * sizeof(WCHAR);
161 SIZE_T cbData = sizeof(WORD) + cbPath + lpLastFSPidl->mkid.cb;
162 if (cbData > 0xffff)
163 return NULL;
164 LPITEMIDLIST pidl = (LPITEMIDLIST) SHAlloc(cbData + sizeof(WORD));
165 if (!pidl)
166 return NULL;
167
168 LPBYTE p = (LPBYTE) pidl;
169 p += sizeof(WORD); // mkid.cb
170
171 PWSTR path = (PWSTR)p;
172 memcpy(p, lpszPath, cbPath);
173 p += cbPath;
174 ((PWSTR)p)[-1] = UNICODE_NULL; // "C:\" not "C:" (required by ILCreateFromPathW and matches Windows)
175 if (!PathIsRootW(path))
176 {
177 p -= sizeof(WCHAR);
178 ((PWSTR)p)[-1] = UNICODE_NULL; // "C:\folder"
179 }
180
181 memcpy(p, lpLastFSPidl, lpLastFSPidl->mkid.cb);
182 p += lpLastFSPidl->mkid.cb;
183
184 pidl->mkid.cb = p - (LPBYTE)pidl;
185 ((LPITEMIDLIST)p)->mkid.cb = 0; // Terminator
186 return pidl;
187}
188
190{
191 if (!pidl || !pidl->mkid.cb)
192 return NULL;
193 return (LPCWSTR) pidl->mkid.abID;
194}
195
197{
198 if (!pidl || !pidl->mkid.cb)
199 return pidl;
200 return (LPCITEMIDLIST) ((LPBYTE) pidl->mkid.abID
201 + ((wcslen((LPCWSTR) pidl->mkid.abID) + 1) * sizeof(WCHAR)));
202}
203
205{
206 PIDLIST_ABSOLUTE pidl = NULL;
207 if (PIDLIST_ABSOLUTE pidlFolder = SHSimpleIDListFromPath(_ILGetPath(pidl))) // FIXME: SHELL32_CreateSimpleIDListFromPath(, DIRECTORY)
208 {
209 pidl = ILCombine(pidlFolder, _ILGetFSPidl(pidl));
210 ILFree(pidlFolder);
211 }
212 return pidl;
213}
214
216{
218 PCWSTR path = _ILGetPath(pidl);
219 if (!path || !path[0])
220 return E_INVALIDARG;
221 PIDLIST_ABSOLUTE pidlFolder = ILCreateFromPathW(path); // FIXME: SHELL32_CreateSimpleIDListFromPath(, DIRECTORY);
222 if (!pidlFolder)
223 return E_FAIL;
224 HRESULT hr = m_pSfDesktop->BindToObject(pidlFolder, NULL, IID_PPV_ARG(IShellFolder, ppSF));
225 ILFree(pidlFolder);
226 if (ppidlLast)
227 *ppidlLast = _ILGetFSPidl(pidl);
228 return hr;
229}
230
232{
234 HRESULT hr = GetFSFolderAndChild(pidl, &pSF1, ppidlLast);
235 if (SUCCEEDED(hr))
236 hr = pSF1->QueryInterface(IID_PPV_ARG(IShellFolder2, ppSF));
237 return hr;
238}
239
240static int CALLBACK ILFreeHelper(void *pItem, void *pCaller)
241{
242 ILFree((LPITEMIDLIST)pItem);
243 return TRUE;
244}
245
247{
249}
250
252{
253 HDPA hDpa = DPA_Create(cidl / 2);
254 if (hDpa)
255 {
256 for (UINT i = 0; i < cidl; ++i)
257 {
258 PIDLIST_ABSOLUTE pidl = _ILCreateAbsolute(apidl[i]);
259 if (pidl)
260 {
261 if (DPA_InsertPtr(hDpa, i, pidl) >= 0)
262 continue;
263 ILFree(pidl);
264 }
265 FreePidlArray(hDpa);
266 return NULL;
267 }
268 }
269 return hDpa;
270}
271
273{
285
286 explicit _SearchData(UINT InitSearchId) : SearchId(InitSearchId) {}
288 {
290 }
291};
292
293template<typename TChar, typename TString, int (&StrNCmp)(const TChar *, const TChar *, size_t)>
294static const TChar* StrStrN(const TChar *lpFirst, const TString &lpSrch, UINT cchMax)
295{
296 if (!lpFirst || lpSrch.IsEmpty() || !cchMax)
297 return NULL;
298
299 for (UINT i = cchMax; i > 0 && *lpFirst; i--, lpFirst++)
300 {
301 if (!StrNCmp(lpFirst, lpSrch, lpSrch.GetLength()))
302 return (const TChar*)lpFirst;
303 }
304
305 return NULL;
306}
307
308static inline BOOL
309StrFindNIA(const CHAR *lpFirst, const CStringA &lpSrch, UINT cchMax)
310{
311 return StrStrN<CHAR, CStringA, _strnicmp>(lpFirst, lpSrch, cchMax) != NULL;
312}
313
314static inline BOOL
315StrFindNIW(const WCHAR *lpFirst, const CStringW &lpSrch, UINT cchMax)
316{
317 return StrStrN<WCHAR, CStringW, _wcsnicmp>(lpFirst, lpSrch, cchMax) != NULL;
318}
319
320/*
321 * The following code is borrowed from base/applications/cmdutils/more/more.c .
322 */
323typedef enum
324{
328 ENCODING_UTF8 = 3
330
331static BOOL
335 OUT ENCODING* Encoding OPTIONAL,
337{
338 PBYTE pBytes = (PBYTE)Buffer;
339 ENCODING encFile = ENCODING_ANSI;
340 DWORD dwPos = 0;
341
342 /*
343 * See http://archives.miloush.net/michkap/archive/2007/04/22/2239345.html
344 * for more details about the algorithm and the pitfalls behind it.
345 * Of course it would be actually great to make a nice function that
346 * would work, once and for all, and put it into a library.
347 */
348
349 /* Look for Byte Order Marks */
350 if ((BufferSize >= 2) && (pBytes[0] == 0xFF) && (pBytes[1] == 0xFE))
351 {
352 encFile = ENCODING_UTF16LE;
353 dwPos = 2;
354 }
355 else if ((BufferSize >= 2) && (pBytes[0] == 0xFE) && (pBytes[1] == 0xFF))
356 {
357 encFile = ENCODING_UTF16BE;
358 dwPos = 2;
359 }
360 else if ((BufferSize >= 3) && (pBytes[0] == 0xEF) && (pBytes[1] == 0xBB) && (pBytes[2] == 0xBF))
361 {
362 encFile = ENCODING_UTF8;
363 dwPos = 3;
364 }
365 else
366 {
367 /*
368 * Try using statistical analysis. Do not rely on the return value of
369 * IsTextUnicode as we can get FALSE even if the text is in UTF-16 BE
370 * (i.e. we have some of the IS_TEXT_UNICODE_REVERSE_MASK bits set).
371 * Instead, set all the tests we want to perform, then just check
372 * the passed tests and try to deduce the string properties.
373 */
374
375/*
376 * This mask contains the 3 highest bits from IS_TEXT_UNICODE_NOT_ASCII_MASK
377 * and the 1st highest bit from IS_TEXT_UNICODE_NOT_UNICODE_MASK.
378 */
379#define IS_TEXT_UNKNOWN_FLAGS_MASK ((7 << 13) | (1 << 11))
380
381 /* Flag out the unknown flags here, the passed tests will not have them either */
386 INT Results;
387
389 Results = Tests;
390
391 /*
392 * As the IS_TEXT_UNICODE_NULL_BYTES or IS_TEXT_UNICODE_ILLEGAL_CHARS
393 * flags are expected to be potentially present in the result without
394 * modifying our expectations, filter them out now.
395 */
397
398 /*
399 * NOTE: The flags IS_TEXT_UNICODE_ASCII16 and
400 * IS_TEXT_UNICODE_REVERSE_ASCII16 are not reliable.
401 *
402 * NOTE2: Check for potential "bush hid the facts" effect by also
403 * checking the original results (in 'Tests') for the absence of
404 * the IS_TEXT_UNICODE_NULL_BYTES flag, as we may presumably expect
405 * that in UTF-16 text there will be at some point some NULL bytes.
406 * If not, fall back to ANSI. This shows the limitations of using the
407 * IsTextUnicode API to perform such tests, and the usage of a more
408 * improved encoding detection algorithm would be really welcome.
409 */
410 if (!(Results & IS_TEXT_UNICODE_NOT_UNICODE_MASK) &&
411 !(Results & IS_TEXT_UNICODE_REVERSE_MASK) &&
412 (Results & IS_TEXT_UNICODE_UNICODE_MASK) &&
414 {
415 encFile = ENCODING_UTF16LE;
416 dwPos = (Results & IS_TEXT_UNICODE_SIGNATURE) ? 2 : 0;
417 }
418 else
419 if (!(Results & IS_TEXT_UNICODE_NOT_UNICODE_MASK) &&
420 !(Results & IS_TEXT_UNICODE_UNICODE_MASK) &&
421 (Results & IS_TEXT_UNICODE_REVERSE_MASK) &&
423 {
424 encFile = ENCODING_UTF16BE;
425 dwPos = (Results & IS_TEXT_UNICODE_REVERSE_SIGNATURE) ? 2 : 0;
426 }
427 else
428 {
429 /*
430 * Either 'Results' has neither of those masks set, as it can be
431 * the case for UTF-8 text (or ANSI), or it has both as can be the
432 * case when analysing pure binary data chunk. This is therefore
433 * invalid and we fall back to ANSI encoding.
434 * FIXME: In case of failure, assume ANSI (as long as we do not have
435 * correct tests for UTF8, otherwise we should do them, and at the
436 * very end, assume ANSI).
437 */
438 encFile = ENCODING_ANSI; // ENCODING_UTF8;
439 dwPos = 0;
440 }
441 }
442
443 if (Encoding)
444 *Encoding = encFile;
445 if (SkipBytes)
446 *SkipBytes = dwPos;
447
448 return (encFile != ENCODING_ANSI);
449}
450
451static BOOL SearchFile(LPCWSTR lpFilePath, _SearchData *pSearchData)
452{
455 return FALSE;
456
457 // FIXME: support large file
459 if (size == 0 || size == INVALID_FILE_SIZE)
460 {
462 return FALSE;
463 }
464
467 if (hFileMap == INVALID_HANDLE_VALUE)
468 return FALSE;
469
470 LPBYTE pbContents = (LPBYTE)MapViewOfFile(hFileMap, FILE_MAP_READ, 0, 0, size);
471 CloseHandle(hFileMap);
472 if (!pbContents)
473 return FALSE;
474
475 ENCODING encoding;
476 IsDataUnicode(pbContents, size, &encoding, NULL);
477
478 BOOL bFound;
479 switch (encoding)
480 {
481 case ENCODING_UTF16LE:
482 // UTF-16
483 bFound = StrFindNIW((LPCWSTR)pbContents, pSearchData->szQueryW, size / sizeof(WCHAR));
484 break;
485 case ENCODING_UTF16BE:
486 // UTF-16 BE
487 bFound = StrFindNIW((LPCWSTR)pbContents, pSearchData->szQueryU16BE, size / sizeof(WCHAR));
488 break;
489 case ENCODING_UTF8:
490 // UTF-8
491 bFound = StrFindNIA((LPCSTR)pbContents, pSearchData->szQueryU8, size / sizeof(CHAR));
492 break;
493 case ENCODING_ANSI:
494 default:
495 // ANSI or UTF-8 without BOM
496 bFound = StrFindNIA((LPCSTR)pbContents, pSearchData->szQueryA, size / sizeof(CHAR));
497 if (!bFound && pSearchData->szQueryA != pSearchData->szQueryU8)
498 bFound = StrFindNIA((LPCSTR)pbContents, pSearchData->szQueryU8, size / sizeof(CHAR));
499 break;
500 }
501
502 UnmapViewOfFile(pbContents);
503 return bFound;
504}
505
506static BOOL FileNameMatch(LPCWSTR FindDataFileName, _SearchData *pSearchData)
507{
508 if (pSearchData->szFileName.IsEmpty() || PathMatchSpecW(FindDataFileName, pSearchData->szFileName))
509 {
510 return TRUE;
511 }
512 return FALSE;
513}
514
516{
517 if (pSearchData->szQueryA.IsEmpty() || SearchFile(szPath, pSearchData))
518 {
519 return TRUE;
520 }
521 return FALSE;
522}
523
525{
526 if (!(FileAttributes & FILE_ATTRIBUTE_HIDDEN) || (pSearchData->SearchHidden))
527 {
528 return TRUE;
529 }
530 return FALSE;
531}
532
533static inline void PostUpdate(UINT Msg, LPCWSTR pszText, const _SearchData &Data)
534{
535 LPWSTR pszDup;
536 if (FAILED(SHStrDupW(pszText, &pszDup)))
537 return;
538 if (!PostMessageW(Data.hwnd, Msg, Data.SearchId, (LPARAM)pszDup))
539 SHFree(pszDup);
540}
541
542static UINT RecursiveFind(LPCWSTR lpPath, _SearchData *pSearchData)
543{
544 if (WaitForSingleObject(pSearchData->hStopEvent, 0) != WAIT_TIMEOUT)
545 return 0;
546
548 WIN32_FIND_DATAW FindData;
549 HANDLE hFindFile;
550 BOOL bMoreFiles = TRUE;
551 UINT uTotalFound = 0;
552
553 PathCombineW(szPath, lpPath, L"*");
554
555 for (hFindFile = FindFirstFileW(szPath, &FindData);
556 bMoreFiles && hFindFile != INVALID_HANDLE_VALUE;
557 bMoreFiles = FindNextFileW(hFindFile, &FindData))
558 {
559#define IS_DOTS(psz) ((psz)[0] == L'.' && ((psz)[1] == 0 || ((psz)[1] == L'.' && (psz)[2] == 0)))
560 if (IS_DOTS(FindData.cFileName))
561 continue;
562
563 PathCombineW(szPath, lpPath, FindData.cFileName);
564
566 {
568 if (pSearchData->szQueryW.IsEmpty() &&
569 FileNameMatch(FindData.cFileName, pSearchData) &&
570 AttribHiddenMatch(FindData.dwFileAttributes, pSearchData))
571 {
572 PostUpdate(WM_SEARCH_ADD_RESULT, szPath, *pSearchData);
573 uTotalFound++;
574 }
575 status.Format(IDS_SEARCH_FOLDER, FindData.cFileName);
576 PostUpdate(WM_SEARCH_UPDATE_STATUS, status.GetBuffer(), *pSearchData);
577
578 uTotalFound += RecursiveFind(szPath, pSearchData);
579 }
580 else if (FileNameMatch(FindData.cFileName, pSearchData)
581 && AttribHiddenMatch(FindData.dwFileAttributes, pSearchData)
582 && ContentsMatch(szPath, pSearchData))
583 {
584 PostUpdate(WM_SEARCH_ADD_RESULT, szPath, *pSearchData);
585 uTotalFound++;
586 }
587 }
588
589 if (hFindFile != INVALID_HANDLE_VALUE)
590 FindClose(hFindFile);
591
592 return uTotalFound;
593}
594
596{
597 _SearchData *data = static_cast<_SearchData*>(lpParameter);
598
600
602
603 data->pFindFolder->NotifyConnections(DISPID_SEARCHSTART);
604
605 UINT uTotalFound = 0;
606 for (LOCATIONITEM *pLocation = data->pPaths; pLocation; pLocation = pLocation->pNext)
607 {
608 uTotalFound += RecursiveFind(pLocation->szPath, data);
609 }
610
611 data->pFindFolder->NotifyConnections(DISPID_SEARCHCOMPLETE);
612
614 status.Format(IDS_SEARCH_FILES_FOUND, uTotalFound);
616 ::SendMessageW(data->hwnd, WM_SEARCH_STOP, 0, 0);
617
618 CloseHandle(data->hStopEvent);
619 delete data;
620
621 if (SUCCEEDED(hrCoInit))
623
624 return 0;
625}
626
628{
629 DISPPARAMS dispatchParams = {0};
630 CComDynamicUnkArray &subscribers =
632 for (IUnknown** pSubscriber = subscribers.begin(); pSubscriber < subscribers.end(); pSubscriber++)
633 {
634 if (!*pSubscriber)
635 continue;
636
637 CComPtr<IDispatch> pDispatch;
638 HRESULT hResult = (*pSubscriber)->QueryInterface(IID_PPV_ARG(IDispatch, &pDispatch));
639 if (!FAILED_UNEXPECTEDLY(hResult))
640 pDispatch->Invoke(id, GUID_NULL, 0, DISPATCH_METHOD, &dispatchParams, NULL, NULL, NULL);
641 }
642}
643
645{
646 HKEY hkey;
647 DWORD size = sizeof(DWORD);
649 DWORD SearchHiddenValue = 0;
650
651 if (!lParam)
652 return 0;
653
654 // Clear all previous search results
655 UINT uItemIndex;
656 m_shellFolderView->RemoveObject(NULL, &uItemIndex);
657
658 _SearchData* pSearchData = new _SearchData(++m_SearchId);
659 pSearchData->pFindFolder = this;
660 pSearchData->hwnd = m_hWnd;
661
662 SearchStart *pSearchParams = (SearchStart *) lParam;
663 pSearchData->pPaths = pSearchParams->pPaths;
664 pSearchData->szFileName = pSearchParams->szFileName;
665 pSearchData->szQueryA = pSearchParams->szQuery;
666 pSearchData->szQueryW = pSearchParams->szQuery;
667
668 // UTF-16 BE
669 {
670 CStringW utf16 = pSearchData->szQueryW;
671 LPWSTR psz = utf16.GetBuffer();
672 for (SIZE_T i = 0; psz[i]; ++i)
673 {
674 psz[i] = MAKEWORD(HIBYTE(psz[i]), LOBYTE(psz[i]));
675 }
676 utf16.ReleaseBuffer();
677 pSearchData->szQueryU16BE = utf16;
678 }
679
680 // UTF-8
681 {
683 INT cch = WideCharToMultiByte(CP_UTF8, 0, pSearchData->szQueryW, -1, NULL, 0, NULL, NULL);
684 if (cch > 0)
685 {
686 LPSTR psz = utf8.GetBuffer(cch);
687 WideCharToMultiByte(CP_UTF8, 0, pSearchData->szQueryW, -1, psz, cch, NULL, NULL);
688 utf8.ReleaseBuffer();
689 pSearchData->szQueryU8 = utf8;
690 }
691 else
692 {
693 pSearchData->szQueryU8 = pSearchData->szQueryA;
694 }
695 }
696
697 pSearchData->SearchHidden = pSearchParams->SearchHidden;
698 SHFree(pSearchParams);
699
700 TRACE("pSearchParams->SearchHidden is '%d'.\n", pSearchData->SearchHidden);
701
702 if (pSearchData->SearchHidden)
703 SearchHiddenValue = 1;
704 else
705 SearchHiddenValue = 0;
706
707 /* Placing the code to save the changed settings to the registry here has the effect of not saving any changes */
708 /* to the registry unless the user clicks on the "Search" button. This is the same as what we see in Windows. */
709 result = RegOpenKeyEx(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer", 0, KEY_SET_VALUE, &hkey);
710 if (result == ERROR_SUCCESS)
711 {
712 if (RegSetValueExW(hkey, L"SearchHidden", NULL, REG_DWORD, (const BYTE*)&SearchHiddenValue, size) == ERROR_SUCCESS)
713 {
714 TRACE("SearchHidden is '%d'.\n", SearchHiddenValue);
715 }
716 else
717 {
718 ERR("RegSetValueEx for \"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\SearchHidden\" Failed.\n");
719 }
720 RegCloseKey(hkey);
721 }
722 else
723 {
724 ERR("RegOpenKey for \"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\" Failed.\n");
725 }
726
727 if (m_hStopEvent)
730
731 if (!SHCreateThread(SearchThreadProc, pSearchData, 0, NULL))
732 {
733 if (pSearchData->hStopEvent)
734 {
735 CloseHandle(pSearchData->hStopEvent);
737 }
738 delete pSearchData;
739 }
740 return 0;
741}
742
744{
745 if (m_hStopEvent)
746 {
749
750 // Wait for all in-flight messages with data we need to free
753 {
754 if (msg.message == WM_SEARCH_STOPPED)
755 break;
756 if (msg.message == WM_SEARCH_ADD_RESULT || msg.message == WM_SEARCH_UPDATE_STATUS)
757 SHFree((void*)msg.lParam);
758 }
759 }
760 return 0;
761}
762
764{
765 if (!lParam)
766 return 0;
767
769 if (wParam != m_SearchId)
770 return 0;
771
772 CComHeapPtr<ITEMIDLIST> lpSearchPidl(_ILCreate(lpPath));
773 if (lpSearchPidl)
774 {
775 UINT uItemIndex;
776 m_shellFolderView->AddObject(lpSearchPidl, &uItemIndex);
777 }
778
779 return 0;
780}
781
783{
786 m_shellBrowser->SetStatusTextSB(status);
787 return 0;
788}
789
790// *** IShellFolder2 methods ***
792{
794 return E_NOTIMPL;
795}
796
798{
800 return E_NOTIMPL;
801}
802
804{
805 if (pSort)
806 *pSort = COL_NAME_INDEX;
807 if (pDisplay)
808 *pDisplay = COL_NAME_INDEX;
809 return S_OK;
810}
811
813{
814 if (!pcsFlags)
815 return E_INVALIDARG;
816 if (iColumn >= _countof(g_ColumnDefs))
817 return m_pisfInner->GetDefaultColumnState(iColumn - _countof(g_ColumnDefs) + 1, pcsFlags);
818 *pcsFlags = g_ColumnDefs[iColumn].dwDefaultState;
819 return S_OK;
820}
821
823{
824 // FIXME: Handle COL_LOCATION_INDEX and COL_RELEVANCE_INDEX
826 PCUITEMID_CHILD pChild;
827 if (SUCCEEDED(GetFSFolder2AndChild(pidl, &pFolder, &pChild)))
828 return pFolder->GetDetailsEx(pChild, pscid, pv);
829 return E_FAIL;
830}
831
833{
834 if (iColumn >= _countof(g_ColumnDefs))
835 {
836 UINT FSColumn = iColumn - _countof(g_ColumnDefs) + 1;
837 if (pidl)
838 {
840 PCUITEMID_CHILD pChild;
841 if (SUCCEEDED(GetFSFolder2AndChild(pidl, &pFolder, &pChild)))
842 return pFolder->GetDetailsOf(pChild, FSColumn, pDetails);
843 }
844 return m_pisfInner->GetDetailsOf(pidl, FSColumn, pDetails); // Column header info
845 }
846
847 pDetails->cxChar = g_ColumnDefs[iColumn].cxChar;
848 pDetails->fmt = g_ColumnDefs[iColumn].fmt;
849 if (!pidl)
850 return SHSetStrRet(&pDetails->str, _AtlBaseModule.GetResourceInstance(), g_ColumnDefs[iColumn].iResource);
851
852 if (iColumn == COL_LOCATION_INDEX)
853 {
854 return SHSetStrRet(&pDetails->str, _ILGetPath(pidl));
855 }
856
857 if (iColumn == COL_RELEVANCE_INDEX)
858 {
859 // TODO: Fill once the relevance is calculated
860 return SHSetStrRetEmpty(&pDetails->str);
861 }
862
863 ATLASSERT(iColumn == COL_NAME_INDEX);
864 return GetDisplayNameOf(pidl, SHGDN_NORMAL | SHGDN_INFOLDER, &pDetails->str);
865}
866
868{
870 return E_NOTIMPL;
871}
872
873// *** IShellFolder methods ***
874STDMETHODIMP CFindFolder::ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, ULONG *pchEaten,
875 PIDLIST_RELATIVE *ppidl, ULONG *pdwAttributes)
876{
878 return E_NOTIMPL;
879}
880
881STDMETHODIMP CFindFolder::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
882{
883 *ppEnumIDList = NULL;
884 return S_FALSE;
885}
886
888{
889 HRESULT hr;
890 CComPtr<IShellFolder> pInnerFolder;
891 PCUITEMID_CHILD pidlChild;
892 if (FAILED_UNEXPECTEDLY(hr = GetFSFolderAndChild(pidl, &pInnerFolder, &pidlChild)))
893 return hr;
894 return pInnerFolder->BindToObject(pidlChild, pbcReserved, riid, ppvOut);
895}
896
898{
900 return E_NOTIMPL;
901}
902
904{
905 HRESULT hr;
906 WORD wColumn = LOWORD(lParam);
907 switch (wColumn)
908 {
909 case COL_NAME_INDEX: // Name
910 C_ASSERT(COL_NAME_INDEX == 0); // SHELL32::SHFSF_COL_NAME
911 // We can have more than one item with the same filename, in this case, look at the path as well.
912 // When DefView wants to identify a specific item, it will use the SHCIDS_CANONICALONLY flag.
913 hr = m_pisfInner->CompareIDs(MAKELONG(0, HIWORD(lParam)), _ILGetFSPidl(pidl1), _ILGetFSPidl(pidl2));
915 hr = CompareIDs(COL_LOCATION_INDEX, pidl1, pidl2);
916 return hr;
917 case COL_LOCATION_INDEX: // Path
918 return MAKE_COMPARE_HRESULT(StrCmpW(_ILGetPath(pidl1), _ILGetPath(pidl2)));
919 case COL_RELEVANCE_INDEX: // Relevance
920 return E_NOTIMPL;
921 default: // Default columns
922 wColumn -= _countof(g_ColumnDefs) - 1;
923 break;
924 }
925 return m_pisfInner->CompareIDs(MAKELONG(wColumn, HIWORD(lParam)), _ILGetFSPidl(pidl1), _ILGetFSPidl(pidl2));
926}
927
929{
930 if (riid == IID_IShellView)
931 {
932 SFV_CREATE sfvparams = {};
933 sfvparams.cbSize = sizeof(SFV_CREATE);
934 sfvparams.pshf = this;
935 sfvparams.psfvcb = this;
936 HRESULT hr = SHCreateShellFolderView(&sfvparams, (IShellView **) ppvOut);
938 {
939 return hr;
940 }
941
942 return ((IShellView * ) * ppvOut)->QueryInterface(IID_PPV_ARG(IShellFolderView, &m_shellFolderView));
943 }
944 return E_NOINTERFACE;
945}
946
948{
949 if (!cidl)
950 {
951 *rgfInOut &= SFGAO_BROWSABLE; // TODO: SFGAO_CANRENAME?
952 return S_OK;
953 }
954
956 for (UINT i = 0; i < cidl; ++i)
957 {
958 CComPtr<IShellFolder> pFolder;
959 PCUITEMID_CHILD pidlChild;
960 if (FAILED_UNEXPECTEDLY(hr = GetFSFolderAndChild(apidl[i], &pFolder, &pidlChild)))
961 break;
962 if (FAILED(hr = pFolder->GetAttributesOf(1, &pidlChild, rgfInOut)))
963 break;
964 }
965 return hr;
966}
967
969 public IContextMenu,
970 public IObjectWithSite,
971 public CComObjectRootEx<CComMultiThreadModelNoCS>
972{
978 static const UINT ADDITIONAL_MENU_ITEMS = 2;
979
980 // *** IContextMenu ***
981 STDMETHODIMP QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags)
982 {
983 if (m_cidl > 1)
984 uFlags &= ~CMF_CANRENAME;
985
986 m_MyFirstId = 0;
987 if (idCmdLast - idCmdFirst > ADDITIONAL_MENU_ITEMS)
988 {
989 // We use the last available id. For DefView, this places us at
990 // DVIDM_CONTEXTMENU_LAST which should not collide with anything.
991 // This is just a temporary fix until we are moved to shell32 and
992 // can use DFM_MERGECONTEXTMENU.
993 _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdLast--, MFT_STRING,
995 _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdLast--, MFT_SEPARATOR, NULL, 0);
996 m_MyFirstId = idCmdLast + 1;
997 }
998 return m_pInner->QueryContextMenu(hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags);
999 }
1000
1002 {
1003 WORD idCmd = IS_INTRESOURCE(lpcmi->lpVerb) ? LOWORD(lpcmi->lpVerb) : 0;
1004 if (m_MyFirstId && idCmd >= m_MyFirstId && idCmd < m_MyFirstId + ADDITIONAL_MENU_ITEMS)
1005 {
1006 PCUITEMID_CHILD *apidl;
1007 UINT cidl;
1008 HRESULT hResult = m_shellFolderView->GetSelectedObjects(&apidl, &cidl);
1009 if (FAILED_UNEXPECTEDLY(hResult))
1010 return hResult;
1011
1012 for (UINT i = 0; i < cidl; i++)
1013 {
1015 if (!folderPidl)
1016 {
1017 hResult = E_OUTOFMEMORY;
1018 break;
1019 }
1021 SHOpenFolderAndSelectItems(folderPidl, 1, &child, 0);
1022 }
1023 LocalFree(apidl); // Yes, LocalFree
1024 return hResult;
1025 }
1026
1027 // TODO: Use GetDfmCmd instead after moving all of this to shell32
1028 CHAR szVerb[42];
1029 PCSTR pszVerb = !idCmd ? lpcmi->lpVerb : NULL;
1030 if (!pszVerb && SUCCEEDED(GetCommandStringA(m_pInner, LOWORD(lpcmi->lpVerb), GCS_VERBA, szVerb, _countof(szVerb))))
1031 pszVerb = szVerb;
1032
1033 if (pszVerb && !lstrcmpiA(pszVerb, "rename"))
1034 {
1035 // Note: We can't invoke m_pInner (CDefaultContextMenu::DoRename) because the pidl is incorrect and SelectItem will fail.
1037 }
1038
1039 // FIXME: We can't block FCIDM_SHVIEW_REFRESH here, add items on SFVM_LISTREFRESHED instead
1040 return m_pInner->InvokeCommand(lpcmi);
1041 }
1042
1044 {
1045 return m_pInner->GetCommandString(idCommand, uFlags, lpReserved, lpszName, uMaxNameLen);
1046 }
1047
1048 // *** IObjectWithSite ***
1049 STDMETHODIMP SetSite(IUnknown *pUnkSite) override
1050 {
1051 IUnknown_Set(&m_pUnkSite, pUnkSite);
1052 IUnknown_SetSite(m_pInner, pUnkSite);
1053 return S_OK;
1054 }
1055
1056 STDMETHODIMP GetSite(REFIID riid, void **ppvSite) override
1057 {
1058 *ppvSite = NULL;
1059 return m_pUnkSite ? m_pUnkSite->QueryInterface(riid, ppvSite) : E_FAIL;
1060 }
1061
1062public:
1064 {
1065 SetSite(NULL);
1066 }
1067
1068 static HRESULT Create(IShellFolderView *pShellFolderView, UINT cidl, IContextMenu *pInnerContextMenu, IContextMenu **pContextMenu)
1069 {
1072 if (FAILED_UNEXPECTEDLY(hResult))
1073 return hResult;
1074 pObj->m_shellFolderView = pShellFolderView;
1075 pObj->m_pInner = pInnerContextMenu;
1076 pObj->m_cidl = cidl;
1077 return pObj->QueryInterface(IID_PPV_ARG(IContextMenu, pContextMenu));
1078 }
1079
1081 COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu)
1083 END_COM_MAP()
1084};
1085
1087{
1088 // For Delete/Move operations, a subfolder/file needs to come before the parent folder
1089 return ::ILGetSize((LPCITEMIDLIST)p1) - ::ILGetSize((LPCITEMIDLIST)p2);
1090}
1091
1093 UINT *prgfInOut, LPVOID *ppvOut)
1094{
1095 HRESULT hr;
1096 if (cidl <= 0)
1097 return E_INVALIDARG;
1098
1099 CComHeapPtr<PCITEMID_CHILD> aFSPidlAlloc;
1100 PCITEMID_CHILD pidlSingleBuffer, *aFSPidl = &pidlSingleBuffer; // Optimize for single item callers
1101 if (cidl != 1)
1102 {
1103 if (riid == IID_IDataObject)
1104 {
1105 if (HDPA hDpa = CreateAbsolutePidlArray(cidl, apidl))
1106 {
1108 ITEMIDLIST pidlRoot = {};
1110 NULL, (IDataObject**)ppvOut);
1111 FreePidlArray(hDpa);
1112 return hr;
1113 }
1114 }
1115
1116 aFSPidlAlloc.Allocate(cidl);
1117 aFSPidl = aFSPidlAlloc;
1118 }
1119 for (UINT i = 0; i < cidl; i++)
1120 {
1121 aFSPidl[i] = _ILGetFSPidl(apidl[i]);
1122 }
1123
1124 if (riid == IID_IContextMenu)
1125 {
1126 // FIXME: Use CDefFolderMenu_Create2(..., AddFSClassKeysToArray())
1128 if (!folderPidl)
1129 return E_OUTOFMEMORY;
1130 CComPtr<IShellFolder> pDesktopFolder;
1131 if (FAILED_UNEXPECTEDLY(hr = SHGetDesktopFolder(&pDesktopFolder)))
1132 return hr;
1133 CComPtr<IShellFolder> pShellFolder;
1134 hr = pDesktopFolder->BindToObject(folderPidl, NULL, IID_PPV_ARG(IShellFolder, &pShellFolder));
1136 return hr;
1137 CComPtr<IContextMenu> pContextMenu;
1138 hr = pShellFolder->GetUIObjectOf(hwndOwner, cidl, aFSPidl, riid, prgfInOut, (void**)&pContextMenu);
1140 return hr;
1141 return CFindFolderContextMenu::Create(m_shellFolderView, cidl, pContextMenu, (IContextMenu **)ppvOut);
1142 }
1143
1144 CComPtr<IShellFolder> pFolder;
1145 if (FAILED_UNEXPECTEDLY(hr = GetFSFolderAndChild(apidl[0], &pFolder)))
1146 return hr;
1147 return pFolder->GetUIObjectOf(hwndOwner, cidl, aFSPidl, riid, prgfInOut, ppvOut);
1148}
1149
1151{
1152 HRESULT hr;
1153 CComPtr<IShellFolder> pFolder;
1154 PCUITEMID_CHILD pidlChild;
1155 if (FAILED_UNEXPECTEDLY(hr = GetFSFolderAndChild(pidl, &pFolder, &pidlChild)))
1156 return hr;
1157 return pFolder->GetDisplayNameOf(pidlChild, dwFlags, pName);
1158}
1159
1161 PITEMID_CHILD *pPidlOut)
1162{
1163 if (!pPidlOut)
1164 return E_INVALIDARG; // Our pidls are special, the caller must get it from us and not from parsing
1165 *pPidlOut = NULL;
1166
1167 HRESULT hr;
1168 CComPtr<IShellFolder> pFolder;
1169 PCUITEMID_CHILD pidlChild;
1170 if (FAILED_UNEXPECTEDLY(hr = GetFSFolderAndChild(pidl, &pFolder, &pidlChild)))
1171 return hr;
1172
1173 PCWSTR pszDir = _ILGetPath(pidl);
1174 PWSTR pszFull = (PWSTR)SHAlloc((wcslen(pszDir) + MAX_PATH) * sizeof(*pszDir));
1175 if (!pszFull)
1176 return E_OUTOFMEMORY;
1177
1178 PITEMID_CHILD pidlRawNew = NULL;
1179 hr = pFolder->SetNameOf(hwndOwner, pidlChild, lpName, dwFlags, &pidlRawNew);
1180 if (SUCCEEDED(hr) && pidlRawNew)
1181 {
1182 WCHAR szFileName[MAX_PATH];
1183 hr = DisplayNameOfW(pFolder, pidlRawNew, SHGDN_FORPARSING | SHGDN_INFOLDER, szFileName, _countof(szFileName));
1184 ILFree(pidlRawNew);
1185 PathCombineW(pszFull, pszDir, szFileName);
1186 if (SUCCEEDED(hr))
1187 hr = ((*pPidlOut = _ILCreate(pszFull)) != NULL) ? S_OK : E_OUTOFMEMORY;
1188 }
1189 SHFree(pszFull);
1190 return hr;
1191}
1192
1195{
1196 switch (uMsg)
1197 {
1198 case SFVM_DEFVIEWMODE:
1199 {
1200 FOLDERVIEWMODE *pViewMode = (FOLDERVIEWMODE *) lParam;
1201 *pViewMode = FVM_DETAILS;
1202 return S_OK;
1203 }
1204 case SFVM_WINDOWCREATED:
1205 {
1206 // Subclass window to receive window messages
1208
1209 // Get shell browser for updating status bar text
1212 return hr;
1213
1214 // Open search bar
1215 CComPtr<IWebBrowser2> pWebBrowser2;
1216 hr = m_shellBrowser->QueryInterface(IID_PPV_ARG(IWebBrowser2, &pWebBrowser2));
1218 return hr;
1219 WCHAR wszGuid[39];
1220 StringFromGUID2(CLSID_FileSearchBand, wszGuid, _countof(wszGuid));
1221 CComVariant searchBar(wszGuid);
1222 return pWebBrowser2->ShowBrowserBar(&searchBar, NULL, NULL);
1223 }
1224 case SFVM_WINDOWCLOSING:
1225 {
1227
1228 // [CORE-20504] LVN_ITEMACTIVATE in the DefView ListView can trigger a navigation that destroys this IShellFolder,
1229 // unsubclass now so we don't get a message after our "this" is dead.
1233 return S_OK;
1234 }
1235 case SFVM_GETCOMMANDDIR:
1236 {
1237 HRESULT hr = E_FAIL;
1239 {
1240 PCUITEMID_CHILD *apidl;
1241 UINT cidl = 0;
1242 if (SUCCEEDED(hr = m_shellFolderView->GetSelectedObjects(&apidl, &cidl)))
1243 {
1244 if (cidl)
1246 LocalFree(apidl);
1247 }
1248 }
1249 return hr;
1250 }
1251 // TODO: SFVM_GETCOLUMNSTREAM
1252 }
1253 return E_NOTIMPL;
1254}
1255
1258{
1260 HRESULT hr = m_pisfInner->QueryInterface(IID_PPV_ARG(IItemNameLimits, &pLimits));
1261 return FAILED_UNEXPECTEDLY(hr) ? hr : pLimits->GetMaxLength(pszName, piMaxNameLen);;
1262}
1263
1264STDMETHODIMP CFindFolder::GetValidCharacters(LPWSTR *ppwszValidChars, LPWSTR *ppwszInvalidChars)
1265{
1267 HRESULT hr = m_pisfInner->QueryInterface(IID_PPV_ARG(IItemNameLimits, &pLimits));
1268 return FAILED_UNEXPECTEDLY(hr) ? hr : pLimits->GetValidCharacters(ppwszValidChars, ppwszInvalidChars);
1269}
1270
1273{
1274 return SHILClone(m_pidl, pidl);
1275}
1276
1277// *** IPersistFolder methods ***
1279{
1280 if (m_pidl)
1281 return E_UNEXPECTED;
1282 HRESULT hr;
1284 return hr;
1285 if (FAILED(hr = SHILClone(pidl, &m_pidl)))
1286 return hr;
1287 return SHELL32_CoCreateInitSF(m_pidl, NULL, NULL, &CLSID_ShellFSFolder,
1289}
1290
1291// *** IPersist methods ***
1293{
1294 if (pClassId == NULL)
1295 return E_INVALIDARG;
1296 *pClassId = CLSID_FindFolder;
1297 return S_OK;
1298}
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv, IShellView **ppsv)
Definition: CDefView.cpp:4822
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
static HRESULT SHELL32_CoCreateInitSF(LPCITEMIDLIST pidlRoot, PERSIST_FOLDER_TARGET_INFO *ppfti, LPCITEMIDLIST pidlChild, const GUID *clsid, REFIID riid, LPVOID *ppvOut)
Definition: CFindFolder.cpp:39
static BOOL StrFindNIW(const WCHAR *lpFirst, const CStringW &lpSrch, UINT cchMax)
static int CALLBACK ILFreeHelper(void *pItem, void *pCaller)
static const TChar * StrStrN(const TChar *lpFirst, const TString &lpSrch, UINT cchMax)
static BOOL AttribHiddenMatch(DWORD FileAttributes, _SearchData *pSearchData)
static void WINAPI _InsertMenuItemW(HMENU hMenu, UINT indexMenu, BOOL fByPosition, UINT wID, UINT fType, LPCWSTR dwTypeData, UINT fState)
Definition: CFindFolder.cpp:68
static BOOL SearchFile(LPCWSTR lpFilePath, _SearchData *pSearchData)
static const FolderViewColumns g_ColumnDefs[]
static PIDLIST_ABSOLUTE _ILCreateAbsolute(LPCITEMIDLIST pidlChild)
static HRESULT GetCommandStringA(_In_ IContextMenu *pCM, _In_ UINT_PTR Id, _In_ UINT GCS, _Out_writes_(cchMax) LPSTR Buf, _In_ UINT cchMax)
Definition: CFindFolder.cpp:25
static HRESULT WINAPI DisplayNameOfW(_In_ IShellFolder *psf, _In_ LPCITEMIDLIST pidl, _In_ DWORD dwFlags, _Out_ LPWSTR pszBuf, _In_ UINT cchBuf)
Definition: CFindFolder.cpp:15
static HRESULT BeginRenameOfShellViewSelection(IUnknown *pUnkSite)
static BOOL FileNameMatch(LPCWSTR FindDataFileName, _SearchData *pSearchData)
#define IS_TEXT_UNKNOWN_FLAGS_MASK
ENCODING
@ ENCODING_UTF16BE
@ ENCODING_UTF8
@ ENCODING_UTF16LE
@ ENCODING_ANSI
static BOOL ContentsMatch(LPCWSTR szPath, _SearchData *pSearchData)
#define IS_DOTS(psz)
static LPITEMIDLIST _ILCreate(LPCWSTR lpszPath)
static UINT RecursiveFind(LPCWSTR lpPath, _SearchData *pSearchData)
static BOOL IsDataUnicode(IN PVOID Buffer, IN DWORD BufferSize, OUT ENCODING *Encoding OPTIONAL, OUT PDWORD SkipBytes OPTIONAL)
static void PostUpdate(UINT Msg, LPCWSTR pszText, const _SearchData &Data)
static HRESULT QueryActiveShellView(IUnknown *pUnkSite, REFGUID rService, IShellView **ppSV)
static BOOL StrFindNIA(const CHAR *lpFirst, const CStringA &lpSrch, UINT cchMax)
static LPCWSTR _ILGetPath(LPCITEMIDLIST pidl)
static LPCITEMIDLIST _ILGetFSPidl(LPCITEMIDLIST pidl)
static FolderViewColumns g_ColumnDefs[]
Definition: CFontExt.cpp:34
#define SHCIDS_ALLFIELDS
Definition: CFontExt.cpp:14
HRESULT WINAPI SHCreateFileDataObject(PCIDLIST_ABSOLUTE pidlFolder, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, IDataObject *pDataInner, IDataObject **ppDataObj)
DWORD Id
void FreeList(LOCATIONITEM *pItems)
Definition: CSearchBar.cpp:95
#define SFVM_GETCOMMANDDIR
#define SFVM_WINDOWCLOSING
struct test_data Tests[]
UINT cchMax
@ lparam
Definition: SystemMenu.c:31
#define msg(x)
Definition: auth_time.c:54
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define ERR(fmt,...)
Definition: precomp.h:57
#define STDMETHODIMP
Definition: basetyps.h:43
#define UNIMPLEMENTED
Definition: ntoskrnl.c:15
#define RegCloseKey(hKey)
Definition: registry.h:49
IUnknown ** end()
Definition: atlcom.h:1128
IUnknown ** begin()
Definition: atlcom.h:1123
static HRESULT WINAPI CreateInstance(CComObject< Base > **pp)
Definition: atlcom.h:171
STDMETHOD() QueryInterface(REFIID iid, void **ppvObject)
Definition: atlcom.h:166
bool IsEmpty() const noexcept
Definition: atlsimpstr.h:394
void ReleaseBuffer(_In_ int nNewLength=-1)
Definition: atlsimpstr.h:387
HWND UnsubclassWindow(BOOL bForce=FALSE)
Definition: atlwin.h:1575
HWND m_hWnd
Definition: atlwin.h:273
Definition: bufpool.h:45
STDMETHODIMP SetSite(IUnknown *pUnkSite) override
CComPtr< IContextMenu > m_pInner
static HRESULT Create(IShellFolderView *pShellFolderView, UINT cidl, IContextMenu *pInnerContextMenu, IContextMenu **pContextMenu)
STDMETHODIMP InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi)
STDMETHODIMP GetCommandString(UINT_PTR idCommand, UINT uFlags, UINT *lpReserved, LPSTR lpszName, UINT uMaxNameLen)
static const UINT ADDITIONAL_MENU_ITEMS
CComPtr< IShellFolderView > m_shellFolderView
STDMETHODIMP QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags)
STDMETHODIMP GetSite(REFIID riid, void **ppvSite) override
STDMETHOD() GetValidCharacters(LPWSTR *ppwszValidChars, LPWSTR *ppwszInvalidChars) override
STDMETHODIMP GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET pName)
HRESULT GetFSFolder2AndChild(LPCITEMIDLIST pidl, IShellFolder2 **ppSF, PCUITEMID_CHILD *ppidlLast=NULL)
LRESULT StartSearch(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
HANDLE m_hStopEvent
Definition: CFindFolder.h:75
STDMETHODIMP GetClassID(CLSID *pClassId)
CComPtr< IShellFolder2 > m_pisfInner
Definition: CFindFolder.h:72
STDMETHODIMP GetDetailsEx(PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv)
STDMETHODIMP BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
STDMETHODIMP SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut)
STDMETHODIMP GetCurFolder(PIDLIST_ABSOLUTE *pidl)
static DWORD WINAPI SearchThreadProc(LPVOID lpParameter)
static int CALLBACK SortItemsForDataObject(void *p1, void *p2, LPARAM lparam)
STDMETHODIMP CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2)
LRESULT AddResult(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
HDPA CreateAbsolutePidlArray(UINT cidl, PCUITEMID_CHILD_ARRAY apidl)
STDMETHOD() GetMaxLength(LPCWSTR pszName, int *piMaxNameLen) override
LRESULT UpdateStatus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
STDMETHODIMP GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut)
STDMETHODIMP GetDefaultColumn(DWORD dwRes, ULONG *pSort, ULONG *pDisplay)
STDMETHODIMP MapColumnToSCID(UINT iColumn, SHCOLUMNID *pscid)
STDMETHODIMP EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
CComPtr< IShellFolderView > m_shellFolderView
Definition: CFindFolder.h:73
STDMETHODIMP MessageSFVCB(UINT uMsg, WPARAM wParam, LPARAM lParam)
STDMETHODIMP EnumSearches(IEnumExtraSearch **ppenum)
void FreePidlArray(HDPA hDpa)
LRESULT StopSearch(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
UINT m_SearchId
Definition: CFindFolder.h:76
STDMETHODIMP GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *pDetails)
STDMETHODIMP Initialize(PCIDLIST_ABSOLUTE pidl)
CComPtr< IShellFolder2 > m_pSfDesktop
Definition: CFindFolder.h:72
STDMETHODIMP ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, ULONG *pchEaten, PIDLIST_RELATIVE *ppidl, ULONG *pdwAttributes)
void NotifyConnections(DISPID id)
STDMETHODIMP BindToStorage(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
STDMETHODIMP GetDefaultSearchGUID(GUID *pguid)
LPITEMIDLIST m_pidl
Definition: CFindFolder.h:71
HRESULT GetFSFolderAndChild(LPCITEMIDLIST pidl, IShellFolder **ppSF, PCUITEMID_CHILD *ppidlLast=NULL)
STDMETHODIMP CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut)
CComPtr< IShellBrowser > m_shellBrowser
Definition: CFindFolder.h:74
STDMETHODIMP GetDefaultColumnState(UINT iColumn, DWORD *pcsFlags)
STDMETHODIMP GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT *prgfInOut, LPVOID *ppvOut)
bool Allocate(_In_ size_t nElements=1)
Definition: atlalloc.h:143
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
struct @1791 Msg[]
#define WAIT_TIMEOUT
Definition: dderror.h:14
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
HRESULT hr
Definition: delayimp.cpp:582
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define IDS_COL_NAME
Definition: resource.h:17
#define SHCIDS_CANONICALONLY
Definition: shobjidl.idl:226
BOOL WINAPI IsTextUnicode(IN CONST VOID *lpv, IN INT iSize, IN OUT LPINT lpiResult OPTIONAL)
Definition: unicode.c:27
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
UINT uFlags
Definition: api.c:59
#define COL_NAME_INDEX
Definition: resource.h:187
#define IDS_COL_RELEVANCE
Definition: resource.h:177
#define IDS_SEARCH_OPEN_FOLDER
Definition: resource.h:181
#define IDS_COL_LOCATION
Definition: resource.h:176
#define COL_RELEVANCE_INDEX
Definition: resource.h:189
#define IDS_SEARCH_FOLDER
Definition: resource.h:179
#define COL_LOCATION_INDEX
Definition: resource.h:188
#define IDS_SEARCH_FILES_FOUND
Definition: resource.h:178
INT WINAPI StringFromGUID2(REFGUID guid, LPOLESTR str, INT cmax)
Definition: combase.c:1525
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(void *reserved, DWORD model)
Definition: combase.c:2803
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: combase.c:2842
BOOL WINAPI DPA_Sort(HDPA hdpa, PFNDPACOMPARE pfnCompare, LPARAM lParam)
Definition: dpa.c:813
void WINAPI DPA_DestroyCallback(HDPA hdpa, PFNDPAENUMCALLBACK enumProc, LPVOID lParam)
Definition: dpa.c:1003
HDPA WINAPI DPA_Create(INT nGrow)
Definition: dpa.c:950
INT WINAPI DPA_InsertPtr(HDPA hdpa, INT i, LPVOID p)
Definition: dpa.c:591
#define CloseHandle
Definition: compat.h:739
#define PAGE_READONLY
Definition: compat.h:138
#define UnmapViewOfFile
Definition: compat.h:746
#define OPEN_EXISTING
Definition: compat.h:775
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define CreateFileMappingW(a, b, c, d, e, f)
Definition: compat.h:744
#define GENERIC_READ
Definition: compat.h:135
#define MAX_PATH
Definition: compat.h:34
#define CreateFileW
Definition: compat.h:741
#define FILE_MAP_READ
Definition: compat.h:776
#define CALLBACK
Definition: compat.h:35
#define WideCharToMultiByte
Definition: compat.h:111
#define MapViewOfFile
Definition: compat.h:745
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
Definition: fileinfo.c:331
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:320
BOOL WINAPI FindClose(HANDLE hFindFile)
Definition: find.c:502
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:382
BOOL WINAPI SetThreadPriority(IN HANDLE hThread, IN int nPriority)
Definition: thread.c:700
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
BOOL WINAPI PathMatchSpecW(const WCHAR *path, const WCHAR *mask)
Definition: path.c:2497
BOOL WINAPI PathIsRootW(const WCHAR *path)
Definition: path.c:1077
int WINAPI StrCmpW(const WCHAR *str, const WCHAR *comp)
Definition: string.c:458
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2988
HRESULT WINAPI IUnknown_QueryService(IUnknown *obj, REFGUID sid, REFIID iid, void **out)
Definition: main.c:181
HRESULT WINAPI SHStrDupW(const WCHAR *src, WCHAR **dest)
Definition: main.c:1692
BOOL WINAPI SHCreateThread(LPTHREAD_START_ROUTINE thread_proc, void *data, DWORD flags, LPTHREAD_START_ROUTINE callback)
Definition: main.c:1628
void WINAPI IUnknown_Set(IUnknown **dest, IUnknown *src)
Definition: main.c:209
DWORD WINAPI SHUnicodeToAnsi(const WCHAR *src, char *dest, int dest_len)
Definition: main.c:1756
HRESULT WINAPI IUnknown_SetSite(IUnknown *obj, IUnknown *site)
Definition: main.c:222
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:370
HRESULT WINAPI SHCoCreateInstance(LPCWSTR aclsid, const CLSID *clsid, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppv)
Definition: shellole.c:197
LPVOID WINAPI SHAlloc(SIZE_T len)
Definition: shellole.c:348
HRESULT WINAPI StrRetToBufW(LPSTRRET src, const ITEMIDLIST *pidl, LPWSTR dest, UINT len)
Definition: string.c:248
#define FAILED_UNEXPECTEDLY
Definition: utils.cpp:33
#define L(x)
Definition: resources.c:13
#define DISPID_SEARCHSTART
Definition: exdispid.h:172
#define DISPID_SEARCHCOMPLETE
Definition: exdispid.h:173
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE _In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES _Out_ PIO_STATUS_BLOCK _In_opt_ PLARGE_INTEGER _In_ ULONG FileAttributes
Definition: fltkernel.h:1236
PITEMID_CHILD _ILCreate(LPCWSTR lpName, LPCWSTR lpFileName)
Definition: fontpidl.cpp:16
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLsizeiptr size
Definition: glext.h:5919
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLuint64EXT * result
Definition: glext.h:11304
GLfloat GLfloat p
Definition: glext.h:8902
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
unsigned int UINT
Definition: sysinfo.c:13
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
REFIID riid
Definition: atlbase.h:39
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
#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
#define LOBYTE(W)
Definition: jmemdos.c:487
#define HIBYTE(W)
Definition: jmemdos.c:486
#define GUID_NULL
Definition: ks.h:106
#define BEGIN_COM_MAP(x)
Definition: atlcom.h:581
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:601
#define END_COM_MAP()
Definition: atlcom.h:592
if(dx< 0)
Definition: linetemp.h:194
#define ZeroMemory
Definition: minwinbase.h:31
LONG_PTR LPARAM
Definition: minwindef.h:175
LONG_PTR LRESULT
Definition: minwindef.h:176
UINT_PTR WPARAM
Definition: minwindef.h:174
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
LPCWSTR szPath
Definition: env.c:37
static LPSTR pName
Definition: security.c:86
const IID IID_IObjectWithSite
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
static VARIANTARG static DISPID
Definition: ordinal.c:49
static HWND child
Definition: cursoricon.c:298
ENCODING
Definition: more.c:492
const CLSID * clsid
Definition: msctf.cpp:50
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
_In_ HANDLE hFile
Definition: mswsock.h:90
_In_ LPWSTR _In_ DWORD _In_ DWORD _In_ DWORD dwFlags
Definition: netsh.h:141
#define _Out_writes_(s)
Definition: no_sal2.h:176
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
#define FILE_ATTRIBUTE_READONLY
Definition: nt_native.h:702
#define FILE_ATTRIBUTE_HIDDEN
Definition: nt_native.h:703
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
#define DWORD
Definition: nt_native.h:44
#define KEY_SET_VALUE
Definition: nt_native.h:1020
#define UNICODE_NULL
@ COINIT_MULTITHREADED
Definition: objbase.h:280
interface IBindCtx * LPBC
Definition: objfwd.h:18
#define DISPATCH_METHOD
Definition: oleauto.h:1006
const GUID IID_IDataObject
#define PathCombineW
Definition: pathcch.h:318
#define LOWORD(l)
Definition: pedump.c:82
BYTE * PBYTE
Definition: pedump.c:66
short WCHAR
Definition: pedump.c:58
DWORD * PDWORD
Definition: pedump.c:68
char CHAR
Definition: pedump.c:57
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:1051
LPITEMIDLIST WINAPI ILFindLastID(LPCITEMIDLIST pidl)
Definition: pidl.c:199
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:817
UINT WINAPI ILGetSize(LPCITEMIDLIST pidl)
Definition: pidl.c:941
LPITEMIDLIST WINAPI ILCreateFromPathW(LPCWSTR path)
Definition: pidl.c:1108
#define LVCFMT_LEFT
Definition: commctrl.h:2603
#define DPA_GetPtrPtr(hdpa)
Definition: commctrl.h:4974
#define REFIID
Definition: guiddef.h:118
_In_opt_ _In_opt_ _In_ _In_ DWORD cbData
Definition: shlwapi.h:761
_In_ UINT cchBuf
Definition: shlwapi.h:378
#define REG_DWORD
Definition: sdbapi.c:615
#define CP_UTF8
Definition: nls.h:20
#define LoadStringW
Definition: utils.h:64
@ TString
Definition: dwarf.h:133
_In_ UINT _In_ UINT cch
Definition: shellapi.h:432
_In_ LPCSTR pszDir
Definition: shellapi.h:609
#define WM_SEARCH_ADD_RESULT
Definition: shellfind.h:31
#define WM_SEARCH_STOPPED
Definition: shellfind.h:33
#define WM_SEARCH_UPDATE_STATUS
Definition: shellfind.h:32
#define WM_SEARCH_START
Definition: shellfind.h:29
#define WM_SEARCH_STOP
Definition: shellfind.h:30
#define MAKE_COMPARE_HRESULT(x)
Definition: shellutils.h:686
#define S_EQUAL
Definition: shellutils.h:684
EXTERN_C HRESULT WINAPI SHOpenFolderAndSelectItems(PCIDLIST_ABSOLUTE pidlFolder, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD dwFlags)
Definition: shlfolder.cpp:583
#define SID_SShellBrowser
Definition: shlguid.h:128
#define SFVM_DEFVIEWMODE
Definition: shlobj.h:1334
#define SFVM_WINDOWCREATED
Definition: shlobj.h:1324
PIDLIST_ABSOLUTE WINAPI SHSimpleIDListFromPath(PCWSTR)
struct _SFV_CREATE SFV_CREATE
FOLDERVIEWMODE
Definition: shobjidl.idl:708
@ FVM_DETAILS
Definition: shobjidl.idl:714
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
const PCUITEMID_CHILD * PCUITEMID_CHILD_ARRAY
Definition: shtypes.idl:71
const ITEMID_CHILD UNALIGNED * PCUITEMID_CHILD
Definition: shtypes.idl:70
@ SHCOLSTATE_TYPE_STR
Definition: shtypes.idl:121
@ SHCOLSTATE_ONBYDEFAULT
Definition: shtypes.idl:125
const ITEMIDLIST_RELATIVE UNALIGNED * PCUIDLIST_RELATIVE
Definition: shtypes.idl:57
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
#define _countof(array)
Definition: sndvol32.h:70
#define TRACE(s)
Definition: solgame.cpp:4
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
DWORD dwDefaultState
Definition: CFontExt.cpp:20
STRRET str
Definition: shtypes.idl:108
WCHAR szFileName[MAX_PATH]
Definition: shellfind.h:54
LOCATIONITEM * pPaths
Definition: shellfind.h:53
BOOL SearchHidden
Definition: shellfind.h:56
WCHAR szQuery[MAX_PATH]
Definition: shellfind.h:55
Definition: dpa.c:49
Definition: scsiwmi.h:51
IShellFolderViewCB * psfvcb
Definition: shlobj.h:1376
UINT cbSize
Definition: shlobj.h:1373
IShellFolder * pshf
Definition: shlobj.h:1374
_SearchData(UINT InitSearchId)
CStringA szQueryA
CStringW szQueryW
CStringW szFileName
CStringW szQueryU16BE
LOCATIONITEM * pPaths
HANDLE hStopEvent
CStringA szQueryU8
CComPtr< CFindFolder > pFindFolder
_Field_z_ WCHAR cFileName[MAX_PATH]
Definition: minwinbase.h:291
DWORD dwFileAttributes
Definition: minwinbase.h:283
Definition: ps.c:97
struct tagLOCATIONITEM * pNext
Definition: shellfind.h:37
LPWSTR dwTypeData
Definition: winuser.h:3377
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:669
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
uint16_t * PWSTR
Definition: typedefs.h:56
const char * LPCSTR
Definition: typedefs.h:52
const uint16_t * PCWSTR
Definition: typedefs.h:57
const uint16_t * LPCWSTR
Definition: typedefs.h:57
#define MAKEWORD(a, b)
Definition: typedefs.h:248
unsigned char * LPBYTE
Definition: typedefs.h:53
uint16_t * LPWSTR
Definition: typedefs.h:56
ULONG_PTR SIZE_T
Definition: typedefs.h:80
char * LPSTR
Definition: typedefs.h:51
int32_t INT
Definition: typedefs.h:58
const char * PCSTR
Definition: typedefs.h:52
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define IN
Definition: typedefs.h:39
#define MAKELONG(a, b)
Definition: typedefs.h:249
uint32_t ULONG
Definition: typedefs.h:59
#define HIWORD(l)
Definition: typedefs.h:247
#define OUT
Definition: typedefs.h:40
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:254
HANDLE WINAPI GetCurrentThread(void)
Definition: proc.c:1145
_In_ LPCSTR lpName
Definition: winbase.h:2519
#define CreateEvent
Definition: winbase.h:3469
#define INVALID_FILE_SIZE
Definition: winbase.h:528
#define THREAD_PRIORITY_BELOW_NORMAL
Definition: winbase.h:301
#define WINAPI
Definition: msvc.h:6
#define SubclassWindow(hwnd, lpfn)
Definition: windowsx.h:542
#define StrNCmp
Definition: shlwapi.h:852
#define S_FALSE
Definition: winerror.h:3451
#define E_NOINTERFACE
Definition: winerror.h:3479
#define E_UNEXPECTED
Definition: winerror.h:3528
_In_ DWORD _In_ int _In_ int _In_opt_ LPNLSVERSIONINFO _In_opt_ LPVOID lpReserved
Definition: winnls.h:1279
#define IS_TEXT_UNICODE_ILLEGAL_CHARS
Definition: winnt_old.h:954
#define IS_TEXT_UNICODE_UNICODE_MASK
Definition: winnt_old.h:958
#define IS_TEXT_UNICODE_NOT_ASCII_MASK
Definition: winnt_old.h:961
#define IS_TEXT_UNICODE_NULL_BYTES
Definition: winnt_old.h:957
#define IS_TEXT_UNICODE_REVERSE_MASK
Definition: winnt_old.h:959
#define IS_TEXT_UNICODE_REVERSE_SIGNATURE
Definition: winnt_old.h:953
#define IS_TEXT_UNICODE_NOT_UNICODE_MASK
Definition: winnt_old.h:960
#define IS_TEXT_UNICODE_SIGNATURE
Definition: winnt_old.h:952
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define RegOpenKeyEx
Definition: winreg.h:552
#define MIIM_ID
Definition: winuser.h:733
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define MFT_SEPARATOR
Definition: winuser.h:755
#define MIIM_STATE
Definition: winuser.h:732
BOOL WINAPI PeekMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
#define PM_REMOVE
Definition: winuser.h:1207
#define SendMessage
Definition: winuser.h:6009
#define MFS_ENABLED
Definition: winuser.h:761
#define MFT_STRING
Definition: winuser.h:757
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define MIIM_TYPE
Definition: winuser.h:736
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI InsertMenuItemW(_In_ HMENU, _In_ UINT, _In_ BOOL, _In_ LPCMENUITEMINFOW)
_Must_inspect_result_ _In_ PHYSICAL_ADDRESS _In_ PHYSICAL_ADDRESS SkipBytes
Definition: mmfuncs.h:227
#define IID_PPV_ARG(Itype, ppType)
unsigned char BYTE
Definition: xxhash.c:193