ReactOS 0.4.15-dev-8422-g6219a1a
shlfolder.cpp
Go to the documentation of this file.
1/*
2 * Shell Folder stuff
3 *
4 * Copyright 1997 Marcus Meissner
5 * Copyright 1998, 1999, 2002 Juergen Schmied
6 * Copyright 2018 Katayama Hirofumi MZ
7 *
8 * IShellFolder2 and related interfaces
9 *
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation; either
13 * version 2.1 of the License, or (at your option) any later version.
14 *
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
25#include "precomp.h"
26
28
31 _Inout_ LPWSTR *ppch,
32 _Out_ LPWSTR pszOut,
33 _In_ INT cchOut,
34 _In_ BOOL bValidate)
35{
36 *pszOut = UNICODE_NULL;
37
38 if (!*ppch)
39 return S_FALSE;
40
41 HRESULT hr;
42 LPWSTR pchNext = wcschr(*ppch, L'\\');
43 if (pchNext)
44 {
45 if (*ppch < pchNext)
46 {
47 /* Get an element */
48 StringCchCopyNW(pszOut, cchOut, *ppch, pchNext - *ppch);
49 ++pchNext;
50
51 if (!*pchNext)
52 pchNext = NULL; /* No next */
53
54 hr = S_OK;
55 }
56 else /* Double backslashes found? */
57 {
58 pchNext = NULL;
60 }
61 }
62 else /* No more next */
63 {
64 StringCchCopyW(pszOut, cchOut, *ppch);
65 hr = S_OK;
66 }
67
68 *ppch = pchNext; /* Go next */
69
70 if (hr == S_OK && bValidate && !PathIsValidElement(pszOut))
71 {
72 *pszOut = UNICODE_NULL;
74 }
75
76 return hr;
77}
78
80 LPITEMIDLIST * pidlInOut, LPOLESTR szNext, DWORD * pEaten, DWORD * pdwAttributes)
81{
83 LPITEMIDLIST pidlIn = pidlInOut ? *pidlInOut : NULL;
84 LPITEMIDLIST pidlOut = NULL;
85 LPITEMIDLIST pidlTemp = NULL;
86 CComPtr<IShellFolder> psfChild;
87
88 TRACE ("(%p, %p, %p, %s)\n", psf, pbc, pidlIn, debugstr_w (szNext));
89
90 /* get the shellfolder for the child pidl and let it analyse further */
91 hr = psf->BindToObject(pidlIn, pbc, IID_PPV_ARG(IShellFolder, &psfChild));
92 if (FAILED(hr))
93 return hr;
94
95 hr = psfChild->ParseDisplayName(hwndOwner, pbc, szNext, pEaten, &pidlOut, pdwAttributes);
96 if (FAILED(hr))
97 return hr;
98
99 pidlTemp = ILCombine (pidlIn, pidlOut);
100 if (!pidlTemp)
101 {
103 if (pidlOut)
104 ILFree(pidlOut);
105 return hr;
106 }
107
108 if (pidlOut)
109 ILFree (pidlOut);
110
111 if (pidlIn)
112 ILFree (pidlIn);
113
114 *pidlInOut = pidlTemp;
115
116 TRACE ("-- pidl=%p ret=0x%08x\n", pidlInOut ? *pidlInOut : NULL, hr);
117 return S_OK;
118}
119
120/***********************************************************************
121 * SHELL32_CoCreateInitSF
122 *
123 * Creates a shell folder and initializes it with a pidl and a root folder
124 * via IPersistFolder3 or IPersistFolder.
125 *
126 * NOTES
127 * pathRoot can be NULL for Folders being a drive.
128 * In this case the absolute path is built from pidlChild (eg. C:)
129 */
130HRESULT SHELL32_CoCreateInitSF (LPCITEMIDLIST pidlRoot, PERSIST_FOLDER_TARGET_INFO* ppfti,
131 LPCITEMIDLIST pidlChild, const GUID* clsid, REFIID riid, LPVOID *ppvOut)
132{
133 HRESULT hr;
134 CComPtr<IShellFolder> pShellFolder;
135
137 if (FAILED(hr))
138 return hr;
139
140 LPITEMIDLIST pidlAbsolute = ILCombine (pidlRoot, pidlChild);
143
144 if (ppfti && SUCCEEDED(pShellFolder->QueryInterface(IID_PPV_ARG(IPersistFolder3, &ppf3))))
145 {
146 ppf3->InitializeEx(NULL, pidlAbsolute, ppfti);
147 }
148 else if (SUCCEEDED(pShellFolder->QueryInterface(IID_PPV_ARG(IPersistFolder, &ppf))))
149 {
150 ppf->Initialize(pidlAbsolute);
151 }
152 ILFree (pidlAbsolute);
153
154 return pShellFolder->QueryInterface(riid, ppvOut);
155}
156
158 int csidl, REFIID riid, LPVOID *ppvOut)
159{
160 /* fill the PERSIST_FOLDER_TARGET_INFO */
161 PERSIST_FOLDER_TARGET_INFO pfti = {0};
162 pfti.dwAttributes = -1;
163 pfti.csidl = csidl;
164
165 return SHELL32_CoCreateInitSF(pidlRoot, &pfti, NULL, clsid, riid, ppvOut);
166}
167
168HRESULT SHELL32_BindToSF (LPCITEMIDLIST pidlRoot, PERSIST_FOLDER_TARGET_INFO* ppfti,
169 LPCITEMIDLIST pidl, const GUID* clsid, REFIID riid, LPVOID *ppvOut)
170{
171 PITEMID_CHILD pidlChild = ILCloneFirst (pidl);
172 if (!pidlChild)
173 return E_FAIL;
174
177 ppfti,
178 pidlChild,
179 clsid,
181 ILFree(pidlChild);
182
184 return hr;
185
186 if (_ILIsPidlSimple (pidl))
187 return psf->QueryInterface(riid, ppvOut);
188 else
189 return psf->BindToObject(ILGetNext (pidl), NULL, riid, ppvOut);
190}
191
192/***********************************************************************
193 * SHELL32_GetDisplayNameOfChild
194 *
195 * Retrieves the display name of a child object of a shellfolder.
196 *
197 * For a pidl eg. [subpidl1][subpidl2][subpidl3]:
198 * - it binds to the child shellfolder [subpidl1]
199 * - asks it for the displayname of [subpidl2][subpidl3]
200 *
201 * Is possible the pidl is a simple pidl. In this case it asks the
202 * subfolder for the displayname of an empty pidl. The subfolder
203 * returns the own displayname eg. "::{guid}". This is used for
204 * virtual folders with the registry key WantsFORPARSING set.
205 */
207 LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet)
208{
209 LPITEMIDLIST pidlFirst = ILCloneFirst(pidl);
210 if (!pidlFirst)
211 return E_OUTOFMEMORY;
212
213 CComPtr<IShellFolder> psfChild;
214 HRESULT hr = psf->BindToObject(pidlFirst, NULL, IID_PPV_ARG(IShellFolder, &psfChild));
215 if (SUCCEEDED (hr))
216 {
217 hr = psfChild->GetDisplayNameOf(ILGetNext (pidl), dwFlags, strRet);
218 }
219 ILFree (pidlFirst);
220
221 return hr;
222}
223
225{
226 PUIDLIST_RELATIVE nextpidl1 = ILGetNext (pidl1);
227 PUIDLIST_RELATIVE nextpidl2 = ILGetNext (pidl2);
228
229 bool isEmpty1 = _ILIsDesktop(nextpidl1);
230 bool isEmpty2 = _ILIsDesktop(nextpidl2);
231 if (isEmpty1 || isEmpty2)
232 return MAKE_COMPARE_HRESULT(isEmpty2 - isEmpty1);
233
234 PITEMID_CHILD firstpidl = ILCloneFirst (pidl1);
235 if (!firstpidl)
236 return E_OUTOFMEMORY;
237
239 HRESULT hr = psf->BindToObject(firstpidl, 0, IID_PPV_ARG(IShellFolder, &psf2));
240 ILFree(firstpidl);
241 if (FAILED(hr))
242 return MAKE_COMPARE_HRESULT(0);
243
244 return psf2->CompareIDs(lParam, nextpidl1, nextpidl2);
245}
246
248{
250 WCHAR wszItem1[MAX_PATH], wszItem2[MAX_PATH];
252 UINT col = LOWORD(lParam); // Column index without SHCIDS_* flags
253
254 hres = isf->GetDetailsOf(pidl1, col, &sd);
255 if (FAILED(hres))
256 return MAKE_COMPARE_HRESULT(1);
257
258 hres = StrRetToBufW(&sd.str, pidl1, wszItem1, MAX_PATH);
259 if (FAILED(hres))
260 return MAKE_COMPARE_HRESULT(1);
261
262 hres = isf->GetDetailsOf(pidl2, col, &sd);
263 if (FAILED(hres))
264 return MAKE_COMPARE_HRESULT(1);
265
266 hres = StrRetToBufW(&sd.str, pidl2, wszItem2, MAX_PATH);
267 if (FAILED(hres))
268 return MAKE_COMPARE_HRESULT(1);
269
270 int ret = wcsicmp(wszItem1, wszItem2);
271 if (ret == 0)
272 return SHELL32_CompareChildren(isf, lParam, pidl1, pidl2);
273
275}
276
278{
279 if (*cKeys >= 16)
280 return ERROR_MORE_DATA;
281
282 HKEY hkey;
284 if (result == ERROR_SUCCESS)
285 {
286 array[*cKeys] = hkey;
287 *cKeys += 1;
288 }
289 return result;
290}
291
293{
294 WCHAR path[6 + 38 + 1] = L"CLSID\\";
295 StringFromGUID2(clsid, path + 6, 38 + 1);
296 return AddClassKeyToArray(path, array, cKeys);
297}
298
300{
301 // This function opens the association array keys in canonical order for filesystem items.
302 // The order is documented: learn.microsoft.com/en-us/windows/win32/shell/fa-associationarray
303
304 ASSERT(cidl >= 1 && apidl);
305 PCUITEMID_CHILD pidl = apidl[0];
306 if (_ILIsValue(pidl))
307 {
309 PWSTR name;
310 FileStructW* pFileData = _ILGetFileStructW(pidl);
311 if (pFileData)
312 {
313 name = pFileData->wszName;
314 }
315 else
316 {
318 name = buf;
319 }
320 LPCWSTR extension = PathFindExtension(name);
321
322 if (extension)
323 {
324 WCHAR wszClass[MAX_PATH], wszSFA[23 + _countof(wszClass)];
325 DWORD dwSize = sizeof(wszClass);
326 if (RegGetValueW(HKEY_CLASSES_ROOT, extension, NULL, RRF_RT_REG_SZ, NULL, wszClass, &dwSize) != ERROR_SUCCESS ||
327 !*wszClass || AddClassKeyToArray(wszClass, array, cKeys) != ERROR_SUCCESS)
328 {
329 // Only add the extension key if the ProgId is not valid
330 AddClassKeyToArray(extension, array, cKeys);
331
332 // "Open With" becomes the default when there are no verbs in the above keys
333 if (cidl == 1)
334 AddClassKeyToArray(L"Unknown", array, cKeys);
335 }
336
337 swprintf(wszSFA, L"SystemFileAssociations\\%s", extension);
338 AddClassKeyToArray(wszSFA, array, cKeys);
339
340 dwSize = sizeof(wszClass);
341 if (RegGetValueW(HKEY_CLASSES_ROOT, extension, L"PerceivedType ", RRF_RT_REG_SZ, NULL, wszClass, &dwSize) == ERROR_SUCCESS)
342 {
343 swprintf(wszSFA, L"SystemFileAssociations\\%s", wszClass);
344 AddClassKeyToArray(wszSFA, array, cKeys);
345 }
346 }
347
348 AddClassKeyToArray(L"*", array, cKeys);
349 AddClassKeyToArray(L"AllFilesystemObjects", array, cKeys);
350 }
351 else if (_ILIsFolder(pidl))
352 {
353 // FIXME: Directory > Folder > AFO is the correct order and it's
354 // the order Windows reports in its undocumented association array
355 // but it is somehow not the order Windows adds the items to its menu!
356 // Until the correct algorithm in CDefaultContextMenu can be determined,
357 // we add the folder keys in "menu order".
358 AddClassKeyToArray(L"Folder", array, cKeys);
359 AddClassKeyToArray(L"AllFilesystemObjects", array, cKeys);
360 AddClassKeyToArray(L"Directory", array, cKeys);
361 }
362 else
363 {
364 ERR("Got non FS pidl\n");
365 }
366}
367
368HRESULT SH_GetApidlFromDataObject(IDataObject *pDataObject, PIDLIST_ABSOLUTE* ppidlfolder, PUITEMID_CHILD **apidlItems, UINT *pcidl)
369{
370 CDataObjectHIDA cida(pDataObject);
371
372 if (FAILED_UNEXPECTEDLY(cida.hr()))
373 return cida.hr();
374
375 /* convert the data into pidl */
376 LPITEMIDLIST pidl;
377 LPITEMIDLIST *apidl = _ILCopyCidaToaPidl(&pidl, cida);
378 if (!apidl)
379 {
380 return E_OUTOFMEMORY;
381 }
382
383 *ppidlfolder = pidl;
384 *apidlItems = apidl;
385 *pcidl = cida->cidl;
386
387 return S_OK;
388}
389
390/***********************************************************************
391 * SHCreateLinks
392 *
393 * Undocumented.
394 */
396 UINT uFlags, LPITEMIDLIST *lppidlLinks)
397{
398 FIXME("%p %s %p %08x %p\n", hWnd, lpszDir, lpDataObject, uFlags, lppidlLinks);
399 return E_NOTIMPL;
400}
401
402/***********************************************************************
403 * SHOpenFolderAndSelectItems
404 *
405 * Unimplemented.
406 */
408WINAPI
410 UINT cidl,
413{
414 ERR("SHOpenFolderAndSelectItems() is hackplemented\n");
416 PCIDLIST_ABSOLUTE pidlItem;
417 if (cidl)
418 {
419 /* Firefox sends a full pidl here dispite the fact it is a PCUITEMID_CHILD_ARRAY -_- */
420 if (!ILIsSingle(apidl[0]))
421 {
422 pidlItem = apidl[0];
423 }
424 else
425 {
426 HRESULT hr = SHILCombine(pidlFolder, apidl[0], &pidlItem);
428 return hr;
429 freeItem.Attach(const_cast<PIDLIST_ABSOLUTE>(pidlItem));
430 }
431 }
432 else
433 {
434 pidlItem = pidlFolder;
435 }
436
437 CComPtr<IShellFolder> psfDesktop;
438
439 HRESULT hr = SHGetDesktopFolder(&psfDesktop);
441 return hr;
442
443 STRRET strret;
444 hr = psfDesktop->GetDisplayNameOf(pidlItem, SHGDN_FORPARSING, &strret);
446 return hr;
447
448 WCHAR wszBuf[MAX_PATH];
449 hr = StrRetToBufW(&strret, pidlItem, wszBuf, _countof(wszBuf));
451 return hr;
452
453 WCHAR wszParams[MAX_PATH];
454 wcscpy(wszParams, L"/select,");
455 wcscat(wszParams, wszBuf);
456
458 memset(&sei, 0, sizeof sei);
459 sei.cbSize = sizeof sei;
461 sei.lpFile = L"explorer.exe";
462 sei.lpParameters = wszParams;
463
464 if (ShellExecuteExW(&sei))
465 return S_OK;
466 else
467 return E_FAIL;
468}
469
470static
473{
474 CComPtr<IDataObject> pDataObject;
475 pDataObject.Attach((IDataObject*)lpParameter);
476
477 CDataObjectHIDA cida(pDataObject);
478
479 if (FAILED_UNEXPECTEDLY(cida.hr()))
480 return cida.hr();
481
482 if (cida->cidl > 1)
483 {
484 ERR("SHMultiFileProperties is not yet implemented\n");
485 return E_FAIL;
486 }
487
489 CComHeapPtr<WCHAR> wszName;
490 if (FAILED_UNEXPECTEDLY(SHGetNameFromIDList(completePidl, SIGDN_PARENTRELATIVEPARSING, &wszName)))
491 return 0;
492
493 BOOL bSuccess = SH_ShowPropertiesDialog(wszName, pDataObject);
494 if (!bSuccess)
495 ERR("SH_ShowPropertiesDialog failed\n");
496
497 return 0;
498}
499
500/*
501 * for internal use
502 */
505{
506 if (!pdtobj)
507 return E_INVALIDARG;
508
509 pdtobj->AddRef();
511 {
512 pdtobj->Release();
514 }
515 else
516 {
517 return S_OK;
518 }
519}
520
523{
524 switch (msg)
525 {
527 return S_OK; // Yes, I want verbs
529 return S_FALSE; // Do it for me please
531 return S_FALSE; // Supposedly "required for Windows 7 to pick a default"
532 }
533 return E_NOTIMPL;
534}
BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
Definition: CBandSite.h:24
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
#define msg(x)
Definition: auth_time.c:54
HWND hWnd
Definition: settings.c:17
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
void shell(int argc, const char *argv[])
Definition: cmds.c:1231
#define FIXME(fmt,...)
Definition: precomp.h:53
#define ERR(fmt,...)
Definition: precomp.h:57
#define EXTERN_C
Definition: basetyps.h:12
void Attach(T *lp)
Definition: atlcomcli.h:179
void Attach(T *lp)
Definition: atlalloc.h:162
LPARAM lParam
Definition: combotst.c:139
#define ERROR_MORE_DATA
Definition: dderror.h:13
#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
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
#define NULL
Definition: types.h:112
#define DFM_GETDEFSTATICID
Definition: precomp.h:47
#define DFM_MERGECONTEXTMENU
Definition: precomp.h:44
#define DFM_INVOKECOMMAND
Definition: precomp.h:45
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LSTATUS WINAPI RegGetValueW(HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData)
Definition: reg.c:1931
UINT uFlags
Definition: api.c:59
BOOL WINAPI _ILIsPidlSimple(LPCITEMIDLIST pidl)
#define wcschr
Definition: compat.h:17
#define MAX_PATH
Definition: compat.h:34
#define wcsicmp
Definition: compat.h:15
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2434
#define RRF_RT_REG_SZ
Definition: driver.c:575
BOOL PathIsValidElement(_In_ LPCWSTR pszPath)
Definition: utils.cpp:38
HRESULT WINAPI SHCoCreateInstance(LPCWSTR aclsid, const CLSID *clsid, LPUNKNOWN pUnkOuter, REFIID refiid, LPVOID *ppv)
Definition: shellole.c:105
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 swprintf
Definition: precomp.h:40
static BOOLEAN bSuccess
Definition: drive.cpp:477
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL SH_ShowPropertiesDialog(LPCWSTR pwszPath, IDataObject *pDataObj)
Definition: fprop.cpp:83
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLuint64EXT * result
Definition: glext.h:11304
REFIID riid
Definition: atlbase.h:39
HRESULT GetDetailsOf([in] PCUITEMID_CHILD pidl, [in] UINT iColumn, [out] SHELLDETAILS *psd)
HRESULT BindToObject([in] PCUIDLIST_RELATIVE pidl, [in] LPBC pbcReserved, [in] REFIID riid, [out, iid_is(riid)] void **ppvOut)
ULONG AddRef()
ULONG Release()
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
#define debugstr_w
Definition: kernel32.h:32
#define ASSERT(a)
Definition: mode.c:44
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
HRESULT hres
Definition: protocol.c:465
static const WCHAR sd[]
Definition: suminfo.c:286
static LPOLESTR
Definition: stg_prop.c:27
#define _Inout_
Definition: ms_sal.h:378
#define _Out_
Definition: ms_sal.h:345
#define _In_
Definition: ms_sal.h:308
REFCLSID clsid
Definition: msctf.c:82
unsigned int UINT
Definition: ndis.h:50
#define KEY_READ
Definition: nt_native.h:1023
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
#define UNICODE_NULL
#define L(x)
Definition: ntvdm.h:50
interface IBindCtx * LPBC
Definition: objfwd.h:18
#define LOWORD(l)
Definition: pedump.c:82
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:940
LPITEMIDLIST * _ILCopyCidaToaPidl(LPITEMIDLIST *pidl, const CIDA *cida)
Definition: pidl.c:2632
HRESULT WINAPI SHGetNameFromIDList(PCIDLIST_ABSOLUTE pidl, SIGDN sigdnName, PWSTR *ppszName)
Definition: pidl.c:1456
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:712
LPITEMIDLIST WINAPI ILCloneFirst(LPCITEMIDLIST pidl)
Definition: pidl.c:262
FileStructW * _ILGetFileStructW(LPCITEMIDLIST pidl)
Definition: pidl.c:2328
BOOL _ILIsFolder(LPCITEMIDLIST pidl)
Definition: pidl.c:2015
LPITEMIDLIST WINAPI ILGetNext(LPCITEMIDLIST pidl)
Definition: pidl.c:866
BOOL _ILIsValue(LPCITEMIDLIST pidl)
Definition: pidl.c:2024
DWORD _ILSimpleGetTextW(LPCITEMIDLIST pidl, LPWSTR szOut, UINT uOutSize)
Definition: pidl.c:2074
#define REFIID
Definition: guiddef.h:118
#define REFCLSID
Definition: guiddef.h:117
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define memset(x, y, z)
Definition: compat.h:39
#define SEE_MASK_WAITFORINPUTIDLE
Definition: shellapi.h:58
static PCUIDLIST_RELATIVE HIDA_GetPIDLItem(CIDA const *pida, SIZE_T i)
Definition: shellutils.h:619
HRESULT HResultFromWin32(DWORD hr)
Definition: shellutils.h:70
static PCUIDLIST_ABSOLUTE HIDA_GetPIDLFolder(CIDA const *pida)
Definition: shellutils.h:614
#define MAKE_COMPARE_HRESULT(x)
Definition: shellutils.h:607
static BOOL ILIsSingle(LPCITEMIDLIST pidl)
Definition: shellutils.h:609
BOOL WINAPI DECLSPEC_HOTPATCH ShellExecuteExW(LPSHELLEXECUTEINFOW sei)
Definition: shlexec.cpp:2455
HRESULT hr
Definition: shlfolder.c:183
HRESULT SHELL32_CoCreateInitSF(LPCITEMIDLIST pidlRoot, PERSIST_FOLDER_TARGET_INFO *ppfti, LPCITEMIDLIST pidlChild, const GUID *clsid, REFIID riid, LPVOID *ppvOut)
Definition: shlfolder.cpp:130
HRESULT SHELL32_BindToSF(LPCITEMIDLIST pidlRoot, PERSIST_FOLDER_TARGET_INFO *ppfti, LPCITEMIDLIST pidl, const GUID *clsid, REFIID riid, LPVOID *ppvOut)
Definition: shlfolder.cpp:168
static DWORD WINAPI _ShowPropertiesDialogThread(LPVOID lpParameter)
Definition: shlfolder.cpp:472
HRESULT SHELL32_GetDisplayNameOfChild(IShellFolder2 *psf, LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet)
Definition: shlfolder.cpp:206
HRESULT SHELL32_CompareChildren(IShellFolder2 *psf, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: shlfolder.cpp:224
void AddFSClassKeysToArray(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, HKEY *array, UINT *cKeys)
Definition: shlfolder.cpp:299
LSTATUS AddClsidKeyToArray(REFCLSID clsid, HKEY *array, UINT *cKeys)
Definition: shlfolder.cpp:292
LSTATUS AddClassKeyToArray(const WCHAR *szClass, HKEY *array, UINT *cKeys)
Definition: shlfolder.cpp:277
HRESULT SHELL32_CompareDetails(IShellFolder2 *isf, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: shlfolder.cpp:247
HRESULT SH_GetApidlFromDataObject(IDataObject *pDataObject, PIDLIST_ABSOLUTE *ppidlfolder, PUITEMID_CHILD **apidlItems, UINT *pcidl)
Definition: shlfolder.cpp:368
HRESULT Shell_NextElement(_Inout_ LPWSTR *ppch, _Out_ LPWSTR pszOut, _In_ INT cchOut, _In_ BOOL bValidate)
Definition: shlfolder.cpp:30
EXTERN_C HRESULT WINAPI SHOpenFolderAndSelectItems(PCIDLIST_ABSOLUTE pidlFolder, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD dwFlags)
Definition: shlfolder.cpp:409
HRESULT SHELL32_DefaultContextMenuCallBack(IShellFolder *psf, IDataObject *pdo, UINT msg)
Definition: shlfolder.cpp:522
HRESULT SHELL32_ParseNextElement(IShellFolder2 *psf, HWND hwndOwner, LPBC pbc, LPITEMIDLIST *pidlInOut, LPOLESTR szNext, DWORD *pEaten, DWORD *pdwAttributes)
Definition: shlfolder.cpp:79
HRESULT SHELL32_ShowPropertiesDialog(IDataObject *pdtobj)
Definition: shlfolder.cpp:504
HRESULT WINAPI SHCreateLinks(HWND hWnd, LPCSTR lpszDir, IDataObject *lpDataObject, UINT uFlags, LPITEMIDLIST *lppidlLinks)
Definition: shlfolder.cpp:395
#define CTF_PROCESS_REF
Definition: shlwapi.h:1935
#define PathFindExtension
Definition: shlwapi.h:907
#define CTF_COINIT
Definition: shlwapi.h:1936
#define CTF_INSIST
Definition: shlwapi.h:1933
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
ITEMID_CHILD UNALIGNED * PUITEMID_CHILD
Definition: shtypes.idl:68
const PCUITEMID_CHILD * PCUITEMID_CHILD_ARRAY
Definition: shtypes.idl:71
const ITEMID_CHILD UNALIGNED * PCUITEMID_CHILD
Definition: shtypes.idl:70
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
ITEMIDLIST_RELATIVE UNALIGNED * PUIDLIST_RELATIVE
Definition: shtypes.idl:55
#define _countof(array)
Definition: sndvol32.h:70
#define TRACE(s)
Definition: solgame.cpp:4
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
STRSAFEAPI StringCchCopyNW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc, size_t cchToCopy)
Definition: strsafe.h:236
WCHAR wszName[1]
Definition: shlfolder.c:1555
LPCWSTR lpParameters
Definition: shellapi.h:333
Definition: name.c:39
uint16_t * PWSTR
Definition: typedefs.h:56
int32_t INT
Definition: typedefs.h:58
int ret
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
LONG_PTR LPARAM
Definition: windef.h:208
#define WINAPI
Definition: msvc.h:6
#define S_FALSE
Definition: winerror.h:2357
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
#define IID_PPV_ARG(Itype, ppType)
const char * LPCSTR
Definition: xmlstorage.h:183
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185