2011-06-27 08:49:23 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: ReactOS kernel-mode tests
|
|
|
|
* LICENSE: LGPLv2+ - See COPYING.LIB in the top level directory
|
|
|
|
* PURPOSE: Kernel-Mode Test Suite FsRtl Test
|
|
|
|
* PROGRAMMER: Pierre Schweitzer <pierre.schweitzer@reactos.org>
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* TODO: most of these calls fail the Windows checked build's !islower assertion and others */
|
|
|
|
|
|
|
|
#include <kmt_test.h>
|
|
|
|
|
|
|
|
#define NDEBUG
|
|
|
|
#include <debug.h>
|
|
|
|
|
|
|
|
static VOID FsRtlIsNameInExpressionTest()
|
|
|
|
{
|
|
|
|
UNICODE_STRING Expression, Name;
|
|
|
|
|
2011-09-10 10:48:07 +00:00
|
|
|
/* !Name->Length || !Expression->Length asserts */
|
|
|
|
if (!KmtIsCheckedBuild)
|
|
|
|
{
|
|
|
|
RtlInitUnicodeString(&Expression, L"*");
|
|
|
|
RtlInitUnicodeString(&Name, L"");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
|
2011-09-10 10:48:07 +00:00
|
|
|
RtlInitUnicodeString(&Expression, L"");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
|
2012-03-13 21:24:11 +00:00
|
|
|
}
|
2012-03-13 21:07:55 +00:00
|
|
|
|
2012-03-13 21:24:11 +00:00
|
|
|
RtlInitUnicodeString(&Expression, L"**");
|
|
|
|
if (!KmtIsCheckedBuild)
|
|
|
|
{
|
2012-03-13 21:07:55 +00:00
|
|
|
RtlInitUnicodeString(&Name, L"");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
|
2011-09-10 10:48:07 +00:00
|
|
|
}
|
2012-03-13 21:24:11 +00:00
|
|
|
RtlInitUnicodeString(&Name, L"a");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
|
|
|
|
RtlInitUnicodeString(&Expression, L"ntdll.dll");
|
|
|
|
RtlInitUnicodeString(&Name, L".");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitUnicodeString(&Name, L"~1");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitUnicodeString(&Name, L"..");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitUnicodeString(&Name, L"ntdll.dll");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
|
|
|
|
RtlInitUnicodeString(&Expression, L"smss.exe");
|
|
|
|
RtlInitUnicodeString(&Name, L".");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitUnicodeString(&Name, L"~1");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitUnicodeString(&Name, L"..");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitUnicodeString(&Name, L"ntdll.dll");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitUnicodeString(&Name, L"NTDLL.dll");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
|
|
|
|
RtlInitUnicodeString(&Expression, L"nt??krnl.???");
|
|
|
|
RtlInitUnicodeString(&Name, L"ntoskrnl.exe");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
|
|
|
|
RtlInitUnicodeString(&Expression, L"he*o");
|
|
|
|
RtlInitUnicodeString(&Name, L"hello");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitUnicodeString(&Name, L"helo");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitUnicodeString(&Name, L"hella");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
|
|
|
|
RtlInitUnicodeString(&Expression, L"he*");
|
|
|
|
RtlInitUnicodeString(&Name, L"hello");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitUnicodeString(&Name, L"helo");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitUnicodeString(&Name, L"hella");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
|
|
|
|
RtlInitUnicodeString(&Expression, L"*.cpl");
|
|
|
|
RtlInitUnicodeString(&Name, L"kdcom.dll");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitUnicodeString(&Name, L"bootvid.dll");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitUnicodeString(&Name, L"ntoskrnl.exe");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
|
|
|
|
RtlInitUnicodeString(&Expression, L".");
|
|
|
|
RtlInitUnicodeString(&Name, L"NTDLL.DLL");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
|
|
|
|
RtlInitUnicodeString(&Expression, L"F0_*.*");
|
|
|
|
RtlInitUnicodeString(&Name, L".");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitUnicodeString(&Name, L"..");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitUnicodeString(&Name, L"SETUP.EXE");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitUnicodeString(&Name, L"F0_001");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
|
|
|
|
RtlInitUnicodeString(&Expression, L"*.TTF");
|
|
|
|
RtlInitUnicodeString(&Name, L".");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitUnicodeString(&Name, L"..");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitUnicodeString(&Name, L"SETUP.INI");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
|
|
|
|
RtlInitUnicodeString(&Expression, L"*");
|
|
|
|
RtlInitUnicodeString(&Name, L".");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitUnicodeString(&Name, L"..");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitUnicodeString(&Name, L"SETUP.INI");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
|
|
|
|
RtlInitUnicodeString(&Expression, L"\"ntoskrnl.exe");
|
|
|
|
RtlInitUnicodeString(&Name, L"ntoskrnl.exe");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitUnicodeString(&Expression, L"ntoskrnl\"exe");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitUnicodeString(&Expression, L"ntoskrn\".exe");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitUnicodeString(&Expression, L"ntoskrn\"\"exe");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitUnicodeString(&Expression, L"ntoskrnl.\"exe");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitUnicodeString(&Expression, L"ntoskrnl.exe\"");
|
|
|
|
RtlInitUnicodeString(&Name, L"ntoskrnl.exe");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitUnicodeString(&Name, L"ntoskrnl.exe.");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
|
|
|
|
RtlInitUnicodeString(&Expression, L"*.c.d");
|
|
|
|
RtlInitUnicodeString(&Name, L"a.b.c.d");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitUnicodeString(&Expression, L"*.?.c.d");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitUnicodeString(&Expression, L"*?");
|
2011-09-10 10:48:07 +00:00
|
|
|
if (!KmtIsCheckedBuild)
|
|
|
|
{
|
|
|
|
RtlInitUnicodeString(&Name, L"");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
|
2011-09-10 10:48:07 +00:00
|
|
|
}
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitUnicodeString(&Name, L"a");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitUnicodeString(&Name, L"aa");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitUnicodeString(&Name, L"aaa");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitUnicodeString(&Expression, L"?*?");
|
2011-09-10 10:48:07 +00:00
|
|
|
if (!KmtIsCheckedBuild)
|
|
|
|
{
|
|
|
|
RtlInitUnicodeString(&Name, L"");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
|
2011-09-10 10:48:07 +00:00
|
|
|
}
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitUnicodeString(&Name, L"a");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitUnicodeString(&Name, L"aa");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitUnicodeString(&Name, L"aaa");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitUnicodeString(&Name, L"aaaa");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
|
|
|
|
/* Tests from #5923 */
|
|
|
|
RtlInitUnicodeString(&Expression, L"C:\\ReactOS\\**");
|
|
|
|
RtlInitUnicodeString(&Name, L"C:\\ReactOS\\dings.bmp");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitUnicodeString(&Expression, L"C:\\ReactOS\\***");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitUnicodeString(&Expression, L"C:\\Windows\\*a*");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
|
|
|
|
RtlInitUnicodeString(&Expression, L"C:\\ReactOS\\*.bmp");
|
|
|
|
RtlInitUnicodeString(&Name, L"C:\\Windows\\explorer.exe");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitUnicodeString(&Expression, L"*.bmp;*.dib");
|
|
|
|
RtlInitUnicodeString(&Name, L"winhlp32.exe");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
|
2011-09-26 05:51:39 +00:00
|
|
|
|
|
|
|
/* Backtracking tests */
|
|
|
|
RtlInitUnicodeString(&Expression, L"*.*.*.*");
|
|
|
|
RtlInitUnicodeString(&Name, L"127.0.0.1");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
|
2011-09-26 05:51:39 +00:00
|
|
|
|
2012-03-13 21:07:55 +00:00
|
|
|
RtlInitUnicodeString(&Expression, L"*?*?*?*");
|
|
|
|
RtlInitUnicodeString(&Name, L"1.0.0.1");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
|
2012-03-13 21:07:55 +00:00
|
|
|
RtlInitUnicodeString(&Expression, L"?*?*?*?");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
|
2012-03-13 21:07:55 +00:00
|
|
|
RtlInitUnicodeString(&Expression, L"?.?.?.?");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
|
2012-03-13 21:07:55 +00:00
|
|
|
|
2011-09-26 05:51:39 +00:00
|
|
|
RtlInitUnicodeString(&Expression, L"*a*ab*abc");
|
|
|
|
RtlInitUnicodeString(&Name, L"aabaabcdadabdabc");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
|
2012-03-14 09:43:16 +00:00
|
|
|
|
|
|
|
/* Tests for extra wildcards */
|
|
|
|
RtlInitUnicodeString(&Expression, L"ab<exe");
|
|
|
|
RtlInitUnicodeString(&Name, L"abcd.exe");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
|
2012-03-14 09:43:16 +00:00
|
|
|
RtlInitUnicodeString(&Name, L"ab.exe");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
|
2012-03-14 09:43:16 +00:00
|
|
|
RtlInitUnicodeString(&Name, L"abcdexe");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
|
2012-03-14 09:43:16 +00:00
|
|
|
RtlInitUnicodeString(&Name, L"acd.exe");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
|
2012-03-14 09:43:16 +00:00
|
|
|
|
|
|
|
RtlInitUnicodeString(&Expression, L"abc.exe\"");
|
|
|
|
RtlInitUnicodeString(&Name, L"abc.exe");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
|
2012-03-14 09:43:16 +00:00
|
|
|
RtlInitUnicodeString(&Name, L"abc.exe.");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
|
2012-03-14 09:43:16 +00:00
|
|
|
RtlInitUnicodeString(&Name, L"abc.exe.back");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
|
2012-03-14 09:43:16 +00:00
|
|
|
RtlInitUnicodeString(&Name, L"abc.exes");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
|
2012-03-14 09:43:16 +00:00
|
|
|
|
|
|
|
RtlInitUnicodeString(&Expression, L"a>c.exe");
|
|
|
|
RtlInitUnicodeString(&Name, L"abc.exe");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE\n");
|
2012-03-14 09:43:16 +00:00
|
|
|
RtlInitUnicodeString(&Name, L"ac.exe");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
|
2012-03-14 09:43:16 +00:00
|
|
|
RtlInitUnicodeString(&Expression, L"a>>>exe");
|
|
|
|
RtlInitUnicodeString(&Name, L"abc.exe");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
|
2012-03-14 09:43:16 +00:00
|
|
|
RtlInitUnicodeString(&Name, L"ac.exe");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static VOID FsRtlIsDbcsInExpressionTest()
|
|
|
|
{
|
|
|
|
ANSI_STRING Expression, Name;
|
|
|
|
|
2011-09-10 10:48:07 +00:00
|
|
|
if (!KmtIsCheckedBuild)
|
|
|
|
{
|
|
|
|
RtlInitAnsiString(&Expression, "*");
|
|
|
|
RtlInitAnsiString(&Name, "");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
|
2011-09-10 10:48:07 +00:00
|
|
|
RtlInitAnsiString(&Expression, "");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
|
2012-03-13 21:24:11 +00:00
|
|
|
}
|
2012-03-13 21:07:55 +00:00
|
|
|
|
2012-03-13 21:24:11 +00:00
|
|
|
RtlInitAnsiString(&Expression, "**");
|
|
|
|
if (!KmtIsCheckedBuild)
|
|
|
|
{
|
2012-03-13 21:07:55 +00:00
|
|
|
RtlInitAnsiString(&Name, "");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
|
2011-09-10 10:48:07 +00:00
|
|
|
}
|
2012-03-13 21:24:11 +00:00
|
|
|
RtlInitAnsiString(&Name, "a");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
|
|
|
|
RtlInitAnsiString(&Expression, "ntdll.dll");
|
|
|
|
RtlInitAnsiString(&Name, ".");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitAnsiString(&Name, "~1");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitAnsiString(&Name, "..");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitAnsiString(&Name, "ntdll.dll");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
|
|
|
|
RtlInitAnsiString(&Expression, "smss.exe");
|
|
|
|
RtlInitAnsiString(&Name, ".");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitAnsiString(&Name, "~1");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitAnsiString(&Name, "..");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitAnsiString(&Name, "ntdll.dll");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitAnsiString(&Name, "NTDLL.dll");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
|
|
|
|
RtlInitAnsiString(&Expression, "nt??krnl.???");
|
|
|
|
RtlInitAnsiString(&Name, "ntoskrnl.exe");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
|
|
|
|
RtlInitAnsiString(&Expression, "he*o");
|
|
|
|
RtlInitAnsiString(&Name, "hello");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitAnsiString(&Name, "helo");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitAnsiString(&Name, "hella");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
|
|
|
|
RtlInitAnsiString(&Expression, "he*");
|
|
|
|
RtlInitAnsiString(&Name, "hello");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitAnsiString(&Name, "helo");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitAnsiString(&Name, "hella");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
|
|
|
|
RtlInitAnsiString(&Expression, "*.cpl");
|
|
|
|
RtlInitAnsiString(&Name, "kdcom.dll");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitAnsiString(&Name, "bootvid.dll");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitAnsiString(&Name, "ntoskrnl.exe");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
|
|
|
|
RtlInitAnsiString(&Expression, ".");
|
|
|
|
RtlInitAnsiString(&Name, "NTDLL.DLL");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
|
|
|
|
RtlInitAnsiString(&Expression, "F0_*.*");
|
|
|
|
RtlInitAnsiString(&Name, ".");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitAnsiString(&Name, "..");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitAnsiString(&Name, "SETUP.EXE");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitAnsiString(&Name, "F0_001");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
|
|
|
|
RtlInitAnsiString(&Expression, "*.TTF");
|
|
|
|
RtlInitAnsiString(&Name, ".");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitAnsiString(&Name, "..");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitAnsiString(&Name, "SETUP.INI");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
|
|
|
|
RtlInitAnsiString(&Expression, "*");
|
|
|
|
RtlInitAnsiString(&Name, ".");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitAnsiString(&Name, "..");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitAnsiString(&Name, "SETUP.INI");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
|
|
|
|
RtlInitAnsiString(&Expression, "\"ntoskrnl.exe");
|
|
|
|
RtlInitAnsiString(&Name, "ntoskrnl.exe");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitAnsiString(&Expression, "ntoskrnl\"exe");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitAnsiString(&Expression, "ntoskrn\".exe");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitAnsiString(&Expression, "ntoskrn\"\"exe");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitAnsiString(&Expression, "ntoskrnl.\"exe");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitAnsiString(&Expression, "ntoskrnl.exe\"");
|
|
|
|
RtlInitAnsiString(&Name, "ntoskrnl.exe");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitAnsiString(&Name, "ntoskrnl.exe.");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
|
|
|
|
RtlInitAnsiString(&Expression, "*.c.d");
|
|
|
|
RtlInitAnsiString(&Name, "a.b.c.d");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitAnsiString(&Expression, "*.?.c.d");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitAnsiString(&Expression, "*?");
|
2011-09-10 10:48:07 +00:00
|
|
|
if (!KmtIsCheckedBuild)
|
|
|
|
{
|
|
|
|
RtlInitAnsiString(&Name, "");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
|
2011-09-10 10:48:07 +00:00
|
|
|
}
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitAnsiString(&Name, "a");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitAnsiString(&Name, "aa");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitAnsiString(&Name, "aaa");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitAnsiString(&Expression, "?*?");
|
2011-09-10 10:48:07 +00:00
|
|
|
if (!KmtIsCheckedBuild)
|
|
|
|
{
|
|
|
|
RtlInitAnsiString(&Name, "");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
|
2011-09-10 10:48:07 +00:00
|
|
|
}
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitAnsiString(&Name, "a");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitAnsiString(&Name, "aa");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitAnsiString(&Name, "aaa");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitAnsiString(&Name, "aaaa");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
|
|
|
|
/* Tests from #5923 */
|
|
|
|
RtlInitAnsiString(&Expression, "C:\\ReactOS\\**");
|
|
|
|
RtlInitAnsiString(&Name, "C:\\ReactOS\\dings.bmp");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitAnsiString(&Expression, "C:\\ReactOS\\***");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitAnsiString(&Expression, "C:\\Windows\\*a*");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
|
|
|
|
RtlInitAnsiString(&Expression, "C:\\ReactOS\\*.bmp");
|
|
|
|
RtlInitAnsiString(&Name, "C:\\Windows\\explorer.exe");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
RtlInitAnsiString(&Expression, "*.bmp;*.dib");
|
|
|
|
RtlInitAnsiString(&Name, "winhlp32.exe");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
|
2011-09-26 05:51:39 +00:00
|
|
|
|
2012-03-13 21:07:55 +00:00
|
|
|
/* Backtracking tests */
|
2011-09-26 05:51:39 +00:00
|
|
|
RtlInitAnsiString(&Expression, "*.*.*.*");
|
|
|
|
RtlInitAnsiString(&Name, "127.0.0.1");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
|
2011-09-26 05:51:39 +00:00
|
|
|
|
2012-03-13 21:07:55 +00:00
|
|
|
RtlInitAnsiString(&Expression, "*?*?*?*");
|
|
|
|
RtlInitAnsiString(&Name, "1.0.0.1");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
|
2012-03-13 21:07:55 +00:00
|
|
|
RtlInitAnsiString(&Expression, "?*?*?*?");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
|
2012-03-13 21:07:55 +00:00
|
|
|
RtlInitAnsiString(&Expression, "?.?.?.?");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
|
2012-03-13 21:07:55 +00:00
|
|
|
|
2011-09-26 05:51:39 +00:00
|
|
|
RtlInitAnsiString(&Expression, "*a*ab*abc");
|
|
|
|
RtlInitAnsiString(&Name, "aabaabcdadabdabc");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
|
2012-03-14 09:43:16 +00:00
|
|
|
|
|
|
|
/* Tests for extra wildcards */
|
|
|
|
RtlInitAnsiString(&Expression, "ab<exe");
|
|
|
|
RtlInitAnsiString(&Name, "abcd.exe");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
|
2012-03-14 09:43:16 +00:00
|
|
|
RtlInitAnsiString(&Name, "ab.exe");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
|
2012-03-14 09:43:16 +00:00
|
|
|
RtlInitAnsiString(&Name, "abcdexe");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
|
2012-03-14 09:43:16 +00:00
|
|
|
RtlInitAnsiString(&Name, "acd.exe");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
|
2012-03-14 09:43:16 +00:00
|
|
|
|
|
|
|
RtlInitAnsiString(&Expression, "abc.exe\"");
|
|
|
|
RtlInitAnsiString(&Name, "abc.exe");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
|
2012-03-14 09:43:16 +00:00
|
|
|
RtlInitAnsiString(&Name, "abc.exe.");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
|
2012-03-14 09:43:16 +00:00
|
|
|
RtlInitAnsiString(&Name, "abc.exe.back");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
|
2012-03-14 09:43:16 +00:00
|
|
|
RtlInitAnsiString(&Name, "abc.exes");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
|
2012-03-14 09:43:16 +00:00
|
|
|
|
|
|
|
RtlInitAnsiString(&Expression, "a>c.exe");
|
|
|
|
RtlInitAnsiString(&Name, "abc.exe");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE\n");
|
2012-03-14 09:43:16 +00:00
|
|
|
RtlInitAnsiString(&Name, "ac.exe");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
|
2012-03-14 09:43:16 +00:00
|
|
|
RtlInitAnsiString(&Expression, "a>>>exe");
|
|
|
|
RtlInitAnsiString(&Name, "abc.exe");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
|
2012-03-14 09:43:16 +00:00
|
|
|
RtlInitAnsiString(&Name, "ac.exe");
|
2012-03-14 10:04:07 +00:00
|
|
|
ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE\n");
|
2011-06-27 08:49:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
START_TEST(FsRtlExpression)
|
|
|
|
{
|
|
|
|
FsRtlIsNameInExpressionTest();
|
|
|
|
FsRtlIsDbcsInExpressionTest();
|
|
|
|
}
|