ReactOS 0.4.15-dev-8061-g57b775e
precomp.h File Reference
#include <stdarg.h>
#include <assert.h>
#include <windef.h>
#include <winbase.h>
#include <winreg.h>
#include <winuser.h>
#include <wincon.h>
#include <commdlg.h>
#include <ddeml.h>
#include <userenv.h>
#include <shlwapi.h>
#include <wininet.h>
#include <shlobj.h>
#include <shobjidl.h>
#include <ndk/rtlfuncs.h>
#include <fmifs/fmifs.h>
#include <tchar.h>
#include <strsafe.h>
#include <atlbase.h>
#include <atlcom.h>
#include <atlwin.h>
#include <atlstr.h>
#include <atlsimpcoll.h>
#include <atlcoll.h>
#include <powrprof.h>
#include <winnetwk.h>
#include <objsafe.h>
#include <comctl32_undoc.h>
#include <shlguid_undoc.h>
#include <shlobj_undoc.h>
#include <shlwapi_undoc.h>
#include <shellapi.h>
#include <undocshell.h>
#include <browseui_undoc.h>
#include <shellutils.h>
#include "shellrecyclebin/recyclebin.h"
#include "wine/pidl.h"
#include "debughlp.h"
#include "wine/shell32_main.h"
#include "shresdef.h"
#include "wine/cpanel.h"
#include "CActiveDesktop.h"
#include "CEnumIDListBase.h"
#include "shfldr.h"
#include "CShellItem.h"
#include "CShellLink.h"
#include "CFolderItemVerbs.h"
#include "CFolderItems.h"
#include "CFolder.h"
#include "CShellDispatch.h"
#include "CDropTargetHelper.h"
#include "CFolderOptions.h"
#include "folders/CFSFolder.h"
#include "folders/CDrivesFolder.h"
#include "folders/CDesktopFolder.h"
#include "folders/CControlPanelFolder.h"
#include "folders/CMyDocsFolder.h"
#include "folders/CNetFolder.h"
#include "folders/CFontsFolder.h"
#include "folders/CPrinterFolder.h"
#include "folders/CAdminToolsFolder.h"
#include "folders/CRecycleBin.h"
#include "droptargets/CexeDropHandler.h"
#include "droptargets/CFSDropTarget.h"
#include "COpenWithMenu.h"
#include "CNewMenu.h"
#include "CSendToMenu.h"
#include "CCopyMoveToMenu.h"
#include "CCopyAsPathMenu.h"
#include "dialogs/filedefext.h"
#include "dialogs/drvdefext.h"
#include "CQueryAssociations.h"
#include "shellmenu/CMenuBand.h"
#include "shellmenu/CMenuDeskBar.h"
#include "shellmenu/CMenuSite.h"
#include "shellmenu/CMergedFolder.h"
#include "shellmenu/shellmenu.h"
#include "CUserNotification.h"
#include "dialogs/folder_options.h"
#include "shelldesktop/CChangeNotifyServer.h"
#include <wine/debug.h>
#include <wine/unicode.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  CStubWindow32
 

Macros

#define COBJMACROS
 
#define WIN32_NO_STATUS
 
#define _INC_WINDOWS
 
#define COM_NO_WINDOWS_H
 
#define NTOS_MODE_USER
 
#define ShellMessageBoxW   ShellMessageBoxWrapW
 
#define MAX_PROPERTY_SHEET_PAGE   32
 

Functions

BOOL CALLBACK AddPropSheetPageCallback (HPROPSHEETPAGE hPage, LPARAM lParam)
 
HRESULT WINAPI Shell_DefaultContextMenuCallBack (IShellFolder *psf, IDataObject *pdtobj)
 
HRESULT Shell_TranslateIDListAlias (_In_ LPCITEMIDLIST pidl, _In_ HANDLE hToken, _Out_ LPITEMIDLIST *ppidlAlias, _In_ DWORD dwFlags)
 
BOOL BindCtx_ContainsObject (_In_ IBindCtx *pBindCtx, _In_ LPCWSTR pszName)
 
DWORD BindCtx_GetMode (_In_ IBindCtx *pbc, _In_ DWORD dwDefault)
 
