From edf9eb6eea95f7ae63062b866b2502a43ae1063a Mon Sep 17 00:00:00 2001 From: Mike McCormack Date: Thu, 5 Feb 2004 01:23:42 +0000 Subject: [PATCH] Fix incorrect GetLongPathName usage exposed by Eric's filename patches. --- dlls/kernel/process.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dlls/kernel/process.c b/dlls/kernel/process.c index ad71131736..a21ef50cbe 100644 --- a/dlls/kernel/process.c +++ b/dlls/kernel/process.c @@ -1140,10 +1140,11 @@ static RTL_USER_PROCESS_PARAMETERS *create_user_params( LPCWSTR filename, LPCWST NTSTATUS status; WCHAR buffer[MAX_PATH]; - if (GetLongPathNameW( filename, buffer, MAX_PATH )) - RtlInitUnicodeString( &image_str, buffer ); - else - RtlInitUnicodeString( &image_str, filename ); + if(!GetLongPathNameW( filename, buffer, MAX_PATH )) + lstrcpynW( buffer, filename, MAX_PATH ); + if(!GetFullPathNameW( buffer, MAX_PATH, buffer, NULL )) + lstrcpynW( buffer, filename, MAX_PATH ); + RtlInitUnicodeString( &image_str, buffer ); RtlInitUnicodeString( &cmdline_str, cmdline ); if (startup->lpDesktop) RtlInitUnicodeString( &desktop, startup->lpDesktop );