ReactOS 0.4.16-dev-106-g10b08aa
IShellFolderHelpers.cpp File Reference
#include <apitest.h>
#include <shlobj.h>
#include <shlwapi.h>
#include <versionhelpers.h>
#include <shlwapi_undoc.h>
Include dependency graph for IShellFolderHelpers.cpp:

Go to the source code of this file.

Classes

class  CTestShellFolder
 

Macros

#define SHLWAPI_ISHELLFOLDER_HELPERS
 

Typedefs

typedef HRESULT(WINAPIFN_IShellFolder_CompareIDs) (_In_ IShellFolder *psf, _In_ LPARAM lParam, _In_ PCUIDLIST_RELATIVE pidl1, _In_ PCUIDLIST_RELATIVE pidl2)
 

Functions

static void Test_GetDisplayNameOf (void)
 
static void Test_ParseDisplayName (void)
 
static void Test_CompareIDs (void)
 
 START_TEST (IShellFolderHelpers)
 

Variables

static INT s_nStep = 0
 

Macro Definition Documentation

◆ SHLWAPI_ISHELLFOLDER_HELPERS

#define SHLWAPI_ISHELLFOLDER_HELPERS

Definition at line 13 of file IShellFolderHelpers.cpp.

Typedef Documentation

◆ FN_IShellFolder_CompareIDs

typedef HRESULT(WINAPI * FN_IShellFolder_CompareIDs) (_In_ IShellFolder *psf, _In_ LPARAM lParam, _In_ PCUIDLIST_RELATIVE pidl1, _In_ PCUIDLIST_RELATIVE pidl2)

Definition at line 254 of file IShellFolderHelpers.cpp.

Function Documentation

◆ START_TEST()

START_TEST ( IShellFolderHelpers  )

Definition at line 298 of file IShellFolderHelpers.cpp.

299{
300 HRESULT hrCoInit = ::CoInitialize(NULL);
301
305
306 if (SUCCEEDED(hrCoInit))
308}
static void Test_CompareIDs(void)
static void Test_ParseDisplayName(void)
static void Test_GetDisplayNameOf(void)
#define NULL
Definition: types.h:112
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
#define SUCCEEDED(hr)
Definition: intsafe.h:50

◆ Test_CompareIDs()

static void Test_CompareIDs ( void  )
static

Definition at line 260 of file IShellFolderHelpers.cpp.

261{
262 FN_IShellFolder_CompareIDs fnIShellFolder_CompareIDs;
263 fnIShellFolder_CompareIDs =
266
268 {
269 skip("Vista+\n");
270 ok(fnIShellFolder_CompareIDs == NULL, "Vista+ has no IShellFolder_CompareIDs\n");
271 return;
272 }
273
275 HRESULT hr;
276
277 s_nStep = 11;
278 hr = fnIShellFolder_CompareIDs(
279 psf,
280 0xFFFF1234,
281 NULL,
282 NULL);
283 ok_long(hr, 0xFEEDF00D);
284 ok_int(s_nStep, 13);
285
286 s_nStep = 13;
287 hr = fnIShellFolder_CompareIDs(
288 psf,
289 0x00005678,
290 NULL,
291 NULL);
292 ok_long(hr, 0xFEEDF00D);
293 ok_int(s_nStep, 14);
294
295 delete psf;
296}
static INT s_nStep
HRESULT(WINAPI * FN_IShellFolder_CompareIDs)(_In_ IShellFolder *psf, _In_ LPARAM lParam, _In_ PCUIDLIST_RELATIVE pidl1, _In_ PCUIDLIST_RELATIVE pidl2)
#define ok_long(expression, result)
Definition: atltest.h:133
#define ok(value,...)
Definition: atltest.h:57
#define skip(...)
Definition: atltest.h:64
#define ok_int(expression, result)
Definition: atltest.h:134
#define GetProcAddress(x, y)
Definition: compat.h:753
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
HRESULT hr
Definition: shlfolder.c:183
VERSIONHELPERAPI IsWindowsVistaOrGreater()
#define MAKEINTRESOURCEA(i)
Definition: winuser.h:581

Referenced by START_TEST().

◆ Test_GetDisplayNameOf()

static void Test_GetDisplayNameOf ( void  )
static

Definition at line 204 of file IShellFolderHelpers.cpp.

205{
207 HRESULT hr;
208
210 psf,
211 NULL,
212 SHGDN_FOREDITING | SHGDN_FORADDRESSBAR | SHGDN_FORPARSING | SHGDN_INFOLDER,
213 NULL,
214 0);
215 ok_long(hr, E_FAIL);
216 ok_int(s_nStep, 4);
217
219 psf,
220 NULL,
221 SHGDN_FOREDITING | SHGDN_FORADDRESSBAR | SHGDN_INFOLDER,
222 NULL,
223 0);
224 ok_long(hr, E_FAIL);
225 ok_int(s_nStep, 10);
226
227 if (s_nStep != 10)
228 skip("s_nStep value is wrong\n");
229
230 delete psf;
231}
#define E_FAIL
Definition: ddrawi.h:102
#define IShellFolder_GetDisplayNameOf
Definition: utils.cpp:13

Referenced by START_TEST().

◆ Test_ParseDisplayName()

static void Test_ParseDisplayName ( void  )
static

Definition at line 233 of file IShellFolderHelpers.cpp.

234{
236 HRESULT hr;
237
238 s_nStep = 10;
239 LPITEMIDLIST pidl = (LPITEMIDLIST)UlongToPtr(0xDEADDEAD);
241 psf,
242 NULL,
243 NULL,
244 NULL,
245 NULL,
246 &pidl,
247 NULL);
248 ok_long(hr, 0xDEADFACE);
249 ok_int(s_nStep, 11);
250
251 delete psf;
252}
#define IShellFolder_ParseDisplayName
Definition: utils.cpp:14
#define UlongToPtr(u)
Definition: config.h:106
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41

Referenced by START_TEST().

Variable Documentation

◆ s_nStep