BOOL SHSkipJunctionBinding (_In_ IBindCtx *pbc, _In_ CLSID *pclsid)
 
HRESULT SHIsFileSysBindCtx (_In_ IBindCtx *pBindCtx, _Out_opt_ WIN32_FIND_DATAW *pFindData)
 
BOOL Shell_FailForceReturn (_In_ HRESULT hr)
 
EXTERN_C INT Shell_ParseSpecialFolder (_In_ LPCWSTR pszStart, _Out_ LPWSTR *ppch, _Out_ INT *pcch)
 
HRESULT Shell_DisplayNameOf (_In_ IShellFolder *psf, _In_ LPCITEMIDLIST pidl, _In_ DWORD dwFlags, _Out_ LPWSTR pszBuf, _In_ UINT cchBuf)
 
HRESULT SHBindToObject (_In_opt_ IShellFolder *psf, _In_ LPCITEMIDLIST pidl, _In_ REFIID riid, _Out_ void **ppvObj)
 
HRESULT SHBindToObjectEx (_In_opt_ IShellFolder *pShellFolder, _In_ LPCITEMIDLIST pidl, _In_opt_ IBindCtx *pBindCtx, _In_ REFIID riid, _Out_ void **ppvObj)
 
DWORD SHGetAttributes (_In_ IShellFolder *psf, _In_ LPCITEMIDLIST pidl, _In_ DWORD dwAttributes)
 
HRESULT SHCoInitializeAnyApartment (VOID)
 
HRESULT SHGetNameAndFlagsW (_In_ LPCITEMIDLIST pidl, _In_ DWORD dwFlags, _Out_opt_ LPWSTR pszText, _In_ UINT cchBuf, _Inout_opt_ DWORD *pdwAttributes)
 
EXTERN_C HWND BindCtx_GetUIWindow (_In_ IBindCtx *pBindCtx)
 
EXTERN_C HRESULT BindCtx_RegisterObjectParam (_In_ IBindCtx *pBindCtx, _In_ LPOLESTR pszKey, _In_opt_ IUnknown *punk, _Out_ LPBC *ppbc)
 
BOOL PathIsDotOrDotDotW (_In_ LPCWSTR pszPath)
 
BOOL PathIsValidElement (_In_ LPCWSTR pszPath)
 
BOOL PathIsDosDevice (_In_ LPCWSTR pszName)
 
HRESULT SHILAppend (_Inout_ LPITEMIDLIST pidl, _Inout_ LPITEMIDLIST *ppidl)
 

Variables

const GUID CLSID_AdminFolderShortcut
 
const GUID CLSID_FontsFolderShortcut
 
const GUID CLSID_StartMenu
 
const GUID CLSID_MenuBandSite
 
const GUID CLSID_OpenWith
 
const GUID CLSID_UnixFolder
 
const GUID CLSID_UnixDosFolder
 
const GUID SHELL32_AdvtShortcutProduct
 
const GUID SHELL32_AdvtShortcutComponent
 

Macro Definition Documentation

◆ _INC_WINDOWS

#define _INC_WINDOWS

Definition at line 9 of file precomp.h.

◆ COBJMACROS

#define COBJMACROS

Definition at line 7 of file precomp.h.

◆ COM_NO_WINDOWS_H

#define COM_NO_WINDOWS_H

Definition at line 10 of file precomp.h.

◆ MAX_PROPERTY_SHEET_PAGE

#define MAX_PROPERTY_SHEET_PAGE   32

Definition at line 125 of file precomp.h.

◆ NTOS_MODE_USER

#define NTOS_MODE_USER

Definition at line 11 of file precomp.h.

◆ ShellMessageBoxW

#define ShellMessageBoxW   ShellMessageBoxWrapW

Definition at line 59 of file precomp.h.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 8 of file precomp.h.

Function Documentation

◆ AddPropSheetPageCallback()

BOOL CALLBACK AddPropSheetPageCallback ( HPROPSHEETPAGE  hPage,
LPARAM  lParam 
)
inline

Definition at line 130 of file precomp.h.

