Add missing EOLs

svn path=/trunk/; revision=56147
This commit is contained in:
Pierre Schweitzer 2012-03-14 10:04:07 +00:00
parent 5503fdf3bd
commit fa63f5ff1c

View file

@ -21,213 +21,213 @@ static VOID FsRtlIsNameInExpressionTest()
{ {
RtlInitUnicodeString(&Expression, L"*"); RtlInitUnicodeString(&Expression, L"*");
RtlInitUnicodeString(&Name, L""); RtlInitUnicodeString(&Name, L"");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
RtlInitUnicodeString(&Expression, L""); RtlInitUnicodeString(&Expression, L"");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
} }
RtlInitUnicodeString(&Expression, L"**"); RtlInitUnicodeString(&Expression, L"**");
if (!KmtIsCheckedBuild) if (!KmtIsCheckedBuild)
{ {
RtlInitUnicodeString(&Name, L""); RtlInitUnicodeString(&Name, L"");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
} }
RtlInitUnicodeString(&Name, L"a"); RtlInitUnicodeString(&Name, L"a");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
RtlInitUnicodeString(&Expression, L"ntdll.dll"); RtlInitUnicodeString(&Expression, L"ntdll.dll");
RtlInitUnicodeString(&Name, L"."); RtlInitUnicodeString(&Name, L".");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
RtlInitUnicodeString(&Name, L"~1"); RtlInitUnicodeString(&Name, L"~1");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
RtlInitUnicodeString(&Name, L".."); RtlInitUnicodeString(&Name, L"..");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
RtlInitUnicodeString(&Name, L"ntdll.dll"); RtlInitUnicodeString(&Name, L"ntdll.dll");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
RtlInitUnicodeString(&Expression, L"smss.exe"); RtlInitUnicodeString(&Expression, L"smss.exe");
RtlInitUnicodeString(&Name, L"."); RtlInitUnicodeString(&Name, L".");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
RtlInitUnicodeString(&Name, L"~1"); RtlInitUnicodeString(&Name, L"~1");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
RtlInitUnicodeString(&Name, L".."); RtlInitUnicodeString(&Name, L"..");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
RtlInitUnicodeString(&Name, L"ntdll.dll"); RtlInitUnicodeString(&Name, L"ntdll.dll");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
RtlInitUnicodeString(&Name, L"NTDLL.dll"); RtlInitUnicodeString(&Name, L"NTDLL.dll");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
RtlInitUnicodeString(&Expression, L"nt??krnl.???"); RtlInitUnicodeString(&Expression, L"nt??krnl.???");
RtlInitUnicodeString(&Name, L"ntoskrnl.exe"); RtlInitUnicodeString(&Name, L"ntoskrnl.exe");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
RtlInitUnicodeString(&Expression, L"he*o"); RtlInitUnicodeString(&Expression, L"he*o");
RtlInitUnicodeString(&Name, L"hello"); RtlInitUnicodeString(&Name, L"hello");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
RtlInitUnicodeString(&Name, L"helo"); RtlInitUnicodeString(&Name, L"helo");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
RtlInitUnicodeString(&Name, L"hella"); RtlInitUnicodeString(&Name, L"hella");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
RtlInitUnicodeString(&Expression, L"he*"); RtlInitUnicodeString(&Expression, L"he*");
RtlInitUnicodeString(&Name, L"hello"); RtlInitUnicodeString(&Name, L"hello");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
RtlInitUnicodeString(&Name, L"helo"); RtlInitUnicodeString(&Name, L"helo");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
RtlInitUnicodeString(&Name, L"hella"); RtlInitUnicodeString(&Name, L"hella");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
RtlInitUnicodeString(&Expression, L"*.cpl"); RtlInitUnicodeString(&Expression, L"*.cpl");
RtlInitUnicodeString(&Name, L"kdcom.dll"); RtlInitUnicodeString(&Name, L"kdcom.dll");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
RtlInitUnicodeString(&Name, L"bootvid.dll"); RtlInitUnicodeString(&Name, L"bootvid.dll");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
RtlInitUnicodeString(&Name, L"ntoskrnl.exe"); RtlInitUnicodeString(&Name, L"ntoskrnl.exe");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
RtlInitUnicodeString(&Expression, L"."); RtlInitUnicodeString(&Expression, L".");
RtlInitUnicodeString(&Name, L"NTDLL.DLL"); RtlInitUnicodeString(&Name, L"NTDLL.DLL");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
RtlInitUnicodeString(&Expression, L"F0_*.*"); RtlInitUnicodeString(&Expression, L"F0_*.*");
RtlInitUnicodeString(&Name, L"."); RtlInitUnicodeString(&Name, L".");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
RtlInitUnicodeString(&Name, L".."); RtlInitUnicodeString(&Name, L"..");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
RtlInitUnicodeString(&Name, L"SETUP.EXE"); RtlInitUnicodeString(&Name, L"SETUP.EXE");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
RtlInitUnicodeString(&Name, L"F0_001"); RtlInitUnicodeString(&Name, L"F0_001");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
RtlInitUnicodeString(&Expression, L"*.TTF"); RtlInitUnicodeString(&Expression, L"*.TTF");
RtlInitUnicodeString(&Name, L"."); RtlInitUnicodeString(&Name, L".");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
RtlInitUnicodeString(&Name, L".."); RtlInitUnicodeString(&Name, L"..");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
RtlInitUnicodeString(&Name, L"SETUP.INI"); RtlInitUnicodeString(&Name, L"SETUP.INI");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
RtlInitUnicodeString(&Expression, L"*"); RtlInitUnicodeString(&Expression, L"*");
RtlInitUnicodeString(&Name, L"."); RtlInitUnicodeString(&Name, L".");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
RtlInitUnicodeString(&Name, L".."); RtlInitUnicodeString(&Name, L"..");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
RtlInitUnicodeString(&Name, L"SETUP.INI"); RtlInitUnicodeString(&Name, L"SETUP.INI");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
RtlInitUnicodeString(&Expression, L"\"ntoskrnl.exe"); RtlInitUnicodeString(&Expression, L"\"ntoskrnl.exe");
RtlInitUnicodeString(&Name, L"ntoskrnl.exe"); RtlInitUnicodeString(&Name, L"ntoskrnl.exe");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
RtlInitUnicodeString(&Expression, L"ntoskrnl\"exe"); RtlInitUnicodeString(&Expression, L"ntoskrnl\"exe");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
RtlInitUnicodeString(&Expression, L"ntoskrn\".exe"); RtlInitUnicodeString(&Expression, L"ntoskrn\".exe");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
RtlInitUnicodeString(&Expression, L"ntoskrn\"\"exe"); RtlInitUnicodeString(&Expression, L"ntoskrn\"\"exe");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
RtlInitUnicodeString(&Expression, L"ntoskrnl.\"exe"); RtlInitUnicodeString(&Expression, L"ntoskrnl.\"exe");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
RtlInitUnicodeString(&Expression, L"ntoskrnl.exe\""); RtlInitUnicodeString(&Expression, L"ntoskrnl.exe\"");
RtlInitUnicodeString(&Name, L"ntoskrnl.exe"); RtlInitUnicodeString(&Name, L"ntoskrnl.exe");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
RtlInitUnicodeString(&Name, L"ntoskrnl.exe."); RtlInitUnicodeString(&Name, L"ntoskrnl.exe.");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
RtlInitUnicodeString(&Expression, L"*.c.d"); RtlInitUnicodeString(&Expression, L"*.c.d");
RtlInitUnicodeString(&Name, L"a.b.c.d"); RtlInitUnicodeString(&Name, L"a.b.c.d");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
RtlInitUnicodeString(&Expression, L"*.?.c.d"); RtlInitUnicodeString(&Expression, L"*.?.c.d");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
RtlInitUnicodeString(&Expression, L"*?"); RtlInitUnicodeString(&Expression, L"*?");
if (!KmtIsCheckedBuild) if (!KmtIsCheckedBuild)
{ {
RtlInitUnicodeString(&Name, L""); RtlInitUnicodeString(&Name, L"");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
} }
RtlInitUnicodeString(&Name, L"a"); RtlInitUnicodeString(&Name, L"a");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
RtlInitUnicodeString(&Name, L"aa"); RtlInitUnicodeString(&Name, L"aa");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
RtlInitUnicodeString(&Name, L"aaa"); RtlInitUnicodeString(&Name, L"aaa");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
RtlInitUnicodeString(&Expression, L"?*?"); RtlInitUnicodeString(&Expression, L"?*?");
if (!KmtIsCheckedBuild) if (!KmtIsCheckedBuild)
{ {
RtlInitUnicodeString(&Name, L""); RtlInitUnicodeString(&Name, L"");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
} }
RtlInitUnicodeString(&Name, L"a"); RtlInitUnicodeString(&Name, L"a");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
RtlInitUnicodeString(&Name, L"aa"); RtlInitUnicodeString(&Name, L"aa");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
RtlInitUnicodeString(&Name, L"aaa"); RtlInitUnicodeString(&Name, L"aaa");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
RtlInitUnicodeString(&Name, L"aaaa"); RtlInitUnicodeString(&Name, L"aaaa");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
/* Tests from #5923 */ /* Tests from #5923 */
RtlInitUnicodeString(&Expression, L"C:\\ReactOS\\**"); RtlInitUnicodeString(&Expression, L"C:\\ReactOS\\**");
RtlInitUnicodeString(&Name, L"C:\\ReactOS\\dings.bmp"); RtlInitUnicodeString(&Name, L"C:\\ReactOS\\dings.bmp");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
RtlInitUnicodeString(&Expression, L"C:\\ReactOS\\***"); RtlInitUnicodeString(&Expression, L"C:\\ReactOS\\***");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
RtlInitUnicodeString(&Expression, L"C:\\Windows\\*a*"); RtlInitUnicodeString(&Expression, L"C:\\Windows\\*a*");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
RtlInitUnicodeString(&Expression, L"C:\\ReactOS\\*.bmp"); RtlInitUnicodeString(&Expression, L"C:\\ReactOS\\*.bmp");
RtlInitUnicodeString(&Name, L"C:\\Windows\\explorer.exe"); RtlInitUnicodeString(&Name, L"C:\\Windows\\explorer.exe");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
RtlInitUnicodeString(&Expression, L"*.bmp;*.dib"); RtlInitUnicodeString(&Expression, L"*.bmp;*.dib");
RtlInitUnicodeString(&Name, L"winhlp32.exe"); RtlInitUnicodeString(&Name, L"winhlp32.exe");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
/* Backtracking tests */ /* Backtracking tests */
RtlInitUnicodeString(&Expression, L"*.*.*.*"); RtlInitUnicodeString(&Expression, L"*.*.*.*");
RtlInitUnicodeString(&Name, L"127.0.0.1"); RtlInitUnicodeString(&Name, L"127.0.0.1");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
RtlInitUnicodeString(&Expression, L"*?*?*?*"); RtlInitUnicodeString(&Expression, L"*?*?*?*");
RtlInitUnicodeString(&Name, L"1.0.0.1"); RtlInitUnicodeString(&Name, L"1.0.0.1");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
RtlInitUnicodeString(&Expression, L"?*?*?*?"); RtlInitUnicodeString(&Expression, L"?*?*?*?");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
RtlInitUnicodeString(&Expression, L"?.?.?.?"); RtlInitUnicodeString(&Expression, L"?.?.?.?");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
RtlInitUnicodeString(&Expression, L"*a*ab*abc"); RtlInitUnicodeString(&Expression, L"*a*ab*abc");
RtlInitUnicodeString(&Name, L"aabaabcdadabdabc"); RtlInitUnicodeString(&Name, L"aabaabcdadabdabc");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
/* Tests for extra wildcards */ /* Tests for extra wildcards */
RtlInitUnicodeString(&Expression, L"ab<exe"); RtlInitUnicodeString(&Expression, L"ab<exe");
RtlInitUnicodeString(&Name, L"abcd.exe"); RtlInitUnicodeString(&Name, L"abcd.exe");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
RtlInitUnicodeString(&Name, L"ab.exe"); RtlInitUnicodeString(&Name, L"ab.exe");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
RtlInitUnicodeString(&Name, L"abcdexe"); RtlInitUnicodeString(&Name, L"abcdexe");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
RtlInitUnicodeString(&Name, L"acd.exe"); RtlInitUnicodeString(&Name, L"acd.exe");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
RtlInitUnicodeString(&Expression, L"abc.exe\""); RtlInitUnicodeString(&Expression, L"abc.exe\"");
RtlInitUnicodeString(&Name, L"abc.exe"); RtlInitUnicodeString(&Name, L"abc.exe");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
RtlInitUnicodeString(&Name, L"abc.exe."); RtlInitUnicodeString(&Name, L"abc.exe.");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
RtlInitUnicodeString(&Name, L"abc.exe.back"); RtlInitUnicodeString(&Name, L"abc.exe.back");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
RtlInitUnicodeString(&Name, L"abc.exes"); RtlInitUnicodeString(&Name, L"abc.exes");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
RtlInitUnicodeString(&Expression, L"a>c.exe"); RtlInitUnicodeString(&Expression, L"a>c.exe");
RtlInitUnicodeString(&Name, L"abc.exe"); RtlInitUnicodeString(&Name, L"abc.exe");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
RtlInitUnicodeString(&Name, L"ac.exe"); RtlInitUnicodeString(&Name, L"ac.exe");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
RtlInitUnicodeString(&Expression, L"a>>>exe"); RtlInitUnicodeString(&Expression, L"a>>>exe");
RtlInitUnicodeString(&Name, L"abc.exe"); RtlInitUnicodeString(&Name, L"abc.exe");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
RtlInitUnicodeString(&Name, L"ac.exe"); RtlInitUnicodeString(&Name, L"ac.exe");
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
} }
static VOID FsRtlIsDbcsInExpressionTest() static VOID FsRtlIsDbcsInExpressionTest()
@ -238,213 +238,213 @@ static VOID FsRtlIsDbcsInExpressionTest()
{ {
RtlInitAnsiString(&Expression, "*"); RtlInitAnsiString(&Expression, "*");
RtlInitAnsiString(&Name, ""); RtlInitAnsiString(&Name, "");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
RtlInitAnsiString(&Expression, ""); RtlInitAnsiString(&Expression, "");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
} }
RtlInitAnsiString(&Expression, "**"); RtlInitAnsiString(&Expression, "**");
if (!KmtIsCheckedBuild) if (!KmtIsCheckedBuild)
{ {
RtlInitAnsiString(&Name, ""); RtlInitAnsiString(&Name, "");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
} }
RtlInitAnsiString(&Name, "a"); RtlInitAnsiString(&Name, "a");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
RtlInitAnsiString(&Expression, "ntdll.dll"); RtlInitAnsiString(&Expression, "ntdll.dll");
RtlInitAnsiString(&Name, "."); RtlInitAnsiString(&Name, ".");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
RtlInitAnsiString(&Name, "~1"); RtlInitAnsiString(&Name, "~1");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
RtlInitAnsiString(&Name, ".."); RtlInitAnsiString(&Name, "..");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
RtlInitAnsiString(&Name, "ntdll.dll"); RtlInitAnsiString(&Name, "ntdll.dll");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
RtlInitAnsiString(&Expression, "smss.exe"); RtlInitAnsiString(&Expression, "smss.exe");
RtlInitAnsiString(&Name, "."); RtlInitAnsiString(&Name, ".");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
RtlInitAnsiString(&Name, "~1"); RtlInitAnsiString(&Name, "~1");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
RtlInitAnsiString(&Name, ".."); RtlInitAnsiString(&Name, "..");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
RtlInitAnsiString(&Name, "ntdll.dll"); RtlInitAnsiString(&Name, "ntdll.dll");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
RtlInitAnsiString(&Name, "NTDLL.dll"); RtlInitAnsiString(&Name, "NTDLL.dll");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
RtlInitAnsiString(&Expression, "nt??krnl.???"); RtlInitAnsiString(&Expression, "nt??krnl.???");
RtlInitAnsiString(&Name, "ntoskrnl.exe"); RtlInitAnsiString(&Name, "ntoskrnl.exe");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
RtlInitAnsiString(&Expression, "he*o"); RtlInitAnsiString(&Expression, "he*o");
RtlInitAnsiString(&Name, "hello"); RtlInitAnsiString(&Name, "hello");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
RtlInitAnsiString(&Name, "helo"); RtlInitAnsiString(&Name, "helo");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
RtlInitAnsiString(&Name, "hella"); RtlInitAnsiString(&Name, "hella");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
RtlInitAnsiString(&Expression, "he*"); RtlInitAnsiString(&Expression, "he*");
RtlInitAnsiString(&Name, "hello"); RtlInitAnsiString(&Name, "hello");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
RtlInitAnsiString(&Name, "helo"); RtlInitAnsiString(&Name, "helo");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
RtlInitAnsiString(&Name, "hella"); RtlInitAnsiString(&Name, "hella");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
RtlInitAnsiString(&Expression, "*.cpl"); RtlInitAnsiString(&Expression, "*.cpl");
RtlInitAnsiString(&Name, "kdcom.dll"); RtlInitAnsiString(&Name, "kdcom.dll");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
RtlInitAnsiString(&Name, "bootvid.dll"); RtlInitAnsiString(&Name, "bootvid.dll");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
RtlInitAnsiString(&Name, "ntoskrnl.exe"); RtlInitAnsiString(&Name, "ntoskrnl.exe");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
RtlInitAnsiString(&Expression, "."); RtlInitAnsiString(&Expression, ".");
RtlInitAnsiString(&Name, "NTDLL.DLL"); RtlInitAnsiString(&Name, "NTDLL.DLL");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
RtlInitAnsiString(&Expression, "F0_*.*"); RtlInitAnsiString(&Expression, "F0_*.*");
RtlInitAnsiString(&Name, "."); RtlInitAnsiString(&Name, ".");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
RtlInitAnsiString(&Name, ".."); RtlInitAnsiString(&Name, "..");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
RtlInitAnsiString(&Name, "SETUP.EXE"); RtlInitAnsiString(&Name, "SETUP.EXE");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
RtlInitAnsiString(&Name, "F0_001"); RtlInitAnsiString(&Name, "F0_001");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
RtlInitAnsiString(&Expression, "*.TTF"); RtlInitAnsiString(&Expression, "*.TTF");
RtlInitAnsiString(&Name, "."); RtlInitAnsiString(&Name, ".");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
RtlInitAnsiString(&Name, ".."); RtlInitAnsiString(&Name, "..");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
RtlInitAnsiString(&Name, "SETUP.INI"); RtlInitAnsiString(&Name, "SETUP.INI");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
RtlInitAnsiString(&Expression, "*"); RtlInitAnsiString(&Expression, "*");
RtlInitAnsiString(&Name, "."); RtlInitAnsiString(&Name, ".");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
RtlInitAnsiString(&Name, ".."); RtlInitAnsiString(&Name, "..");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
RtlInitAnsiString(&Name, "SETUP.INI"); RtlInitAnsiString(&Name, "SETUP.INI");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
RtlInitAnsiString(&Expression, "\"ntoskrnl.exe"); RtlInitAnsiString(&Expression, "\"ntoskrnl.exe");
RtlInitAnsiString(&Name, "ntoskrnl.exe"); RtlInitAnsiString(&Name, "ntoskrnl.exe");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
RtlInitAnsiString(&Expression, "ntoskrnl\"exe"); RtlInitAnsiString(&Expression, "ntoskrnl\"exe");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
RtlInitAnsiString(&Expression, "ntoskrn\".exe"); RtlInitAnsiString(&Expression, "ntoskrn\".exe");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
RtlInitAnsiString(&Expression, "ntoskrn\"\"exe"); RtlInitAnsiString(&Expression, "ntoskrn\"\"exe");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
RtlInitAnsiString(&Expression, "ntoskrnl.\"exe"); RtlInitAnsiString(&Expression, "ntoskrnl.\"exe");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
RtlInitAnsiString(&Expression, "ntoskrnl.exe\""); RtlInitAnsiString(&Expression, "ntoskrnl.exe\"");
RtlInitAnsiString(&Name, "ntoskrnl.exe"); RtlInitAnsiString(&Name, "ntoskrnl.exe");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
RtlInitAnsiString(&Name, "ntoskrnl.exe."); RtlInitAnsiString(&Name, "ntoskrnl.exe.");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
RtlInitAnsiString(&Expression, "*.c.d"); RtlInitAnsiString(&Expression, "*.c.d");
RtlInitAnsiString(&Name, "a.b.c.d"); RtlInitAnsiString(&Name, "a.b.c.d");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
RtlInitAnsiString(&Expression, "*.?.c.d"); RtlInitAnsiString(&Expression, "*.?.c.d");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
RtlInitAnsiString(&Expression, "*?"); RtlInitAnsiString(&Expression, "*?");
if (!KmtIsCheckedBuild) if (!KmtIsCheckedBuild)
{ {
RtlInitAnsiString(&Name, ""); RtlInitAnsiString(&Name, "");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
} }
RtlInitAnsiString(&Name, "a"); RtlInitAnsiString(&Name, "a");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
RtlInitAnsiString(&Name, "aa"); RtlInitAnsiString(&Name, "aa");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
RtlInitAnsiString(&Name, "aaa"); RtlInitAnsiString(&Name, "aaa");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
RtlInitAnsiString(&Expression, "?*?"); RtlInitAnsiString(&Expression, "?*?");
if (!KmtIsCheckedBuild) if (!KmtIsCheckedBuild)
{ {
RtlInitAnsiString(&Name, ""); RtlInitAnsiString(&Name, "");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
} }
RtlInitAnsiString(&Name, "a"); RtlInitAnsiString(&Name, "a");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
RtlInitAnsiString(&Name, "aa"); RtlInitAnsiString(&Name, "aa");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
RtlInitAnsiString(&Name, "aaa"); RtlInitAnsiString(&Name, "aaa");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
RtlInitAnsiString(&Name, "aaaa"); RtlInitAnsiString(&Name, "aaaa");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
/* Tests from #5923 */ /* Tests from #5923 */
RtlInitAnsiString(&Expression, "C:\\ReactOS\\**"); RtlInitAnsiString(&Expression, "C:\\ReactOS\\**");
RtlInitAnsiString(&Name, "C:\\ReactOS\\dings.bmp"); RtlInitAnsiString(&Name, "C:\\ReactOS\\dings.bmp");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
RtlInitAnsiString(&Expression, "C:\\ReactOS\\***"); RtlInitAnsiString(&Expression, "C:\\ReactOS\\***");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
RtlInitAnsiString(&Expression, "C:\\Windows\\*a*"); RtlInitAnsiString(&Expression, "C:\\Windows\\*a*");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
RtlInitAnsiString(&Expression, "C:\\ReactOS\\*.bmp"); RtlInitAnsiString(&Expression, "C:\\ReactOS\\*.bmp");
RtlInitAnsiString(&Name, "C:\\Windows\\explorer.exe"); RtlInitAnsiString(&Name, "C:\\Windows\\explorer.exe");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
RtlInitAnsiString(&Expression, "*.bmp;*.dib"); RtlInitAnsiString(&Expression, "*.bmp;*.dib");
RtlInitAnsiString(&Name, "winhlp32.exe"); RtlInitAnsiString(&Name, "winhlp32.exe");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
/* Backtracking tests */ /* Backtracking tests */
RtlInitAnsiString(&Expression, "*.*.*.*"); RtlInitAnsiString(&Expression, "*.*.*.*");
RtlInitAnsiString(&Name, "127.0.0.1"); RtlInitAnsiString(&Name, "127.0.0.1");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
RtlInitAnsiString(&Expression, "*?*?*?*"); RtlInitAnsiString(&Expression, "*?*?*?*");
RtlInitAnsiString(&Name, "1.0.0.1"); RtlInitAnsiString(&Name, "1.0.0.1");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
RtlInitAnsiString(&Expression, "?*?*?*?"); RtlInitAnsiString(&Expression, "?*?*?*?");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
RtlInitAnsiString(&Expression, "?.?.?.?"); RtlInitAnsiString(&Expression, "?.?.?.?");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
RtlInitAnsiString(&Expression, "*a*ab*abc"); RtlInitAnsiString(&Expression, "*a*ab*abc");
RtlInitAnsiString(&Name, "aabaabcdadabdabc"); RtlInitAnsiString(&Name, "aabaabcdadabdabc");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
/* Tests for extra wildcards */ /* Tests for extra wildcards */
RtlInitAnsiString(&Expression, "ab<exe"); RtlInitAnsiString(&Expression, "ab<exe");
RtlInitAnsiString(&Name, "abcd.exe"); RtlInitAnsiString(&Name, "abcd.exe");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
RtlInitAnsiString(&Name, "ab.exe"); RtlInitAnsiString(&Name, "ab.exe");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
RtlInitAnsiString(&Name, "abcdexe"); RtlInitAnsiString(&Name, "abcdexe");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
RtlInitAnsiString(&Name, "acd.exe"); RtlInitAnsiString(&Name, "acd.exe");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
RtlInitAnsiString(&Expression, "abc.exe\""); RtlInitAnsiString(&Expression, "abc.exe\"");
RtlInitAnsiString(&Name, "abc.exe"); RtlInitAnsiString(&Name, "abc.exe");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
RtlInitAnsiString(&Name, "abc.exe."); RtlInitAnsiString(&Name, "abc.exe.");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
RtlInitAnsiString(&Name, "abc.exe.back"); RtlInitAnsiString(&Name, "abc.exe.back");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
RtlInitAnsiString(&Name, "abc.exes"); RtlInitAnsiString(&Name, "abc.exes");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
RtlInitAnsiString(&Expression, "a>c.exe"); RtlInitAnsiString(&Expression, "a>c.exe");
RtlInitAnsiString(&Name, "abc.exe"); RtlInitAnsiString(&Name, "abc.exe");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
RtlInitAnsiString(&Name, "ac.exe"); RtlInitAnsiString(&Name, "ac.exe");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
RtlInitAnsiString(&Expression, "a>>>exe"); RtlInitAnsiString(&Expression, "a>>>exe");
RtlInitAnsiString(&Name, "abc.exe"); RtlInitAnsiString(&Name, "abc.exe");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
RtlInitAnsiString(&Name, "ac.exe"); RtlInitAnsiString(&Name, "ac.exe");
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
} }
START_TEST(FsRtlExpression) START_TEST(FsRtlExpression)