ntdll: Keep drive letter size in RtlGetFullPathName_U when full path is specified.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Piotr Caban 2016-07-28 14:24:05 +02:00 committed by Alexandre Julliard
parent 7cda73e818
commit f333bf47a8
4 changed files with 8 additions and 7 deletions

View File

@ -625,7 +625,7 @@ static ULONG get_full_path_helper(LPCWSTR name, LPWSTR buffer, ULONG size)
case ABSOLUTE_DRIVE_PATH: /* c:\foo */ case ABSOLUTE_DRIVE_PATH: /* c:\foo */
reqsize = sizeof(WCHAR); reqsize = sizeof(WCHAR);
tmp[0] = toupperW(name[0]); tmp[0] = name[0];
ins_str = tmp; ins_str = tmp;
dep = 1; dep = 1;
mark = 3; mark = 3;

View File

@ -265,7 +265,7 @@ static void test_RtlGetFullPathName_U(void)
{ "c:/test/ .... .. ", "c:\\test\\", NULL}, { "c:/test/ .... .. ", "c:\\test\\", NULL},
{ "c:/test/..", "c:\\", NULL}, { "c:/test/..", "c:\\", NULL},
{ "c:/test/.. ", "c:\\test\\", NULL}, { "c:/test/.. ", "c:\\test\\", NULL},
{ "c:/TEST", "c:\\test", "test"}, { "c:/TEST", "c:\\TEST", "TEST"},
{ "c:/test/file", "c:\\test\\file", "file"}, { "c:/test/file", "c:\\test\\file", "file"},
{ "c:/test./file", "c:\\test\\file", "file"}, { "c:/test./file", "c:\\test\\file", "file"},
{ "c:/test.. /file", "c:\\test.. \\file","file"}, { "c:/test.. /file", "c:\\test.. \\file","file"},
@ -279,6 +279,7 @@ static void test_RtlGetFullPathName_U(void)
{ "c:///test\\..\\file\\..\\//", "c:\\", NULL}, { "c:///test\\..\\file\\..\\//", "c:\\", NULL},
{ "c:/test../file", "c:\\test.\\file", "file", { "c:/test../file", "c:\\test.\\file", "file",
"c:\\test..\\file", "file"}, /* vista */ "c:\\test..\\file", "file"}, /* vista */
{ "c:\\test", "c:\\test", "test"},
{ NULL, NULL, NULL} { NULL, NULL, NULL}
}; };
@ -325,14 +326,14 @@ static void test_RtlGetFullPathName_U(void)
"Wrong result %d/%d for \"%s\"\n", ret, len, test->path ); "Wrong result %d/%d for \"%s\"\n", ret, len, test->path );
ok(pRtlUnicodeToMultiByteN(rbufferA,MAX_PATH,&reslen,rbufferW,(lstrlenW(rbufferW) + 1) * sizeof(WCHAR)) == STATUS_SUCCESS, ok(pRtlUnicodeToMultiByteN(rbufferA,MAX_PATH,&reslen,rbufferW,(lstrlenW(rbufferW) + 1) * sizeof(WCHAR)) == STATUS_SUCCESS,
"RtlUnicodeToMultiByteN failed\n"); "RtlUnicodeToMultiByteN failed\n");
ok(!lstrcmpiA(rbufferA,test->rname) || (test->alt_rname && !lstrcmpiA(rbufferA,test->alt_rname)), ok(!lstrcmpA(rbufferA,test->rname) || (test->alt_rname && !lstrcmpA(rbufferA,test->alt_rname)),
"Got \"%s\" expected \"%s\"\n",rbufferA,test->rname); "Got \"%s\" expected \"%s\"\n",rbufferA,test->rname);
if (file_part) if (file_part)
{ {
ok(pRtlUnicodeToMultiByteN(rfileA,MAX_PATH,&reslen,file_part,(lstrlenW(file_part) + 1) * sizeof(WCHAR)) == STATUS_SUCCESS, ok(pRtlUnicodeToMultiByteN(rfileA,MAX_PATH,&reslen,file_part,(lstrlenW(file_part) + 1) * sizeof(WCHAR)) == STATUS_SUCCESS,
"RtlUnicodeToMultiByteN failed\n"); "RtlUnicodeToMultiByteN failed\n");
ok((test->rfile && !lstrcmpiA(rfileA,test->rfile)) || ok((test->rfile && !lstrcmpA(rfileA,test->rfile)) ||
(test->alt_rfile && !lstrcmpiA(rfileA,test->alt_rfile)), (test->alt_rfile && !lstrcmpA(rfileA,test->alt_rfile)),
"Got \"%s\" expected \"%s\"\n",rfileA,test->rfile); "Got \"%s\" expected \"%s\"\n",rfileA,test->rfile);
} }
else else

View File

@ -248,7 +248,7 @@ static void test_get_set(void)
strcpy(buffer,"garbage"); strcpy(buffer,"garbage");
r = IShellLinkA_GetPath(sl, buffer, sizeof(buffer), NULL, SLGP_RAWPATH); r = IShellLinkA_GetPath(sl, buffer, sizeof(buffer), NULL, SLGP_RAWPATH);
ok(r==S_OK, "GetPath failed (0x%08x)\n", r); ok(r==S_OK, "GetPath failed (0x%08x)\n", r);
ok(!strcmp(buffer, "C:\\nonexistent\\file") || todo_wine ok(!strcmp(buffer, "C:\\nonexistent\\file") ||
broken(!strcmp(buffer, "C:\\\"c:\\nonexistent\\file\"")), /* NT4 */ broken(!strcmp(buffer, "C:\\\"c:\\nonexistent\\file\"")), /* NT4 */
"case doesn't match\n"); "case doesn't match\n");

View File

@ -980,7 +980,7 @@ a d
a a
C r C r
foo bar baz foo bar baz
@todo_wine@c:\ c:\
------ skip option ------ skip option
c c
no output no output