a3af05277eda0a4e5adf9525b6b9b0878cea74f7
[reactos.git] / rostests / winetests / kernel32 / directory.c
1 /*
2 * Unit test suite for directory functions.
3 *
4 * Copyright 2002 Dmitry Timoshkov
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
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 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21 #include <stdarg.h>
22
23 #include "wine/test.h"
24 #include "windef.h"
25 #include "winbase.h"
26 #include "winerror.h"
27
28 /* If you change something in these tests, please do the same
29 * for GetSystemDirectory tests.
30 */
31 static void test_GetWindowsDirectoryA(void)
32 {
33 UINT len, len_with_null;
34 char buf[MAX_PATH];
35
36 len_with_null = GetWindowsDirectoryA(NULL, 0);
37 ok(len_with_null <= MAX_PATH, "should fit into MAX_PATH\n");
38
39 lstrcpyA(buf, "foo");
40 len_with_null = GetWindowsDirectoryA(buf, 1);
41 ok(lstrcmpA(buf, "foo") == 0, "should not touch the buffer\n");
42
43 lstrcpyA(buf, "foo");
44 len = GetWindowsDirectoryA(buf, len_with_null - 1);
45 ok(lstrcmpA(buf, "foo") == 0, "should not touch the buffer\n");
46 ok(len == len_with_null, "GetWindowsDirectoryW returned %d, expected %d\n",
47 len, len_with_null);
48
49 lstrcpyA(buf, "foo");
50 len = GetWindowsDirectoryA(buf, len_with_null);
51 ok(lstrcmpA(buf, "foo") != 0, "should touch the buffer\n");
52 ok(len == strlen(buf), "returned length should be equal to the length of string\n");
53 ok(len == len_with_null-1, "GetWindowsDirectoryA returned %d, expected %d\n",
54 len, len_with_null-1);
55 }
56
57 static void test_GetWindowsDirectoryW(void)
58 {
59 UINT len, len_with_null;
60 WCHAR buf[MAX_PATH];
61 static const WCHAR fooW[] = {'f','o','o',0};
62
63 len_with_null = GetWindowsDirectoryW(NULL, 0);
64 if (len_with_null == 0 && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
65 {
66 win_skip("GetWindowsDirectoryW is not implemented\n");
67 return;
68 }
69 ok(len_with_null <= MAX_PATH, "should fit into MAX_PATH\n");
70
71 lstrcpyW(buf, fooW);
72 len = GetWindowsDirectoryW(buf, 1);
73 ok(lstrcmpW(buf, fooW) == 0, "should not touch the buffer\n");
74 ok(len == len_with_null, "GetWindowsDirectoryW returned %d, expected %d\n",
75 len, len_with_null);
76
77 lstrcpyW(buf, fooW);
78 len = GetWindowsDirectoryW(buf, len_with_null - 1);
79 ok(lstrcmpW(buf, fooW) == 0, "should not touch the buffer\n");
80 ok(len == len_with_null, "GetWindowsDirectoryW returned %d, expected %d\n",
81 len, len_with_null);
82
83 lstrcpyW(buf, fooW);
84 len = GetWindowsDirectoryW(buf, len_with_null);
85 ok(lstrcmpW(buf, fooW) != 0, "should touch the buffer\n");
86 ok(len == lstrlenW(buf), "returned length should be equal to the length of string\n");
87 ok(len == len_with_null-1, "GetWindowsDirectoryW returned %d, expected %d\n",
88 len, len_with_null-1);
89 }
90
91
92 /* If you change something in these tests, please do the same
93 * for GetWindowsDirectory tests.
94 */
95 static void test_GetSystemDirectoryA(void)
96 {
97 UINT len, len_with_null;
98 char buf[MAX_PATH];
99
100 len_with_null = GetSystemDirectoryA(NULL, 0);
101 ok(len_with_null <= MAX_PATH, "should fit into MAX_PATH\n");
102
103 lstrcpyA(buf, "foo");
104 len = GetSystemDirectoryA(buf, 1);
105 ok(lstrcmpA(buf, "foo") == 0, "should not touch the buffer\n");
106 ok(len == len_with_null, "GetSystemDirectoryA returned %d, expected %d\n",
107 len, len_with_null);
108
109 lstrcpyA(buf, "foo");
110 len = GetSystemDirectoryA(buf, len_with_null - 1);
111 ok(lstrcmpA(buf, "foo") == 0, "should not touch the buffer\n");
112 ok(len == len_with_null, "GetSystemDirectoryA returned %d, expected %d\n",
113 len, len_with_null);
114
115 lstrcpyA(buf, "foo");
116 len = GetSystemDirectoryA(buf, len_with_null);
117 ok(lstrcmpA(buf, "foo") != 0, "should touch the buffer\n");
118 ok(len == strlen(buf), "returned length should be equal to the length of string\n");
119 ok(len == len_with_null-1, "GetSystemDirectoryW returned %d, expected %d\n",
120 len, len_with_null-1);
121 }
122
123 static void test_GetSystemDirectoryW(void)
124 {
125 UINT len, len_with_null;
126 WCHAR buf[MAX_PATH];
127 static const WCHAR fooW[] = {'f','o','o',0};
128
129 len_with_null = GetSystemDirectoryW(NULL, 0);
130 if (len_with_null == 0 && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
131 {
132 win_skip("GetSystemDirectoryW is not available\n");
133 return;
134 }
135 ok(len_with_null <= MAX_PATH, "should fit into MAX_PATH\n");
136
137 lstrcpyW(buf, fooW);
138 len = GetSystemDirectoryW(buf, 1);
139 ok(lstrcmpW(buf, fooW) == 0, "should not touch the buffer\n");
140 ok(len == len_with_null, "GetSystemDirectoryW returned %d, expected %d\n",
141 len, len_with_null);
142
143 lstrcpyW(buf, fooW);
144 len = GetSystemDirectoryW(buf, len_with_null - 1);
145 ok(lstrcmpW(buf, fooW) == 0, "should not touch the buffer\n");
146 ok(len == len_with_null, "GetSystemDirectoryW returned %d, expected %d\n",
147 len, len_with_null);
148
149 lstrcpyW(buf, fooW);
150 len = GetSystemDirectoryW(buf, len_with_null);
151 ok(lstrcmpW(buf, fooW) != 0, "should touch the buffer\n");
152 ok(len == lstrlenW(buf), "returned length should be equal to the length of string\n");
153 ok(len == len_with_null-1, "GetSystemDirectoryW returned %d, expected %d\n",
154 len, len_with_null-1);
155 }
156
157 static void test_CreateDirectoryA(void)
158 {
159 char tmpdir[MAX_PATH];
160 WCHAR curdir[MAX_PATH];
161 BOOL ret;
162
163 ret = CreateDirectoryA(NULL, NULL);
164 ok(ret == FALSE && (GetLastError() == ERROR_PATH_NOT_FOUND ||
165 GetLastError() == ERROR_INVALID_PARAMETER),
166 "CreateDirectoryA(NULL): ret=%d err=%d\n", ret, GetLastError());
167
168 ret = CreateDirectoryA("", NULL);
169 ok(ret == FALSE && (GetLastError() == ERROR_BAD_PATHNAME ||
170 GetLastError() == ERROR_PATH_NOT_FOUND),
171 "CreateDirectoryA(%s): ret=%d err=%d\n", tmpdir, ret, GetLastError());
172
173 ret = GetSystemDirectoryA(tmpdir, MAX_PATH);
174 ok(ret < MAX_PATH, "System directory should fit into MAX_PATH\n");
175
176 GetCurrentDirectoryW(MAX_PATH, curdir);
177 ret = SetCurrentDirectoryA(tmpdir);
178 ok(ret == TRUE, "could not chdir to the System directory\n");
179
180 ret = CreateDirectoryA(".", NULL);
181 ok(ret == FALSE && GetLastError() == ERROR_ALREADY_EXISTS,
182 "CreateDirectoryA(%s): ret=%d err=%d\n", tmpdir, ret, GetLastError());
183
184
185 ret = CreateDirectoryA("..", NULL);
186 ok(ret == FALSE && GetLastError() == ERROR_ALREADY_EXISTS,
187 "CreateDirectoryA(%s): ret=%d err=%d\n", tmpdir, ret, GetLastError());
188
189 GetTempPathA(MAX_PATH, tmpdir);
190 tmpdir[3] = 0; /* truncate the path */
191 ret = CreateDirectoryA(tmpdir, NULL);
192 ok(ret == FALSE && (GetLastError() == ERROR_ALREADY_EXISTS ||
193 GetLastError() == ERROR_ACCESS_DENIED),
194 "CreateDirectoryA(%s): ret=%d err=%d\n", tmpdir, ret, GetLastError());
195
196 GetTempPathA(MAX_PATH, tmpdir);
197 lstrcatA(tmpdir, "Please Remove Me");
198 ret = CreateDirectoryA(tmpdir, NULL);
199 ok(ret == TRUE, "CreateDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError());
200
201 ret = CreateDirectoryA(tmpdir, NULL);
202 ok(ret == FALSE && GetLastError() == ERROR_ALREADY_EXISTS,
203 "CreateDirectoryA(%s): ret=%d err=%d\n", tmpdir, ret, GetLastError());
204
205 ret = RemoveDirectoryA(tmpdir);
206 ok(ret == TRUE,
207 "RemoveDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError());
208
209
210 lstrcatA(tmpdir, "?");
211 ret = CreateDirectoryA(tmpdir, NULL);
212 ok(ret == FALSE && (GetLastError() == ERROR_INVALID_NAME ||
213 GetLastError() == ERROR_PATH_NOT_FOUND),
214 "CreateDirectoryA(%s): ret=%d err=%d\n", tmpdir, ret, GetLastError());
215 RemoveDirectoryA(tmpdir);
216
217 tmpdir[lstrlenA(tmpdir) - 1] = '*';
218 ret = CreateDirectoryA(tmpdir, NULL);
219 ok(ret == FALSE && (GetLastError() == ERROR_INVALID_NAME ||
220 GetLastError() == ERROR_PATH_NOT_FOUND),
221 "CreateDirectoryA(%s): ret=%d err=%d\n", tmpdir, ret, GetLastError());
222 RemoveDirectoryA(tmpdir);
223
224 GetTempPathA(MAX_PATH, tmpdir);
225 lstrcatA(tmpdir, "Please Remove Me/Please Remove Me");
226 ret = CreateDirectoryA(tmpdir, NULL);
227 ok(ret == FALSE && GetLastError() == ERROR_PATH_NOT_FOUND,
228 "CreateDirectoryA(%s): ret=%d err=%d\n", tmpdir, ret, GetLastError());
229 RemoveDirectoryA(tmpdir);
230
231 /* Test behavior with a trailing dot.
232 * The directory should be created without the dot.
233 */
234 GetTempPathA(MAX_PATH, tmpdir);
235 lstrcatA(tmpdir, "Please Remove Me.");
236 ret = CreateDirectoryA(tmpdir, NULL);
237 ok(ret == TRUE,
238 "CreateDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError());
239
240 lstrcatA(tmpdir, "/Please Remove Me");
241 ret = CreateDirectoryA(tmpdir, NULL);
242 ok(ret == TRUE,
243 "CreateDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError());
244 ret = RemoveDirectoryA(tmpdir);
245 ok(ret == TRUE,
246 "RemoveDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError());
247
248 GetTempPathA(MAX_PATH, tmpdir);
249 lstrcatA(tmpdir, "Please Remove Me");
250 ret = RemoveDirectoryA(tmpdir);
251 ok(ret == TRUE,
252 "RemoveDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError());
253
254 /* Test behavior with two trailing dots.
255 * The directory should be created without the trailing dots.
256 */
257 GetTempPathA(MAX_PATH, tmpdir);
258 lstrcatA(tmpdir, "Please Remove Me..");
259 ret = CreateDirectoryA(tmpdir, NULL);
260 ok(ret == TRUE,
261 "CreateDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError());
262
263 lstrcatA(tmpdir, "/Please Remove Me");
264 ret = CreateDirectoryA(tmpdir, NULL);
265 ok(ret == TRUE || /* On Win98 */
266 (ret == FALSE && GetLastError() == ERROR_PATH_NOT_FOUND), /* On NT! */
267 "CreateDirectoryA(%s): ret=%d err=%d\n", tmpdir, ret, GetLastError());
268 if (ret == TRUE)
269 {
270 ret = RemoveDirectoryA(tmpdir);
271 ok(ret == TRUE,
272 "RemoveDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError());
273 }
274
275 GetTempPathA(MAX_PATH, tmpdir);
276 lstrcatA(tmpdir, "Please Remove Me");
277 ret = RemoveDirectoryA(tmpdir);
278 ok(ret == TRUE,
279 "RemoveDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError());
280
281 /* Test behavior with a trailing space.
282 * The directory should be created without the trailing space.
283 */
284 GetTempPathA(MAX_PATH, tmpdir);
285 lstrcatA(tmpdir, "Please Remove Me ");
286 ret = CreateDirectoryA(tmpdir, NULL);
287 ok(ret == TRUE,
288 "CreateDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError());
289
290 lstrcatA(tmpdir, "/Please Remove Me");
291 ret = CreateDirectoryA(tmpdir, NULL);
292 ok(ret == TRUE || /* On Win98 */
293 (ret == FALSE && GetLastError() == ERROR_PATH_NOT_FOUND), /* On NT! */
294 "CreateDirectoryA(%s): ret=%d err=%d\n", tmpdir, ret, GetLastError());
295 if (ret == TRUE)
296 {
297 ret = RemoveDirectoryA(tmpdir);
298 ok(ret == TRUE,
299 "RemoveDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError());
300 }
301
302 GetTempPathA(MAX_PATH, tmpdir);
303 lstrcatA(tmpdir, "Please Remove Me");
304 ret = RemoveDirectoryA(tmpdir);
305 ok(ret == TRUE,
306 "RemoveDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError());
307
308 /* Test behavior with a trailing space.
309 * The directory should be created without the trailing spaces.
310 */
311 GetTempPathA(MAX_PATH, tmpdir);
312 lstrcatA(tmpdir, "Please Remove Me ");
313 ret = CreateDirectoryA(tmpdir, NULL);
314 ok(ret == TRUE,
315 "CreateDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError());
316
317 lstrcatA(tmpdir, "/Please Remove Me");
318 ret = CreateDirectoryA(tmpdir, NULL);
319 ok(ret == TRUE || /* On Win98 */
320 (ret == FALSE && GetLastError() == ERROR_PATH_NOT_FOUND), /* On NT! */
321 "CreateDirectoryA(%s): ret=%d err=%d\n", tmpdir, ret, GetLastError());
322 if (ret == TRUE)
323 {
324 ret = RemoveDirectoryA(tmpdir);
325 ok(ret == TRUE,
326 "RemoveDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError());
327 }
328
329 GetTempPathA(MAX_PATH, tmpdir);
330 lstrcatA(tmpdir, "Please Remove Me");
331 ret = RemoveDirectoryA(tmpdir);
332 ok(ret == TRUE,
333 "RemoveDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError());
334 SetCurrentDirectoryW(curdir);
335 }
336
337 static void test_CreateDirectoryW(void)
338 {
339 WCHAR tmpdir[MAX_PATH];
340 BOOL ret;
341 static const WCHAR empty_strW[] = { 0 };
342 static const WCHAR tmp_dir_name[] = {'P','l','e','a','s','e',' ','R','e','m','o','v','e',' ','M','e',0};
343 static const WCHAR dotW[] = {'.',0};
344 static const WCHAR slashW[] = {'/',0};
345 static const WCHAR dotdotW[] = {'.','.',0};
346 static const WCHAR questionW[] = {'?',0};
347 WCHAR curdir[MAX_PATH];
348
349 ret = CreateDirectoryW(NULL, NULL);
350 if (!ret && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
351 {
352 win_skip("CreateDirectoryW is not available\n");
353 return;
354 }
355 ok(ret == FALSE && GetLastError() == ERROR_PATH_NOT_FOUND,
356 "should not create NULL path ret %u err %u\n", ret, GetLastError());
357
358 ret = CreateDirectoryW(empty_strW, NULL);
359 ok(ret == FALSE && GetLastError() == ERROR_PATH_NOT_FOUND,
360 "should not create empty path ret %u err %u\n", ret, GetLastError());
361
362 ret = GetSystemDirectoryW(tmpdir, MAX_PATH);
363 ok(ret < MAX_PATH, "System directory should fit into MAX_PATH\n");
364
365 GetCurrentDirectoryW(MAX_PATH, curdir);
366 ret = SetCurrentDirectoryW(tmpdir);
367 ok(ret == TRUE, "could not chdir to the System directory ret %u err %u\n", ret, GetLastError());
368
369 ret = CreateDirectoryW(dotW, NULL);
370 ok(ret == FALSE && GetLastError() == ERROR_ALREADY_EXISTS,
371 "should not create existing path ret %u err %u\n", ret, GetLastError());
372
373 ret = CreateDirectoryW(dotdotW, NULL);
374 ok(ret == FALSE && GetLastError() == ERROR_ALREADY_EXISTS,
375 "should not create existing path ret %u err %u\n", ret, GetLastError());
376
377 GetTempPathW(MAX_PATH, tmpdir);
378 tmpdir[3] = 0; /* truncate the path */
379 ret = CreateDirectoryW(tmpdir, NULL);
380 ok(ret == FALSE && (GetLastError() == ERROR_ACCESS_DENIED || GetLastError() == ERROR_ALREADY_EXISTS),
381 "should deny access to the drive root ret %u err %u\n", ret, GetLastError());
382
383 GetTempPathW(MAX_PATH, tmpdir);
384 lstrcatW(tmpdir, tmp_dir_name);
385 ret = CreateDirectoryW(tmpdir, NULL);
386 ok(ret == TRUE, "CreateDirectoryW should always succeed\n");
387
388 ret = CreateDirectoryW(tmpdir, NULL);
389 ok(ret == FALSE && GetLastError() == ERROR_ALREADY_EXISTS,
390 "should not create existing path ret %u err %u\n", ret, GetLastError());
391
392 ret = RemoveDirectoryW(tmpdir);
393 ok(ret == TRUE, "RemoveDirectoryW should always succeed\n");
394
395 lstrcatW(tmpdir, questionW);
396 ret = CreateDirectoryW(tmpdir, NULL);
397 ok(ret == FALSE && GetLastError() == ERROR_INVALID_NAME,
398 "CreateDirectoryW with ? wildcard name should fail with error 183, ret=%s error=%d\n",
399 ret ? " True" : "False", GetLastError());
400 ret = RemoveDirectoryW(tmpdir);
401 ok(ret == FALSE, "RemoveDirectoryW should have failed\n");
402
403 tmpdir[lstrlenW(tmpdir) - 1] = '*';
404 ret = CreateDirectoryW(tmpdir, NULL);
405 ok(ret == FALSE && GetLastError() == ERROR_INVALID_NAME,
406 "CreateDirectoryW with * wildcard name should fail with error 183, ret=%s error=%d\n",
407 ret ? " True" : "False", GetLastError());
408 ret = RemoveDirectoryW(tmpdir);
409 ok(ret == FALSE, "RemoveDirectoryW should have failed\n");
410
411 GetTempPathW(MAX_PATH, tmpdir);
412 lstrcatW(tmpdir, tmp_dir_name);
413 lstrcatW(tmpdir, slashW);
414 lstrcatW(tmpdir, tmp_dir_name);
415 ret = CreateDirectoryW(tmpdir, NULL);
416 ok(ret == FALSE && GetLastError() == ERROR_PATH_NOT_FOUND,
417 "CreateDirectoryW with multiple nonexistent directories in path should fail ret %u err %u\n",
418 ret, GetLastError());
419 ret = RemoveDirectoryW(tmpdir);
420 ok(ret == FALSE, "RemoveDirectoryW should have failed\n");
421
422 SetCurrentDirectoryW(curdir);
423 }
424
425 static void test_RemoveDirectoryA(void)
426 {
427 char tmpdir[MAX_PATH];
428 BOOL ret;
429
430 GetTempPathA(MAX_PATH, tmpdir);
431 lstrcatA(tmpdir, "Please Remove Me");
432 ret = CreateDirectoryA(tmpdir, NULL);
433 ok(ret == TRUE, "CreateDirectoryA should always succeed\n");
434
435 ret = RemoveDirectoryA(tmpdir);
436 ok(ret == TRUE, "RemoveDirectoryA should always succeed\n");
437
438 lstrcatA(tmpdir, "?");
439 ret = RemoveDirectoryA(tmpdir);
440 ok(ret == FALSE && (GetLastError() == ERROR_INVALID_NAME ||
441 GetLastError() == ERROR_PATH_NOT_FOUND),
442 "RemoveDirectoryA with ? wildcard name should fail, ret=%s error=%d\n",
443 ret ? " True" : "False", GetLastError());
444
445 tmpdir[lstrlenA(tmpdir) - 1] = '*';
446 ret = RemoveDirectoryA(tmpdir);
447 ok(ret == FALSE && (GetLastError() == ERROR_INVALID_NAME ||
448 GetLastError() == ERROR_PATH_NOT_FOUND),
449 "RemoveDirectoryA with * wildcard name should fail, ret=%s error=%d\n",
450 ret ? " True" : "False", GetLastError());
451 }
452
453 static void test_RemoveDirectoryW(void)
454 {
455 WCHAR tmpdir[MAX_PATH];
456 BOOL ret;
457 static const WCHAR tmp_dir_name[] = {'P','l','e','a','s','e',' ','R','e','m','o','v','e',' ','M','e',0};
458 static const WCHAR questionW[] = {'?',0};
459
460 GetTempPathW(MAX_PATH, tmpdir);
461 lstrcatW(tmpdir, tmp_dir_name);
462 ret = CreateDirectoryW(tmpdir, NULL);
463 if (!ret && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
464 {
465 win_skip("CreateDirectoryW is not available\n");
466 return;
467 }
468
469 ok(ret == TRUE, "CreateDirectoryW should always succeed\n");
470
471 ret = RemoveDirectoryW(tmpdir);
472 ok(ret == TRUE, "RemoveDirectoryW should always succeed\n");
473
474 lstrcatW(tmpdir, questionW);
475 ret = RemoveDirectoryW(tmpdir);
476 ok(ret == FALSE && GetLastError() == ERROR_INVALID_NAME,
477 "RemoveDirectoryW with wildcard should fail with error 183, ret=%s error=%d\n",
478 ret ? " True" : "False", GetLastError());
479
480 tmpdir[lstrlenW(tmpdir) - 1] = '*';
481 ret = RemoveDirectoryW(tmpdir);
482 ok(ret == FALSE && GetLastError() == ERROR_INVALID_NAME,
483 "RemoveDirectoryW with * wildcard name should fail with error 183, ret=%s error=%d\n",
484 ret ? " True" : "False", GetLastError());
485 }
486
487 static void test_SetCurrentDirectoryA(void)
488 {
489 SetLastError(0);
490 ok( !SetCurrentDirectoryA( "\\some_dummy_dir" ), "SetCurrentDirectoryA succeeded\n" );
491 ok( GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %d\n", GetLastError() );
492 ok( !SetCurrentDirectoryA( "\\some_dummy\\subdir" ), "SetCurrentDirectoryA succeeded\n" );
493 ok( GetLastError() == ERROR_PATH_NOT_FOUND, "wrong error %d\n", GetLastError() );
494 }
495
496 START_TEST(directory)
497 {
498 test_GetWindowsDirectoryA();
499 test_GetWindowsDirectoryW();
500
501 test_GetSystemDirectoryA();
502 test_GetSystemDirectoryW();
503
504 test_CreateDirectoryA();
505 test_CreateDirectoryW();
506
507 test_RemoveDirectoryA();
508 test_RemoveDirectoryW();
509
510 test_SetCurrentDirectoryA();
511 }