ReactOS  0.4.13-dev-242-g611e6d7
IACLCustomMRU.cpp File Reference
#include <apitest.h>
#include <shlobj.h>
#include <atlbase.h>
#include <atlstr.h>
#include <atlcom.h>
#include <atlwin.h>
#include <shellutils.h>
#include <shlwapi.h>
#include <strsafe.h>
#include <initguid.h>
Include dependency graph for IACLCustomMRU.cpp:

Go to the source code of this file.

Classes

struct  CCoInit
 

Macros

#define _UNICODE
 
#define UNICODE
 
#define ok_hex_(file, line, key, expression, result)
 
#define INTERFACE   IACLCustomMRU
 
#define verify_mru(mru, ...)   verify_mru_(__FILE__, __LINE__, mru, __VA_ARGS__, NULL)
 

Functions

ULONG DbgPrint (PCH Format,...)
 
 DEFINE_GUID (IID_IACLCustomMRU, 0xf729fc5e, 0x8769, 0x4f3e, 0xbd, 0xb2, 0xd7, 0xb5, 0x0f, 0xd2, 0x27, 0x5b)
 
 DECLARE_INTERFACE_IID_ (IACLCustomMRU, IUnknown, "F729FC5E-8769-4F3E-BDB2-D7B50FD2275B")
 
static void Cleanup_Testdata ()
 
static void verify_mru_ (const char *file, int line, IACLCustomMRU *mru, PCWSTR MRUString,...)
 
static void test_IACLCustomMRU_Basics ()
 
static void FillDefault (IACLCustomMRU *CustomMRU)
 
static void test_IACLCustomMRU_UpdateOrder ()
 
static void test_IACLCustomMRU_ExtraChars ()
 
static void test_IACLCustomMRU_Continue ()
 
 START_TEST (IACLCustomMRU)
 

Variables

static const WCHAR szTestPath [] = L"TESTPATH_BROWSEUI_APITEST"
 

Macro Definition Documentation

◆ _UNICODE

#define _UNICODE

Definition at line 8 of file IACLCustomMRU.cpp.

◆ INTERFACE

#define INTERFACE   IACLCustomMRU

Definition at line 46 of file IACLCustomMRU.cpp.

◆ ok_hex_

#define ok_hex_ (   file,
  line,
  key,
  expression,
  result 
)
Value:
do { \
int _value = (expression); \
ok_(file, line)(_value == (result), "Wrong value for '%s', expected: " #result " (0x%x), got: 0x%x for %c\n", \
#expression, (int)(result), _value, (char)key); \
} while (0)
Definition: parser.c:48
HKEY key
Definition: reg.c:42
GLuint64EXT * result
Definition: glext.h:11304
Definition: fci.c:126

Definition at line 25 of file IACLCustomMRU.cpp.

◆ UNICODE

Definition at line 9 of file IACLCustomMRU.cpp.

◆ verify_mru

#define verify_mru (   mru,
  ... 
)    verify_mru_(__FILE__, __LINE__, mru, __VA_ARGS__, NULL)

Definition at line 69 of file IACLCustomMRU.cpp.

Function Documentation

◆ Cleanup_Testdata()

static void Cleanup_Testdata ( )
static

Definition at line 62 of file IACLCustomMRU.cpp.

63 {
64  CRegKey tmp;
67 }
#define KEY_READ
Definition: nt_native.h:1023
#define HKEY_CURRENT_USER
Definition: winreg.h:11
LONG DeleteSubKey(LPCTSTR lpszSubKey)
Definition: atlbase.h:1316
smooth NULL
Definition: ftsmooth.c:416
#define KEY_WRITE
Definition: nt_native.h:1031
static const WCHAR szTestPath[]
LONG Open(HKEY hKeyParent, LPCTSTR lpszKeyName, REGSAM samDesired=KEY_READ|KEY_WRITE)
Definition: atlbase.h:1070

Referenced by FillDefault(), START_TEST(), test_IACLCustomMRU_Basics(), test_IACLCustomMRU_Continue(), test_IACLCustomMRU_ExtraChars(), and test_IACLCustomMRU_UpdateOrder().

◆ DbgPrint()

ULONG DbgPrint ( PCH  Format,
  ... 
)

◆ DECLARE_INTERFACE_IID_()

DECLARE_INTERFACE_IID_ ( IACLCustomMRU  ,
IUnknown  ,
"F729FC5E-8769-4F3E-BDB2-D7B50FD2275B"   
)

Definition at line 49 of file IACLCustomMRU.cpp.

