2 * PROJECT: ReactOS api tests
3 * LICENSE: GPLv2+ - See COPYING in the top level directory
4 * PURPOSE: Test for RtlDosApplyFileIsolationRedirection_Ustr
5 * PROGRAMMER: Giannis Adamopoulos
10 #define WIN32_NO_STATUS
11 #include <ndk/rtlfuncs.h>
13 #define ok_eq_hex(value, expected) ok((value) == (expected), #value " = 0x%lx, expected 0x%lx\n", value, expected)
14 #define ok_eq_pointer(value, expected) ok((value) == (expected), #value " = %p, expected %p\n", value, expected)
16 UNICODE_STRING DotDll
= RTL_CONSTANT_STRING(L
".DLL");
18 void TestDefaultSxsRedirection(void)
20 UNICODE_STRING GdiPlusSXS
= RTL_CONSTANT_STRING(L
"\\WinSxS\\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.");
21 UNICODE_STRING Comctl32SXS
= RTL_CONSTANT_STRING(L
"\\WinSxS\\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82");
22 UNICODE_STRING Comctl32
= RTL_CONSTANT_STRING(L
"COMCTL32.DLL");
23 UNICODE_STRING GdiPlus
= RTL_CONSTANT_STRING(L
"GDIPLUS.DLL");
24 UNICODE_STRING CallerBuffer
;
25 UNICODE_STRING DynamicString
;
26 PUNICODE_STRING FullNameOut
;
31 /* NOTE: in xp and 2k3 gdiplus does not exist in system32 */
32 RtlInitUnicodeString(&CallerBuffer
, NULL
);
33 RtlInitUnicodeString(&DynamicString
, NULL
);
35 Status
= RtlDosApplyFileIsolationRedirection_Ustr(TRUE
,
44 ok_eq_hex(Status
, STATUS_SUCCESS
);
45 ok_eq_pointer(CallerBuffer
.Buffer
, NULL
);
46 ok_eq_pointer(FullNameOut
, &DynamicString
);
47 Status
= RtlFindCharInUnicodeString(RTL_FIND_CHAR_IN_UNICODE_STRING_CASE_INSENSITIVE
,
51 ok_eq_hex(Status
, STATUS_SUCCESS
);
54 RtlInitUnicodeString(&CallerBuffer
, NULL
);
55 RtlInitUnicodeString(&DynamicString
, NULL
);
57 Status
= RtlDosApplyFileIsolationRedirection_Ustr(TRUE
,
66 ok_eq_hex(Status
, STATUS_SUCCESS
);
67 ok_eq_pointer(CallerBuffer
.Buffer
, NULL
);
68 ok_eq_pointer(FullNameOut
, &DynamicString
);
69 Status
= RtlFindCharInUnicodeString(RTL_FIND_CHAR_IN_UNICODE_STRING_CASE_INSENSITIVE
,
73 ok_eq_hex(Status
, STATUS_SUCCESS
);
76 void TestDotLocal(void)
80 START_TEST(RtlDosApplyFileIsolationRedirection_Ustr
)
83 TestDefaultSxsRedirection();