fix incorrect GetLongPathName usage exposed by Eric's filename patches
Mike McCormack
mike at codeweavers.com
Tue Jan 27 15:11:49 CST 2004
GetLongPathName no longer makes a full path name.
Mike
ChangeLog:
* fix incorrect GetLongPathName usage exposed by Eric's filename patches
-------------- next part --------------
Index: dlls/kernel/process.c
===================================================================
RCS file: /home/wine/wine/dlls/kernel/process.c,v
retrieving revision 1.42
diff -u -r1.42 process.c
--- dlls/kernel/process.c 20 Jan 2004 21:51:27 -0000 1.42
+++ dlls/kernel/process.c 27 Jan 2004 20:07:51 -0000
@@ -1138,12 +1138,20 @@
RTL_USER_PROCESS_PARAMETERS *params;
UNICODE_STRING image_str, cmdline_str, desktop, title;
NTSTATUS status;
- WCHAR buffer[MAX_PATH];
+ WCHAR longname[MAX_PATH], fullname[MAX_PATH], *dummy;
- if (GetLongPathNameW( filename, buffer, MAX_PATH ))
- RtlInitUnicodeString( &image_str, buffer );
- else
- RtlInitUnicodeString( &image_str, filename );
+ if(!GetLongPathNameW( filename, longname, MAX_PATH ))
+ {
+ ERR("GetLongPathName(%s) failed\n", debugstr_w(filename));
+ return NULL;
+ }
+
+ if(!GetFullPathNameW( longname, MAX_PATH, fullname, &dummy ))
+ {
+ ERR("GetFullPathName(%s) failed\n", debugstr_w(filename));
+ return NULL;
+ }
+ RtlInitUnicodeString( &image_str, fullname );
RtlInitUnicodeString( &cmdline_str, cmdline );
if (startup->lpDesktop) RtlInitUnicodeString( &desktop, startup->lpDesktop );
More information about the wine-patches
mailing list