131{
133
134 if (pHeader->nPages < MAX_PROPERTY_SHEET_PAGE)
135 {
136 pHeader->phpage[pHeader->nPages++] = hPage;
137 return TRUE;
138 }
139
140 return FALSE;
141}
LPARAM lParam
Definition: combotst.c:139
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define MAX_PROPERTY_SHEET_PAGE
Definition: precomp.h:125
FxContextHeader * pHeader
Definition: handleapi.cpp:604

Referenced by LoadPropSheetHandlers(), SH_ShowDriveProperties(), and SH_ShowPropertiesDialog().

◆ BindCtx_ContainsObject()

BOOL BindCtx_ContainsObject ( _In_ IBindCtx pBindCtx,
_In_ LPCWSTR  pszName 
)

Definition at line 106 of file utils.cpp.

107{
109 if (!pBindCtx || FAILED(pBindCtx->GetObjectParam(const_cast<LPWSTR>(pszName), &punk)))
110 return FALSE;
111 return TRUE;
112}
#define FAILED(hr)
Definition: intsafe.h:51
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by CDesktopFolder::_ParseDisplayNameByParent(), CDesktopFolder::ParseDisplayName(), and CDesktopFolder::ShellUrlParseDisplayName().

◆ BindCtx_GetMode()

DWORD BindCtx_GetMode ( _In_ IBindCtx pbc,
_In_ DWORD  dwDefault 
)

Definition at line 114 of file utils.cpp.

115{
116 if (!pbc)
117 return dwDefault;
118
119 BIND_OPTS BindOpts = { sizeof(BindOpts) };
120 HRESULT hr = pbc->GetBindOptions(&BindOpts);
121 if (FAILED(hr))
122 return dwDefault;
123
124 return BindOpts.grfMode;
125}
HRESULT hr
Definition: shlfolder.c:183

Referenced by CDrivesFolder::ParseDisplayName(), CFSFolder::ParseDisplayName(), and CRegFolder::ParseDisplayName().

◆ BindCtx_GetUIWindow()

EXTERN_C HWND BindCtx_GetUIWindow ( _In_ IBindCtx pBindCtx)

Definition at line 313 of file utils.cpp.

314{
315 HWND hWnd = NULL;
316
318 if (pBindCtx && SUCCEEDED(pBindCtx->GetObjectParam((LPWSTR)L"UI During Binding", &punk)))
319 IUnknown_GetWindow(punk, &hWnd);
320
321 return hWnd;
322}
HWND hWnd
Definition: settings.c:17
#define NULL
Definition: types.h:112
HRESULT WINAPI IUnknown_GetWindow(IUnknown *lpUnknown, HWND *lphWnd)
Definition: ordinal.c:1332
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define L(x)
Definition: ntvdm.h:50

◆ BindCtx_RegisterObjectParam()

EXTERN_C HRESULT BindCtx_RegisterObjectParam ( _In_ IBindCtx pBindCtx,
_In_ LPOLESTR  pszKey,
_In_opt_ IUnknown punk,
_Out_ LPBC ppbc 
)

Definition at line 373 of file utils.cpp.

378{
379 HRESULT hr = S_OK;
381
382 *ppbc = pBindCtx;
383
384 if (pBindCtx)
385 {
386 pBindCtx->AddRef();
387 }
388 else
389 {
390 hr = CreateBindCtx(0, ppbc);
391 if (FAILED(hr))
392 return hr;
393 }
394
395 if (!punk)
396 punk = pUnknown = new CDummyOleWindow();
397
398 hr = (*ppbc)->RegisterObjectParam(pszKey, punk);
399
400 if (pUnknown)
401 pUnknown->Release();
402
403 if (FAILED(hr))
404 {
405 (*ppbc)->Release();
406 *ppbc = NULL;
407 }
408
409 return hr;
410}
_In_ PUNKNOWN pUnknown
Definition: drmk.h:76
ULONG Release()
#define S_OK
Definition: intsafe.h:52
HRESULT WINAPI CreateBindCtx(DWORD reserved, LPBC *ppbc)
Definition: bindctx.c:556

◆ PathIsDosDevice()

BOOL PathIsDosDevice ( _In_ LPCWSTR  pszName)

Definition at line 38 of file utils.cpp.

