ReactOS 0.4.15-dev-5895-g2687c1b
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
13static HRESULT SHELL32_CoCreateInitSF(LPCITEMIDLIST pidlRoot, PERSIST_FOLDER_TARGET_INFO* ppfti,
14 LPCITEMIDLIST pidlChild, const GUID* clsid, REFIID riid, LPVOID *ppvOut)
15{
16 HRESULT hr;
17 CComPtr<IShellFolder> pShellFolder;
18
20 if (FAILED(hr))
21 return hr;
22
23 LPITEMIDLIST pidlAbsolute = ILCombine (pidlRoot, pidlChild);
26
27 if (ppfti && SUCCEEDED(pShellFolder->QueryInterface(IID_PPV_ARG(IPersistFolder3, &ppf3))))
28 {
29 ppf3->InitializeEx(NULL, pidlAbsolute, ppfti);
30 }
31 else if (SUCCEEDED(pShellFolder->QueryInterface(IID_PPV_ARG(IPersistFolder, &ppf))))
32 {
33 ppf->Initialize(pidlAbsolute);
34 }
35 ILFree (pidlAbsolute);
36
37 return pShellFolder->QueryInterface(riid, ppvOut);
38}
39
41 HMENU hMenu,
42 UINT indexMenu,
43 BOOL fByPosition,
44 UINT wID,
45 UINT fType,
46 LPCWSTR dwTypeData,
47 UINT fState)
48{
49 MENUITEMINFOW mii;
50 WCHAR wszText[100];
51
52 ZeroMemory(&mii, sizeof(mii));
53 mii.cbSize = sizeof(mii);
54 if (fType == MFT_SEPARATOR)
55 mii.fMask = MIIM_ID | MIIM_TYPE;
56 else if (fType == MFT_STRING)
57 {
59 if (IS_INTRESOURCE(dwTypeData))
60 {
61 if (LoadStringW(_AtlBaseModule.GetResourceInstance(), LOWORD((ULONG_PTR)dwTypeData), wszText, _countof(wszText)))
62 mii.dwTypeData = wszText;
63 else
64 {
65 ERR("failed to load string %p\n", dwTypeData);
66 return;
67 }
68 }
69 else
70 mii.dwTypeData = (LPWSTR)dwTypeData;
71 mii.fState = fState;
72 }
73
74 mii.wID = wID;
75 mii.fType = fType;
76 InsertMenuItemW(hMenu, indexMenu, fByPosition, &mii);
77}
78
80{
81 int iResource;
83 int fmt;
84 int cxChar;
85};
86
88{
92};
93
95 m_hStopEvent(NULL)
96{
97}
98
100{
101 CComHeapPtr<ITEMIDLIST> lpFSPidl(ILCreateFromPathW(lpszPath));
102 if (!lpFSPidl)
103 {
104 ERR("Failed to create pidl from path\n");
105 return NULL;
106 }
107 LPITEMIDLIST lpLastFSPidl = ILFindLastID(lpFSPidl);
108
109 int pathLen = (PathFindFileNameW(lpszPath) - lpszPath) * sizeof(WCHAR);
110 int cbData = sizeof(WORD) + pathLen + lpLastFSPidl->mkid.cb;
111 LPITEMIDLIST pidl = (LPITEMIDLIST) SHAlloc(cbData + sizeof(WORD));
112 if (!pidl)
113 return NULL;
114
115 LPBYTE p = (LPBYTE) pidl;
116 *((WORD *) p) = cbData;
117 p += sizeof(WORD);
118
119 memcpy(p, lpszPath, pathLen);
120 p += pathLen - sizeof(WCHAR);
121 *((WCHAR *) p) = '\0';
122 p += sizeof(WCHAR);
123
124 memcpy(p, lpLastFSPidl, lpLastFSPidl->mkid.cb);
125 p += lpLastFSPidl->mkid.cb;
126
127 *((WORD *) p) = 0;
128
129 return pidl;
130}
131
133{
134 if (!pidl || !pidl->mkid.cb)
135 return NULL;
136 return (LPCWSTR) pidl->mkid.abID;
137}
138
140{
141 if (!pidl || !pidl->mkid.cb)
142 return pidl;
143 return (LPCITEMIDLIST) ((LPBYTE) pidl->mkid.abID
144 + ((wcslen((LPCWSTR) pidl->mkid.abID) + 1) * sizeof(WCHAR)));
145}
146
148{
159};
160
161template<typename TChar, typename TString, int (&StrNCmp)(const TChar *, const TChar *, size_t)>
162static const TChar* StrStrN(const TChar *lpFirst, const TString &lpSrch, UINT cchMax)
163{
164 if (!lpFirst || lpSrch.IsEmpty() || !cchMax)
165 return NULL;
166
167 for (UINT i = cchMax; i > 0 && *lpFirst; i--, lpFirst++)
168 {
169 if (!StrNCmp(lpFirst, lpSrch, lpSrch.GetLength()))
170 return (const TChar*)lpFirst;
171 }
172
173 return NULL;
174}
175
176static inline BOOL
177StrFindNIA(const CHAR *lpFirst, const CStringA &lpSrch, UINT cchMax)
178{
179 return StrStrN<CHAR, CStringA, _strnicmp>(lpFirst, lpSrch, cchMax) != NULL;
180}
181
182static inline BOOL
183StrFindNIW(const WCHAR *lpFirst, const CStringW &lpSrch, UINT cchMax)
184{
185 return StrStrN<WCHAR, CStringW, _wcsnicmp>(lpFirst, lpSrch, cchMax) != NULL;
186}
187
188/*
189 * The following code is borrowed from base/applications/cmdutils/more/more.c .
190 */
191typedef enum
192{
196 ENCODING_UTF8 = 3
198
199static BOOL
203 OUT ENCODING* Encoding OPTIONAL,
205{
206 PBYTE pBytes = (PBYTE)Buffer;
207 ENCODING encFile = ENCODING_ANSI;
208 DWORD dwPos = 0;
209
210 /*
211 * See http://archives.miloush.net/michkap/archive/2007/04/22/2239345.html
212 * for more details about the algorithm and the pitfalls behind it.
213 * Of course it would be actually great to make a nice function that
214 * would work, once and for all, and put it into a library.
215 */
216
217 /* Look for Byte Order Marks */
218 if ((BufferSize >= 2) && (pBytes[0] == 0xFF) && (pBytes[1] == 0xFE))
219 {
220 encFile = ENCODING_UTF16LE;
221 dwPos = 2;
222 }
223 else if ((BufferSize >= 2) && (pBytes[0] == 0xFE) && (pBytes[1] == 0xFF))
224 {
225 encFile = ENCODING_UTF16BE;
226 dwPos = 2;
227 }
228 else if ((BufferSize >= 3) && (pBytes[0] == 0xEF) && (pBytes[1] == 0xBB) && (pBytes[2] == 0xBF))
229 {
230 encFile = ENCODING_UTF8;
231 dwPos = 3;
232 }
233 else
234 {
235 /*
236 * Try using statistical analysis. Do not rely on the return value of
237 * IsTextUnicode as we can get FALSE even if the text is in UTF-16 BE
238 * (i.e. we have some of the IS_TEXT_UNICODE_REVERSE_MASK bits set).
239 * Instead, set all the tests we want to perform, then just check
240 * the passed tests and try to deduce the string properties.
241 */
242
243/*
244 * This mask contains the 3 highest bits from IS_TEXT_UNICODE_NOT_ASCII_MASK
245 * and the 1st highest bit from IS_TEXT_UNICODE_NOT_UNICODE_MASK.
246 */
247#define IS_TEXT_UNKNOWN_FLAGS_MASK ((7 << 13) | (1 << 11))
248
249 /* Flag out the unknown flags here, the passed tests will not have them either */
254 INT Results;
255
257 Results = Tests;
258
259 /*
260 * As the IS_TEXT_UNICODE_NULL_BYTES or IS_TEXT_UNICODE_ILLEGAL_CHARS
261 * flags are expected to be potentially present in the result without
262 * modifying our expectations, filter them out now.
263 */
265
266 /*
267 * NOTE: The flags IS_TEXT_UNICODE_ASCII16 and
268 * IS_TEXT_UNICODE_REVERSE_ASCII16 are not reliable.
269 *
270 * NOTE2: Check for potential "bush hid the facts" effect by also
271 * checking the original results (in 'Tests') for the absence of
272 * the IS_TEXT_UNICODE_NULL_BYTES flag, as we may presumably expect
273 * that in UTF-16 text there will be at some point some NULL bytes.
274 * If not, fall back to ANSI. This shows the limitations of using the
275 * IsTextUnicode API to perform such tests, and the usage of a more
276 * improved encoding detection algorithm would be really welcome.
277 */
278 if (!(Results & IS_TEXT_UNICODE_NOT_UNICODE_MASK) &&
279 !(Results & IS_TEXT_UNICODE_REVERSE_MASK) &&
280 (Results & IS_TEXT_UNICODE_UNICODE_MASK) &&
282 {
283 encFile = ENCODING_UTF16LE;
284 dwPos = (Results & IS_TEXT_UNICODE_SIGNATURE) ? 2 : 0;
285 }
286 else
287 if (!(Results & IS_TEXT_UNICODE_NOT_UNICODE_MASK) &&
288 !(Results & IS_TEXT_UNICODE_UNICODE_MASK) &&
289 (Results & IS_TEXT_UNICODE_REVERSE_MASK) &&
291 {
292 encFile = ENCODING_UTF16BE;
293 dwPos = (Results & IS_TEXT_UNICODE_REVERSE_SIGNATURE) ? 2 : 0;
294 }
295 else
296 {
297 /*
298 * Either 'Results' has neither of those masks set, as it can be
299 * the case for UTF-8 text (or ANSI), or it has both as can be the
300 * case when analysing pure binary data chunk. This is therefore
301 * invalid and we fall back to ANSI encoding.
302 * FIXME: In case of failure, assume ANSI (as long as we do not have
303 * correct tests for UTF8, otherwise we should do them, and at the
304 * very end, assume ANSI).
305 */
306 encFile = ENCODING_ANSI; // ENCODING_UTF8;
307 dwPos = 0;
308 }
309 }
310
311 if (Encoding)
312 *Encoding = encFile;
313 if (SkipBytes)
314 *SkipBytes = dwPos;
315
316 return (encFile != ENCODING_ANSI);
317}
318
319static BOOL SearchFile(LPCWSTR lpFilePath, _SearchData *pSearchData)
320{
323 return FALSE;
324
325 // FIXME: support large file
327 if (size == 0 || size == INVALID_FILE_SIZE)
328 {
330 return FALSE;
331 }
332
335 if (hFileMap == INVALID_HANDLE_VALUE)
336 return FALSE;
337
338 LPBYTE pbContents = (LPBYTE)MapViewOfFile(hFileMap, FILE_MAP_READ, 0, 0, size);
339 CloseHandle(hFileMap);
340 if (!pbContents)
341 return FALSE;
342
344 IsDataUnicode(pbContents, size, &encoding, NULL);
345
346 BOOL bFound;
347 switch (encoding)
348 {
349 case ENCODING_UTF16LE:
350 // UTF-16
351 bFound = StrFindNIW((LPCWSTR)pbContents, pSearchData->szQueryW, size / sizeof(WCHAR));
352 break;
353 case ENCODING_UTF16BE:
354 // UTF-16 BE
355 bFound = StrFindNIW((LPCWSTR)pbContents, pSearchData->szQueryU16BE, size / sizeof(WCHAR));
356 break;
357 case ENCODING_UTF8:
358 // UTF-8
359 bFound = StrFindNIA((LPCSTR)pbContents, pSearchData->szQueryU8, size / sizeof(CHAR));
360 break;
361 case ENCODING_ANSI:
362 default:
363 // ANSI or UTF-8 without BOM
364 bFound = StrFindNIA((LPCSTR)pbContents, pSearchData->szQueryA, size / sizeof(CHAR));
365 if (!bFound && pSearchData->szQueryA != pSearchData->szQueryU8)
366 bFound = StrFindNIA((LPCSTR)pbContents, pSearchData->szQueryU8, size / sizeof(CHAR));
367 break;
368 }
369
370 UnmapViewOfFile(pbContents);
371 return bFound;
372}
373
374static BOOL FileNameMatch(LPCWSTR FindDataFileName, _SearchData *pSearchData)
375{
376 if (pSearchData->szFileName.IsEmpty() || PathMatchSpecW(FindDataFileName, pSearchData->szFileName))
377 {
378 return TRUE;
379 }
380 return FALSE;
381}
382
384{
385 if (pSearchData->szQueryA.IsEmpty() || SearchFile(szPath, pSearchData))
386 {
387 return TRUE;
388 }
389 return FALSE;
390}
391
393{
394 if (!(FileAttributes & FILE_ATTRIBUTE_HIDDEN) || (pSearchData->SearchHidden))
395 {
396 return TRUE;
397 }
398 return FALSE;
399}
400
401static UINT RecursiveFind(LPCWSTR lpPath, _SearchData *pSearchData)
402{
403 if (WaitForSingleObject(pSearchData->hStopEvent, 0) != WAIT_TIMEOUT)
404 return 0;
405
407 WIN32_FIND_DATAW FindData;
408 HANDLE hFindFile;
409 BOOL bMoreFiles = TRUE;
410 UINT uTotalFound = 0;
411
412 PathCombineW(szPath, lpPath, L"*");
413
414 for (hFindFile = FindFirstFileW(szPath, &FindData);
415 bMoreFiles && hFindFile != INVALID_HANDLE_VALUE;
416 bMoreFiles = FindNextFileW(hFindFile, &FindData))
417 {
418#define IS_DOTS(psz) ((psz)[0] == L'.' && ((psz)[1] == 0 || ((psz)[1] == L'.' && (psz)[2] == 0)))
419 if (IS_DOTS(FindData.cFileName))
420 continue;
421
422 PathCombineW(szPath, lpPath, FindData.cFileName);
423
424 if (FindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
425 {
427 if (pSearchData->szQueryW.IsEmpty() &&
428 FileNameMatch(FindData.cFileName, pSearchData) &&
429 AttribHiddenMatch(FindData.dwFileAttributes, pSearchData))
430 {
432 uTotalFound++;
433 }
434 status.Format(IDS_SEARCH_FOLDER, FindData.cFileName);
435 PostMessageW(pSearchData->hwnd, WM_SEARCH_UPDATE_STATUS, 0, (LPARAM) StrDupW(status.GetBuffer()));
436
437 uTotalFound += RecursiveFind(szPath, pSearchData);
438 }
439 else if (FileNameMatch(FindData.cFileName, pSearchData)
440 && AttribHiddenMatch(FindData.dwFileAttributes, pSearchData)
441 && ContentsMatch(szPath, pSearchData))
442 {
443 uTotalFound++;
445 }
446 }
447
448 if (hFindFile != INVALID_HANDLE_VALUE)
449 FindClose(hFindFile);
450
451 return uTotalFound;
452}
453
455{
456 _SearchData *data = static_cast<_SearchData*>(lpParameter);
457
458 data->pFindFolder->NotifyConnections(DISPID_SEARCHSTART);
459
460 UINT uTotalFound = RecursiveFind(data->szPath, data);
461
462 data->pFindFolder->NotifyConnections(DISPID_SEARCHCOMPLETE);
463
465 status.Format(IDS_SEARCH_FILES_FOUND, uTotalFound);
467 ::SendMessageW(data->hwnd, WM_SEARCH_STOP, 0, 0);
468
469 CloseHandle(data->hStopEvent);
470 delete data;
471
472 return 0;
473}
474
476{
477 DISPPARAMS dispatchParams = {0};
478 CComDynamicUnkArray &subscribers =
480 for (IUnknown** pSubscriber = subscribers.begin(); pSubscriber < subscribers.end(); pSubscriber++)
481 {
482 if (!*pSubscriber)
483 continue;
484
485 CComPtr<IDispatch> pDispatch;
486 HRESULT hResult = (*pSubscriber)->QueryInterface(IID_PPV_ARG(IDispatch, &pDispatch));
487 if (!FAILED_UNEXPECTEDLY(hResult))
488 pDispatch->Invoke(id, GUID_NULL, 0, DISPATCH_METHOD, &dispatchParams, NULL, NULL, NULL);
489 }
490}
491
493{
494 HKEY hkey;
495 DWORD size = sizeof(DWORD);
497 DWORD SearchHiddenValue = 0;
498
499 if (!lParam)
500 return 0;
501
502 // Clear all previous search results
503 UINT uItemIndex;
504 m_shellFolderView->RemoveObject(NULL, &uItemIndex);
505
506 _SearchData* pSearchData = new _SearchData();
507 pSearchData->pFindFolder = this;
508 pSearchData->hwnd = m_hWnd;
509
510 SearchStart *pSearchParams = (SearchStart *) lParam;
511 pSearchData->szPath = pSearchParams->szPath;
512 pSearchData->szFileName = pSearchParams->szFileName;
513 pSearchData->szQueryA = pSearchParams->szQuery;
514 pSearchData->szQueryW = pSearchParams->szQuery;
515
516 // UTF-16 BE
517 {
518 CStringW utf16 = pSearchData->szQueryW;
519 LPWSTR psz = utf16.GetBuffer();
520 for (SIZE_T i = 0; psz[i]; ++i)
521 {
522 psz[i] = MAKEWORD(HIBYTE(psz[i]), LOBYTE(psz[i]));
523 }
524 utf16.ReleaseBuffer();
525 pSearchData->szQueryU16BE = utf16;
526 }
527
528 // UTF-8
529 {
530 CStringA utf8;
531 INT cch = WideCharToMultiByte(CP_UTF8, 0, pSearchData->szQueryW, -1, NULL, 0, NULL, NULL);
532 if (cch > 0)
533 {
534 LPSTR psz = utf8.GetBuffer(cch);
535 WideCharToMultiByte(CP_UTF8, 0, pSearchData->szQueryW, -1, psz, cch, NULL, NULL);
536 utf8.ReleaseBuffer();
537 pSearchData->szQueryU8 = utf8;
538 }
539 else
540 {
541 pSearchData->szQueryU8 = pSearchData->szQueryA;
542 }
543 }
544
545 pSearchData->SearchHidden = pSearchParams->SearchHidden;
546 SHFree(pSearchParams);
547
548 TRACE("pSearchParams->SearchHidden is '%d'.\n", pSearchData->SearchHidden);
549
550 if (pSearchData->SearchHidden)
551 SearchHiddenValue = 1;
552 else
553 SearchHiddenValue = 0;
554
555 /* Placing the code to save the changed settings to the registry here has the effect of not saving any changes */
556 /* to the registry unless the user clicks on the "Search" button. This is the same as what we see in Windows. */
557 result = RegOpenKeyEx(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer", 0, KEY_SET_VALUE, &hkey);
558 if (result == ERROR_SUCCESS)
559 {
560 if (RegSetValueExW(hkey, L"SearchHidden", NULL, REG_DWORD, (const BYTE*)&SearchHiddenValue, size) == ERROR_SUCCESS)
561 {
562 TRACE("SearchHidden is '%d'.\n", SearchHiddenValue);
563 }
564 else
565 {
566 ERR("RegSetValueEx for \"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\SearchHidden\" Failed.\n");
567 }
568 RegCloseKey(hkey);
569 }
570 else
571 {
572 ERR("RegOpenKey for \"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\" Failed.\n");
573 }
574
575 if (m_hStopEvent)
578
579 if (!SHCreateThread(SearchThreadProc, pSearchData, NULL, NULL))
580 {
581 SHFree(pSearchData);
582 return 0;
583 }
584
585 return 0;
586}
587
589{
590 if (m_hStopEvent)
591 {
594 }
595 return 0;
596}
597
599{
600 if (!lParam)
601 return 0;
602
604
605 CComHeapPtr<ITEMIDLIST> lpSearchPidl(_ILCreate(lpPath));
606 if (lpSearchPidl)
607 {
608 UINT uItemIndex;
609 m_shellFolderView->AddObject(lpSearchPidl, &uItemIndex);
610 }
611
612 return 0;
613}
614
616{
618 if (m_shellBrowser)
619 {
620 m_shellBrowser->SetStatusTextSB(status);
621 }
622
623 return 0;
624}
625
626// *** IShellFolder2 methods ***
628{
630 return E_NOTIMPL;
631}
632
634{
636 return E_NOTIMPL;
637}
638
640{
641 if (pSort)
642 *pSort = 0;
643 if (pDisplay)
644 *pDisplay = 0;
645 return S_OK;
646}
647
649{
650 if (!pcsFlags)
651 return E_INVALIDARG;
652 if (iColumn >= _countof(g_ColumnDefs))
653 return m_pisfInner->GetDefaultColumnState(iColumn - _countof(g_ColumnDefs) + 1, pcsFlags);
654 *pcsFlags = g_ColumnDefs[iColumn].dwDefaultState;
655 return S_OK;
656}
657
659{
660 return m_pisfInner->GetDetailsEx(pidl, pscid, pv);
661}
662
664{
665 if (iColumn >= _countof(g_ColumnDefs))
666 return m_pisfInner->GetDetailsOf(_ILGetFSPidl(pidl), iColumn - _countof(g_ColumnDefs) + 1, pDetails);
667
668 pDetails->cxChar = g_ColumnDefs[iColumn].cxChar;
669 pDetails->fmt = g_ColumnDefs[iColumn].fmt;
670
671 if (!pidl)
672 return SHSetStrRet(&pDetails->str, _AtlBaseModule.GetResourceInstance(), g_ColumnDefs[iColumn].iResource);
673
674 if (iColumn == COL_LOCATION_INDEX)
675 {
676 return SHSetStrRet(&pDetails->str, _ILGetPath(pidl));
677 }
678
679 if (iColumn == COL_RELEVANCE_INDEX)
680 {
681 // TODO: Fill once the relevance is calculated
682 return SHSetStrRet(&pDetails->str, "");
683 }
684
685 return GetDisplayNameOf(pidl, SHGDN_NORMAL, &pDetails->str);
686}
687
689{
691 return E_NOTIMPL;
692}
693
694// *** IShellFolder methods ***
695STDMETHODIMP CFindFolder::ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, ULONG *pchEaten,
696 PIDLIST_RELATIVE *ppidl, ULONG *pdwAttributes)
697{
699 return E_NOTIMPL;
700}
701
702STDMETHODIMP CFindFolder::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
703{
704 *ppEnumIDList = NULL;
705 return S_FALSE;
706}
707
709{
711 return E_NOTIMPL;
712}
713
715{
717 return E_NOTIMPL;
718}
719
721{
722 WORD wColumn = LOWORD(lParam);
723 switch (wColumn)
724 {
725 case COL_NAME_INDEX: // Name
726 break;
727 case COL_LOCATION_INDEX: // Path
728 return MAKE_COMPARE_HRESULT(StrCmpW(_ILGetPath(pidl1), _ILGetPath(pidl2)));
729 case COL_RELEVANCE_INDEX: // Relevance
730 return E_NOTIMPL;
731 default: // Default columns
732 wColumn -= _countof(g_ColumnDefs) - 1;
733 break;
734 }
735 return m_pisfInner->CompareIDs(HIWORD(lParam) | wColumn, _ILGetFSPidl(pidl1), _ILGetFSPidl(pidl2));
736}
737
739{
740 if (riid == IID_IShellView)
741 {
742 SFV_CREATE sfvparams = {};
743 sfvparams.cbSize = sizeof(SFV_CREATE);
744 sfvparams.pshf = this;
745 sfvparams.psfvcb = this;
746 HRESULT hr = SHCreateShellFolderView(&sfvparams, (IShellView **) ppvOut);
748 {
749 return hr;
750 }
751
752 return ((IShellView * ) * ppvOut)->QueryInterface(IID_PPV_ARG(IShellFolderView, &m_shellFolderView));
753 }
754 return E_NOINTERFACE;
755}
756
758{
760 aFSPidl.Allocate(cidl);
761 for (UINT i = 0; i < cidl; i++)
762 {
763 aFSPidl[i] = _ILGetFSPidl(apidl[i]);
764 }
765
766 return m_pisfInner->GetAttributesOf(cidl, aFSPidl, rgfInOut);
767}
768
770 public IContextMenu,
771 public CComObjectRootEx<CComMultiThreadModelNoCS>
772{
776 static const UINT ADDITIONAL_MENU_ITEMS = 2;
777
779 STDMETHODIMP QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags)
780 {
781 m_firstCmdId = indexMenu;
783 _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst++, MFT_SEPARATOR, NULL, 0);
784 return m_pInner->QueryContextMenu(hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags);
785 }
786
788 {
789 if (!IS_INTRESOURCE(lpcmi->lpVerb))
790 {
791 return m_pInner->InvokeCommand(lpcmi);
792 }
793
795 {
796 PCUITEMID_CHILD *apidl;
797 UINT cidl;
798 HRESULT hResult = m_shellFolderView->GetSelectedObjects(&apidl, &cidl);
799 if (FAILED_UNEXPECTEDLY(hResult))
800 return hResult;
801
802 for (UINT i = 0; i < cidl; i++)
803 {
805 if (!folderPidl)
806 return E_OUTOFMEMORY;
807 CComHeapPtr<ITEMIDLIST> filePidl(ILCombine(folderPidl, _ILGetFSPidl(apidl[i])));
808 if (!filePidl)
809 return E_OUTOFMEMORY;
810 SHOpenFolderAndSelectItems(folderPidl, 1, &filePidl, 0);
811 }
812 return S_OK;
813 }
814
815 CMINVOKECOMMANDINFOEX actualCmdInfo;
816 memcpy(&actualCmdInfo, lpcmi, lpcmi->cbSize);
817 actualCmdInfo.lpVerb -= ADDITIONAL_MENU_ITEMS;
818 return m_pInner->InvokeCommand((CMINVOKECOMMANDINFO *)&actualCmdInfo);
819 }
820
821 STDMETHODIMP GetCommandString(UINT_PTR idCommand, UINT uFlags, UINT *lpReserved, LPSTR lpszName, UINT uMaxNameLen)
822 {
823 return m_pInner->GetCommandString(idCommand, uFlags, lpReserved, lpszName, uMaxNameLen);
824 }
825
826public:
827 static HRESULT Create(IShellFolderView *pShellFolderView, IContextMenu *pInnerContextMenu, IContextMenu **pContextMenu)
828 {
831 if (FAILED_UNEXPECTEDLY(hResult))
832 return hResult;
833 pObj->m_shellFolderView = pShellFolderView;
834 pObj->m_pInner = pInnerContextMenu;
835 return pObj->QueryInterface(IID_PPV_ARG(IContextMenu, pContextMenu));
836 }
837
839 COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu)
841};
842
844 UINT *prgfInOut, LPVOID *ppvOut)
845{
846 if (cidl <= 0)
847 {
848 return m_pisfInner->GetUIObjectOf(hwndOwner, cidl, apidl, riid, prgfInOut, ppvOut);
849 }
850
852 aFSPidl.Allocate(cidl);
853 for (UINT i = 0; i < cidl; i++)
854 {
855 aFSPidl[i] = _ILGetFSPidl(apidl[i]);
856 }
857
858 if (riid == IID_IContextMenu)
859 {
861 if (!folderPidl)
862 return E_OUTOFMEMORY;
863 CComPtr<IShellFolder> pDesktopFolder;
864 HRESULT hResult = SHGetDesktopFolder(&pDesktopFolder);
865 if (FAILED_UNEXPECTEDLY(hResult))
866 return hResult;
867 CComPtr<IShellFolder> pShellFolder;
868 hResult = pDesktopFolder->BindToObject(folderPidl, NULL, IID_PPV_ARG(IShellFolder, &pShellFolder));
869 if (FAILED_UNEXPECTEDLY(hResult))
870 return hResult;
871 CComPtr<IContextMenu> pContextMenu;
872 hResult = pShellFolder->GetUIObjectOf(hwndOwner, cidl, aFSPidl, riid, prgfInOut, (LPVOID *)&pContextMenu);
873 if (FAILED_UNEXPECTEDLY(hResult))
874 return hResult;
875 return CFindFolderContextMenu::Create(m_shellFolderView, pContextMenu, (IContextMenu **)ppvOut);
876 }
877
878 return m_pisfInner->GetUIObjectOf(hwndOwner, cidl, aFSPidl, riid, prgfInOut, ppvOut);
879}
880
882{
883 return m_pisfInner->GetDisplayNameOf(_ILGetFSPidl(pidl), dwFlags, pName);
884}
885
887 PITEMID_CHILD *pPidlOut)
888{
890 return E_NOTIMPL;
891}
892
895{
896 switch (uMsg)
897 {
898 case SFVM_DEFVIEWMODE:
899 {
900 FOLDERVIEWMODE *pViewMode = (FOLDERVIEWMODE *) lParam;
901 *pViewMode = FVM_DETAILS;
902 return S_OK;
903 }
905 {
906 // Subclass window to receive window messages
908
909 // Get shell browser for updating status bar text
910 CComPtr<IServiceProvider> pServiceProvider;
911 HRESULT hr = m_shellFolderView->QueryInterface(IID_PPV_ARG(IServiceProvider, &pServiceProvider));
913 return hr;
914 hr = pServiceProvider->QueryService(SID_SShellBrowser, IID_PPV_ARG(IShellBrowser, &m_shellBrowser));
916 return hr;
917
918 // Open search bar
919 CComPtr<IWebBrowser2> pWebBrowser2;
920 hr = m_shellBrowser->QueryInterface(IID_PPV_ARG(IWebBrowser2, &pWebBrowser2));
922 return hr;
923 WCHAR pwszGuid[MAX_PATH];
924 StringFromGUID2(CLSID_FileSearchBand, pwszGuid, _countof(pwszGuid));
925 CComVariant searchBar(pwszGuid);
926 return pWebBrowser2->ShowBrowserBar(&searchBar, NULL, NULL);
927 }
928 }
929 return E_NOTIMPL;
930}
931
934{
935 *pidl = ILClone(m_pidl);
936 return S_OK;
937}
938
939// *** IPersistFolder methods ***
941{
942 m_pidl = ILClone(pidl);
943 if (!m_pidl)
944 return E_OUTOFMEMORY;
945
947 NULL,
948 NULL,
949 &CLSID_ShellFSFolder,
951}
952
953// *** IPersist methods ***
955{
956 if (pClassId == NULL)
957 return E_INVALIDARG;
958 *pClassId = CLSID_FindFolder;
959 return S_OK;
960}
HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv, IShellView **ppsv)
Definition: CDefView.cpp:3931
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:13
static BOOL StrFindNIW(const WCHAR *lpFirst, const CStringW &lpSrch, UINT cchMax)
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:40
static BOOL SearchFile(LPCWSTR lpFilePath, _SearchData *pSearchData)
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)
Definition: CFindFolder.cpp:99
static FolderViewColumns g_ColumnDefs[]
Definition: CFindFolder.cpp:87
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 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:35
struct test_data Tests[]
UINT cchMax
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define STDMETHODIMP
Definition: basetyps.h:43
#define UNIMPLEMENTED
Definition: debug.h:115
#define ERR(fmt,...)
Definition: debug.h:110
#define RegCloseKey(hKey)
Definition: registry.h:47
IUnknown ** end()
Definition: atlcom.h:1070
IUnknown ** begin()
Definition: atlcom.h:1065
static HRESULT WINAPI CreateInstance(CComObject< Base > **pp)
Definition: atlcom.h:166
STDMETHOD() QueryInterface(REFIID iid, void **ppvObject)
Definition: atlcom.h:161
bool IsEmpty() const
Definition: atlsimpstr.h:379
void ReleaseBuffer(_In_ int nNewLength=-1)
Definition: atlsimpstr.h:372
HWND m_hWnd
Definition: atlwin.h:267
Definition: bufpool.h:45
CComPtr< IContextMenu > m_pInner
STDMETHODIMP InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi)
STDMETHODIMP GetCommandString(UINT_PTR idCommand, UINT uFlags, UINT *lpReserved, LPSTR lpszName, UINT uMaxNameLen)
static HRESULT Create(IShellFolderView *pShellFolderView, IContextMenu *pInnerContextMenu, IContextMenu **pContextMenu)
static const UINT ADDITIONAL_MENU_ITEMS
CComPtr< IShellFolderView > m_shellFolderView
STDMETHODIMP QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags)
STDMETHODIMP GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET pName)
LRESULT StartSearch(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
HANDLE m_hStopEvent
Definition: CFindFolder.h:70
STDMETHODIMP GetClassID(CLSID *pClassId)
CComPtr< IShellFolder2 > m_pisfInner
Definition: CFindFolder.h:67
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)
STDMETHODIMP CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2)
LRESULT AddResult(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
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:68
STDMETHODIMP MessageSFVCB(UINT uMsg, WPARAM wParam, LPARAM lParam)
STDMETHODIMP EnumSearches(IEnumExtraSearch **ppenum)
LRESULT StopSearch(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
STDMETHODIMP GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *pDetails)
STDMETHODIMP Initialize(PCIDLIST_ABSOLUTE pidl)
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:66
STDMETHODIMP CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut)
CComPtr< IShellBrowser > m_shellBrowser
Definition: CFindFolder.h:69
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
#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 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:6
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:4900
UINT uFlags
Definition: api.c:59
#define COL_NAME_INDEX
Definition: resource.h:184
#define IDS_COL_RELEVANCE
Definition: resource.h:175
#define IDS_SEARCH_OPEN_FOLDER
Definition: resource.h:179
#define IDS_COL_LOCATION
Definition: resource.h:174
#define COL_RELEVANCE_INDEX
Definition: resource.h:186
#define IDS_SEARCH_FOLDER
Definition: resource.h:177
#define COL_LOCATION_INDEX
Definition: resource.h:185
#define IDS_SEARCH_FILES_FOUND
Definition: resource.h:176
#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 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
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2434
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:326
LPVOID WINAPI SHAlloc(SIZE_T len)
Definition: shellole.c:304
HRESULT WINAPI SHCoCreateInstance(LPCWSTR aclsid, const CLSID *clsid, LPUNKNOWN pUnkOuter, REFIID refiid, LPVOID *ppv)
Definition: shellole.c:105
LPWSTR WINAPI PathFindFileNameW(LPCWSTR lpszPath)
Definition: path.c:394
BOOL WINAPI PathMatchSpecW(LPCWSTR lpszPath, LPCWSTR lpszMask)
Definition: path.c:1964
LPWSTR WINAPI PathCombineW(LPWSTR lpszDest, LPCWSTR lpszDir, LPCWSTR lpszFile)
Definition: path.c:194
int WINAPI StrCmpW(LPCWSTR lpszStr, LPCWSTR lpszComp)
Definition: string.c:434
LPWSTR WINAPI StrDupW(LPCWSTR lpszStr)
Definition: string.c:1089
BOOL WINAPI SHCreateThread(LPTHREAD_START_ROUTINE pfnThreadProc, VOID *pData, DWORD dwFlags, LPTHREAD_START_ROUTINE pfnCallback)
Definition: thread.c:356
#define DISPID_SEARCHSTART
Definition: exdispid.h:172
#define DISPID_SEARCHCOMPLETE
Definition: exdispid.h:173
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
_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
LPITEMIDLIST _ILCreate(LPCWSTR lpString, ULONG Index)
Definition: fontpidl.cpp:10
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLsizeiptr size
Definition: glext.h:5919
GLfloat GLfloat p
Definition: glext.h:8902
GLuint64EXT * result
Definition: glext.h:11304
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
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
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 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:542
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:562
#define END_COM_MAP()
Definition: atlcom.h:553
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
LPCWSTR szPath
Definition: env.c:37
static LPSTR pName
Definition: security.c:75
static DWORD DWORD void LPSTR DWORD cch
Definition: str.c:202
static LPOLESTR
Definition: stg_prop.c:27
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
ENCODING
Definition: more.c:492
REFCLSID clsid
Definition: msctf.c:82
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
_In_ HANDLE hFile
Definition: mswsock.h:90
unsigned int UINT
Definition: ndis.h:50
#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:1017
#define L(x)
Definition: ntvdm.h:50
interface IBindCtx * LPBC
Definition: objfwd.h:18
#define DISPATCH_METHOD
Definition: oleauto.h:1006
#define LOWORD(l)
Definition: pedump.c:82
BYTE * PBYTE
Definition: pedump.c:66
DWORD * PDWORD
Definition: pedump.c:68
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:228
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:925
LPITEMIDLIST WINAPI ILFindLastID(LPCITEMIDLIST pidl)
Definition: pidl.c:189
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:699
LPITEMIDLIST WINAPI ILCreateFromPathW(LPCWSTR path)
Definition: pidl.c:982
#define LVCFMT_LEFT
Definition: commctrl.h:2598
#define REFIID
Definition: guiddef.h:118
#define REG_DWORD
Definition: sdbapi.c:596
#define CP_UTF8
Definition: nls.h:20
@ TString
Definition: dwarf.h:133
#define WM_SEARCH_ADD_RESULT
Definition: shellfind.h:31
#define WM_SEARCH_UPDATE_STATUS
Definition: shellfind.h:32
#define WM_SEARCH_STOP
Definition: shellfind.h:30
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:82
#define MAKE_COMPARE_HRESULT(x)
Definition: shellutils.h:561
HRESULT hr
Definition: shlfolder.c:183
EXTERN_C HRESULT WINAPI SHOpenFolderAndSelectItems(PCIDLIST_ABSOLUTE pidlFolder, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD dwFlags)
Definition: shlfolder.cpp:369
#define SID_SShellBrowser
Definition: shlguid.h:128
#define SFVM_DEFVIEWMODE
Definition: shlobj.h:1245
#define SFVM_WINDOWCREATED
Definition: shlobj.h:1235
struct _SFV_CREATE SFV_CREATE
#define StrNCmp
Definition: shlwapi.h:1524
FOLDERVIEWMODE
Definition: shobjidl.idl:666
@ FVM_DETAILS
Definition: shobjidl.idl:672
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:68
#define TRACE(s)
Definition: solgame.cpp:4
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
DWORD dwDefaultState
Definition: CFontExt.cpp:21
STRRET str
Definition: shtypes.idl:108
WCHAR szFileName[MAX_PATH]
Definition: shellfind.h:37
WCHAR szPath[MAX_PATH]
Definition: shellfind.h:36
BOOL SearchHidden
Definition: shellfind.h:39
WCHAR szQuery[MAX_PATH]
Definition: shellfind.h:38
IShellFolderViewCB * psfvcb
Definition: shlobj.h:1285
UINT cbSize
Definition: shlobj.h:1282
IShellFolder * pshf
Definition: shlobj.h:1283
CStringA szQueryA
CStringW szQueryW
CStringW szFileName
CStringW szPath
CStringW szQueryU16BE
HANDLE hStopEvent
CStringA szQueryU8
CComPtr< CFindFolder > pFindFolder
Definition: ps.c:97
LPWSTR dwTypeData
Definition: winuser.h:3259
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
#define MAKEWORD(a, b)
Definition: typedefs.h:248
unsigned char * LPBYTE
Definition: typedefs.h:53
ULONG_PTR SIZE_T
Definition: typedefs.h:80
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define IN
Definition: typedefs.h:39
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
#define ZeroMemory
Definition: winbase.h:1670
_In_ LPCSTR lpName
Definition: winbase.h:2776
#define CreateEvent
Definition: winbase.h:3619
#define INVALID_FILE_SIZE
Definition: winbase.h:548
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
#define WINAPI
Definition: msvc.h:6
#define SubclassWindow(hwnd, lpfn)
Definition: windowsx.h:542
#define S_FALSE
Definition: winerror.h:2357
#define E_NOINTERFACE
Definition: winerror.h:2364
#define IS_TEXT_UNICODE_ILLEGAL_CHARS
Definition: winnt_old.h:928
#define IS_TEXT_UNICODE_UNICODE_MASK
Definition: winnt_old.h:932
#define IS_TEXT_UNICODE_NOT_ASCII_MASK
Definition: winnt_old.h:935
#define IS_TEXT_UNICODE_NULL_BYTES
Definition: winnt_old.h:931
#define IS_TEXT_UNICODE_REVERSE_MASK
Definition: winnt_old.h:933
#define IS_TEXT_UNICODE_REVERSE_SIGNATURE
Definition: winnt_old.h:927
#define IS_TEXT_UNICODE_NOT_UNICODE_MASK
Definition: winnt_old.h:934
#define IS_TEXT_UNICODE_SIGNATURE
Definition: winnt_old.h:926
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define RegOpenKeyEx
Definition: winreg.h:520
#define MIIM_ID
Definition: winuser.h:717
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define IS_INTRESOURCE(i)
Definition: winuser.h:580
#define MFT_SEPARATOR
Definition: winuser.h:739
#define MIIM_STATE
Definition: winuser.h:716
#define MFS_ENABLED
Definition: winuser.h:745
#define MFT_STRING
Definition: winuser.h:741
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define MIIM_TYPE
Definition: winuser.h:720
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)
static char * encoding
Definition: xmllint.c:155
const char * LPCSTR
Definition: xmlstorage.h:183
char * LPSTR
Definition: xmlstorage.h:182
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
char CHAR
Definition: xmlstorage.h:175
unsigned char BYTE
Definition: xxhash.c:193