mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-26 19:33:31 +00:00
[KERNEL32] GetStartupInfoA(): Check other thread result at the latest (#8326)
Give a bit more time to succeed.
- Remove a remnant assignment.
- Check the interesting variable itself and as late as possible.
Follow-up to 0.4.16-dev-1610-g 4f61d2ea04 (#8282).
This commit is contained in:
@@ -287,8 +287,6 @@ GetStartupInfoA(IN LPSTARTUPINFOA lpStartupInfo)
|
||||
}
|
||||
|
||||
/* Someone beat us to it, we will use their data instead */
|
||||
Status = STATUS_SUCCESS;
|
||||
|
||||
/* We're going to free our own stuff, but not raise */
|
||||
RtlFreeAnsiString(&TitleString);
|
||||
}
|
||||
@@ -297,9 +295,6 @@ GetStartupInfoA(IN LPSTARTUPINFOA lpStartupInfo)
|
||||
RtlFreeAnsiString(&ShellString);
|
||||
}
|
||||
RtlFreeHeap(RtlGetProcessHeap(), 0, StartupInfo);
|
||||
|
||||
/* Get the cached information again: either still NULL or set by another thread */
|
||||
StartupInfo = BaseAnsiStartupInfo;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -307,8 +302,12 @@ GetStartupInfoA(IN LPSTARTUPINFOA lpStartupInfo)
|
||||
Status = STATUS_NO_MEMORY;
|
||||
}
|
||||
|
||||
/* Raise an error unless we got here due to the race condition */
|
||||
if (!StartupInfo) RtlRaiseStatus(Status);
|
||||
/* Raise an error if there is no cached information */
|
||||
if (!BaseAnsiStartupInfo)
|
||||
RtlRaiseStatus(Status);
|
||||
|
||||
/* Get the cached information again: set by another thread */
|
||||
StartupInfo = BaseAnsiStartupInfo;
|
||||
}
|
||||
|
||||
/* Now copy from the cached ANSI version */
|
||||
|
||||
Reference in New Issue
Block a user