ReactOS 0.4.15-dev-5672-gf73ac17
IACLHistory.cpp
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS api tests
3 * LICENSE: LGPL-2.0-or-later (https://spdx.org/licenses/LGPL-2.0-or-later)
4 * PURPOSE: Test for IACLHistory objects
5 * COPYRIGHT: Copyright 2021 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
6 */
7
8#define _UNICODE
9#define UNICODE
10#include <apitest.h>
11#include <shlobj.h>
12#include <atlbase.h>
13#include <atlcom.h>
14#include <stdio.h>
15#include <shellutils.h>
16
17START_TEST(IACLHistory)
18{
19 CCoInit init;
20 ok_hex(init.hr, S_OK);
21 if (FAILED(init.hr))
22 {
23 skip("CoInitialize failed with 0x%08lX\n", init.hr);
24 return;
25 }
26
27 HRESULT hr;
28 CComPtr<IUnknown> pHistory;
29 hr = CoCreateInstance(CLSID_ACLHistory, NULL, CLSCTX_INPROC_SERVER,
30 IID_PPV_ARG(IUnknown, &pHistory));
31 ok_long(hr, S_OK);
32 ok_int(!!pHistory, TRUE);
33
34 CComPtr<IEnumString> pEnum;
35 hr = pHistory->QueryInterface(IID_PPV_ARG(IEnumString, &pEnum));
36 ok_long(hr, S_OK);
37
38 hr = pEnum->Reset();
39 ok_long(hr, S_OK);
40 hr = pEnum->Reset();
41 ok_long(hr, S_OK);
42
43 hr = pEnum->Skip(0);
45 hr = pEnum->Skip(1);
47 hr = pEnum->Skip(3);
49}
#define ok_hex(expression, result)
Definition: atltest.h:94
#define ok_long(expression, result)
Definition: atltest.h:133
#define skip(...)
Definition: atltest.h:64
#define START_TEST(x)
Definition: atltest.h:75
#define ok_int(expression, result)
Definition: atltest.h:134
#define E_NOTIMPL
Definition: ddrawi.h:99
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
HRESULT hr
Definition: shlfolder.c:183
static int init
Definition: wintirpc.c:33
#define IID_PPV_ARG(Itype, ppType)