From 279183baba37d71491aaa9f7641d86583e3f5587 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sun, 20 May 2012 14:06:09 +0000 Subject: [PATCH] [KERNEL32] - Swap GetFullPathName success/failure cases in BasePushProcessParameters. Fixes kernel32:GetModuleFileName test. See issue #6786 for more details. svn path=/trunk/; revision=56643 --- reactos/dll/win32/kernel32/client/path.c | 2 +- reactos/dll/win32/kernel32/client/proc.c | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/reactos/dll/win32/kernel32/client/path.c b/reactos/dll/win32/kernel32/client/path.c index c22dcd80eaf..48224db7a3a 100644 --- a/reactos/dll/win32/kernel32/client/path.c +++ b/reactos/dll/win32/kernel32/client/path.c @@ -307,7 +307,7 @@ BasepComputeProcessPath(IN PBASE_SEARCH_PATH_TYPE PathOrder, } break; - /* Add the current applicaiton path */ + /* Add the current application path */ case BaseSearchPathApp: if ((AppName) && (AppNameEnd)) { diff --git a/reactos/dll/win32/kernel32/client/proc.c b/reactos/dll/win32/kernel32/client/proc.c index 5ef7eddbd83..3975f8169a3 100644 --- a/reactos/dll/win32/kernel32/client/proc.c +++ b/reactos/dll/win32/kernel32/client/proc.c @@ -778,8 +778,7 @@ BasePushProcessParameters(IN ULONG ParameterFlags, if ((Size) && (Size <= (MAX_PATH + 4))) { /* Get the DLL Path */ - DllPathString = BaseComputeProcessDllPath((LPWSTR)ApplicationPathName, - lpEnvironment); + DllPathString = BaseComputeProcessDllPath(FullPath, lpEnvironment); if (!DllPathString) { /* Fail */ @@ -789,12 +788,13 @@ BasePushProcessParameters(IN ULONG ParameterFlags, /* Initialize Strings */ RtlInitUnicodeString(&DllPath, DllPathString); - RtlInitUnicodeString(&ImageName, ApplicationPathName); + RtlInitUnicodeString(&ImageName, FullPath); } else { - /* Get the DLL Path */ - DllPathString = BaseComputeProcessDllPath(FullPath, lpEnvironment); + /* Couldn't get the path name. Just take the original path */ + DllPathString = BaseComputeProcessDllPath((LPWSTR)ApplicationPathName, + lpEnvironment); if (!DllPathString) { /* Fail */ @@ -804,7 +804,7 @@ BasePushProcessParameters(IN ULONG ParameterFlags, /* Initialize Strings */ RtlInitUnicodeString(&DllPath, DllPathString); - RtlInitUnicodeString(&ImageName, FullPath); + RtlInitUnicodeString(&ImageName, ApplicationPathName); } /* Initialize Strings */ @@ -1656,7 +1656,7 @@ GetStartupInfoA(IN LPSTARTUPINFOA lpStartupInfo) /* Someone beat us to it, use their data instead */ StartupInfo = BaseAnsiStartupInfo; Status = STATUS_SUCCESS; - + /* We're going to free our own stuff, but not raise */ RtlFreeAnsiString(&TitleString); } -- 2.17.1