Index: v86vdm.c =================================================================== --- ntoskrnl/ke/i386/v86vdm.c (revision 74238) +++ ntoskrnl/ke/i386/v86vdm.c (working copy) @@ -23,6 +23,7 @@ PVOID Ki386IopmSaveArea; BOOLEAN KeI386VirtualIntExtensions = FALSE; const PULONG KiNtVdmState = (PULONG)FIXED_NTVDMSTATE_LINEAR_PC_AT; +static BOOLEAN in_int; /* UNHANDLED OPCODES **********************************************************/ @@ -53,6 +54,8 @@ { ULONG Esp, V86EFlags, TrapEFlags; + if (in_int) DPRINT1("%x:%x PUSHF\n", TrapFrame->SegCs, TrapFrame->Eip); + /* Get current V8086 flags and mask out interrupt flag */ V86EFlags = *KiNtVdmState; V86EFlags &= ~EFLAGS_INTERRUPT_MASK; @@ -106,6 +109,8 @@ { ULONG Esp, V86EFlags, EFlags, TrapEFlags; + if (in_int) DPRINT1("%x:%x POPF\n", TrapFrame->SegCs, TrapFrame->Eip); + /* Build flat ESP */ Esp = (TrapFrame->HardwareSegSs << 4) + (USHORT)TrapFrame->HardwareEsp; @@ -180,6 +185,7 @@ { ULONG Esp, V86EFlags, TrapEFlags, Eip, Interrupt; + if (in_int) DPRINT1("%x:%x INT 0x%x, ax=%x\n", TrapFrame->SegCs, TrapFrame->Eip, *(PUCHAR)(TrapFrame->Eip + 1), TrapFrame->Eax); /* Read trap frame EFlags */ TrapEFlags = TrapFrame->EFlags; @@ -258,6 +264,8 @@ TrapFrame->SegCs = Interrupt; } + if (in_int) DPRINT1("Interrupt jumping to %x:%x\n", TrapFrame->SegCs, TrapFrame->Eip); + /* We're done */ return TRUE; } @@ -269,6 +277,8 @@ { ULONG Esp, V86EFlags, EFlags, TrapEFlags, Eip; + if (in_int) DPRINT1("%x:%x IRET\n", TrapFrame->SegCs, TrapFrame->Eip); + /* Build flat ESP */ Esp = (TrapFrame->HardwareSegSs << 4) + TrapFrame->HardwareEsp; @@ -341,6 +351,8 @@ KiVdmOpcodeCLI(IN PKTRAP_FRAME TrapFrame, IN ULONG Flags) { + if (in_int) DPRINT1("%x:%x CLI\n", TrapFrame->SegCs, TrapFrame->Eip); + /* Check for VME support */ ASSERT(KeI386VirtualIntExtensions == FALSE); @@ -359,6 +371,8 @@ KiVdmOpcodeSTI(IN PKTRAP_FRAME TrapFrame, IN ULONG Flags) { + if (in_int) DPRINT1("%x:%x STI\n", TrapFrame->SegCs, TrapFrame->Eip); + /* Check for VME support */ ASSERT(KeI386VirtualIntExtensions == FALSE); @@ -493,7 +507,7 @@ /* Restore TEB addresses */ Thread->Teb = V86Frame->ThreadTeb; KiSetTebBase(KeGetPcr(), V86Frame->ThreadTeb); - +in_int = FALSE; /* Enable interrupts and return a pointer to the trap frame */ _enable(); return StackFrameUnaligned; @@ -621,6 +635,8 @@ PVDM_PROCESS_OBJECTS VdmProcessObjects; USHORT OldOffset, OldBase; + DPRINT1("Ke386CallBios for int 0x%lx, Eax=%lx, Ebx=%lx, Ecx=%lx, Edx=%lx, Ebp=%lx, Edi=%lx, Esi=%lx, Ds=%x, Es=%x\n", + Int, Context->Eax, Context->Ebx, Context->Ecx, Context->Edx, Context->Ebp, Context->Edi, Context->Esi, Context->SegDs, Context->SegEs); /* Start with a clean TEB */ RtlZeroMemory(VdmTeb, sizeof(TEB)); @@ -629,6 +645,11 @@ *Trampoline++ = (UCHAR)Int; *(PULONG)Trampoline = TRAMPOLINE_BOP; + if (Int == 0x10 && Context->Eax == 0x4f15) + { + in_int = TRUE; + } + /* Setup the VDM TEB and TIB */ VdmTeb->Vdm = (PVOID)TRAMPOLINE_TIB; RtlZeroMemory(VdmTib, sizeof(VDM_TIB));