ReactOS  0.4.15-dev-344-g6808e40
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 hr
Definition: shlfolder.c:183
HRESULT WINAPI StrRetToBufW(LPSTRRET src, const ITEMIDLIST *pidl, LPWSTR dest, UINT len)
Definition: string.c:1522
UINT uFlags
Definition: api.c:59
_In_ PSID _Out_writes_to_opt_ cchName LPSTR _Inout_ LPDWORD cchName
Definition: winbase.h:2729
const WCHAR * str
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
LONG HRESULT
Definition: typedefs.h:78
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71

Referenced by CCommonFolder< CRegistryFolder, RegPidlEntry, CRegistryFolderExtractIcon >::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 }
STRSAFEAPI StringCbCopyNW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc, size_t cbToCopy)
Definition: strsafe.h:255
const WCHAR * str
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
WCHAR * LPWSTR
Definition: xmlstorage.h:184
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426

Referenced by CRegistryFolder::GetDetailsOf(), CNtObjectFolder::GetDetailsOf(), CCommonFolder< CRegistryFolder, RegPidlEntry, CRegistryFolderExtractIcon >::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 }
const WCHAR * str
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
HRESULT INLINE MakeStrRetFromString(LPCWSTR string, DWORD cbLength, STRRET *str)
Definition: util.h:7

◆ 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 }
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
#define S_OK
Definition: intsafe.h:59

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