Polyfill auxiliary values on XNU

This commit is contained in:
Justine Tunney 2021-02-03 20:37:52 -08:00
parent a37960a3af
commit d934f38c99
6 changed files with 27 additions and 32 deletions

View file

@ -67,7 +67,7 @@ static noasan textwindows void MakeLongDoubleLongAgain(void) {
static noasan textwindows void NormalizeCmdExe(void) {
uint32_t mode;
int64_t handle, hstdin, hstdout, hstderr;
if ((int)weakaddr("sys_v_ntsubsystem") == kNtImageSubsystemWindowsCui &&
if ((int)weakaddr("v_ntsubsystem") == kNtImageSubsystemWindowsCui &&
NtGetVersion() >= kNtVersionWindows10) {
hstdin = GetStdHandle(pushpop(kNtStdInputHandle));
hstdout = GetStdHandle(pushpop(kNtStdOutputHandle));