4 * Copyright 2010 Pierre Schweitzer <pierre.schweitzer@reactos.org>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; see the file COPYING.LIB.
18 * If not, write to the Free Software Foundation,
19 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 /* INCLUDES *******************************************************************/
30 /* PRIVATE FUNCTIONS **********************************************************/
32 VOID
FsRtlIsNameInExpressionTest()
34 UNICODE_STRING Expression
, Name
;
36 RtlInitUnicodeString(&Expression
, L
"ntdll.dll");
37 RtlInitUnicodeString(&Name
, L
".");
38 ok(FsRtlIsNameInExpression(&Expression
, &Name
, FALSE
, NULL
) == FALSE
, "expected FALSE, got TRUE");
39 RtlInitUnicodeString(&Name
, L
"~1");
40 ok(FsRtlIsNameInExpression(&Expression
, &Name
, FALSE
, NULL
) == FALSE
, "expected FALSE, got TRUE");
41 RtlInitUnicodeString(&Name
, L
"..");
42 ok(FsRtlIsNameInExpression(&Expression
, &Name
, FALSE
, NULL
) == FALSE
, "expected FALSE, got TRUE");
43 RtlInitUnicodeString(&Name
, L
"ntdll.dll");
44 ok(FsRtlIsNameInExpression(&Expression
, &Name
, FALSE
, NULL
) == TRUE
, "expected TRUE, got FALSE");
46 RtlInitUnicodeString(&Expression
, L
"smss.exe");
47 RtlInitUnicodeString(&Name
, L
".");
48 ok(FsRtlIsNameInExpression(&Expression
, &Name
, FALSE
, NULL
) == FALSE
, "expected FALSE, got TRUE");
49 RtlInitUnicodeString(&Name
, L
"~1");
50 ok(FsRtlIsNameInExpression(&Expression
, &Name
, FALSE
, NULL
) == FALSE
, "expected FALSE, got TRUE");
51 RtlInitUnicodeString(&Name
, L
"..");
52 ok(FsRtlIsNameInExpression(&Expression
, &Name
, FALSE
, NULL
) == FALSE
, "expected FALSE, got TRUE");
53 RtlInitUnicodeString(&Name
, L
"ntdll.dll");
54 ok(FsRtlIsNameInExpression(&Expression
, &Name
, FALSE
, NULL
) == FALSE
, "expected FALSE, got TRUE");
55 RtlInitUnicodeString(&Name
, L
"NTDLL.dll");
56 ok(FsRtlIsNameInExpression(&Expression
, &Name
, FALSE
, NULL
) == FALSE
, "expected FALSE, got TRUE");
58 RtlInitUnicodeString(&Expression
, L
"nt??krnl.???");
59 RtlInitUnicodeString(&Name
, L
"ntoskrnl.exe");
60 ok(FsRtlIsNameInExpression(&Expression
, &Name
, FALSE
, NULL
) == TRUE
, "expected TRUE, got FALSE");
62 RtlInitUnicodeString(&Expression
, L
"he*o");
63 RtlInitUnicodeString(&Name
, L
"hello");
64 ok(FsRtlIsNameInExpression(&Expression
, &Name
, FALSE
, NULL
) == TRUE
, "expected TRUE, got FALSE");
65 RtlInitUnicodeString(&Name
, L
"helo");
66 ok(FsRtlIsNameInExpression(&Expression
, &Name
, FALSE
, NULL
) == TRUE
, "expected TRUE, got FALSE");
67 RtlInitUnicodeString(&Name
, L
"hella");
68 ok(FsRtlIsNameInExpression(&Expression
, &Name
, FALSE
, NULL
) == FALSE
, "expected FALSE, got TRUE");
70 RtlInitUnicodeString(&Expression
, L
"he*");
71 RtlInitUnicodeString(&Name
, L
"hello");
72 ok(FsRtlIsNameInExpression(&Expression
, &Name
, FALSE
, NULL
) == TRUE
, "expected TRUE, got FALSE");
73 RtlInitUnicodeString(&Name
, L
"helo");
74 ok(FsRtlIsNameInExpression(&Expression
, &Name
, FALSE
, NULL
) == TRUE
, "expected TRUE, got FALSE");
75 RtlInitUnicodeString(&Name
, L
"hella");
76 ok(FsRtlIsNameInExpression(&Expression
, &Name
, FALSE
, NULL
) == TRUE
, "expected TRUE, got FALSE");
78 RtlInitUnicodeString(&Expression
, L
"*.cpl");
79 RtlInitUnicodeString(&Name
, L
"kdcom.dll");
80 ok(FsRtlIsNameInExpression(&Expression
, &Name
, FALSE
, NULL
) == FALSE
, "expected FALSE, got TRUE");
81 RtlInitUnicodeString(&Name
, L
"bootvid.dll");
82 ok(FsRtlIsNameInExpression(&Expression
, &Name
, FALSE
, NULL
) == FALSE
, "expected FALSE, got TRUE");
83 RtlInitUnicodeString(&Name
, L
"ntoskrnl.exe");
84 ok(FsRtlIsNameInExpression(&Expression
, &Name
, FALSE
, NULL
) == FALSE
, "expected FALSE, got TRUE");
86 RtlInitUnicodeString(&Expression
, L
".");
87 RtlInitUnicodeString(&Name
, L
"NTDLL.DLL");
88 ok(FsRtlIsNameInExpression(&Expression
, &Name
, FALSE
, NULL
) == FALSE
, "expected FALSE, got TRUE");
90 RtlInitUnicodeString(&Expression
, L
"F0_*.*");
91 RtlInitUnicodeString(&Name
, L
".");
92 ok(FsRtlIsNameInExpression(&Expression
, &Name
, FALSE
, NULL
) == FALSE
, "expected FALSE, got TRUE");
93 RtlInitUnicodeString(&Name
, L
"..");
94 ok(FsRtlIsNameInExpression(&Expression
, &Name
, FALSE
, NULL
) == FALSE
, "expected FALSE, got TRUE");
95 RtlInitUnicodeString(&Name
, L
"SETUP.EXE");
96 ok(FsRtlIsNameInExpression(&Expression
, &Name
, FALSE
, NULL
) == FALSE
, "expected FALSE, got TRUE");
97 RtlInitUnicodeString(&Name
, L
"F0_001");
98 ok(FsRtlIsNameInExpression(&Expression
, &Name
, FALSE
, NULL
) == FALSE
, "expected FALSE, got TRUE");
100 RtlInitUnicodeString(&Expression
, L
"*.TTF");
101 RtlInitUnicodeString(&Name
, L
".");
102 ok(FsRtlIsNameInExpression(&Expression
, &Name
, FALSE
, NULL
) == FALSE
, "expected FALSE, got TRUE");
103 RtlInitUnicodeString(&Name
, L
"..");
104 ok(FsRtlIsNameInExpression(&Expression
, &Name
, FALSE
, NULL
) == FALSE
, "expected FALSE, got TRUE");
105 RtlInitUnicodeString(&Name
, L
"SETUP.INI");
106 ok(FsRtlIsNameInExpression(&Expression
, &Name
, FALSE
, NULL
) == FALSE
, "expected FALSE, got TRUE");
108 RtlInitUnicodeString(&Expression
, L
"*");
109 RtlInitUnicodeString(&Name
, L
".");
110 ok(FsRtlIsNameInExpression(&Expression
, &Name
, FALSE
, NULL
) == TRUE
, "expected TRUE, got FALSE");
111 RtlInitUnicodeString(&Name
, L
"..");
112 ok(FsRtlIsNameInExpression(&Expression
, &Name
, FALSE
, NULL
) == TRUE
, "expected TRUE, got FALSE");
113 RtlInitUnicodeString(&Name
, L
"SETUP.INI");
114 ok(FsRtlIsNameInExpression(&Expression
, &Name
, FALSE
, NULL
) == TRUE
, "expected TRUE, got FALSE");
117 /* PUBLIC FUNCTIONS ***********************************************************/
120 NtoskrnlFsRtlTest(HANDLE KeyHandle
)
122 FsRtlIsNameInExpressionTest();
124 FinishTest(KeyHandle
, L
"FsRtlTest");