Disable correct usage of ESP0 since it seems the V86 code is still not ready to handle that. This should fix the V86 exceptions some people have been having.

svn path=/trunk/; revision=20914
This commit is contained in:
Alex Ionescu 2006-01-16 17:05:50 +00:00
parent 7d5b2bb49d
commit 68d8925879
2 changed files with 11 additions and 1 deletions

View file

@ -171,7 +171,10 @@ BadThread:
NoAdjust:
/* Set new ESP0 */
mov [ebp+KTSS_ESP0], eax
//mov [ebp+KTSS_ESP0], eax
/* Save it */
push [ebp+KTSS_ESP0]
/* Set TEB pointer */
mov eax, [esi+KTHREAD_TEB]
@ -257,6 +260,9 @@ SameProcess:
mov cr0, eax
4:
/* Restore ESP0 */
pop [ebp+KTSS_ESP0]
/* Restore exception list */
pop [ebx+KPCR_EXCEPTION_LIST]

View file

@ -14,6 +14,7 @@
typedef struct _KSHARED_CTXSWITCH_FRAME
{
ULONG Esp0;
PVOID ExceptionList;
PVOID RetEip;
} KSHARED_CTXSWITCH_FRAME, *PKSHARED_CTXSWITCH_FRAME;
@ -231,6 +232,9 @@ Ke386InitThreadWithContext(PKTHREAD Thread,
/* And set up the Context Switch Frame */
CtxSwitchFrame->RetEip = KiThreadStartup;
CtxSwitchFrame->Esp0 = (ULONG_PTR)Thread->InitialStack -
sizeof(FX_SAVE_AREA) -
0x10;
CtxSwitchFrame->ExceptionList = (PVOID)0xFFFFFFFF;
/* Save back the new value of the kernel stack. */