ReactOS 0.4.15-dev-8222-g9164419
utility.cpp
Go to the documentation of this file.
1#include "precomp.h"
2#ifndef SHCIDS_CANONICALONLY
3#define SHCIDS_CANONICALONLY 0x10000000L
4#endif
5
6void *operator new(size_t size)
7{
9}
10
11void operator delete(void *p)
12{
13 LocalFree(p);
14}
15
16void operator delete(void *p, UINT_PTR)
17{
18 LocalFree(p);
19}
20
22{
23#if DLL_EXPORT_VERSION >= _WIN32_WINNT_VISTA && 0 // FIXME: SHELL32 not ready yet
24 return SHGetIDListFromObject(punk, ppidl);
25#else
26 HRESULT hr;
27 IPersistFolder2 *pf2;
29 {
30 hr = pf2->GetCurFolder(ppidl);
31 pf2->Release();
32 }
33 IPersistIDList *pil;
35 {
36 hr = pil->GetIDList(ppidl);
37 pil->Release();
38 }
39 return hr;
40#endif
41}
42
44{
45 IShellFolder *psf;
47 if (FAILED(hr))
48 return hr;
49 hr = psf->CompareIDs(lParam, a, b);
50 psf->Release();
51 return hr;
52}
53
55{
57}
58
60{
61 HRESULT hr;
62 WCHAR wide[MAX_PATH];
63 if (SUCCEEDED(hr = pcm->GetCommandString(idCmd, GCS_VERBW, NULL, (LPSTR)wide, _countof(wide))))
64 return !lstrcmpiW(wide, Verb);
65
66 CHAR ansi[_countof(wide)], buf[MAX_PATH];
67 if (SHUnicodeToAnsi(Verb, buf, _countof(buf)))
68 {
69 if (SUCCEEDED(hr = pcm->GetCommandString(idCmd, GCS_VERBA, NULL, ansi, _countof(ansi))))
70 return !lstrcmpiA(ansi, buf);
71 }
72 return FALSE;
73}
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
LPARAM lParam
Definition: combotst.c:139
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define SHCIDS_CANONICALONLY
Definition: utility.cpp:3
static HRESULT SHELL_CompareAbsoluteIDs(LPARAM lParam, PCIDLIST_ABSOLUTE a, PCIDLIST_ABSOLUTE b)
Definition: utility.cpp:43
BOOL SHELL_IsVerb(IContextMenu *pcm, UINT_PTR idCmd, LPCWSTR Verb)
Definition: utility.cpp:59
BOOL SHELL_IsEqualAbsoluteID(PCIDLIST_ABSOLUTE a, PCIDLIST_ABSOLUTE b)
Definition: utility.cpp:54
HRESULT SHELL_GetIDListFromObject(IUnknown *punk, PIDLIST_ABSOLUTE *ppidl)
Definition: utility.cpp:21
#define MAX_PATH
Definition: compat.h:34
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4261
int WINAPI lstrcmpiA(LPCSTR str1, LPCSTR str2)
Definition: locale.c:4223
INT WINAPI SHUnicodeToAnsi(LPCWSTR lpSrcStr, LPSTR lpDstStr, INT iLen)
Definition: string.c:2791
unsigned int BOOL
Definition: ntddk_ex.h:94
GLsizeiptr size
Definition: glext.h:5919
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLfloat GLfloat p
Definition: glext.h:8902
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:1390
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
HRESULT GetCommandString([in] UINT_PTR idCmd, [in] UINT uType, [out] UINT *pwReserved, [out, size_is(cchMax)] LPSTR pszName, [in] UINT cchMax)
HRESULT GetCurFolder([out] PIDLIST_ABSOLUTE *ppidl)
HRESULT GetIDList([out] PIDLIST_ABSOLUTE *ppidl)
HRESULT CompareIDs([in] LPARAM lParam, [in] PCUIDLIST_RELATIVE pidl1, [in] PCUIDLIST_RELATIVE pidl2)
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
ULONG Release()
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
HRESULT WINAPI SHGetIDListFromObject(IUnknown *punk, PIDLIST_ABSOLUTE *ppidl)
Definition: pidl.c:1519
HRESULT hr
Definition: shlfolder.c:183
#define _countof(array)
Definition: sndvol32.h:70
#define LMEM_ZEROINIT
Definition: winbase.h:375
LONG_PTR LPARAM
Definition: windef.h:208
#define IID_PPV_ARG(Itype, ppType)
char * LPSTR
Definition: xmlstorage.h:182
__wchar_t WCHAR
Definition: xmlstorage.h:180
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
char CHAR
Definition: xmlstorage.h:175