Module: wine Branch: master Commit: d58bd680b195da55687cedaf0ab8b8781fb95bcd URL: http://source.winehq.org/git/wine.git/?a=commit;h=d58bd680b195da55687cedaf0a...
Author: Paul Vriens Paul.Vriens.Wine@gmail.com Date: Thu Dec 17 10:44:05 2009 +0100
kernel32: Fix a crash with GetLongPathNameW and UNC path names.
---
dlls/kernel32/path.c | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/dlls/kernel32/path.c b/dlls/kernel32/path.c index e9463bb..7618dc9 100644 --- a/dlls/kernel32/path.c +++ b/dlls/kernel32/path.c @@ -313,9 +313,15 @@ DWORD WINAPI GetLongPathNameW( LPCWSTR shortpath, LPWSTR longpath, DWORD longlen
if (shortpath[0] == '\' && shortpath[1] == '\') { - ERR("UNC pathname %s\n", debugstr_w(shortpath)); - lstrcpynW( longpath, shortpath, longlen ); - return strlenW(longpath); + FIXME("UNC pathname %s\n", debugstr_w(shortpath)); + + tmplen = strlenW(shortpath); + if (tmplen < longlen) + { + if (longpath != shortpath) strcpyW( longpath, shortpath ); + return tmplen; + } + return tmplen + 1; }
unixabsolute = (shortpath[0] == '/');