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 */
reqsize = sizeof(WCHAR);
tmp[0] = toupperW(name[0]);
tmp[0] = name[0];
ins_str = tmp;
dep = 1;
mark = 3;

View File

@ -265,7 +265,7 @@ static void test_RtlGetFullPathName_U(void)
{ "c:/test/ .... .. ", "c:\\test\\", NULL},
{ "c:/test/..", "c:\\", 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"},
@ -279,6 +279,7 @@ static void test_RtlGetFullPathName_U(void)
{ "c:///test\\..\\file\\..\\//", "c:\\", NULL},
{ "c:/test../file", "c:\\test.\\file", "file",
"c:\\test..\\file", "file"}, /* vista */
{ "c:\\test", "c:\\test", "test"},
{ NULL, NULL, NULL}
};
@ -325,14 +326,14 @@ static void test_RtlGetFullPathName_U(void)
"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,
"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);
if (file_part)
{
ok(pRtlUnicodeToMultiByteN(rfileA,MAX_PATH,&reslen,file_part,(lstrlenW(file_part) + 1) * sizeof(WCHAR)) == STATUS_SUCCESS,
"RtlUnicodeToMultiByteN failed\n");
ok((test->rfile && !lstrcmpiA(rfileA,test->rfile)) ||
(test->alt_rfile && !lstrcmpiA(rfileA,test->alt_rfile)),
ok((test->rfile && !lstrcmpA(rfileA,test->rfile)) ||
(test->alt_rfile && !lstrcmpA(rfileA,test->alt_rfile)),
"Got \"%s\" expected \"%s\"\n",rfileA,test->rfile);
}
else

View File

@ -248,7 +248,7 @@ static void test_get_set(void)
strcpy(buffer,"garbage");
r = IShellLinkA_GetPath(sl, buffer, sizeof(buffer), NULL, SLGP_RAWPATH);
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 */
"case doesn't match\n");

View File

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