ReactOS 0.4.15-dev-7924-g5949c20
util.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define INLINE   inline
 

Functions

HRESULT INLINE MakeStrRetFromString (LPCWSTR string, DWORD cbLength, STRRET *str)
 
HRESULT INLINE MakeStrRetFromString (LPCWSTR string, STRRET *str)
 
HRESULT INLINE MakeVariantString (VARIANT *pv, PCWSTR string)
 
HRESULT INLINE GetFullName (PCIDLIST_ABSOLUTE pidl, DWORD uFlags, PWSTR strName, DWORD cchName)
 

Macro Definition Documentation

◆ INLINE

#define INLINE   inline

Definition at line 4 of file util.h.

Function Documentation

◆ GetFullName()

HRESULT INLINE GetFullName ( PCIDLIST_ABSOLUTE  pidl,
DWORD  uFlags,
PWSTR  strName,
DWORD  cchName 
)

Definition at line 29 of file util.h.

30{
31 CComPtr<IShellFolder> psfDesktop;
32 STRRET str;
33 HRESULT hr;
34
35 hr = SHGetDesktopFolder(&psfDesktop);
37 return hr;
38
39 hr = psfDesktop->GetDisplayNameOf(pidl, uFlags, &str);
41 return hr;
42
43 return StrRetToBufW(&str, pidl, strName, cchName);
44}
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
UINT uFlags
Definition: api.c:59
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
HRESULT WINAPI StrRetToBufW(LPSTRRET src, const ITEMIDLIST *pidl, LPWSTR dest, UINT len)
Definition: string.c:1530
const WCHAR * str
HRESULT hr
Definition: shlfolder.c:183
_In_ PSID _Out_writes_to_opt_ cchName LPSTR _Inout_ LPDWORD cchName
Definition: winbase.h:2767

Referenced by CCommonFolder< TSelf, TItemId, TExtractIcon >::GetDisplayNameOf().

◆ MakeStrRetFromString() [1/2]

HRESULT INLINE MakeStrRetFromString ( LPCWSTR  string,
DWORD  cbLength,
STRRET str 
)

Definition at line 7 of file util.h.

8{
9 str->uType = STRRET_WSTR;
10
11 DWORD blen = cbLength + sizeof(WCHAR);
12 str->pOleStr = (LPWSTR) CoTaskMemAlloc(blen);
13 return StringCbCopyNW(str->pOleStr, blen, string, cbLength);
14}
unsigned long DWORD
Definition: ntddk_ex.h:95
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
@ STRRET_WSTR
Definition: shtypes.idl:85
STRSAFEAPI StringCbCopyNW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc, size_t cbToCopy)
Definition: strsafe.h:255
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by CNtObjectFolder::GetDetailsOf(), CRegistryFolder::GetDetailsOf(), CCommonFolder< TSelf, TItemId, TExtractIcon >::GetDisplayNameOf(), and MakeStrRetFromString().

◆ MakeStrRetFromString() [2/2]

HRESULT INLINE MakeStrRetFromString ( LPCWSTR  string,
STRRET str 
)

Definition at line 16 of file util.h.

17{
18 DWORD stringLength = wcslen(string) * sizeof(WCHAR);
19 return MakeStrRetFromString(string, stringLength, str);
20}
HRESULT INLINE MakeStrRetFromString(LPCWSTR string, DWORD cbLength, STRRET *str)
Definition: util.h:7
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)

◆ MakeVariantString()

HRESULT INLINE MakeVariantString ( VARIANT pv,
PCWSTR  string 
)

Definition at line 22 of file util.h.

23{
24 V_VT(pv) = VT_BSTR;
25 V_BSTR(pv) = SysAllocString(string);
26 return S_OK;
27}
@ VT_BSTR
Definition: compat.h:2303
#define S_OK
Definition: intsafe.h:52
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226

Referenced by CNtObjectFolder::GetDetailsEx(), and CRegistryFolder::GetDetailsEx().