ReactOS 0.4.15-dev-8231-g29a56f3
shelltest.cpp File Reference
#include "shelltest.h"
Include dependency graph for shelltest.cpp:

Go to the source code of this file.

Classes

class  CFileSysBindData
 

Functions

static HRESULT AddFileSysBindCtx (_In_ IBindCtx *pbc)
 
static HRESULT CreateBindCtxWithOpts (_In_ BIND_OPTS *pbo, _Outptr_ IBindCtx **ppbc)
 
static HRESULT CreateFileSysBindCtx (_Outptr_ IBindCtx **ppbc)
 
VOID PathToIDList (LPCWSTR pszPath, ITEMIDLIST **ppidl)
 

Variables

CComModule gModule
 

Function Documentation

◆ AddFileSysBindCtx()

static HRESULT AddFileSysBindCtx ( _In_ IBindCtx pbc)
static

Definition at line 39 of file shelltest.cpp.

40{
41 CComPtr<IFileSystemBindData> spfsbc(new CComObject<CFileSysBindData>());
42 WIN32_FIND_DATAW wfd = { 0 };
43 wfd.dwFileAttributes = FILE_ATTRIBUTE_NORMAL;
44 spfsbc->SetFindData(&wfd);
45 HRESULT hr = pbc->RegisterObjectParam((LPOLESTR)STR_FILE_SYS_BIND_DATA, spfsbc);
46 ok(hr == S_OK, "hr = %lx\n", hr);
47 return hr;
48}
#define ok(value,...)
Definition: atltest.h:57
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
#define S_OK
Definition: intsafe.h:52
static LPOLESTR
Definition: stg_prop.c:27
HRESULT hr
Definition: shlfolder.c:183

Referenced by CreateFileSysBindCtx().

◆ CreateBindCtxWithOpts()

static HRESULT CreateBindCtxWithOpts ( _In_ BIND_OPTS *  pbo,
_Outptr_ IBindCtx **  ppbc 
)
static

Definition at line 52 of file shelltest.cpp.

53{
54 CComPtr<IBindCtx> spbc;
55 HRESULT hr = CreateBindCtx(0, &spbc);
56 ok(hr == S_OK, "hr = %lx\n", hr);
57 if (SUCCEEDED(hr))
58 {
59 hr = spbc->SetBindOptions(pbo);
60 ok(hr == S_OK, "hr = %lx\n", hr);
61 }
62 *ppbc = SUCCEEDED(hr) ? spbc.Detach() : NULL;
63 return hr;
64}
#define NULL
Definition: types.h:112
#define SUCCEEDED(hr)
Definition: intsafe.h:50
HRESULT WINAPI CreateBindCtx(DWORD reserved, LPBC *ppbc)
Definition: bindctx.c:556
_In_opt_ SURFOBJ _In_opt_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL _In_opt_ POINTL _In_opt_ POINTL _In_opt_ BRUSHOBJ * pbo
Definition: winddi.h:3440

Referenced by CreateFileSysBindCtx().

◆ CreateFileSysBindCtx()

static HRESULT CreateFileSysBindCtx ( _Outptr_ IBindCtx **  ppbc)
static

Definition at line 67 of file shelltest.cpp.

68{
69 CComPtr<IBindCtx> spbc;
70 BIND_OPTS bo = { sizeof(bo), 0, STGM_CREATE, 0 };
71 HRESULT hr = CreateBindCtxWithOpts(&bo, &spbc);
72 ok(hr == S_OK, "hr = %lx\n", hr);
73 if (SUCCEEDED(hr))
74 {
75 hr = AddFileSysBindCtx(spbc);
76 ok(hr == S_OK, "hr = %lx\n", hr);
77 }
78 *ppbc = SUCCEEDED(hr) ? spbc.Detach() : NULL;
79 return hr;
80}
#define STGM_CREATE
Definition: objbase.h:926
static HRESULT CreateBindCtxWithOpts(_In_ BIND_OPTS *pbo, _Outptr_ IBindCtx **ppbc)
Definition: shelltest.cpp:52
static HRESULT AddFileSysBindCtx(_In_ IBindCtx *pbc)
Definition: shelltest.cpp:39

Referenced by PathToIDList().

◆ PathToIDList()

VOID 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}
HRESULT WINAPI SHParseDisplayName(LPCWSTR pszName, IBindCtx *pbc, LPITEMIDLIST *ppidl, SFGAOF sfgaoIn, SFGAOF *psfgaoOut)
Definition: pidl.c:1394
static HRESULT CreateFileSysBindCtx(_Outptr_ IBindCtx **ppbc)
Definition: shelltest.cpp:67

Referenced by TestCompareIDList().

Variable Documentation

◆ gModule

CComModule gModule

Definition at line 8 of file shelltest.cpp.