From: Vishnunithyasoundhar S <svishnunithyasoundhar@gmail.com> Signed-off-by: Vishnunithyasoundhar S <svishnunithyasoundhar@gmail.com> --- dlls/kernel32/tests/path.c | 6 +++--- dlls/kernelbase/file.c | 8 ++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/dlls/kernel32/tests/path.c b/dlls/kernel32/tests/path.c index aa1833504d8..8b7ac2272a3 100644 --- a/dlls/kernel32/tests/path.c +++ b/dlls/kernel32/tests/path.c @@ -360,7 +360,7 @@ static void test_InitPathA(CHAR *newdir, CHAR *curDrive, CHAR *otherDrive) lstrcmpiA(newdir+lstrlenA(tmppath),tmpstr1)==0, "GetTempFileNameA returned '%s' which doesn't match '%s' or '%s'. id=%x\n", newdir,tmpstr,tmpstr1,id); - ok(DeleteFileA(newdir),"Couldn't delete the temporary file we just created\n"); + ok(DeleteFileA(newdir),"Couldn't delete the temporary file we just created\n"); id=GetTempFileNameA(tmppath,NULL,0,newdir); sprintf(tmpstr,"%.4x.tmp",id & 0xffff); @@ -1256,12 +1256,12 @@ static void test_GetLongPathNameW(void) static const WCHAR backslash[] = { '\\', 0}; static const WCHAR letterX[] = { 'X', 0}; - SetLastError(0xdeadbeef); + SetLastError(0xdeadbeef); length = GetLongPathNameW(NULL,NULL,0); ok(0==length,"GetLongPathNameW returned %ld but expected 0\n",length); ok(GetLastError()==ERROR_INVALID_PARAMETER,"GetLastError returned %ld but expected ERROR_INVALID_PARAMETER\n",GetLastError()); - SetLastError(0xdeadbeef); + SetLastError(0xdeadbeef); empty[0]=0; length = GetLongPathNameW(empty,NULL,0); ok(0==length,"GetLongPathNameW returned %ld but expected 0\n",length); diff --git a/dlls/kernelbase/file.c b/dlls/kernelbase/file.c index c206e2f9cc2..c9e46ab6f5b 100644 --- a/dlls/kernelbase/file.c +++ b/dlls/kernelbase/file.c @@ -2117,6 +2117,14 @@ DWORD WINAPI DECLSPEC_HOTPATCH GetLongPathNameW( LPCWSTR shortpath, LPWSTR longp return 0; } + /* Handle \\?\ prefix (Extended Length Path) */ + if (shortpath[0] == '\\' && shortpath[1] == '\\' && shortpath[2] == '?' && + shortpath[3] == '\\') + { + if (iswalpha(shortpath[4]) && shortpath[5] == ':' && shortpath[6] == '\\') + return GetLongPathNameW(shortpath + 4, longpath, longlen); + } + if (shortpath[0] == '\\' && shortpath[1] == '\\') { FIXME( "UNC pathname %s\n", debugstr_w(shortpath) ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10192