Damjan Jovanovic : kernel32: Deal with unix paths in wine_get_dos_file_name .

Alexandre Julliard julliard at winehq.org
Fri Jul 23 10:05:47 CDT 2010


Module: wine
Branch: master
Commit: f56be472c65f4ad964fb9fc891824a8441a2d01a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=f56be472c65f4ad964fb9fc891824a8441a2d01a

Author: Damjan Jovanovic <damjan.jov at gmail.com>
Date:   Thu Jul 22 21:38:59 2010 +0200

kernel32: Deal with unix paths in wine_get_dos_file_name.

---

 dlls/kernel32/path.c |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/dlls/kernel32/path.c b/dlls/kernel32/path.c
index 0e69f91..81467cb 100644
--- a/dlls/kernel32/path.c
+++ b/dlls/kernel32/path.c
@@ -1788,10 +1788,15 @@ WCHAR * CDECL wine_get_dos_file_name( LPCSTR str )
         SetLastError( RtlNtStatusToDosError( status ) );
         return NULL;
     }
-    /* get rid of the \??\ prefix */
-    /* FIXME: should implement RtlNtPathNameToDosPathName and use that instead */
-    len = nt_name.Length - 4 * sizeof(WCHAR);
-    memmove( nt_name.Buffer, nt_name.Buffer + 4, len );
-    nt_name.Buffer[len / sizeof(WCHAR)] = 0;
+    if (nt_name.Buffer[5] == ':')
+    {
+        /* get rid of the \??\ prefix */
+        /* FIXME: should implement RtlNtPathNameToDosPathName and use that instead */
+        len = nt_name.Length - 4 * sizeof(WCHAR);
+        memmove( nt_name.Buffer, nt_name.Buffer + 4, len );
+        nt_name.Buffer[len / sizeof(WCHAR)] = 0;
+    }
+    else
+        nt_name.Buffer[1] = '\\';
     return nt_name.Buffer;
 }




More information about the wine-cvs mailing list