ReactOS 0.4.16-dev-251-ga17b6e9
utility.cpp File Reference
#include "objects.h"
#include <wine/debug.h>
Include dependency graph for utility.cpp:

Go to the source code of this file.

Macros

#define SHCIDS_CANONICALONLY   0x10000000L
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (shdocvw)
 
EXTERN_C HRESULT SHELL_GetIDListFromObject (IUnknown *punk, PIDLIST_ABSOLUTE *ppidl)
 
static HRESULT SHELL_CompareAbsoluteIDs (LPARAM lParam, PCIDLIST_ABSOLUTE a, PCIDLIST_ABSOLUTE b)
 
EXTERN_C BOOL SHELL_IsEqualAbsoluteID (PCIDLIST_ABSOLUTE a, PCIDLIST_ABSOLUTE b)
 
EXTERN_C BOOL SHELL_IsVerb (IContextMenu *pcm, UINT_PTR idCmd, LPCWSTR Verb)
 
EXTERN_C BOOL _ILIsDesktop (LPCITEMIDLIST pidl)
 
EXTERN_C BOOL WINAPI IEILIsEqual (_In_ LPCITEMIDLIST pidl1, _In_ LPCITEMIDLIST pidl2, _In_ BOOL bUnknown)
 

Macro Definition Documentation

◆ SHCIDS_CANONICALONLY

#define SHCIDS_CANONICALONLY   0x10000000L

Definition at line 14 of file utility.cpp.

Function Documentation

◆ _ILIsDesktop()

EXTERN_C BOOL _ILIsDesktop ( LPCITEMIDLIST  pidl)
inline

Definition at line 75 of file utility.cpp.

76{
77 return (pidl == NULL || pidl->mkid.cb == 0);
78}
#define NULL
Definition: types.h:112

◆ IEILIsEqual()

EXTERN_C BOOL WINAPI IEILIsEqual ( _In_ LPCITEMIDLIST  pidl1,
_In_ LPCITEMIDLIST  pidl2,
_In_ BOOL  bUnknown 
)

Definition at line 84 of file utility.cpp.

88{
89 UINT cb1 = ILGetSize(pidl1), cb2 = ILGetSize(pidl2);
90 if (cb1 == cb2 && memcmp(pidl1, pidl2, cb1) == 0)
91 return TRUE;
92
93 FIXME("%p, %p\n", pidl1, pidl2);
94 return FALSE;
95}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#define FIXME(fmt,...)
Definition: precomp.h:53
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
unsigned int UINT
Definition: ndis.h:50
#define ILGetSize
Definition: shellclasses.h:638

Referenced by CMruBase::_IsEqual().

◆ SHELL_CompareAbsoluteIDs()

static HRESULT SHELL_CompareAbsoluteIDs ( LPARAM  lParam,
PCIDLIST_ABSOLUTE  a,
PCIDLIST_ABSOLUTE  b 
)
static

Definition at line 40 of file utility.cpp.

41{
42 IShellFolder *psf;
44 if (FAILED(hr))
45 return hr;
46 hr = psf->CompareIDs(lParam, a, b);
47 psf->Release();
48 return hr;
49}
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
LPARAM lParam
Definition: combotst.c:139
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
HRESULT CompareIDs([in] LPARAM lParam, [in] PCUIDLIST_RELATIVE pidl1, [in] PCUIDLIST_RELATIVE pidl2)
ULONG Release()
#define FAILED(hr)
Definition: intsafe.h:51
HRESULT hr
Definition: shlfolder.c:183

Referenced by SHELL_IsEqualAbsoluteID().

◆ SHELL_GetIDListFromObject()

EXTERN_C HRESULT SHELL_GetIDListFromObject ( IUnknown punk,
PIDLIST_ABSOLUTE ppidl 
)

Definition at line 18 of file utility.cpp.

19{
20#if DLL_EXPORT_VERSION >= _WIN32_WINNT_VISTA && 0 // FIXME: SHELL32 not ready yet
21 return SHGetIDListFromObject(punk, ppidl);
22#else
23 HRESULT hr;
24 IPersistFolder2 *pf2;
26 {
27 hr = pf2->GetCurFolder(ppidl);
28 pf2->Release();
29 }
30 IPersistIDList *pil;
32 {
33 hr = pil->GetIDList(ppidl);
34 pil->Release();
35 }
36 return hr;
37#endif
38}
HRESULT GetCurFolder([out] PIDLIST_ABSOLUTE *ppidl)
HRESULT GetIDList([out] PIDLIST_ABSOLUTE *ppidl)
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
#define SUCCEEDED(hr)
Definition: intsafe.h:50
HRESULT WINAPI SHGetIDListFromObject(IUnknown *punk, PIDLIST_ABSOLUTE *ppidl)
Definition: pidl.c:1525
#define IID_PPV_ARG(Itype, ppType)

Referenced by SHDOCVW_GetCurrentLocationFromView().

◆ SHELL_IsEqualAbsoluteID()

EXTERN_C BOOL SHELL_IsEqualAbsoluteID ( PCIDLIST_ABSOLUTE  a,
PCIDLIST_ABSOLUTE  b 
)

Definition at line 52 of file utility.cpp.

53{
55}
#define SHCIDS_CANONICALONLY
Definition: utility.cpp:14
static HRESULT SHELL_CompareAbsoluteIDs(LPARAM lParam, PCIDLIST_ABSOLUTE a, PCIDLIST_ABSOLUTE b)
Definition: utility.cpp:40

◆ SHELL_IsVerb()

EXTERN_C BOOL SHELL_IsVerb ( IContextMenu pcm,
UINT_PTR  idCmd,
LPCWSTR  Verb 
)

Definition at line 58 of file utility.cpp.

59{
60 HRESULT hr;
61 WCHAR wide[MAX_PATH];
62 if (SUCCEEDED(hr = pcm->GetCommandString(idCmd, GCS_VERBW, NULL, (LPSTR)wide, _countof(wide))))
63 return !lstrcmpiW(wide, Verb);
64
65 CHAR ansi[_countof(wide)], buf[MAX_PATH];
66 if (SHUnicodeToAnsi(Verb, buf, _countof(buf)))
67 {
68 if (SUCCEEDED(hr = pcm->GetCommandString(idCmd, GCS_VERBA, NULL, ansi, _countof(ansi))))
69 return !lstrcmpiA(ansi, buf);
70 }
71 return FALSE;
72}
#define MAX_PATH
Definition: compat.h:34
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4262
int WINAPI lstrcmpiA(LPCSTR str1, LPCSTR str2)
Definition: locale.c:4224
INT WINAPI SHUnicodeToAnsi(LPCWSTR lpSrcStr, LPSTR lpDstStr, INT iLen)
Definition: string.c:2791
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
HRESULT GetCommandString([in] UINT_PTR idCmd, [in] UINT uType, [out] UINT *pwReserved, [out, size_is(cchMax)] LPSTR pszName, [in] UINT cchMax)
#define _countof(array)
Definition: sndvol32.h:70
char * LPSTR
Definition: xmlstorage.h:182
__wchar_t WCHAR
Definition: xmlstorage.h:180
char CHAR
Definition: xmlstorage.h:175

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( shdocvw  )