39{
43
44 if (lstrcmpiW(szPath, L"NUL") == 0 || lstrcmpiW(szPath, L"PRN") == 0 ||
45 lstrcmpiW(szPath, L"CON") == 0 || lstrcmpiW(szPath, L"AUX") == 0)
46 {
47 return TRUE;
48 }
49
50 if (_wcsnicmp(szPath, L"LPT", 3) == 0 || _wcsnicmp(szPath, L"COM", 3) == 0)
51 {
52 if ((L'0' <= szPath[3] && szPath[3] <= L'9') && szPath[4] == UNICODE_NULL)
53 return TRUE;
54 }
55
56 return FALSE;
57}
#define MAX_PATH
Definition: compat.h:34
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4261
void WINAPI PathRemoveExtensionW(LPWSTR lpszPath)
Definition: path.c:823
LPCWSTR szPath
Definition: env.c:37
#define UNICODE_NULL
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
#define _countof(array)
Definition: sndvol32.h:68
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by CFSFolder::_CreateIDListFromName().

◆ PathIsDotOrDotDotW()

BOOL PathIsDotOrDotDotW ( _In_ LPCWSTR  pszPath)

Definition at line 12 of file utils.cpp.

13{
14 if (pszPath[0] != L'.')
15 return FALSE;
16 return !pszPath[1] || (pszPath[1] == L'.' && !pszPath[2]);
17}

Referenced by PathIsValidElement().

◆ PathIsValidElement()

BOOL PathIsValidElement ( _In_ LPCWSTR  pszPath)

Definition at line 24 of file utils.cpp.

25{
26 if (!*pszPath || PathIsDotOrDotDotW(pszPath))
27 return FALSE;
28
29 for (LPCWSTR pch = pszPath; *pch; ++pch)
30 {
32 return FALSE;
33 }
34
35 return TRUE;
36}
#define PATH_VALID_ELEMENT
Definition: utils.cpp:19
BOOL PathIsDotOrDotDotW(_In_ LPCWSTR pszPath)
Definition: utils.cpp:12
BOOL WINAPI PathIsValidCharW(WCHAR c, DWORD class)
Definition: path.c:4419
#define pch(ap)
Definition: match.c:418
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by Shell_NextElement().

◆ SHBindToObject()

HRESULT SHBindToObject ( _In_opt_ IShellFolder psf,
_In_ LPCITEMIDLIST  pidl,
_In_ REFIID  riid,
_Out_ void **  ppvObj 
)

Definition at line 205 of file utils.cpp.

210{
211 return SHBindToObjectEx(psf, pidl, NULL, riid, ppvObj);
212}
HRESULT SHBindToObjectEx(_In_opt_ IShellFolder *pShellFolder, _In_ LPCITEMIDLIST pidl, _In_opt_ IBindCtx *pBindCtx, _In_ REFIID riid, _Out_ void **ppvObj)
Definition: utils.cpp:173
REFIID riid
Definition: atlbase.h:39

Referenced by CDesktopFolder::_ParseDisplayNameByParent(), Shell_ParsePrinterName(), and CDesktopFolder::ShellUrlParseDisplayName().

◆ SHBindToObjectEx()

HRESULT SHBindToObjectEx ( _In_opt_ IShellFolder pShellFolder,
_In_ LPCITEMIDLIST  pidl,
_In_opt_ IBindCtx pBindCtx,
_In_ REFIID  riid,
_Out_ void **  ppvObj 
)

Definition at line 173 of file utils.cpp.

179{
180 CComPtr<IShellFolder> psfDesktop;
181
182 *ppvObj = NULL;
183
184 if (!pShellFolder)
185 {
186 SHGetDesktopFolder(&psfDesktop);
187 if (!psfDesktop)
188 return E_FAIL;
189
190 pShellFolder = psfDesktop;
191 }
192
193 HRESULT hr;
194 if (_ILIsDesktop(pidl))
195 hr = pShellFolder->QueryInterface(riid, ppvObj);
196 else
197 hr = pShellFolder->BindToObject(pidl, pBindCtx, riid, ppvObj);
198
199 if (SUCCEEDED(hr) && !*ppvObj)
200 hr = E_FAIL;
201
202 return hr;
203}
BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
Definition: CBandSite.h:24
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
#define E_FAIL
Definition: ddrawi.h:102
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)

