ReactOS  0.4.15-dev-5122-g72bdbdd
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 
17 struct CCoInit
18 {
21  HRESULT hres;
22 };
23 
24 START_TEST(IACLHistory)
25 {
26  CCoInit init;
27  ok_hex(init.hres, S_OK);
28  if (FAILED(init.hres))
29  {
30  skip("CoInitialize failed with 0x%08lX\n", init.hres);
31  return;
32  }
33 
34  HRESULT hr;
35  CComPtr<IUnknown> pHistory;
36  hr = CoCreateInstance(CLSID_ACLHistory, NULL, CLSCTX_INPROC_SERVER,
37  IID_PPV_ARG(IUnknown, &pHistory));
38  ok_long(hr, S_OK);
39  ok_int(!!pHistory, TRUE);
40 
41  CComPtr<IEnumString> pEnum;
42  hr = pHistory->QueryInterface(IID_PPV_ARG(IEnumString, &pEnum));
43  ok_long(hr, S_OK);
44 
45  hr = pEnum->Reset();
46  ok_long(hr, S_OK);
47  hr = pEnum->Reset();
48  ok_long(hr, S_OK);
49 
50  hr = pEnum->Skip(0);
52  hr = pEnum->Skip(1);
54  hr = pEnum->Skip(3);
56 }
HRESULT hr
Definition: shlfolder.c:183
HRESULT hres
Definition: ACPPage.cpp:82
#define TRUE
Definition: types.h:120
#define ok_long(expression, result)
Definition: atltest.h:133
#define IID_PPV_ARG(Itype, ppType)
#define ok_hex(expression, result)
Definition: atltest.h:94
static int init
Definition: wintirpc.c:33
if SUCCEEDED(hr)
#define ok_int(expression, result)
Definition: atltest.h:134
LONG HRESULT
Definition: typedefs.h:79
START_TEST(IACLHistory)
Definition: IACLHistory.cpp:24
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
#define S_OK
Definition: intsafe.h:52
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
#define E_NOTIMPL
Definition: ddrawi.h:99
#define NULL
Definition: types.h:112
#define skip(...)
Definition: atltest.h:64
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964