ReactOS 0.4.17-dev-1190-g4c812f4
shelltest.h File Reference
#include <ntstatus.h>
#include <apitest.h>
#include <winreg.h>
#include <shlobj.h>
#include <shellapi.h>
#include <shlwapi.h>
#include <atlbase.h>
#include <atlcom.h>
Include dependency graph for shelltest.h:

Go to the source code of this file.

Macros

#define COM_NO_WINDOWS_H
 
#define WIN32_NO_STATUS
 

Functions

HRESULT PathToIDList (LPCWSTR pszPath, ITEMIDLIST **ppidl)
 
static LPITEMIDLIST SHELL_SimpleIDListFromPath (LPCWSTR pszPath)
 
static LPCWSTR RegNameDisp (LPCWSTR s)
 
static UINT RegSetStringEx (HKEY hKey, LPCWSTR Path, LPCWSTR Name, LPCWSTR Str, DWORD Type)
 
static UINT RegSetString (HKEY hKey, LPCWSTR Path, LPCWSTR Name, LPCWSTR Str)
 

Variables

static const BOOL g_bVista = (GetNTVersion() == _WIN32_WINNT_VISTA)
 

Macro Definition Documentation

◆ COM_NO_WINDOWS_H

#define COM_NO_WINDOWS_H

Definition at line 5 of file shelltest.h.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 8 of file shelltest.h.

Function Documentation

◆ PathToIDList()

HRESULT PathToIDList ( LPCWSTR  pszPath,
ITEMIDLIST **  ppidl 
)

Definition at line 83 of file shelltest.cpp.

84{
85 CComPtr<IBindCtx> spbc;
87 ok(hr == S_OK, "hr = %lx\n", hr);
88 if (SUCCEEDED(hr))
89 {
90 hr = SHParseDisplayName(pszPath, spbc, ppidl, 0, NULL);
91 ok(hr == S_OK, "hr = %lx\n", hr);
92 }
93 return hr;
94}
#define ok(value,...)
Definition: atltest.h:57
HRESULT hr
Definition: delayimp.cpp:582
#define NULL
Definition: types.h:112
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
HRESULT WINAPI SHParseDisplayName(LPCWSTR pszName, IBindCtx *pbc, LPITEMIDLIST *ppidl, SFGAOF sfgaoIn, SFGAOF *psfgaoOut)
Definition: pidl.c:1548
static HRESULT CreateFileSysBindCtx(_Outptr_ IBindCtx **ppbc)
Definition: shelltest.cpp:67

Referenced by SHELL_SimpleIDListFromPath(), and TestCompareIDList().

◆ RegNameDisp()

static LPCWSTR RegNameDisp ( LPCWSTR  s)
inlinestatic

Definition at line 29 of file shelltest.h.

30{
31 return (s && *s) ? s : L"(Default)";
32}
#define L(x)
Definition: resources.c:13
GLdouble s
Definition: gl.h:2039

◆ RegSetString()

static UINT RegSetString ( HKEY  hKey,
LPCWSTR  Path,
LPCWSTR  Name,
LPCWSTR  Str 
)
inlinestatic

Definition at line 39 of file shelltest.h.

40{
42}
PRTL_UNICODE_STRING_BUFFER Path
#define REG_SZ
Definition: layer.c:22
LPWSTR Name
Definition: desk.c:124
FxAutoRegKey hKey
static UINT RegSetStringEx(HKEY hKey, LPCWSTR Path, LPCWSTR Name, LPCWSTR Str, DWORD Type)
Definition: shelltest.h:34

◆ RegSetStringEx()

static UINT RegSetStringEx ( HKEY  hKey,
LPCWSTR  Path,
LPCWSTR  Name,
LPCWSTR  Str,
DWORD  Type 
)
inlinestatic

Definition at line 34 of file shelltest.h.

35{
36 return SHSetValueW(hKey, Path, Name, Type, (LPCVOID)Str, (lstrlenW(Str) + 1) * sizeof(WCHAR));
37}
Type
Definition: Type.h:7
#define lstrlenW
Definition: compat.h:750
DWORD WINAPI SHSetValueW(HKEY hkey, const WCHAR *subkey, const WCHAR *value, DWORD type, const void *data, DWORD data_len)
Definition: main.c:2292
CONST void * LPCVOID
Definition: minwindef.h:164
short WCHAR
Definition: pedump.c:58

Referenced by RegSetString(), and START_TEST().

◆ SHELL_SimpleIDListFromPath()

static LPITEMIDLIST SHELL_SimpleIDListFromPath ( LPCWSTR  pszPath)
inlinestatic

Definition at line 22 of file shelltest.h.

23{
24 ITEMIDLIST *pidl = NULL;
25 HRESULT hr = PathToIDList(pszPath, &pidl);
26 return SUCCEEDED(hr) ? pidl : NULL;
27}
HRESULT PathToIDList(LPCWSTR pszPath, ITEMIDLIST **ppidl)
Definition: shelltest.cpp:83

Referenced by START_TEST().

Variable Documentation

◆ g_bVista

const BOOL g_bVista = (GetNTVersion() == _WIN32_WINNT_VISTA)
static

Definition at line 18 of file shelltest.h.

Referenced by CMenuCallback::CallbackSM(), and TestCompareIDList().