KERNEL: temporary fix for Unix path names

Mike McCormack mike at codeweavers.com
Mon Feb 9 18:46:31 CST 2004


Hi,

GetFullPathName no longer works the way we want for unix path names.

Here's a quick and dirty hack to make it work again until Eric finishes 
his work on ntdll.

Alexandre probably won't apply this, but we'll probably be using it in 
the Crossover tree for a while ...

Mike


ChangeLog:
* make unix path names work again in GetFullPathName

-------------- next part --------------
Index: dlls/kernel/path.c
===================================================================
RCS file: /cvstrees/crossover/office/wine/dlls/kernel/path.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 path.c
--- dlls/kernel/path.c	5 Feb 2004 02:15:01 -0000	1.1.1.1
+++ dlls/kernel/path.c	9 Feb 2004 23:40:38 -0000
@@ -38,6 +38,8 @@
 #include "wine/unicode.h"
 #include "wine/debug.h"
 
+#include "file.h"
+
 WINE_DEFAULT_DEBUG_CHANNEL(file);
 
 #define MAX_PATHNAME_LEN        1024
@@ -50,6 +52,28 @@
 DWORD WINAPI GetFullPathNameW( LPCWSTR name, DWORD len, LPWSTR buffer,
                                LPWSTR *lastpart )
 {
+    /* CODEWEAVERS HACK: restore unix->DOS translation functionality */
+    if(name[0]=='/')
+    {
+        DOS_FULL_NAME full_name;
+        DWORD ret;
+
+        ret = DOSFS_GetFullName( name, FALSE, &full_name );
+        strncpyW( buffer, full_name.short_name, len);
+        if (ret && lastpart)
+        {
+            LPWSTR p = buffer + strlenW(buffer) + 1;
+            if (*p != (WCHAR)'\\')
+            {
+                while ((p > buffer + 2) && (*p != (WCHAR)'\\')) p--;
+                *lastpart = p + 1;
+            }
+            else *lastpart = NULL;
+        }
+        return ret;
+    }
+    /* CODEWEAVERS HACK: end of sucky hack */
+
     return RtlGetFullPathName_U(name, len * sizeof(WCHAR), buffer, lastpart) / sizeof(WCHAR);
 }
 


More information about the wine-patches mailing list