50 {
51  // *** IUnknown methods ***
55 
56  // *** IACLCustomMRU methods ***
57  STDMETHOD(Initialize) (THIS_ LPCWSTR pwszMRURegKey, DWORD dwMax) PURE;
58  STDMETHOD(AddMRUString) (THIS_ LPCWSTR pwszEntry) PURE;
59 };
#define REFIID
Definition: guiddef.h:113
#define THIS_
Definition: basetyps.h:65
_In_ BOOLEAN Release
Definition: classpnp.h:929
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define THIS
Definition: basetyps.h:66
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
NTSTATUS QueryInterface(IN PDEVICE_OBJECT DeviceObject, IN CONST GUID InterfaceType, IN LONG Size, IN LONG Version, OUT PVOID Interface)
Definition: fdo.c:532
#define STDMETHOD(m)
Definition: basetyps.h:62
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL Initialize(HINSTANCE hInstance)
Definition: msconfig.c:341
#define PURE
Definition: basetyps.h:64
static ULONG WINAPI AddRef(IStream *iface)
Definition: clist.c:90
unsigned int ULONG
Definition: retypes.h:1
#define STDMETHOD_(t, m)
Definition: basetyps.h:63

◆ DEFINE_GUID()

DEFINE_GUID ( IID_IACLCustomMRU  ,
0xf729fc5e  ,
0x8769  ,
0x4f3e  ,
0xbd  ,
0xb2  ,
0xd7  ,
0xb5  ,
0x0f  ,
0xd2  ,
0x27  ,
0x5b   
)

◆ FillDefault()

static void FillDefault ( IACLCustomMRU *  CustomMRU)
static

Definition at line 157 of file IACLCustomMRU.cpp.

158 {
160  HRESULT hr = CustomMRU->Initialize(szTestPath, 3);
161  ok_hex(hr, S_OK);
162  hr = CustomMRU->AddMRUString(L"FIRST_ENTRY");
163  ok_hex(hr, S_OK);
164  hr = CustomMRU->AddMRUString(L"SECOND_ENTRY");
165  ok_hex(hr, S_OK);
166  hr = CustomMRU->AddMRUString(L"THIRD_ENTRY");
167  ok_hex(hr, S_OK);
168 }
HRESULT hr
Definition: shlfolder.c:183
#define ok_hex(expression, result)
Definition: test.h:759
static const WCHAR szTestPath[]
LONG HRESULT
Definition: typedefs.h:77
static void Cleanup_Testdata()
static const WCHAR L[]
Definition: oid.c:1250
#define S_OK
Definition: intsafe.h:59

Referenced by test_IACLCustomMRU_Continue(), and test_IACLCustomMRU_UpdateOrder().

◆ START_TEST()

START_TEST ( IACLCustomMRU  )

Definition at line 404 of file IACLCustomMRU.cpp.

405 {
406  CCoInit init;
407  ok_hex(init.hres, S_OK);
408  if (!SUCCEEDED(init.hres))
409  return;
410 
415 
417 }
static void test_IACLCustomMRU_Continue()
static int init
Definition: wintirpc.c:33
#define ok_hex(expression, result)
Definition: test.h:759
static void test_IACLCustomMRU_Basics()
static void Cleanup_Testdata()
static void test_IACLCustomMRU_UpdateOrder()
#define S_OK
Definition: intsafe.h:59
static void test_IACLCustomMRU_ExtraChars()
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ test_IACLCustomMRU_Basics()

static void test_IACLCustomMRU_Basics ( )
static

Definition at line 111 of file IACLCustomMRU.cpp.

