[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:
Serge Gautherie
2026-05-11 14:44:24 +03:00
committed by GitHub
parent 45303a2782
commit 42d178789b
+6 -7
View File
@@ -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 */