Update i686 thread context initialization to match AMD64

This commit is contained in:
2026-06-15 09:15:48 +02:00
parent 89681897d7
commit 208684c3b4
3 changed files with 12 additions and 11 deletions

View File

@@ -121,14 +121,14 @@ KE::KThread::InitializeThreadContext(IN PKTHREAD Thread,
}
/* Initialize thread startup information */
ThreadFrame->StartFrame.StartContext = StartContext;
ThreadFrame->StartFrame.StartRoutine = StartRoutine;
ThreadFrame->StartFrame.SystemRoutine = SystemRoutine;
ThreadFrame->StartFrame.P1Home = (ULONG)StartContext;
ThreadFrame->StartFrame.P2Home = (ULONG)StartRoutine;
ThreadFrame->StartFrame.P3Home = (ULONG)SystemRoutine;
/* Initialize switch frame */
ThreadFrame->SwitchFrame.ApcBypassDisabled = TRUE;
ThreadFrame->SwitchFrame.ApcBypass = APC_LEVEL;
ThreadFrame->SwitchFrame.ExceptionList = (PEXCEPTION_REGISTRATION_RECORD) - 1;
ThreadFrame->SwitchFrame.Return = (PVOID)(ULONG)RunThread;
ThreadFrame->SwitchFrame.Return = (ULONG)RunThread;
/* Set thread stack boundaries */
Thread->InitialStack = (PVOID)&ThreadFrame->NpxFrame;