112 {
113  CComPtr<IACLCustomMRU> CustomMRU;
114  HRESULT hr = CoCreateInstance(CLSID_ACLCustomMRU, NULL, CLSCTX_ALL, IID_PPV_ARG(IACLCustomMRU, &CustomMRU));
115  ok_hex(hr, S_OK);
116  if (!SUCCEEDED(hr))
117  return;
118 
120 
121  /* Initialize with a NULL name will cause an AV */
122  //hr = CustomMRU->Initialize(NULL, 0);
123 
124  hr = CustomMRU->Initialize(szTestPath, 0);
125  ok_hex(hr, S_OK);
126  /* Adding an entry with a dwMax of 0 will cause an AV */
127 
128  /* Calling it again will resize */
129  hr = CustomMRU->Initialize(szTestPath, 3);
130  ok_hex(hr, S_OK);
131  verify_mru(CustomMRU, L"");
132 
133  hr = CustomMRU->AddMRUString(L"FIRST_ENTRY");
134  ok_hex(hr, S_OK);
135  verify_mru(CustomMRU, L"a", L"FIRST_ENTRY");
136 
137  hr = CustomMRU->AddMRUString(L"SECOND_ENTRY");
138  ok_hex(hr, S_OK);
139  verify_mru(CustomMRU, L"ba", L"FIRST_ENTRY", L"SECOND_ENTRY");
140 
141  hr = CustomMRU->AddMRUString(L"THIRD_ENTRY");
142  ok_hex(hr, S_OK);
143  verify_mru(CustomMRU, L"cba", L"FIRST_ENTRY", L"SECOND_ENTRY", L"THIRD_ENTRY");
144 
145  /* First entry is replaced */
146  hr = CustomMRU->AddMRUString(L"FOURTH_ENTRY");
147  ok_hex(hr, S_OK);
148  verify_mru(CustomMRU, L"acb", L"FOURTH_ENTRY", L"SECOND_ENTRY", L"THIRD_ENTRY");
149 
150  /* Second entry is replaced */
151  hr = CustomMRU->AddMRUString(L"FIFTH_ENTRY");
152  ok_hex(hr, S_OK);
153  verify_mru(CustomMRU, L"bac", L"FOURTH_ENTRY", L"FIFTH_ENTRY", L"THIRD_ENTRY");
154 }
HRESULT hr
Definition: shlfolder.c:183
#define IID_PPV_ARG(Itype, ppType)
smooth NULL
Definition: ftsmooth.c:416
#define ok_hex(expression, result)
Definition: test.h:759
static const WCHAR szTestPath[]
LONG HRESULT
Definition: typedefs.h:77
static void Cleanup_Testdata()
static const WCHAR L[]
Definition: oid.c:1250
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3234
#define S_OK
Definition: intsafe.h:59
#define verify_mru(mru,...)
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by START_TEST().

◆ test_IACLCustomMRU_Continue()

static void test_IACLCustomMRU_Continue ( )
static

Definition at line 249 of file IACLCustomMRU.cpp.