Referenced by SHBindToObject().

◆ SHCoInitializeAnyApartment()

HRESULT SHCoInitializeAnyApartment ( VOID  )

Definition at line 270 of file utils.cpp.

271{
273 if (FAILED(hr))
275 return hr;
276}
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
Definition: compobj.c:2002
@ COINIT_APARTMENTTHREADED
Definition: objbase.h:278
@ COINIT_DISABLE_OLE1DDE
Definition: objbase.h:280

Referenced by SHGetNameAndFlagsW().

◆ Shell_DefaultContextMenuCallBack()

HRESULT WINAPI Shell_DefaultContextMenuCallBack ( IShellFolder psf,
IDataObject pdtobj 
)

Definition at line 497 of file shlfolder.cpp.

498{
499 pdtobj->AddRef();
501 {
502 pdtobj->Release();
504 }
505 else
506 {
507 return S_OK;
508 }
509}
BOOL WINAPI SHCreateThread(LPTHREAD_START_ROUTINE pfnThreadProc, VOID *pData, DWORD dwFlags, LPTHREAD_START_ROUTINE pfnCallback)
Definition: thread.c:356
ULONG AddRef()
static DWORD WINAPI _ShowPropertiesDialogThread(LPVOID lpParameter)
Definition: shlfolder.cpp:465
#define CTF_COINIT
Definition: shlwapi.h:1936
#define CTF_INSIST
Definition: shlwapi.h:1933
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92

Referenced by CDesktopFolder::CallBack(), CDrivesFolder::CallBack(), CFSFolder::CallBack(), and CDefaultContextMenu::DoProperties().

◆ Shell_DisplayNameOf()

HRESULT Shell_DisplayNameOf ( _In_ IShellFolder psf,
_In_ LPCITEMIDLIST  pidl,
_In_ DWORD  dwFlags,
_Out_ LPWSTR  pszBuf,
_In_ UINT  cchBuf 
)

Definition at line 215 of file utils.cpp.

221{
222 *pszBuf = UNICODE_NULL;
223 STRRET sr;
224 HRESULT hr = psf->GetDisplayNameOf(pidl, dwFlags, &sr);
225 if (FAILED(hr))
226 return hr;
227 return StrRetToBufW(&sr, pidl, pszBuf, cchBuf);
228}
HRESULT WINAPI StrRetToBufW(LPSTRRET src, const ITEMIDLIST *pidl, LPWSTR dest, UINT len)
Definition: string.c:1530
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176

Referenced by SHGetNameAndFlagsW().

◆ Shell_FailForceReturn()

BOOL Shell_FailForceReturn ( _In_ HRESULT  hr)

Definition at line 156 of file utils.cpp.

157{
159
160 switch (code)
161 {
164 case ERROR_CANCELLED:
165 return TRUE;
166
167 default:
169 }
170}
unsigned long DWORD
Definition: ntddk_ex.h:95
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
Definition: inflate.c:139
#define ERROR_BAD_NETPATH
Definition: winerror.h:145
#define ERROR_PATH_NOT_FOUND
Definition: winerror.h:106
#define ERROR_CANCELLED
Definition: winerror.h:726
#define HRESULT_CODE(hr)
Definition: winerror.h:76
#define ERROR_BAD_NET_NAME
Definition: winerror.h:159

Referenced by CDesktopFolder::ParseDisplayName(), and CDesktopFolder::ShellUrlParseDisplayName().

◆ Shell_ParseSpecialFolder()

EXTERN_C INT Shell_ParseSpecialFolder ( _In_ LPCWSTR  pszStart,
_Out_ LPWSTR ppch,
_Out_ INT pcch 
)

Definition at line 1859 of file shellpath.c.

