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,6 +778,21 @@ BasePushProcessParameters(IN ULONG ParameterFlags, if ((Size) && (Size <= (MAX_PATH + 4))) { /* Get the DLL Path */ + DllPathString = BaseComputeProcessDllPath(FullPath, lpEnvironment); + if (!DllPathString) + { + /* Fail */ + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } + + /* Initialize Strings */ + RtlInitUnicodeString(&DllPath, DllPathString); + RtlInitUnicodeString(&ImageName, FullPath); + } + else + { + /* Couldn't get the path name. Just take the original path */ DllPathString = BaseComputeProcessDllPath((LPWSTR)ApplicationPathName, lpEnvironment); if (!DllPathString) @@ -791,21 +806,6 @@ BasePushProcessParameters(IN ULONG ParameterFlags, RtlInitUnicodeString(&DllPath, DllPathString); RtlInitUnicodeString(&ImageName, ApplicationPathName); } - else - { - /* Get the DLL Path */ - DllPathString = BaseComputeProcessDllPath(FullPath, lpEnvironment); - if (!DllPathString) - { - /* Fail */ - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return FALSE; - } - - /* Initialize Strings */ - RtlInitUnicodeString(&DllPath, DllPathString); - RtlInitUnicodeString(&ImageName, FullPath); - } /* Initialize Strings */ RtlInitUnicodeString(&CommandLine, lpCommandLine); @@ -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); }