250 {
251  CComPtr<IACLCustomMRU> CustomMRU;
252  HRESULT hr = CoCreateInstance(CLSID_ACLCustomMRU, NULL, CLSCTX_ALL, IID_PPV_ARG(IACLCustomMRU, &CustomMRU));
253  ok_hex(hr, S_OK);
254  if (!SUCCEEDED(hr))
255  return;
256 
258  FillDefault(CustomMRU);
259  verify_mru(CustomMRU, L"cba", L"FIRST_ENTRY", L"SECOND_ENTRY", L"THIRD_ENTRY");
260 
261  CustomMRU.Release();
262 
263  hr = CoCreateInstance(CLSID_ACLCustomMRU, NULL, CLSCTX_ALL, IID_PPV_ARG(IACLCustomMRU, &CustomMRU));
264  ok_hex(hr, S_OK);
265  if (!SUCCEEDED(hr))
266  return;
267 
268  hr = CustomMRU->Initialize(szTestPath, 3);
269  ok_hex(hr, S_OK);
270 
271  /* First entry is replaced */
272  hr = CustomMRU->AddMRUString(L"FOURTH_ENTRY");
273  ok_hex(hr, S_OK);
274  verify_mru(CustomMRU, L"acb", L"FOURTH_ENTRY", L"SECOND_ENTRY", L"THIRD_ENTRY");
275 
276  CustomMRU.Release();
277 
278  hr = CoCreateInstance(CLSID_ACLCustomMRU, NULL, CLSCTX_ALL, IID_PPV_ARG(IACLCustomMRU, &CustomMRU));
279  ok_hex(hr, S_OK);
280  if (!SUCCEEDED(hr))
281  return;
282 
283  hr = CustomMRU->Initialize(szTestPath, 3);
284  ok_hex(hr, S_OK);
285 
286  /* Second entry is replaced */
287  hr = CustomMRU->AddMRUString(L"FIFTH_ENTRY");
288  ok_hex(hr, S_OK);
289  verify_mru(CustomMRU, L"bac", L"FOURTH_ENTRY", L"FIFTH_ENTRY", L"THIRD_ENTRY");
290 
291  CustomMRU.Release();
292 
293  hr = CoCreateInstance(CLSID_ACLCustomMRU, NULL, CLSCTX_ALL, IID_PPV_ARG(IACLCustomMRU, &CustomMRU));
294  ok_hex(hr, S_OK);
295  if (!SUCCEEDED(hr))
296  return;
297 
298 
299  /* Save some garbage */
300  CRegKey key;
302  key.SetStringValue(L"MRUList", L"b**");
303  key.Close();
304 
305  hr = CustomMRU->Initialize(szTestPath, 3);
306  ok_hex(hr, S_OK);
307 
308  CustomMRU.Release();
309 
310  /* Not cleaned up */
311  verify_mru(CustomMRU, L"b**", L"FOURTH_ENTRY", L"FIFTH_ENTRY", L"THIRD_ENTRY");
312 
313  hr = CoCreateInstance(CLSID_ACLCustomMRU, NULL, CLSCTX_ALL, IID_PPV_ARG(IACLCustomMRU, &CustomMRU));
314  ok_hex(hr, S_OK);
315  if (!SUCCEEDED(hr))
316  return;
317 
318  hr = CustomMRU->Initialize(szTestPath, 3);
319  ok_hex(hr, S_OK);
320 
321  /* Now it's just cleaned up */
322  hr = CustomMRU->AddMRUString(L"SIXTH_ENTRY");
323  ok_hex(hr, S_OK);
324  verify_mru(CustomMRU, L"ab", L"SIXTH_ENTRY");
325 
326  CustomMRU.Release();
327 
328  hr = CoCreateInstance(CLSID_ACLCustomMRU, NULL, CLSCTX_ALL, IID_PPV_ARG(IACLCustomMRU, &CustomMRU));
329  ok_hex(hr, S_OK);
330  if (!SUCCEEDED(hr))
331  return;
332 
334  FillDefault(CustomMRU);
335  verify_mru(CustomMRU, L"cba", L"FIRST_ENTRY", L"SECOND_ENTRY", L"THIRD_ENTRY");
336 
337  CustomMRU.Release();
338 
339  hr = CoCreateInstance(CLSID_ACLCustomMRU, NULL, CLSCTX_ALL, IID_PPV_ARG(IACLCustomMRU, &CustomMRU));
340  ok_hex(hr, S_OK);
341  if (!SUCCEEDED(hr))
342  return;
343 
345  key.SetStringValue(L"MRUList", L"baccccc");
346  key.Close();
347 
348  hr = CustomMRU->Initialize(szTestPath, 3);
349  ok_hex(hr, S_OK);
350  CustomMRU.Release();
351 
352  verify_mru(CustomMRU, L"baccccc", L"FIRST_ENTRY", L"SECOND_ENTRY", L"THIRD_ENTRY");
353 
354  hr = CoCreateInstance(CLSID_ACLCustomMRU, NULL, CLSCTX_ALL, IID_PPV_ARG(IACLCustomMRU, &CustomMRU));
355  ok_hex(hr, S_OK);
356  if (!SUCCEEDED(hr))
357  return;
358 
359  hr = CustomMRU->Initialize(szTestPath, 3);
360  ok_hex(hr, S_OK);
361 
362  hr = CustomMRU->AddMRUString(L"FOURTH_ENTRY");
363  ok_hex(hr, S_OK);
364  verify_mru(CustomMRU, L"a", L"FOURTH_ENTRY", L"SECOND_ENTRY", L"THIRD_ENTRY");
365 
366  CustomMRU.Release();
368 
369  hr = CoCreateInstance(CLSID_ACLCustomMRU, NULL, CLSCTX_ALL, IID_PPV_ARG(IACLCustomMRU, &CustomMRU));
370  ok_hex(hr, S_OK);
371  if (!SUCCEEDED(hr))
372  return;
373 
374  hr = CustomMRU->Initialize(szTestPath, 3);
375  ok_hex(hr, S_OK);
376  if (!SUCCEEDED(hr))
377  return;
378 
379  hr = CustomMRU->AddMRUString(L"FIRST_ENTRY");
380  ok_hex(hr, S_OK);
381  verify_mru(CustomMRU, L"a", L"FIRST_ENTRY");
382 
383  CustomMRU.Release();
384 
386  key.SetStringValue(L"MRUList", L"aaa");
387  key.Close();
388 
389  hr = CoCreateInstance(CLSID_ACLCustomMRU, NULL, CLSCTX_ALL, IID_PPV_ARG(IACLCustomMRU, &CustomMRU));
390  ok_hex(hr, S_OK);
391  if (!SUCCEEDED(hr))
392  return;
393 
394  hr = CustomMRU->Initialize(szTestPath, 3);
395  ok_hex(hr, S_OK);
396  if (!SUCCEEDED(hr))
397  return;
398 
399  hr = CustomMRU->AddMRUString(L"SECOND_ENTRY");
400  ok_hex(hr, S_OK);
401  verify_mru(CustomMRU, L"ba", L"FIRST_ENTRY", L"SECOND_ENTRY");
402 }
HRESULT hr
Definition: shlfolder.c:183
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define IID_PPV_ARG(Itype, ppType)
smooth NULL
Definition: ftsmooth.c:416
#define ok_hex(expression, result)
Definition: test.h:759
static const WCHAR szTestPath[]
LONG HRESULT
Definition: typedefs.h:77
static void Cleanup_Testdata()
static const WCHAR L[]
Definition: oid.c:1250
static void FillDefault(IACLCustomMRU *CustomMRU)
HKEY key
Definition: reg.c:42
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3234
#define S_OK
Definition: intsafe.h:59
void Release()
Definition: atlcomcli.h:140
#define verify_mru(mru,...)
#define SUCCEEDED(hr)
Definition: intsafe.h:57
Definition: path.c:42

