279{
281 static const WCHAR deadbeefW[] = {
'd',
'e',
'a',
'd',
'b',
'e',
'e',
'f',0};
282
284 {
286 const char *rname;
287 const char *rfile;
288 const char *alt_rname;
289 const char *alt_rfile;
290 };
291
293 {
294 { "c:/test", "c:\\test", "test"},
295 {
"c:/test/",
"c:\\test\\",
NULL},
296 { "c:/test ", "c:\\test", "test"},
297 { "c:/test.", "c:\\test", "test"},
298 { "c:/test .... .. ", "c:\\test", "test"},
299 {
"c:/test/ .... .. ",
"c:\\test\\",
NULL},
300 {
"c:/test/..",
"c:\\",
NULL},
301 {
"c:/test/.. ",
"c:\\test\\",
NULL},
302 { "c:/TEST", "c:\\TEST", "TEST"},
303 { "c:/test/file", "c:\\test\\file", "file"},
304 { "c:/test./file", "c:\\test\\file", "file"},
305 { "c:/test.. /file", "c:\\test.. \\file","file"},
306 { "c:/test/././file", "c:\\test\\file", "file"},
307 { "c:/test\\.\\.\\file", "c:\\test\\file", "file"},
308 { "c:/test/\\.\\.\\file", "c:\\test\\file", "file"},
309 { "c:/test\\\\.\\.\\file", "c:\\test\\file", "file"},
310 { "c:/test\\test1\\..\\.\\file", "c:\\test\\file", "file"},
311 {
"c:///test\\.\\.\\file//",
"c:\\test\\file\\",
NULL,
312 "c:\\test\\file", "file"},
313 {
"c:///test\\..\\file\\..\\//",
"c:\\",
NULL},
314 { "c:/test../file", "c:\\test.\\file", "file",
315 "c:\\test..\\file", "file"},
316 { "c:\\test", "c:\\test", "test"},
317 { "c:\\test\\*.", "c:\\test\\*", "*"},
318 { "c:\\test\\a*b.*", "c:\\test\\a*b.*", "a*b.*"},
319 { "c:\\test\\a*b*.", "c:\\test\\a*b*", "a*b*"},
320 { "C:\\test", "C:\\test", "test"},
321 {
"c:/",
"c:\\",
NULL},
322 { "c:.", "C:\\windows", "windows"},
323 { "c:foo", "C:\\windows\\foo", "foo"},
324 { "c:foo/bar", "C:\\windows\\foo\\bar", "bar"},
325 { "c:./foo", "C:\\windows\\foo", "foo"},
326 { "\\foo", "C:\\foo", "foo"},
327 { "foo", "C:\\windows\\foo", "foo"},
328 { ".", "C:\\windows", "windows"},
329 {
"..",
"C:\\",
NULL},
330 {
"...",
"C:\\windows\\",
NULL},
331 { "./foo", "C:\\windows\\foo", "foo"},
332 { "foo/..", "C:\\windows", "windows"},
333 {
"\\windows\\nul",
"\\\\.\\nul",
NULL},
334 {
"C:\\nonexistent\\nul",
"\\\\.\\nul",
NULL},
335 {
"C:\\con\\con",
"\\\\.\\con",
NULL,
336 "C:\\con\\con", "con"},
337 {
"C:NUL.",
"\\\\.\\NUL",
NULL},
338 {
"C:NUL",
"\\\\.\\NUL",
NULL},
339 {
"AUX",
"\\\\.\\AUX",
NULL},
340 {
"COM1",
"\\\\.\\COM1",
NULL},
341 { "?<>*\"|:", "C:\\windows\\?<>*\"|:", "?<>*\"|:"},
342
343 {
"\\\\foo",
"\\\\foo",
NULL},
344 {
"//foo",
"\\\\foo",
NULL},
345 {
"\\/foo",
"\\\\foo",
NULL},
346 {
"//",
"\\\\",
NULL},
347 {
"//foo/",
"\\\\foo\\",
NULL},
348
349 {
"//.",
"\\\\.\\",
NULL},
350 {
"//./",
"\\\\.\\",
NULL},
351 {
"//.//",
"\\\\.\\",
NULL},
352 { "//./foo", "\\\\.\\foo", "foo"},
353 {
"//./foo/",
"\\\\.\\foo\\",
NULL},
354 { "//./foo/bar", "\\\\.\\foo\\bar", "bar"},
355 { "//./foo/.", "\\\\.\\foo", "foo"},
356 {
"//./foo/..",
"\\\\.\\",
NULL},
357
358 {
"//?/",
"\\\\?\\",
NULL},
359 {
"//?//",
"\\\\?\\",
NULL},
360 { "//?/foo", "\\\\?\\foo", "foo"},
361 {
"//?/foo/",
"\\\\?\\foo\\",
NULL},
362 { "//?/foo/bar", "\\\\?\\foo\\bar", "bar"},
363 { "//?/foo/.", "\\\\?\\foo", "foo"},
364 {
"//?/foo/..",
"\\\\?\\",
NULL},
365
366 {
"CONIN$",
"\\\\.\\CONIN$",
NULL,
367 "C:\\windows\\CONIN$", "CONIN$"},
368 {
"CONOUT$",
"\\\\.\\CONOUT$",
NULL,
369 "C:\\windows\\CONOUT$", "CONOUT$"},
370
371
372 { "\\??\\foo", "C:\\??\\foo", "foo"},
373 { 0 }
374 };
375
383
386
387 file_part = (
WCHAR *)0xdeadbeef;
390 ok(!
ret,
"Expected RtlGetFullPathName_U to return 0, got %lu\n",
ret);
392 "Expected the output buffer to be untouched, got %s\n",
wine_dbgstr_w(rbufferW));
393 ok(file_part == (
WCHAR *)0xdeadbeef ||
395 "Expected file part pointer to be untouched, got %p\n", file_part);
396
397 file_part = (
WCHAR *)0xdeadbeef;
400 ok(!
ret,
"Expected RtlGetFullPathName_U to return 0, got %lu\n",
ret);
402 "Expected the output buffer to be untouched, got %s\n",
wine_dbgstr_w(rbufferW));
403 ok(file_part == (
WCHAR *)0xdeadbeef ||
405 "Expected file part pointer to be untouched, got %p\n", file_part);
406
408 {
410 pRtlMultiByteToUnicodeN(pathbufW ,
sizeof(pathbufW),
NULL,
test->path,
strlen(
test->path)+1 );
411 ret = pRtlGetFullPathName_U( pathbufW,
MAX_PATH, rbufferW, &file_part);
413 "Wrong result %ld/%d for \"%s\"\n",
ret,
len,
test->path );
415 "RtlUnicodeToMultiByteN failed\n");
417 "Got \"%s\" expected \"%s\"\n",rbufferA,
test->rname);
418 if (file_part)
419 {
421 "RtlUnicodeToMultiByteN failed\n");
424 "Got \"%s\" expected \"%s\"\n",rfileA,
test->rfile);
425 }
426 else
427 {
428 ok( !
test->rfile,
"Got NULL expected \"%s\"\n",
test->rfile );
429 }
430 }
431
433}
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
static const WCHAR emptyW[]
static DWORD LPDWORD reslen