ReactOS 0.4.16-dev-1493-ge7358c5
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
16 _In_ DWORD dwFlags, _Out_ LPWSTR pszBuf, _In_ UINT cchBuf)
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{
284
286 {
288 }
289};
290
291template<typename TChar, typename TString, int (&StrNCmp)(const TChar *, const TChar *, size_t)>
292static const TChar* StrStrN(const TChar *lpFirst, const TString &lpSrch, UINT cchMax)
293{
294 if (!lpFirst || lpSrch.IsEmpty() || !cchMax)
295 return NULL;
296
297 for (UINT i = cchMax; i > 0 && *lpFirst; i--, lpFirst++)
298 {
299 if (!StrNCmp(lpFirst, lpSrch, lpSrch.GetLength()))
300 return (const TChar*)lpFirst;
301 }
302
303 return NULL;
304}
305
306static inline BOOL
307StrFindNIA(const CHAR *lpFirst, const CStringA &lpSrch, UINT cchMax)
308{
309 return StrStrN<CHAR, CStringA, _strnicmp>(lpFirst, lpSrch, cchMax) != NULL;
310}
311
312static inline BOOL
313StrFindNIW(const WCHAR *lpFirst, const CStringW &lpSrch, UINT cchMax)
314{
315 return StrStrN<WCHAR, CStringW, _wcsnicmp>(lpFirst, lpSrch, cchMax) != NULL;
316}
317
318/*
319 * The following code is borrowed from base/applications/cmdutils/more/more.c .
320 */
321typedef enum
322{
326 ENCODING_UTF8 = 3
328
329static BOOL
333 OUT ENCODING* Encoding OPTIONAL,
335{
336 PBYTE pBytes = (PBYTE)Buffer;
337 ENCODING encFile = ENCODING_ANSI;
338 DWORD dwPos = 0;
339
340 /*
341 * See http://archives.miloush.net/michkap/archive/2007/04/22/2239345.html
342 * for more details about the algorithm and the pitfalls behind it.
343 * Of course it would be actually great to make a nice function that
344 * would work, once and for all, and put it into a library.
345 */
346
347 /* Look for Byte Order Marks */
348 if ((BufferSize >= 2) && (pBytes[0] == 0xFF) && (pBytes[1] == 0xFE))
349 {
350 encFile = ENCODING_UTF16LE;
351 dwPos = 2;
352 }
353 else if ((BufferSize >= 2) && (pBytes[0] == 0xFE) && (pBytes[1] == 0xFF))
354 {
355 encFile = ENCODING_UTF16BE;
356 dwPos = 2;
357 }
358 else if ((BufferSize >= 3) && (pBytes[0] == 0xEF) && (pBytes[1] == 0xBB) && (pBytes[2] == 0xBF))
359 {
360 encFile = ENCODING_UTF8;
361 dwPos = 3;
362 }
363 else
364 {
365 /*
366 * Try using statistical analysis. Do not rely on the return value of
367 * IsTextUnicode as we can get FALSE even if the text is in UTF-16 BE
368 * (i.e. we have some of the IS_TEXT_UNICODE_REVERSE_MASK bits set).
369 * Instead, set all the tests we want to perform, then just check
370 * the passed tests and try to deduce the string properties.
371 */
372
373/*
374 * This mask contains the 3 highest bits from IS_TEXT_UNICODE_NOT_ASCII_MASK
375 * and the 1st highest bit from IS_TEXT_UNICODE_NOT_UNICODE_MASK.
376 */
377#define IS_TEXT_UNKNOWN_FLAGS_MASK ((7 << 13) | (1 << 11))
378
379 /* Flag out the unknown flags here, the passed tests will not have them either */
384 INT Results;
385
387 Results = Tests;
388
389 /*
390 * As the IS_TEXT_UNICODE_NULL_BYTES or IS_TEXT_UNICODE_ILLEGAL_CHARS
391 * flags are expected to be potentially present in the result without
392 * modifying our expectations, filter them out now.
393 */
395
396 /*
397 * NOTE: The flags IS_TEXT_UNICODE_ASCII16 and
398 * IS_TEXT_UNICODE_REVERSE_ASCII16 are not reliable.
399 *
400 * NOTE2: Check for potential "bush hid the facts" effect by also
401 * checking the original results (in 'Tests') for the absence of
402 * the IS_TEXT_UNICODE_NULL_BYTES flag, as we may presumably expect
403 * that in UTF-16 text there will be at some point some NULL bytes.
404 * If not, fall back to ANSI. This shows the limitations of using the
405 * IsTextUnicode API to perform such tests, and the usage of a more
406 * improved encoding detection algorithm would be really welcome.
407 */
408 if (!(Results & IS_TEXT_UNICODE_NOT_UNICODE_MASK) &&
409 !(Results & IS_TEXT_UNICODE_REVERSE_MASK) &&
410 (Results & IS_TEXT_UNICODE_UNICODE_MASK) &&
412 {
413 encFile = ENCODING_UTF16LE;
414 dwPos = (Results & IS_TEXT_UNICODE_SIGNATURE) ? 2 : 0;
415 }
416 else
417 if (!(Results & IS_TEXT_UNICODE_NOT_UNICODE_MASK) &&
418 !(Results & IS_TEXT_UNICODE_UNICODE_MASK) &&
419 (Results & IS_TEXT_UNICODE_REVERSE_MASK) &&
421 {
422 encFile = ENCODING_UTF16BE;
423 dwPos = (Results & IS_TEXT_UNICODE_REVERSE_SIGNATURE) ? 2 : 0;
424 }
425 else
426 {
427 /*
428 * Either 'Results' has neither of those masks set, as it can be
429 * the case for UTF-8 text (or ANSI), or it has both as can be the
430 * case when analysing pure binary data chunk. This is therefore
431 * invalid and we fall back to ANSI encoding.
432 * FIXME: In case of failure, assume ANSI (as long as we do not have
433 * correct tests for UTF8, otherwise we should do them, and at the
434 * very end, assume ANSI).
435 */
436 encFile = ENCODING_ANSI; // ENCODING_UTF8;
437 dwPos = 0;
438 }
439 }
440
441 if (Encoding)
442 *Encoding = encFile;
443 if (SkipBytes)
444 *SkipBytes = dwPos;
445
446 return (encFile != ENCODING_ANSI);
447}
448
449static BOOL SearchFile(LPCWSTR lpFilePath, _SearchData *pSearchData)
450{
453 return FALSE;
454
455 // FIXME: support large file
457 if (size == 0 || size == INVALID_FILE_SIZE)
458 {
460 return FALSE;
461 }
462
465 if (hFileMap == INVALID_HANDLE_VALUE)
466 return FALSE;
467
468 LPBYTE pbContents = (LPBYTE)MapViewOfFile(hFileMap, FILE_MAP_READ, 0, 0, size);
469 CloseHandle(hFileMap);
470 if (!pbContents)
471 return FALSE;
472
474 IsDataUnicode(pbContents, size, &encoding, NULL);
475
476 BOOL bFound;
477 switch (encoding)
478 {
479 case ENCODING_UTF16LE:
480 // UTF-16
481 bFound = StrFindNIW((LPCWSTR)pbContents, pSearchData->szQueryW, size / sizeof(WCHAR));
482 break;
483 case ENCODING_UTF16BE:
484 // UTF-16 BE
485 bFound = StrFindNIW((LPCWSTR)pbContents, pSearchData->szQueryU16BE, size / sizeof(WCHAR));
486 break;
487 case ENCODING_UTF8:
488 // UTF-8
489 bFound = StrFindNIA((LPCSTR)pbContents, pSearchData->szQueryU8, size / sizeof(CHAR));
490 break;
491 case ENCODING_ANSI:
492 default:
493 // ANSI or UTF-8 without BOM
494 bFound = StrFindNIA((LPCSTR)pbContents, pSearchData->szQueryA, size / sizeof(CHAR));
495 if (!bFound && pSearchData->szQueryA != pSearchData->szQueryU8)
496 bFound = StrFindNIA((LPCSTR)pbContents, pSearchData->szQueryU8, size / sizeof(CHAR));
497 break;
498 }
499
500 UnmapViewOfFile(pbContents);
501 return bFound;
502}
503
504static BOOL FileNameMatch(LPCWSTR FindDataFileName, _SearchData *pSearchData)
505{
506 if (pSearchData->szFileName.IsEmpty() || PathMatchSpecW(FindDataFileName, pSearchData->szFileName))
507 {
508 return TRUE;
509 }
510 return FALSE;
511}
512
514{
515 if (pSearchData->szQueryA.IsEmpty() || SearchFile(szPath, pSearchData))
516 {
517 return TRUE;
518 }
519 return FALSE;
520}
521
523{
524 if (!(FileAttributes & FILE_ATTRIBUTE_HIDDEN) || (pSearchData->SearchHidden))
525 {
526 return TRUE;
527 }
528 return FALSE;
529}
530
531static UINT RecursiveFind(LPCWSTR lpPath, _SearchData *pSearchData)
532{
533 if (WaitForSingleObject(pSearchData->hStopEvent, 0) != WAIT_TIMEOUT)
534 return 0;
535
537 WIN32_FIND_DATAW FindData;
538 HANDLE hFindFile;
539 BOOL bMoreFiles = TRUE;
540 UINT uTotalFound = 0;
541
542 PathCombineW(szPath, lpPath, L"*");
543
544 for (hFindFile = FindFirstFileW(szPath, &FindData);
545 bMoreFiles && hFindFile != INVALID_HANDLE_VALUE;
546 bMoreFiles = FindNextFileW(hFindFile, &FindData))
547 {
548#define IS_DOTS(psz) ((psz)[0] == L'.' && ((psz)[1] == 0 || ((psz)[1] == L'.' && (psz)[2] == 0)))
549 if (IS_DOTS(FindData.cFileName))
550 continue;
551
552 PathCombineW(szPath, lpPath, FindData.cFileName);
553
554 if (FindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
555 {
557 if (pSearchData->szQueryW.IsEmpty() &&
558 FileNameMatch(FindData.cFileName, pSearchData) &&
559 AttribHiddenMatch(FindData.dwFileAttributes, pSearchData))
560 {
561 LPWSTR pszPathDup;
562 SHStrDupW(szPath, &pszPathDup);
563 PostMessageW(pSearchData->hwnd, WM_SEARCH_ADD_RESULT, 0, (LPARAM)pszPathDup);
564 uTotalFound++;
565 }
566 status.Format(IDS_SEARCH_FOLDER, FindData.cFileName);
567 LPWSTR pszStatusDup;
568 SHStrDupW(status.GetBuffer(), &pszStatusDup);
569 PostMessageW(pSearchData->hwnd, WM_SEARCH_UPDATE_STATUS, 0, (LPARAM)pszStatusDup);
570
571 uTotalFound += RecursiveFind(szPath, pSearchData);
572 }
573 else if (FileNameMatch(FindData.cFileName, pSearchData)
574 && AttribHiddenMatch(FindData.dwFileAttributes, pSearchData)
575 && ContentsMatch(szPath, pSearchData))
576 {
577 uTotalFound++;
578 LPWSTR pszPathDup;
579 SHStrDupW(szPath, &pszPathDup);
580 PostMessageW(pSearchData->hwnd, WM_SEARCH_ADD_RESULT, 0, (LPARAM)pszPathDup);
581 }
582 }
583
584 if (hFindFile != INVALID_HANDLE_VALUE)
585 FindClose(hFindFile);
586
587 return uTotalFound;
588}
589
591{
592 _SearchData *data = static_cast<_SearchData*>(lpParameter);
593
595
597
598 data->pFindFolder->NotifyConnections(DISPID_SEARCHSTART);
599
600 UINT uTotalFound = 0;
601 for (LOCATIONITEM *pLocation = data->pPaths; pLocation; pLocation = pLocation->pNext)
602 {
603 uTotalFound += RecursiveFind(pLocation->szPath, data);
604 }
605
606 data->pFindFolder->NotifyConnections(DISPID_SEARCHCOMPLETE);
607
609 status.Format(IDS_SEARCH_FILES_FOUND, uTotalFound);
610 LPWSTR pszStatusDup;
611 SHStrDupW(status.GetBuffer(), &pszStatusDup);
612 ::PostMessageW(data->hwnd, WM_SEARCH_UPDATE_STATUS, 0, (LPARAM)pszStatusDup);
613 ::SendMessageW(data->hwnd, WM_SEARCH_STOP, 0, 0);
614
615 CloseHandle(data->hStopEvent);
616 delete data;
617
618 if (SUCCEEDED(hrCoInit))
620
621 return 0;
622}
623
625{
626 DISPPARAMS dispatchParams = {0};
627 CComDynamicUnkArray &subscribers =
629 for (IUnknown** pSubscriber = subscribers.begin(); pSubscriber < subscribers.end(); pSubscriber++)
630 {
631 if (!*pSubscriber)
632 continue;
633
634 CComPtr<IDispatch> pDispatch;
635 HRESULT hResult = (*pSubscriber)->QueryInterface(IID_PPV_ARG(IDispatch, &pDispatch));
636 if (!FAILED_UNEXPECTEDLY(hResult))
637 pDispatch->Invoke(id, GUID_NULL, 0, DISPATCH_METHOD, &dispatchParams, NULL, NULL, NULL);
638 }
639}
640
642{
643 HKEY hkey;
644 DWORD size = sizeof(DWORD);
646 DWORD SearchHiddenValue = 0;
647
648 if (!lParam)
649 return 0;
650
651 // Clear all previous search results
652 UINT uItemIndex;
653 m_shellFolderView->RemoveObject(NULL, &uItemIndex);
654
655 _SearchData* pSearchData = new _SearchData();
656 pSearchData->pFindFolder = this;
657 pSearchData->hwnd = m_hWnd;
658
659 SearchStart *pSearchParams = (SearchStart *) lParam;
660 pSearchData->pPaths = pSearchParams->pPaths;
661 pSearchData->szFileName = pSearchParams->szFileName;
662 pSearchData->szQueryA = pSearchParams->szQuery;
663 pSearchData->szQueryW = pSearchParams->szQuery;
664
665 // UTF-16 BE
666 {
667 CStringW utf16 = pSearchData->szQueryW;
668 LPWSTR psz = utf16.GetBuffer();
669 for (SIZE_T i = 0; psz[i]; ++i)
670 {
671 psz[i] = MAKEWORD(HIBYTE(psz[i]), LOBYTE(psz[i]));
672 }
673 utf16.ReleaseBuffer();
674 pSearchData->szQueryU16BE = utf16;
675 }
676
677 // UTF-8
678 {
680 INT cch = WideCharToMultiByte(CP_UTF8, 0, pSearchData->szQueryW, -1, NULL, 0, NULL, NULL);
681 if (cch > 0)
682 {
683 LPSTR psz = utf8.GetBuffer(cch);
684 WideCharToMultiByte(CP_UTF8, 0, pSearchData->szQueryW, -1, psz, cch, NULL, NULL);
685 utf8.ReleaseBuffer();
686 pSearchData->szQueryU8 = utf8;
687 }
688 else
689 {
690 pSearchData->szQueryU8 = pSearchData->szQueryA;
691 }
692 }
693
694 pSearchData->SearchHidden = pSearchParams->SearchHidden;
695 SHFree(pSearchParams);
696
697 TRACE("pSearchParams->SearchHidden is '%d'.\n", pSearchData->SearchHidden);
698
699 if (pSearchData->SearchHidden)
700 SearchHiddenValue = 1;
701 else
702 SearchHiddenValue = 0;
703
704 /* Placing the code to save the changed settings to the registry here has the effect of not saving any changes */
705 /* to the registry unless the user clicks on the "Search" button. This is the same as what we see in Windows. */
706 result = RegOpenKeyEx(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer", 0, KEY_SET_VALUE, &hkey);
707 if (result == ERROR_SUCCESS)
708 {
709 if (RegSetValueExW(hkey, L"SearchHidden", NULL, REG_DWORD, (const BYTE*)&SearchHiddenValue, size) == ERROR_SUCCESS)
710 {
711 TRACE("SearchHidden is '%d'.\n", SearchHiddenValue);
712 }
713 else
714 {
715 ERR("RegSetValueEx for \"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\SearchHidden\" Failed.\n");
716 }
717 RegCloseKey(hkey);
718 }
719 else
720 {
721 ERR("RegOpenKey for \"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\" Failed.\n");
722 }
723
724 if (m_hStopEvent)
727
728 if (!SHCreateThread(SearchThreadProc, pSearchData, 0, NULL))
729 {
730 if (pSearchData->hStopEvent)
731 {
732 CloseHandle(pSearchData->hStopEvent);
734 }
735 delete pSearchData;
736 }
737 return 0;
738}
739
741{
742 if (m_hStopEvent)
743 {
746 }
747 return 0;
748}
749
751{
752 if (!lParam)
753 return 0;
754
756
757 CComHeapPtr<ITEMIDLIST> lpSearchPidl(_ILCreate(lpPath));
758 if (lpSearchPidl)
759 {
760 UINT uItemIndex;
761 m_shellFolderView->AddObject(lpSearchPidl, &uItemIndex);
762 }
763
764 return 0;
765}
766
768{
770 if (m_shellBrowser)
771 {
772 m_shellBrowser->SetStatusTextSB(status);
773 }
774
775 return 0;
776}
777
778// *** IShellFolder2 methods ***
780{
782 return E_NOTIMPL;
783}
784
786{
788 return E_NOTIMPL;
789}
790
792{
793 if (pSort)
794 *pSort = COL_NAME_INDEX;
795 if (pDisplay)
796 *pDisplay = COL_NAME_INDEX;
797 return S_OK;
798}
799
801{
802 if (!pcsFlags)
803 return E_INVALIDARG;
804 if (iColumn >= _countof(g_ColumnDefs))
805 return m_pisfInner->GetDefaultColumnState(iColumn - _countof(g_ColumnDefs) + 1, pcsFlags);
806 *pcsFlags = g_ColumnDefs[iColumn].dwDefaultState;
807 return S_OK;
808}
809
811{
812 // FIXME: Handle COL_LOCATION_INDEX and COL_RELEVANCE_INDEX
814 PCUITEMID_CHILD pChild;
815 if (SUCCEEDED(GetFSFolder2AndChild(pidl, &pFolder, &pChild)))
816 return pFolder->GetDetailsEx(pChild, pscid, pv);
817 return E_FAIL;
818}
819
821{
822 if (iColumn >= _countof(g_ColumnDefs))
823 {
824 UINT FSColumn = iColumn - _countof(g_ColumnDefs) + 1;
825 if (pidl)
826 {
828 PCUITEMID_CHILD pChild;
829 if (SUCCEEDED(GetFSFolder2AndChild(pidl, &pFolder, &pChild)))
830 return pFolder->GetDetailsOf(pChild, FSColumn, pDetails);
831 }
832 return m_pisfInner->GetDetailsOf(pidl, FSColumn, pDetails); // Column header info
833 }
834
835 pDetails->cxChar = g_ColumnDefs[iColumn].cxChar;
836 pDetails->fmt = g_ColumnDefs[iColumn].fmt;
837 if (!pidl)
838 return SHSetStrRet(&pDetails->str, _AtlBaseModule.GetResourceInstance(), g_ColumnDefs[iColumn].iResource);
839
840 if (iColumn == COL_LOCATION_INDEX)
841 {
842 return SHSetStrRet(&pDetails->str, _ILGetPath(pidl));
843 }
844
845 if (iColumn == COL_RELEVANCE_INDEX)
846 {
847 // TODO: Fill once the relevance is calculated
848 return SHSetStrRetEmpty(&pDetails->str);
849 }
850
851 ATLASSERT(iColumn == COL_NAME_INDEX);
852 return GetDisplayNameOf(pidl, SHGDN_NORMAL | SHGDN_INFOLDER, &pDetails->str);
853}
854
856{
858 return E_NOTIMPL;
859}
860
861// *** IShellFolder methods ***
862STDMETHODIMP CFindFolder::ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, ULONG *pchEaten,
863 PIDLIST_RELATIVE *ppidl, ULONG *pdwAttributes)
864{
866 return E_NOTIMPL;
867}
868
869STDMETHODIMP CFindFolder::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
870{
871 *ppEnumIDList = NULL;
872 return S_FALSE;
873}
874
876{
877 HRESULT hr;
878 CComPtr<IShellFolder> pInnerFolder;
879 PCUITEMID_CHILD pidlChild;
880 if (FAILED_UNEXPECTEDLY(hr = GetFSFolderAndChild(pidl, &pInnerFolder, &pidlChild)))
881 return hr;
882 return pInnerFolder->BindToObject(pidlChild, pbcReserved, riid, ppvOut);
883}
884
886{
888 return E_NOTIMPL;
889}
890
892{
893 HRESULT hr;
894 WORD wColumn = LOWORD(lParam);
895 switch (wColumn)
896 {
897 case COL_NAME_INDEX: // Name
898 C_ASSERT(COL_NAME_INDEX == 0); // SHELL32::SHFSF_COL_NAME
899 // We can have more than one item with the same filename, in this case, look at the path as well.
900 // When DefView wants to identify a specific item, it will use the SHCIDS_CANONICALONLY flag.
901 hr = m_pisfInner->CompareIDs(MAKELONG(0, HIWORD(lParam)), _ILGetFSPidl(pidl1), _ILGetFSPidl(pidl2));
903 hr = CompareIDs(COL_LOCATION_INDEX, pidl1, pidl2);
904 return hr;
905 case COL_LOCATION_INDEX: // Path
906 return MAKE_COMPARE_HRESULT(StrCmpW(_ILGetPath(pidl1), _ILGetPath(pidl2)));
907 case COL_RELEVANCE_INDEX: // Relevance
908 return E_NOTIMPL;
909 default: // Default columns
910 wColumn -= _countof(g_ColumnDefs) - 1;
911 break;
912 }
913 return m_pisfInner->CompareIDs(MAKELONG(wColumn, HIWORD(lParam)), _ILGetFSPidl(pidl1), _ILGetFSPidl(pidl2));
914}
915
917{
918 if (riid == IID_IShellView)
919 {
920 SFV_CREATE sfvparams = {};
921 sfvparams.cbSize = sizeof(SFV_CREATE);
922 sfvparams.pshf = this;
923 sfvparams.psfvcb = this;
924 HRESULT hr = SHCreateShellFolderView(&sfvparams, (IShellView **) ppvOut);
926 {
927 return hr;
928 }
929
930 return ((IShellView * ) * ppvOut)->QueryInterface(IID_PPV_ARG(IShellFolderView, &m_shellFolderView));
931 }
932 return E_NOINTERFACE;
933}
934
936{
937 if (!cidl)
938 {
939 *rgfInOut &= SFGAO_BROWSABLE; // TODO: SFGAO_CANRENAME?
940 return S_OK;
941 }
942
944 for (UINT i = 0; i < cidl; ++i)
945 {
946 CComPtr<IShellFolder> pFolder;
947 PCUITEMID_CHILD pidlChild;
948 if (FAILED_UNEXPECTEDLY(hr = GetFSFolderAndChild(apidl[i], &pFolder, &pidlChild)))
949 break;
950 if (FAILED(hr = pFolder->GetAttributesOf(1, &pidlChild, rgfInOut)))
951 break;
952 }
953 return hr;
954}
955
957 public IContextMenu,
958 public IObjectWithSite,
959 public CComObjectRootEx<CComMultiThreadModelNoCS>
960{
966 static const UINT ADDITIONAL_MENU_ITEMS = 2;
967
968 // *** IContextMenu ***
969 STDMETHODIMP QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags)
970 {
971 if (m_cidl > 1)
972 uFlags &= ~CMF_CANRENAME;
973
974 m_MyFirstId = 0;
975 if (idCmdLast - idCmdFirst > ADDITIONAL_MENU_ITEMS)
976 {
977 // We use the last available id. For DefView, this places us at
978 // DVIDM_CONTEXTMENU_LAST which should not collide with anything.
979 // This is just a temporary fix until we are moved to shell32 and
980 // can use DFM_MERGECONTEXTMENU.
981 _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdLast--, MFT_STRING,
983 _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdLast--, MFT_SEPARATOR, NULL, 0);
984 m_MyFirstId = idCmdLast + 1;
985 }
986 return m_pInner->QueryContextMenu(hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags);
987 }
988
990 {
991 WORD idCmd = IS_INTRESOURCE(lpcmi->lpVerb) ? LOWORD(lpcmi->lpVerb) : 0;
992 if (m_MyFirstId && idCmd >= m_MyFirstId && idCmd < m_MyFirstId + ADDITIONAL_MENU_ITEMS)
993 {
994 PCUITEMID_CHILD *apidl;
995 UINT cidl;
996 HRESULT hResult = m_shellFolderView->GetSelectedObjects(&apidl, &cidl);
997 if (FAILED_UNEXPECTEDLY(hResult))
998 return hResult;
999
1000 for (UINT i = 0; i < cidl; i++)
1001 {
1003 if (!folderPidl)
1004 {
1005 hResult = E_OUTOFMEMORY;
1006 break;
1007 }
1009 SHOpenFolderAndSelectItems(folderPidl, 1, &child, 0);
1010 }
1011 LocalFree(apidl); // Yes, LocalFree
1012 return hResult;
1013 }
1014
1015 // TODO: Use GetDfmCmd instead after moving all of this to shell32
1016 CHAR szVerb[42];
1017 PCSTR pszVerb = !idCmd ? lpcmi->lpVerb : NULL;
1018 if (!pszVerb && SUCCEEDED(GetCommandStringA(m_pInner, LOWORD(lpcmi->lpVerb), GCS_VERBA, szVerb, _countof(szVerb))))
1019 pszVerb = szVerb;
1020
1021 if (pszVerb && !lstrcmpiA(pszVerb, "rename"))
1022 {
1023 // Note: We can't invoke m_pInner (CDefaultContextMenu::DoRename) because the pidl is incorrect and SelectItem will fail.
1025 }
1026
1027 // FIXME: We can't block FCIDM_SHVIEW_REFRESH here, add items on SFVM_LISTREFRESHED instead
1028 return m_pInner->InvokeCommand(lpcmi);
1029 }
1030
1032 {
1033 return m_pInner->GetCommandString(idCommand, uFlags, lpReserved, lpszName, uMaxNameLen);
1034 }
1035
1036 // *** IObjectWithSite ***
1037 STDMETHODIMP SetSite(IUnknown *pUnkSite) override
1038 {
1039 IUnknown_Set(&m_pUnkSite, pUnkSite);
1040 IUnknown_SetSite(m_pInner, pUnkSite);
1041 return S_OK;
1042 }
1043
1044 STDMETHODIMP GetSite(REFIID riid, void **ppvSite) override
1045 {
1046 *ppvSite = NULL;
1047 return m_pUnkSite ? m_pUnkSite->QueryInterface(riid, ppvSite) : E_FAIL;
1048 }
1049
1050public:
1052 {
1053 SetSite(NULL);
1054 }
1055
1056 static HRESULT Create(IShellFolderView *pShellFolderView, UINT cidl, IContextMenu *pInnerContextMenu, IContextMenu **pContextMenu)
1057 {
1060 if (FAILED_UNEXPECTEDLY(hResult))
1061 return hResult;
1062 pObj->m_shellFolderView = pShellFolderView;
1063 pObj->m_pInner = pInnerContextMenu;
1064 pObj->m_cidl = cidl;
1065 return pObj->QueryInterface(IID_PPV_ARG(IContextMenu, pContextMenu));
1066 }
1067
1069 COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu)
1071 END_COM_MAP()
1072};
1073
1075{
1076 // For Delete/Move operations, a subfolder/file needs to come before the parent folder
1077 return ::ILGetSize((LPCITEMIDLIST)p1) - ::ILGetSize((LPCITEMIDLIST)p2);
1078}
1079
1081 UINT *prgfInOut, LPVOID *ppvOut)
1082{
1083 HRESULT hr;
1084 if (cidl <= 0)
1085 return E_INVALIDARG;
1086
1087 CComHeapPtr<PCITEMID_CHILD> aFSPidlAlloc;
1088 PCITEMID_CHILD pidlSingleBuffer, *aFSPidl = &pidlSingleBuffer; // Optimize for single item callers
1089 if (cidl != 1)
1090 {
1091 if (riid == IID_IDataObject)
1092 {
1093 if (HDPA hDpa = CreateAbsolutePidlArray(cidl, apidl))
1094 {
1096 ITEMIDLIST pidlRoot = {};
1098 NULL, (IDataObject**)ppvOut);
1099 FreePidlArray(hDpa);
1100 return hr;
1101 }
1102 }
1103
1104 aFSPidlAlloc.Allocate(cidl);
1105 aFSPidl = aFSPidlAlloc;
1106 }
1107 for (UINT i = 0; i < cidl; i++)
1108 {
1109 aFSPidl[i] = _ILGetFSPidl(apidl[i]);
1110 }
1111
1112 if (riid == IID_IContextMenu)
1113 {
1114 // FIXME: Use CDefFolderMenu_Create2(..., AddFSClassKeysToArray())
1116 if (!folderPidl)
1117 return E_OUTOFMEMORY;
1118 CComPtr<IShellFolder> pDesktopFolder;
1119 if (FAILED_UNEXPECTEDLY(hr = SHGetDesktopFolder(&pDesktopFolder)))
1120 return hr;
1121 CComPtr<IShellFolder> pShellFolder;
1122 hr = pDesktopFolder->BindToObject(folderPidl, NULL, IID_PPV_ARG(IShellFolder, &pShellFolder));
1124 return hr;
1125 CComPtr<IContextMenu> pContextMenu;
1126 hr = pShellFolder->GetUIObjectOf(hwndOwner, cidl, aFSPidl, riid, prgfInOut, (void**)&pContextMenu);
1128 return hr;
1129 return CFindFolderContextMenu::Create(m_shellFolderView, cidl, pContextMenu, (IContextMenu **)ppvOut);
1130 }
1131
1132 CComPtr<IShellFolder> pFolder;
1133 if (FAILED_UNEXPECTEDLY(hr = GetFSFolderAndChild(apidl[0], &pFolder)))
1134 return hr;
1135 return pFolder->GetUIObjectOf(hwndOwner, cidl, aFSPidl, riid, prgfInOut, ppvOut);
1136}
1137
1139{
1140 HRESULT hr;
1141 CComPtr<IShellFolder> pFolder;
1142 PCUITEMID_CHILD pidlChild;
1143 if (FAILED_UNEXPECTEDLY(hr = GetFSFolderAndChild(pidl, &pFolder, &pidlChild)))
1144 return hr;
1145 return pFolder->GetDisplayNameOf(pidlChild, dwFlags, pName);
1146}
1147
1149 PITEMID_CHILD *pPidlOut)
1150{
1151 if (!pPidlOut)
1152 return E_INVALIDARG; // Our pidls are special, the caller must get it from us and not from parsing
1153 *pPidlOut = NULL;
1154
1155 HRESULT hr;
1156 CComPtr<IShellFolder> pFolder;
1157 PCUITEMID_CHILD pidlChild;
1158 if (FAILED_UNEXPECTEDLY(hr = GetFSFolderAndChild(pidl, &pFolder, &pidlChild)))
1159 return hr;
1160
1161 PCWSTR pszDir = _ILGetPath(pidl);
1162 PWSTR pszFull = (PWSTR)SHAlloc((wcslen(pszDir) + MAX_PATH) * sizeof(*pszDir));
1163 if (!pszFull)
1164 return E_OUTOFMEMORY;
1165
1166 PITEMID_CHILD pidlRawNew = NULL;
1167 hr = pFolder->SetNameOf(hwndOwner, pidlChild, lpName, dwFlags, &pidlRawNew);
1168 if (SUCCEEDED(hr) && pidlRawNew)
1169 {
1170 WCHAR szFileName[MAX_PATH];
1171 hr = DisplayNameOfW(pFolder, pidlRawNew, SHGDN_FORPARSING | SHGDN_INFOLDER, szFileName, _countof(szFileName));
1172 ILFree(pidlRawNew);
1173 PathCombineW(pszFull, pszDir, szFileName);
1174 if (SUCCEEDED(hr))
1175 hr = ((*pPidlOut = _ILCreate(pszFull)) != NULL) ? S_OK : E_OUTOFMEMORY;
1176 }
1177 SHFree(pszFull);
1178 return hr;
1179}
1180
1183{
1184 switch (uMsg)
1185 {
1186 case SFVM_DEFVIEWMODE:
1187 {
1188 FOLDERVIEWMODE *pViewMode = (FOLDERVIEWMODE *) lParam;
1189 *pViewMode = FVM_DETAILS;
1190 return S_OK;
1191 }
1192 case SFVM_WINDOWCREATED:
1193 {
1194 // Subclass window to receive window messages
1196
1197 // Get shell browser for updating status bar text
1200 return hr;
1201
1202 // Open search bar
1203 CComPtr<IWebBrowser2> pWebBrowser2;
1204 hr = m_shellBrowser->QueryInterface(IID_PPV_ARG(IWebBrowser2, &pWebBrowser2));
1206 return hr;
1207 WCHAR wszGuid[39];
1208 StringFromGUID2(CLSID_FileSearchBand, wszGuid, _countof(wszGuid));
1209 CComVariant searchBar(wszGuid);
1210 return pWebBrowser2->ShowBrowserBar(&searchBar, NULL, NULL);
1211 }
1212 case SFVM_WINDOWCLOSING:
1213 {
1216 return S_OK;
1217 }
1218 case SFVM_GETCOMMANDDIR:
1219 {
1220 HRESULT hr = E_FAIL;
1222 {
1223 PCUITEMID_CHILD *apidl;
1224 UINT cidl = 0;
1225 if (SUCCEEDED(hr = m_shellFolderView->GetSelectedObjects(&apidl, &cidl)))
1226 {
1227 if (cidl)
1229 LocalFree(apidl);
1230 }
1231 }
1232 return hr;
1233 }
1234 // TODO: SFVM_GETCOLUMNSTREAM
1235 }
1236 return E_NOTIMPL;
1237}
1238
1241{
1243 HRESULT hr = m_pisfInner->QueryInterface(IID_PPV_ARG(IItemNameLimits, &pLimits));
1244 return FAILED_UNEXPECTEDLY(hr) ? hr : pLimits->GetMaxLength(pszName, piMaxNameLen);;
1245}
1246
1247STDMETHODIMP CFindFolder::GetValidCharacters(LPWSTR *ppwszValidChars, LPWSTR *ppwszInvalidChars)
1248{
1250 HRESULT hr = m_pisfInner->QueryInterface(IID_PPV_ARG(IItemNameLimits, &pLimits));
1251 return FAILED_UNEXPECTEDLY(hr) ? hr : pLimits->GetValidCharacters(ppwszValidChars, ppwszInvalidChars);
1252}
1253
1256{
1257 return SHILClone(m_pidl, pidl);
1258}
1259
1260// *** IPersistFolder methods ***
1262{
1263 if (m_pidl)
1264 return E_UNEXPECTED;
1265 HRESULT hr;
1267 return hr;
1268 if (FAILED(hr = SHILClone(pidl, &m_pidl)))
1269 return hr;
1270 return SHELL32_CoCreateInitSF(m_pidl, NULL, NULL, &CLSID_ShellFSFolder,
1272}
1273
1274// *** IPersist methods ***
1276{
1277 if (pClassId == NULL)
1278 return E_INVALIDARG;
1279 *pClassId = CLSID_FindFolder;
1280 return S_OK;
1281}
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv, IShellView **ppsv)
Definition: CDefView.cpp:4814
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 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 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 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)
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
#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
#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
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:4227
#define IS_INTRESOURCE(x)
Definition: loader.c:613
WCHAR *WINAPI PathFindFileNameW(const WCHAR *path)
Definition: path.c:1701
BOOL WINAPI PathMatchSpecW(const WCHAR *path, const WCHAR *mask)
Definition: path.c:2521
BOOL WINAPI PathIsRootW(const WCHAR *path)
Definition: path.c:1101
INT WINAPI DECLSPEC_HOTPATCH LoadStringW(HINSTANCE instance, UINT resource_id, LPWSTR buffer, INT buflen)
Definition: string.c:1220
int WINAPI StrCmpW(const WCHAR *str, const WCHAR *comp)
Definition: string.c:450
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
Definition: compobj.c:2002
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2434
HRESULT SHILClone(_In_opt_ LPCITEMIDLIST pidl, _Outptr_ LPITEMIDLIST *ppidl)
Definition: utils.cpp:133
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
VOID WINAPI IUnknown_Set(IUnknown **lppDest, IUnknown *lpUnknown)
Definition: ordinal.c:2190
HRESULT WINAPI IUnknown_QueryService(IUnknown *, REFGUID, REFIID, LPVOID *)
Definition: ordinal.c:1501
HRESULT WINAPI IUnknown_SetSite(IUnknown *obj, IUnknown *site)
Definition: ordinal.c:1411
HRESULT WINAPI SHStrDupW(LPCWSTR src, LPWSTR *dest)
Definition: string.c:2018
INT WINAPI SHUnicodeToAnsi(LPCWSTR lpSrcStr, LPSTR lpDstStr, INT iLen)
Definition: string.c:2797
HRESULT WINAPI StrRetToBufW(LPSTRRET src, const ITEMIDLIST *pidl, LPWSTR dest, UINT len)
Definition: string.c:1530
BOOL WINAPI SHCreateThread(LPTHREAD_START_ROUTINE pfnThreadProc, VOID *pData, DWORD dwFlags, LPTHREAD_START_ROUTINE pfnCallback)
Definition: thread.c:356
#define FAILED_UNEXPECTEDLY
Definition: utils.cpp:30
#define L(x)
Definition: resources.c:13
#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
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
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
_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 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 memcpy(s1, s2, n)
Definition: mkisofs.h:878
LPCWSTR LPCWSTR LPCWSTR DWORD dwFlags
Definition: env.c:37
LPCWSTR szPath
Definition: env.c:37
static LPSTR pName
Definition: security.c:75
const IID IID_IObjectWithSite
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:63
static VARIANTARG static DISPID
Definition: ordinal.c:52
static HWND child
Definition: cursoricon.c:298
ENCODING
Definition: more.c:493
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 _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:1017
#define UNICODE_NULL
@ COINIT_MULTITHREADED
Definition: objbase.h:279
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
DWORD * PDWORD
Definition: pedump.c:68
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:1045
LPITEMIDLIST WINAPI ILFindLastID(LPCITEMIDLIST pidl)
Definition: pidl.c:199
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:817
LPITEMIDLIST WINAPI ILCreateFromPathW(LPCWSTR path)
Definition: pidl.c:1102
#define LVCFMT_LEFT
Definition: commctrl.h:2603
#define DPA_GetPtrPtr(hdpa)
Definition: commctrl.h:4974
#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
_In_ LPCSTR pszDir
Definition: shellapi.h:601
#define ILGetSize
Definition: shellclasses.h:638
#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 MAKE_COMPARE_HRESULT(x)
Definition: shellutils.h:678
#define S_EQUAL
Definition: shellutils.h:676
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:551
#define SID_SShellBrowser
Definition: shlguid.h:128
#define SFVM_DEFVIEWMODE
Definition: shlobj.h:1323
#define SFVM_WINDOWCREATED
Definition: shlobj.h:1313
PIDLIST_ABSOLUTE WINAPI SHSimpleIDListFromPath(PCWSTR)
struct _SFV_CREATE SFV_CREATE
#define StrNCmp
Definition: shlwapi.h:1570
FOLDERVIEWMODE
Definition: shobjidl.idl:677
@ FVM_DETAILS
Definition: shobjidl.idl:683
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:53
LOCATIONITEM * pPaths
Definition: shellfind.h:52
BOOL SearchHidden
Definition: shellfind.h:55
WCHAR szQuery[MAX_PATH]
Definition: shellfind.h:54
Definition: dpa.c:49
Definition: scsiwmi.h:51
IShellFolderViewCB * psfvcb
Definition: shlobj.h:1365
UINT cbSize
Definition: shlobj.h:1362
IShellFolder * pshf
Definition: shlobj.h:1363
CStringA szQueryA
CStringW szQueryW
CStringW szFileName
CStringW szQueryU16BE
LOCATIONITEM * pPaths
HANDLE hStopEvent
CStringA szQueryU8
CComPtr< CFindFolder > pFindFolder
Definition: ps.c:97
struct tagLOCATIONITEM * pNext
Definition: shellfind.h:36
LPWSTR dwTypeData
Definition: winuser.h:3371
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
uint16_t * PWSTR
Definition: typedefs.h:56
const uint16_t * PCWSTR
Definition: typedefs.h:57
#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
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
#define ZeroMemory
Definition: winbase.h:1753
HANDLE WINAPI GetCurrentThread(void)
Definition: proc.c:1148
_In_ LPCSTR lpName
Definition: winbase.h:2830
#define CreateEvent
Definition: winbase.h:3789
#define INVALID_FILE_SIZE
Definition: winbase.h:584
#define THREAD_PRIORITY_BELOW_NORMAL
Definition: winbase.h:309
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 E_UNEXPECTED
Definition: winerror.h:2456
_In_ DWORD _In_ int _In_ int _In_opt_ LPNLSVERSIONINFO _In_opt_ LPVOID lpReserved
Definition: winnls.h:1199
#define IS_TEXT_UNICODE_ILLEGAL_CHARS
Definition: winnt_old.h:938
#define IS_TEXT_UNICODE_UNICODE_MASK
Definition: winnt_old.h:942
#define IS_TEXT_UNICODE_NOT_ASCII_MASK
Definition: winnt_old.h:945
#define IS_TEXT_UNICODE_NULL_BYTES
Definition: winnt_old.h:941
#define IS_TEXT_UNICODE_REVERSE_MASK
Definition: winnt_old.h:943
#define IS_TEXT_UNICODE_REVERSE_SIGNATURE
Definition: winnt_old.h:937
#define IS_TEXT_UNICODE_NOT_UNICODE_MASK
Definition: winnt_old.h:944
#define IS_TEXT_UNICODE_SIGNATURE
Definition: winnt_old.h:936
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define RegOpenKeyEx
Definition: winreg.h:520
#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
#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)
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