Referenced by START_TEST().

◆ test_IACLCustomMRU_ExtraChars()

static void test_IACLCustomMRU_ExtraChars ( )
static

Definition at line 217 of file IACLCustomMRU.cpp.

218 {
219  CComPtr<IACLCustomMRU> CustomMRU;
220  HRESULT hr = CoCreateInstance(CLSID_ACLCustomMRU, NULL, CLSCTX_ALL, IID_PPV_ARG(IACLCustomMRU, &CustomMRU));
221  ok_hex(hr, S_OK);
222  if (!SUCCEEDED(hr))
223  return;
224 
226 
227  /* Still returnes success */
228  hr = CustomMRU->Initialize(szTestPath, 30);
229  ok_hex(hr, S_OK);
230 
231  for (int n = 0; n < 30; ++n)
232  {
233  CStringW tmp;
234  tmp.Format(L"%d", n);
235 
236  hr = CustomMRU->AddMRUString(tmp);
237  ok_hex(hr, S_OK);
238  }
239  /* But is starting to wrap around */
240  verify_mru(CustomMRU, L"a}|{zyxwvutsrqponmlkjihgfedcb", L"29",
241  L"1", L"2", L"3", L"4", L"5", L"6", L"7", L"8", L"9",
242  L"10", L"11", L"12", L"13", L"14", L"15", L"16", L"17", L"18", L"19",
243  L"20", L"21", L"22", L"23", L"24", L"25", L"26", L"27", L"28");
244 
246 }
HRESULT hr
Definition: shlfolder.c:183
GLdouble n
Definition: glext.h:7729
void __cdecl Format(UINT nFormatID,...)
Definition: cstringt.h:668
#define IID_PPV_ARG(Itype, ppType)
smooth NULL
Definition: ftsmooth.c:416
#define ok_hex(expression, result)
Definition: test.h:759
static const WCHAR szTestPath[]
LONG HRESULT
Definition: typedefs.h:77
static void Cleanup_Testdata()
static const WCHAR L[]
Definition: oid.c:1250
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3234
#define S_OK
Definition: intsafe.h:59
#define verify_mru(mru,...)
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by START_TEST().

◆ test_IACLCustomMRU_UpdateOrder()

static void test_IACLCustomMRU_UpdateOrder ( )
static

Definition at line 171 of file IACLCustomMRU.cpp.

