ReactOS 0.4.15-dev-7961-gdcf9eb0
GetDisplayNameOf.cpp File Reference
#include "shelltest.h"
#include <stdio.h>
#include <shellutils.h>
Include dependency graph for GetDisplayNameOf.cpp:

Go to the source code of this file.

Functions

 START_TEST (GetDisplayNameOf)
 

Function Documentation

◆ START_TEST()

START_TEST ( GetDisplayNameOf  )

Definition at line 13 of file GetDisplayNameOf.cpp.

14{
15 HRESULT hr;
17
18 CComPtr<IShellFolder> spPanel;
19
20 hr = CoCreateInstance(CLSID_ControlPanel, NULL, CLSCTX_ALL,
21 IID_PPV_ARG(IShellFolder, &spPanel));
22 ok_hr(hr, S_OK);
23 if (SUCCEEDED(hr))
24 {
26
27 memset(&ret, 'a', sizeof(ret));
28 memset(&expected, 'a', sizeof(expected));
29 hr = spPanel->GetDisplayNameOf(NULL, SHGDN_NORMAL, &ret);
30
31 /* Return value is expected to be 'S_FALSE', which is out-of-spec behavior.
32 * The data after function call is expected to be unchanged. */
34 ok(memcmp(&ret, &expected, sizeof(ret)) == 0, "Data was changed!\n");
35
36 /* Repeat the same test with SHGDN_FORPARSING */
37 memset(&ret, 'a', sizeof(ret));
38 memset(&expected, 'a', sizeof(expected));
39 hr = spPanel->GetDisplayNameOf(NULL, SHGDN_FORPARSING, &ret);
40
42 ok(memcmp(&ret, &expected, sizeof(ret)) == 0, "Data was changed!\n");
43 }
44}
#define ok_hr(status, expected)
Definition: ACListISF.cpp:31
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#define ok_hex(expression, result)
Definition: atltest.h:94
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
Definition: compobj.c:2002
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
BOOL expected
Definition: store.c:2063
@ COINIT_APARTMENTTHREADED
Definition: objbase.h:278
#define memset(x, y, z)
Definition: compat.h:39
HRESULT hr
Definition: shlfolder.c:183
int ret
#define S_FALSE
Definition: winerror.h:2357
#define IID_PPV_ARG(Itype, ppType)