1860{
1861 LPCWSTR pszPath, pchBackslash;
1863
1864 pchBackslash = StrChrW(pszStart, L'\\');
1865 if (pchBackslash)
1866 {
1867 *ppch = (LPWSTR)(pchBackslash + 1);
1868 *pcch = (pchBackslash - pszStart) + 1;
1869 StrCpyNW(szPath, pszStart, max(*pcch, _countof(szPath)));
1870 pszPath = szPath;
1871 }
1872 else
1873 {
1874 *ppch = NULL;
1875 *pcch = lstrlenW(pszStart);
1876 pszPath = pszStart;
1877 }
1878
1879 return SHGetSpecialFolderID(pszPath);
1880}
LPWSTR WINAPI StrChrW(LPCWSTR lpszStr, WCHAR ch)
Definition: string.c:468
#define lstrlenW
Definition: compat.h:750
INT SHGetSpecialFolderID(_In_ LPCWSTR pszName)
Definition: shellpath.c:1845
LPWSTR WINAPI StrCpyNW(LPWSTR dst, LPCWSTR src, int count)
Definition: string.c:536
#define max(a, b)
Definition: svc.c:63

Referenced by CDesktopFolder::ShellUrlParseDisplayName().

◆ Shell_TranslateIDListAlias()

HRESULT Shell_TranslateIDListAlias ( _In_ LPCITEMIDLIST  pidl,
_In_ HANDLE  hToken,
_Out_ LPITEMIDLIST ppidlAlias,
_In_ DWORD  dwFlags 
)

Definition at line 97 of file utils.cpp.

102{
103 return E_FAIL; //FIXME
104}

Referenced by CDesktopFolder::ParseDisplayName().

◆ SHGetAttributes()

DWORD SHGetAttributes ( _In_ IShellFolder psf,
_In_ LPCITEMIDLIST  pidl,
_In_ DWORD  dwAttributes 
)

Definition at line 231 of file utils.cpp.

232{
233 LPCITEMIDLIST pidlLast;
234
235 if (psf)
236 {
237 psf->AddRef();
238 pidlLast = pidl;
239 }
240 else
241 {
242 SHBindToParent(pidl, IID_PPV_ARG(IShellFolder, &psf), &pidlLast);
243 }
244
245 if (!psf)
246 return 0;
247
248 DWORD oldAttrs = dwAttributes;
249 if (FAILED(psf->GetAttributesOf(1, &pidlLast, &dwAttributes)))
250 dwAttributes = 0;
251 else
252 dwAttributes &= oldAttrs;
253
254 if ((dwAttributes & SFGAO_FOLDER) &&
255 (dwAttributes & SFGAO_STREAM) &&
256 !(dwAttributes & SFGAO_STORAGEANCESTOR) &&
257 (oldAttrs & SFGAO_STORAGEANCESTOR) &&
258 (SHGetObjectCompatFlags(psf, NULL) & 0x200))
259 {
260 dwAttributes &= ~(SFGAO_STREAM | SFGAO_STORAGEANCESTOR);
261 dwAttributes |= SFGAO_STORAGEANCESTOR;
262 }
263
264 if (psf)
265 psf->Release();
266
267 return dwAttributes;
268}
DWORD WINAPI SHGetObjectCompatFlags(IUnknown *pUnk, const CLSID *clsid)
Definition: ordinal.c:6278
HRESULT WINAPI SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv, LPCITEMIDLIST *ppidlLast)
Definition: pidl.c:1361
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
DWORD dwAttributes
Definition: vdmdbg.h:34
#define IID_PPV_ARG(Itype, ppType)

Referenced by SHGetNameAndFlagsW().

◆ SHGetNameAndFlagsW()

HRESULT SHGetNameAndFlagsW ( _In_ LPCITEMIDLIST  pidl,
_In_ DWORD  dwFlags,
_Out_opt_ LPWSTR  pszText,
_In_ UINT  cchBuf,
_Inout_opt_ DWORD pdwAttributes 
)

Definition at line 279 of file utils.cpp.