172 {
173  CComPtr<IACLCustomMRU> CustomMRU;
174  HRESULT hr = CoCreateInstance(CLSID_ACLCustomMRU, NULL, CLSCTX_ALL, IID_PPV_ARG(IACLCustomMRU, &CustomMRU));
175  ok_hex(hr, S_OK);
176  if (!SUCCEEDED(hr))
177  return;
178 
180  FillDefault(CustomMRU);
181  verify_mru(CustomMRU, L"cba", L"FIRST_ENTRY", L"SECOND_ENTRY", L"THIRD_ENTRY");
182 
183  /* Add the first entry again */
184  hr = CustomMRU->AddMRUString(L"FIRST_ENTRY");
185  ok_hex(hr, S_OK);
186  /* No change */
187  verify_mru(CustomMRU, L"cba", L"FIRST_ENTRY", L"SECOND_ENTRY", L"THIRD_ENTRY");
188 
189  CustomMRU.Release();
190  /* Now the order is updated */
191  verify_mru(NULL, L"acb", L"FIRST_ENTRY", L"SECOND_ENTRY", L"THIRD_ENTRY");
192 
193 
194  hr = CoCreateInstance(CLSID_ACLCustomMRU, NULL, CLSCTX_ALL, IID_PPV_ARG(IACLCustomMRU, &CustomMRU));
195  ok_hex(hr, S_OK);
196  if (!SUCCEEDED(hr))
197  return;
198 
200  FillDefault(CustomMRU);
201  verify_mru(CustomMRU, L"cba", L"FIRST_ENTRY", L"SECOND_ENTRY", L"THIRD_ENTRY");
202 
203 
204  /* Add the first entry again */
205  hr = CustomMRU->AddMRUString(L"FIRST_ENTRY");
206  ok_hex(hr, S_OK);
207  /* No change */
208  verify_mru(CustomMRU, L"cba", L"FIRST_ENTRY", L"SECOND_ENTRY", L"THIRD_ENTRY");
209 
210  hr = CustomMRU->AddMRUString(L"SOMETHING_ELSE");
211  ok_hex(hr, S_OK);
212  /* Now all changes are persisted */
213  verify_mru(CustomMRU, L"bac", L"FIRST_ENTRY", L"SOMETHING_ELSE", L"THIRD_ENTRY");
214 }
HRESULT hr
Definition: shlfolder.c:183
#define IID_PPV_ARG(Itype, ppType)
smooth NULL
Definition: ftsmooth.c:416
#define ok_hex(expression, result)
Definition: test.h:759
LONG HRESULT
Definition: typedefs.h:77
static void Cleanup_Testdata()
static const WCHAR L[]
Definition: oid.c:1250
static void FillDefault(IACLCustomMRU *CustomMRU)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3234
#define S_OK
Definition: intsafe.h:59
void Release()
Definition: atlcomcli.h:140
#define verify_mru(mru,...)
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by START_TEST().

◆ verify_mru_()

static void verify_mru_ ( const char file,
int  line,
IACLCustomMRU *  mru,
PCWSTR  MRUString,
  ... 
)
static

Definition at line 70 of file IACLCustomMRU.cpp.

71 {
72 
73  CRegKey key;
75 
76  va_list args;
77  va_start(args, MRUString);
78  PCWSTR Entry;
79  WCHAR Key = L'a';
80  while ((Entry = va_arg(args, PCWSTR)))
81  {
83  ULONG nChars = _countof(Value);
84  CStringW tmp;
85  tmp += Key;
86  LSTATUS Status = key.QueryStringValue(tmp, Value, &nChars);
88  if (Status == ERROR_SUCCESS)
89  {
90  ok_(file, line)(!wcscmp(Value, Entry), "Expected value %c to be %S, was %S\n", (char)Key, Entry, Value);
91  }
92  Key++;
93  }
94  va_end(args);
95 
96  if (Key != L'a')
97  {
99  ULONG nChars = _countof(Value);
100  LSTATUS Status = key.QueryStringValue(L"MRUList", Value, &nChars);
102  if (Status == ERROR_SUCCESS)
103  {
104  ok_(file, line)(!wcscmp(Value, MRUString), "Expected MRUList to be %S, was %S\n", MRUString, Value);
105  }
106  }
107 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2327
const uint16_t * PCWSTR
Definition: typedefs.h:55
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ULONG Key
Definition: fatprocs.h:2697
#define ERROR_SUCCESS
Definition: deptool.c:10
struct _Entry Entry
Definition: kefuncs.h:640
#define ok_(x1, x2)
#define _countof(array)
Definition: fontsub.cpp:30
#define HKEY_CURRENT_USER
Definition: winreg.h:11
Definition: match.c:390
#define ok_hex_(file, line, key, expression, result)
#define va_end(ap)
Definition: acmsvcex.h:90
unsigned char
Definition: typeof.h:29
Definition: parser.c:48
char * va_list
Definition: acmsvcex.h:78
static const WCHAR szTestPath[]
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
static const WCHAR L[]
Definition: oid.c:1250
HKEY key
Definition: reg.c:42
Status
Definition: gdiplustypes.h:24
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define va_arg(ap, T)
Definition: acmsvcex.h:89
#define va_start(ap, A)
Definition: acmsvcex.h:91
unsigned int ULONG
Definition: retypes.h:1
#define args
Definition: format.c:66
base of all file and directory entries
Definition: entries.h:82
Definition: path.c:42
Definition: fci.c:126

Variable Documentation

◆ szTestPath

const WCHAR szTestPath[] = L"TESTPATH_BROWSEUI_APITEST"
static