[KMTEST]
[reactos.git] / rostests / kmtests / ntos_fsrtl / FsRtlExpression.c
1 /*
2 * PROJECT: ReactOS kernel-mode tests
3 * LICENSE: LGPLv2+ - See COPYING.LIB in the top level directory
4 * PURPOSE: Kernel-Mode Test Suite FsRtl Test
5 * PROGRAMMER: Pierre Schweitzer <pierre.schweitzer@reactos.org>
6 */
7
8 /* TODO: most of these calls fail the Windows checked build's !islower assertion and others */
9
10 #include <kmt_test.h>
11
12 #define NDEBUG
13 #include <debug.h>
14
15 static VOID FsRtlIsNameInExpressionTest()
16 {
17 UNICODE_STRING Expression, Name;
18
19 /* !Name->Length || !Expression->Length asserts */
20 if (!KmtIsCheckedBuild)
21 {
22 RtlInitUnicodeString(&Expression, L"*");
23 RtlInitUnicodeString(&Name, L"");
24 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE");
25 RtlInitUnicodeString(&Expression, L"");
26 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE");
27 }
28
29 RtlInitUnicodeString(&Expression, L"ntdll.dll");
30 RtlInitUnicodeString(&Name, L".");
31 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE");
32 RtlInitUnicodeString(&Name, L"~1");
33 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE");
34 RtlInitUnicodeString(&Name, L"..");
35 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE");
36 RtlInitUnicodeString(&Name, L"ntdll.dll");
37 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE");
38
39 RtlInitUnicodeString(&Expression, L"smss.exe");
40 RtlInitUnicodeString(&Name, L".");
41 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE");
42 RtlInitUnicodeString(&Name, L"~1");
43 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE");
44 RtlInitUnicodeString(&Name, L"..");
45 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE");
46 RtlInitUnicodeString(&Name, L"ntdll.dll");
47 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE");
48 RtlInitUnicodeString(&Name, L"NTDLL.dll");
49 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE");
50
51 RtlInitUnicodeString(&Expression, L"nt??krnl.???");
52 RtlInitUnicodeString(&Name, L"ntoskrnl.exe");
53 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE");
54
55 RtlInitUnicodeString(&Expression, L"he*o");
56 RtlInitUnicodeString(&Name, L"hello");
57 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE");
58 RtlInitUnicodeString(&Name, L"helo");
59 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE");
60 RtlInitUnicodeString(&Name, L"hella");
61 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE");
62
63 RtlInitUnicodeString(&Expression, L"he*");
64 RtlInitUnicodeString(&Name, L"hello");
65 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE");
66 RtlInitUnicodeString(&Name, L"helo");
67 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE");
68 RtlInitUnicodeString(&Name, L"hella");
69 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE");
70
71 RtlInitUnicodeString(&Expression, L"*.cpl");
72 RtlInitUnicodeString(&Name, L"kdcom.dll");
73 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE");
74 RtlInitUnicodeString(&Name, L"bootvid.dll");
75 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE");
76 RtlInitUnicodeString(&Name, L"ntoskrnl.exe");
77 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE");
78
79 RtlInitUnicodeString(&Expression, L".");
80 RtlInitUnicodeString(&Name, L"NTDLL.DLL");
81 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE");
82
83 RtlInitUnicodeString(&Expression, L"F0_*.*");
84 RtlInitUnicodeString(&Name, L".");
85 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE");
86 RtlInitUnicodeString(&Name, L"..");
87 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE");
88 RtlInitUnicodeString(&Name, L"SETUP.EXE");
89 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE");
90 RtlInitUnicodeString(&Name, L"F0_001");
91 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE");
92
93 RtlInitUnicodeString(&Expression, L"*.TTF");
94 RtlInitUnicodeString(&Name, L".");
95 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE");
96 RtlInitUnicodeString(&Name, L"..");
97 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE");
98 RtlInitUnicodeString(&Name, L"SETUP.INI");
99 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE");
100
101 RtlInitUnicodeString(&Expression, L"*");
102 RtlInitUnicodeString(&Name, L".");
103 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE");
104 RtlInitUnicodeString(&Name, L"..");
105 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE");
106 RtlInitUnicodeString(&Name, L"SETUP.INI");
107 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE");
108
109 RtlInitUnicodeString(&Expression, L"\"ntoskrnl.exe");
110 RtlInitUnicodeString(&Name, L"ntoskrnl.exe");
111 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE");
112 RtlInitUnicodeString(&Expression, L"ntoskrnl\"exe");
113 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE");
114 RtlInitUnicodeString(&Expression, L"ntoskrn\".exe");
115 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE");
116 RtlInitUnicodeString(&Expression, L"ntoskrn\"\"exe");
117 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE");
118 RtlInitUnicodeString(&Expression, L"ntoskrnl.\"exe");
119 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE");
120 RtlInitUnicodeString(&Expression, L"ntoskrnl.exe\"");
121 RtlInitUnicodeString(&Name, L"ntoskrnl.exe");
122 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE");
123 RtlInitUnicodeString(&Name, L"ntoskrnl.exe.");
124 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE");
125
126 RtlInitUnicodeString(&Expression, L"*.c.d");
127 RtlInitUnicodeString(&Name, L"a.b.c.d");
128 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE");
129 RtlInitUnicodeString(&Expression, L"*.?.c.d");
130 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE");
131 RtlInitUnicodeString(&Expression, L"*?");
132 if (!KmtIsCheckedBuild)
133 {
134 RtlInitUnicodeString(&Name, L"");
135 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE");
136 }
137 RtlInitUnicodeString(&Name, L"a");
138 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE");
139 RtlInitUnicodeString(&Name, L"aa");
140 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE");
141 RtlInitUnicodeString(&Name, L"aaa");
142 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE");
143 RtlInitUnicodeString(&Expression, L"?*?");
144 if (!KmtIsCheckedBuild)
145 {
146 RtlInitUnicodeString(&Name, L"");
147 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE");
148 }
149 RtlInitUnicodeString(&Name, L"a");
150 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE");
151 RtlInitUnicodeString(&Name, L"aa");
152 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE");
153 RtlInitUnicodeString(&Name, L"aaa");
154 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE");
155 RtlInitUnicodeString(&Name, L"aaaa");
156 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE");
157
158 /* Tests from #5923 */
159 RtlInitUnicodeString(&Expression, L"C:\\ReactOS\\**");
160 RtlInitUnicodeString(&Name, L"C:\\ReactOS\\dings.bmp");
161 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE");
162 RtlInitUnicodeString(&Expression, L"C:\\ReactOS\\***");
163 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE");
164 RtlInitUnicodeString(&Expression, L"C:\\Windows\\*a*");
165 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE");
166
167 RtlInitUnicodeString(&Expression, L"C:\\ReactOS\\*.bmp");
168 RtlInitUnicodeString(&Name, L"C:\\Windows\\explorer.exe");
169 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE");
170 RtlInitUnicodeString(&Expression, L"*.bmp;*.dib");
171 RtlInitUnicodeString(&Name, L"winhlp32.exe");
172 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE");
173
174 /* Backtracking tests */
175 RtlInitUnicodeString(&Expression, L"*.*.*.*");
176 RtlInitUnicodeString(&Name, L"127.0.0.1");
177 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE");
178
179 RtlInitUnicodeString(&Expression, L"*a*ab*abc");
180 RtlInitUnicodeString(&Name, L"aabaabcdadabdabc");
181 ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE");
182 }
183
184 static VOID FsRtlIsDbcsInExpressionTest()
185 {
186 ANSI_STRING Expression, Name;
187
188 if (!KmtIsCheckedBuild)
189 {
190 RtlInitAnsiString(&Expression, "*");
191 RtlInitAnsiString(&Name, "");
192 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE");
193 RtlInitAnsiString(&Expression, "");
194 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE");
195 }
196
197 RtlInitAnsiString(&Expression, "ntdll.dll");
198 RtlInitAnsiString(&Name, ".");
199 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE");
200 RtlInitAnsiString(&Name, "~1");
201 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE");
202 RtlInitAnsiString(&Name, "..");
203 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE");
204 RtlInitAnsiString(&Name, "ntdll.dll");
205 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE");
206
207 RtlInitAnsiString(&Expression, "smss.exe");
208 RtlInitAnsiString(&Name, ".");
209 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE");
210 RtlInitAnsiString(&Name, "~1");
211 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE");
212 RtlInitAnsiString(&Name, "..");
213 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE");
214 RtlInitAnsiString(&Name, "ntdll.dll");
215 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE");
216 RtlInitAnsiString(&Name, "NTDLL.dll");
217 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE");
218
219 RtlInitAnsiString(&Expression, "nt??krnl.???");
220 RtlInitAnsiString(&Name, "ntoskrnl.exe");
221 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE");
222
223 RtlInitAnsiString(&Expression, "he*o");
224 RtlInitAnsiString(&Name, "hello");
225 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE");
226 RtlInitAnsiString(&Name, "helo");
227 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE");
228 RtlInitAnsiString(&Name, "hella");
229 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE");
230
231 RtlInitAnsiString(&Expression, "he*");
232 RtlInitAnsiString(&Name, "hello");
233 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE");
234 RtlInitAnsiString(&Name, "helo");
235 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE");
236 RtlInitAnsiString(&Name, "hella");
237 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE");
238
239 RtlInitAnsiString(&Expression, "*.cpl");
240 RtlInitAnsiString(&Name, "kdcom.dll");
241 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE");
242 RtlInitAnsiString(&Name, "bootvid.dll");
243 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE");
244 RtlInitAnsiString(&Name, "ntoskrnl.exe");
245 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE");
246
247 RtlInitAnsiString(&Expression, ".");
248 RtlInitAnsiString(&Name, "NTDLL.DLL");
249 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE");
250
251 RtlInitAnsiString(&Expression, "F0_*.*");
252 RtlInitAnsiString(&Name, ".");
253 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE");
254 RtlInitAnsiString(&Name, "..");
255 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE");
256 RtlInitAnsiString(&Name, "SETUP.EXE");
257 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE");
258 RtlInitAnsiString(&Name, "F0_001");
259 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE");
260
261 RtlInitAnsiString(&Expression, "*.TTF");
262 RtlInitAnsiString(&Name, ".");
263 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE");
264 RtlInitAnsiString(&Name, "..");
265 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE");
266 RtlInitAnsiString(&Name, "SETUP.INI");
267 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE");
268
269 RtlInitAnsiString(&Expression, "*");
270 RtlInitAnsiString(&Name, ".");
271 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE");
272 RtlInitAnsiString(&Name, "..");
273 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE");
274 RtlInitAnsiString(&Name, "SETUP.INI");
275 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE");
276
277 RtlInitAnsiString(&Expression, "\"ntoskrnl.exe");
278 RtlInitAnsiString(&Name, "ntoskrnl.exe");
279 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE");
280 RtlInitAnsiString(&Expression, "ntoskrnl\"exe");
281 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE");
282 RtlInitAnsiString(&Expression, "ntoskrn\".exe");
283 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE");
284 RtlInitAnsiString(&Expression, "ntoskrn\"\"exe");
285 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE");
286 RtlInitAnsiString(&Expression, "ntoskrnl.\"exe");
287 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE");
288 RtlInitAnsiString(&Expression, "ntoskrnl.exe\"");
289 RtlInitAnsiString(&Name, "ntoskrnl.exe");
290 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE");
291 RtlInitAnsiString(&Name, "ntoskrnl.exe.");
292 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE");
293
294 RtlInitAnsiString(&Expression, "*.c.d");
295 RtlInitAnsiString(&Name, "a.b.c.d");
296 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE");
297 RtlInitAnsiString(&Expression, "*.?.c.d");
298 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE");
299 RtlInitAnsiString(&Expression, "*?");
300 if (!KmtIsCheckedBuild)
301 {
302 RtlInitAnsiString(&Name, "");
303 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE");
304 }
305 RtlInitAnsiString(&Name, "a");
306 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE");
307 RtlInitAnsiString(&Name, "aa");
308 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE");
309 RtlInitAnsiString(&Name, "aaa");
310 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE");
311 RtlInitAnsiString(&Expression, "?*?");
312 if (!KmtIsCheckedBuild)
313 {
314 RtlInitAnsiString(&Name, "");
315 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE");
316 }
317 RtlInitAnsiString(&Name, "a");
318 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE");
319 RtlInitAnsiString(&Name, "aa");
320 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE");
321 RtlInitAnsiString(&Name, "aaa");
322 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE");
323 RtlInitAnsiString(&Name, "aaaa");
324 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE");
325
326 /* Tests from #5923 */
327 RtlInitAnsiString(&Expression, "C:\\ReactOS\\**");
328 RtlInitAnsiString(&Name, "C:\\ReactOS\\dings.bmp");
329 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE");
330 RtlInitAnsiString(&Expression, "C:\\ReactOS\\***");
331 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE");
332 RtlInitAnsiString(&Expression, "C:\\Windows\\*a*");
333 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE");
334
335 RtlInitAnsiString(&Expression, "C:\\ReactOS\\*.bmp");
336 RtlInitAnsiString(&Name, "C:\\Windows\\explorer.exe");
337 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE");
338 RtlInitAnsiString(&Expression, "*.bmp;*.dib");
339 RtlInitAnsiString(&Name, "winhlp32.exe");
340 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE");
341
342 /* Backtracking tetss */
343 RtlInitAnsiString(&Expression, "*.*.*.*");
344 RtlInitAnsiString(&Name, "127.0.0.1");
345 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE");
346
347 RtlInitAnsiString(&Expression, "*a*ab*abc");
348 RtlInitAnsiString(&Name, "aabaabcdadabdabc");
349 ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE");
350 }
351
352 START_TEST(FsRtlExpression)
353 {
354 FsRtlIsNameInExpressionTest();
355 FsRtlIsDbcsInExpressionTest();
356 }