[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;
/* Add the current applicaiton path */
/* Add the current application path */
case BaseSearchPathApp:
if ((AppName) && (AppNameEnd))
{

View file

@ -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);