[KERNEL32]

- Swap GetFullPathName success/failure cases in BasePushProcessParameters. Fixes kernel32:GetModuleFileName test.
See issue #6786 for more details.

svn path=/trunk/; revision=56643
This commit is contained in:
Thomas Faber 2012-05-20 14:06:09 +00:00
parent beb9a0d70f
commit 279183baba
2 changed files with 17 additions and 17 deletions

View file

@ -307,7 +307,7 @@ BasepComputeProcessPath(IN PBASE_SEARCH_PATH_TYPE PathOrder,
} }
break; break;
/* Add the current applicaiton path */ /* Add the current application path */
case BaseSearchPathApp: case BaseSearchPathApp:
if ((AppName) && (AppNameEnd)) if ((AppName) && (AppNameEnd))
{ {

View file

@ -778,6 +778,21 @@ BasePushProcessParameters(IN ULONG ParameterFlags,
if ((Size) && (Size <= (MAX_PATH + 4))) if ((Size) && (Size <= (MAX_PATH + 4)))
{ {
/* Get the DLL Path */ /* 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, DllPathString = BaseComputeProcessDllPath((LPWSTR)ApplicationPathName,
lpEnvironment); lpEnvironment);
if (!DllPathString) if (!DllPathString)
@ -791,21 +806,6 @@ BasePushProcessParameters(IN ULONG ParameterFlags,
RtlInitUnicodeString(&DllPath, DllPathString); RtlInitUnicodeString(&DllPath, DllPathString);
RtlInitUnicodeString(&ImageName, ApplicationPathName); 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 */ /* Initialize Strings */
RtlInitUnicodeString(&CommandLine, lpCommandLine); RtlInitUnicodeString(&CommandLine, lpCommandLine);
@ -1656,7 +1656,7 @@ GetStartupInfoA(IN LPSTARTUPINFOA lpStartupInfo)
/* Someone beat us to it, use their data instead */ /* Someone beat us to it, use their data instead */
StartupInfo = BaseAnsiStartupInfo; StartupInfo = BaseAnsiStartupInfo;
Status = STATUS_SUCCESS; Status = STATUS_SUCCESS;
/* We're going to free our own stuff, but not raise */ /* We're going to free our own stuff, but not raise */
RtlFreeAnsiString(&TitleString); RtlFreeAnsiString(&TitleString);
} }