25#define ok_hex2(file, line, key, expression, result) \
27 int _value = (expression); \
28 ok_(file, line)(_value == (result), "Wrong value for '%s', expected: " #result " (0x%x), got: 0x%x for %c\n", \
29 #expression, (int)(result), _value, (char)key); \
32#define ok_wstri(x, y) \
33 ok(lstrcmpiW(x, y) == 0, "Wrong string. Expected '%S', got '%S'\n", y, x)
36DEFINE_GUID(IID_IACLCustomMRU, 0xf729fc5e, 0x8769, 0x4f3e, 0xbd, 0xb2, 0xd7, 0xb5, 0x0f, 0xd2, 0x27, 0x5b);
40#define INTERFACE IACLCustomMRU
63#define verify_mru(mru, ...) verify_mru_(__FILE__, __LINE__, mru, __VA_ARGS__, NULL)
127 hr = CustomMRU->AddMRUString(
L"FIRST_ENTRY");
131 hr = CustomMRU->AddMRUString(
L"SECOND_ENTRY");
133 verify_mru(CustomMRU,
L"ba",
L"FIRST_ENTRY",
L"SECOND_ENTRY");
135 hr = CustomMRU->AddMRUString(
L"THIRD_ENTRY");
137 verify_mru(CustomMRU,
L"cba",
L"FIRST_ENTRY",
L"SECOND_ENTRY",
L"THIRD_ENTRY");
140 hr = CustomMRU->AddMRUString(
L"FOURTH_ENTRY");
142 verify_mru(CustomMRU,
L"acb",
L"FOURTH_ENTRY",
L"SECOND_ENTRY",
L"THIRD_ENTRY");
145 hr = CustomMRU->AddMRUString(
L"FIFTH_ENTRY");
147 verify_mru(CustomMRU,
L"bac",
L"FOURTH_ENTRY",
L"FIFTH_ENTRY",
L"THIRD_ENTRY");
156 hr = CustomMRU->AddMRUString(
L"FIRST_ENTRY");
158 hr = CustomMRU->AddMRUString(
L"SECOND_ENTRY");
160 hr = CustomMRU->AddMRUString(
L"THIRD_ENTRY");
175 verify_mru(CustomMRU,
L"cba",
L"FIRST_ENTRY",
L"SECOND_ENTRY",
L"THIRD_ENTRY");
178 hr = CustomMRU->AddMRUString(
L"FIRST_ENTRY");
181 verify_mru(CustomMRU,
L"cba",
L"FIRST_ENTRY",
L"SECOND_ENTRY",
L"THIRD_ENTRY");
195 verify_mru(CustomMRU,
L"cba",
L"FIRST_ENTRY",
L"SECOND_ENTRY",
L"THIRD_ENTRY");
199 hr = CustomMRU->AddMRUString(
L"FIRST_ENTRY");
202 verify_mru(CustomMRU,
L"cba",
L"FIRST_ENTRY",
L"SECOND_ENTRY",
L"THIRD_ENTRY");
204 hr = CustomMRU->AddMRUString(
L"SOMETHING_ELSE");
207 verify_mru(CustomMRU,
L"bac",
L"FIRST_ENTRY",
L"SOMETHING_ELSE",
L"THIRD_ENTRY");
225 for (
int n = 0;
n < 30; ++
n)
230 hr = CustomMRU->AddMRUString(tmp);
234 verify_mru(CustomMRU,
L"a}|{zyxwvutsrqponmlkjihgfedcb",
L"29",
235 L"1",
L"2",
L"3",
L"4",
L"5",
L"6",
L"7",
L"8",
L"9",
236 L"10",
L"11",
L"12",
L"13",
L"14",
L"15",
L"16",
L"17",
L"18",
L"19",
237 L"20",
L"21",
L"22",
L"23",
L"24",
L"25",
L"26",
L"27",
L"28");
253 verify_mru(CustomMRU,
L"cba",
L"FIRST_ENTRY",
L"SECOND_ENTRY",
L"THIRD_ENTRY");
266 hr = CustomMRU->AddMRUString(
L"FOURTH_ENTRY");
268 verify_mru(CustomMRU,
L"acb",
L"FOURTH_ENTRY",
L"SECOND_ENTRY",
L"THIRD_ENTRY");
281 hr = CustomMRU->AddMRUString(
L"FIFTH_ENTRY");
283 verify_mru(CustomMRU,
L"bac",
L"FOURTH_ENTRY",
L"FIFTH_ENTRY",
L"THIRD_ENTRY");
296 key.SetStringValue(
L"MRUList",
L"b**");
305 verify_mru(CustomMRU,
L"b**",
L"FOURTH_ENTRY",
L"FIFTH_ENTRY",
L"THIRD_ENTRY");
316 hr = CustomMRU->AddMRUString(
L"SIXTH_ENTRY");
329 verify_mru(CustomMRU,
L"cba",
L"FIRST_ENTRY",
L"SECOND_ENTRY",
L"THIRD_ENTRY");
339 key.SetStringValue(
L"MRUList",
L"baccccc");
346 verify_mru(CustomMRU,
L"baccccc",
L"FIRST_ENTRY",
L"SECOND_ENTRY",
L"THIRD_ENTRY");
356 hr = CustomMRU->AddMRUString(
L"FOURTH_ENTRY");
358 verify_mru(CustomMRU,
L"a",
L"FOURTH_ENTRY",
L"SECOND_ENTRY",
L"THIRD_ENTRY");
373 hr = CustomMRU->AddMRUString(
L"FIRST_ENTRY");
380 key.SetStringValue(
L"MRUList",
L"aaa");
393 hr = CustomMRU->AddMRUString(
L"SECOND_ENTRY");
395 verify_mru(CustomMRU,
L"ba",
L"FIRST_ENTRY",
L"SECOND_ENTRY");
398#define TYPED_URLS_KEY L"Software\\Microsoft\\Internet Explorer\\TypedURLs"
408 key.DeleteValue(
L"url1");
412 key.DeleteValue(
L"url2");
435 key.SetStringValue(
L"url1",
L"aaa");
436 key.SetStringValue(
L"url2",
L"bbb");
445 skip(
"IACLCustomMRU was NULL\n");
451 hr = CustomMRU->QueryInterface(
IID_PPV_ARG(IACList, &ACList));
455 hr = ACList->Expand(
L"C:");
457 hr = ACList->Expand(
L"C:\\");
459 hr = ACList->Expand(
L"C:\\Program Files");
461 hr = ACList->Expand(
L"C:\\Program Files\\");
463 hr = ACList->Expand(
L"http://");
465 hr = ACList->Expand(
L"https://");
467 hr = ACList->Expand(
L"https://google.co.jp/");
476 hr = ACList->Expand(
L"C:");
478 hr = ACList->Expand(
L"C:\\");
480 hr = ACList->Expand(
L"C:\\Program Files");
482 hr = ACList->Expand(
L"C:\\Program Files\\");
484 hr = ACList->Expand(
L"http://");
486 hr = ACList->Expand(
L"https://");
488 hr = ACList->Expand(
L"https://google.co.jp/");
497 skip(
"IEnumString was NULL\n");
503 hr = pEnum->Clone(&pEnumClone);
509#define INVALID_LPOLESTR ((LPOLESTR)(LONG_PTR)0xDEADBEEF)
512 hr = pEnum->Next(2, apsz, &
c);
521 hr = pEnum->Next(0, &psz, &
c);
528 hr = pEnum->Next(1, &psz, &
c);
534 hr = CustomMRU->AddMRUString(
L"https://google.co.jp");
536 hr = CustomMRU->AddMRUString(
L"C:");
538 hr = CustomMRU->AddMRUString(
L"C:\\");
static const WCHAR szTestPath[]
static void test_IACLCustomMRU_ExtraChars()
static void RestoreTypedURLs(const CStringW &url1, const CStringW &url2)
#define ok_hex2(file, line, key, expression, result)
static void test_IACLCustomMRU_UpdateOrder()
static void verify_mru_(const char *file, int line, IACLCustomMRU *mru, PCWSTR MRUString,...)
static void test_IACLCustomMRU_Continue()
static void test_IACLCustomMRU_TypedURLs()
#define verify_mru(mru,...)
static void FillDefault(IACLCustomMRU *CustomMRU)
static void Cleanup_Testdata()
static void test_IACLCustomMRU_Basics()
#define ok_hex(expression, result)
#define ok_int(expression, result)
LONG Open(HKEY hKeyParent, LPCTSTR lpszKeyName, REGSAM samDesired=KEY_READ|KEY_WRITE) noexcept
LONG DeleteSubKey(LPCTSTR lpszSubKey) noexcept
void __cdecl Format(UINT nFormatID,...)
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
VOID WINAPI CoTaskMemFree(LPVOID ptr)
static DWORD DWORD void LPSTR DWORD cch
static HRESULT QueryInterface(REFIID, void **)
static ULONG WINAPI AddRef(IStream *iface)
static const WCHAR url1[]
static const WCHAR url2[]
#define DECLARE_INTERFACE_IID_(iface, ibase, iid)
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
base of all file and directory entries
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
#define HKEY_CURRENT_USER
#define IID_PPV_ARG(Itype, ppType)