285{
286 if (pszText)
287 *pszText = UNICODE_NULL;
288
290
291 CComPtr<IShellFolder> psfFolder;
292 LPCITEMIDLIST ppidlLast;
293 HRESULT hr = SHBindToParent(pidl, IID_PPV_ARG(IShellFolder, &psfFolder), &ppidlLast);
294 if (SUCCEEDED(hr))
295 {
296 if (pszText)
297 hr = Shell_DisplayNameOf(psfFolder, ppidlLast, dwFlags, pszText, cchBuf);
298
299 if (SUCCEEDED(hr))
300 {
301 if (pdwAttributes)
302 *pdwAttributes = SHGetAttributes(psfFolder, ppidlLast, *pdwAttributes);
303 }
304 }
305
306 if (SUCCEEDED(hrCoInit))
308
309 return hr;
310}
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
HRESULT Shell_DisplayNameOf(_In_ IShellFolder *psf, _In_ LPCITEMIDLIST pidl, _In_ DWORD dwFlags, _Out_ LPWSTR pszBuf, _In_ UINT cchBuf)
Definition: utils.cpp:215
DWORD SHGetAttributes(_In_ IShellFolder *psf, _In_ LPCITEMIDLIST pidl, _In_ DWORD dwAttributes)
Definition: utils.cpp:231
HRESULT SHCoInitializeAnyApartment(VOID)
Definition: utils.cpp:270

Referenced by CDesktopFolder::ShellUrlParseDisplayName().

◆ SHILAppend()

HRESULT SHILAppend ( _Inout_ LPITEMIDLIST  pidl,
_Inout_ LPITEMIDLIST ppidl 
)

Definition at line 59 of file utils.cpp.

60{
61 LPITEMIDLIST pidlOld = *ppidl;
62 if (!pidlOld)
63 {
64 *ppidl = pidl;
65 return S_OK;
66 }
67
68 HRESULT hr = SHILCombine(*ppidl, pidl, ppidl);
69 ILFree(pidlOld);
70 ILFree(pidl);
71 return hr;
72}
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:938
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41

Referenced by CFSFolder::_ParseSimple(), and CFSFolder::ParseDisplayName().

◆ SHIsFileSysBindCtx()

HRESULT SHIsFileSysBindCtx ( _In_ IBindCtx pBindCtx,
_Out_opt_ WIN32_FIND_DATAW pFindData 
)

Definition at line 139 of file utils.cpp.

140{
143
144 if (!pBindCtx || FAILED(pBindCtx->GetObjectParam((LPWSTR)STR_FILE_SYS_BIND_DATA, &punk)))
145 return S_FALSE;
146
147 if (FAILED(punk->QueryInterface(IID_PPV_ARG(IFileSystemBindData, &pBindData))))
148 return S_FALSE;
149
150 if (pFindData)
151 pBindData->GetFindData(pFindData);
152
153 return S_OK;
154}
#define S_FALSE
Definition: winerror.h:2357

Referenced by CDesktopFolder::ParseDisplayName(), CDrivesFolder::ParseDisplayName(), and CFSFolder::ParseDisplayName().

◆ SHSkipJunctionBinding()

BOOL SHSkipJunctionBinding ( _In_ IBindCtx pbc,
_In_ CLSID pclsid 
)

Definition at line 127 of file utils.cpp.

128{
129 if (!pbc)
130 return FALSE;
131
132 BIND_OPTS BindOps = { sizeof(BindOps) };
133 if (SUCCEEDED(pbc->GetBindOptions(&BindOps)) && BindOps.grfFlags == OLECONTF_LINKS)
134 return TRUE;
135
136 return pclsid && SHSkipJunction(pbc, pclsid);
137}
BOOL WINAPI SHSkipJunction(IBindCtx *pbc, const CLSID *pclsid)
Definition: ordinal.c:4558

Referenced by CDesktopFolder::_ParseDisplayNameByParent().

Variable Documentation

◆ CLSID_AdminFolderShortcut

◆ CLSID_FontsFolderShortcut

const GUID CLSID_FontsFolderShortcut
extern

◆ CLSID_MenuBandSite

◆ CLSID_OpenWith

const GUID CLSID_OpenWith
extern

◆ CLSID_StartMenu

◆ CLSID_UnixDosFolder

const GUID CLSID_UnixDosFolder
extern

Referenced by test_FolderShortcut().

◆ CLSID_UnixFolder

const GUID CLSID_UnixFolder
extern

◆ SHELL32_AdvtShortcutComponent

const GUID SHELL32_AdvtShortcutComponent
extern

◆ SHELL32_AdvtShortcutProduct

const GUID SHELL32_AdvtShortcutProduct
extern