@@ -191,13 +191,21 @@ KiVdmOpcodeINTnn(IN PKTRAP_FRAME TrapFrame,
191191 V86EFlags &= (EFLAGS_ALIGN_CHECK | EFLAGS_INTERRUPT_MASK );
192192
193193 /* Check for VME support */
194- ASSERT (KeI386VirtualIntExtensions == FALSE);
194+ if (KeI386VirtualIntExtensions )
195+ {
196+ /* Set IF based on VIF */
197+ V86EFlags &= ~EFLAGS_INTERRUPT_MASK ;
198+ if (TrapEFlags & EFLAGS_VIF )
199+ {
200+ V86EFlags |= EFLAGS_INTERRUPT_MASK ;
201+ }
202+ }
195203
196204 /* Mask in the relevant V86 EFlags into the trap flags */
197205 V86EFlags |= (TrapEFlags & ~EFLAGS_INTERRUPT_MASK );
198206
199207 /* And mask out the VIF, nested task and TF flag from the trap flags */
200- TrapFrame -> EFlags = TrapEFlags & ~ (EFLAGS_VIF | EFLAGS_NESTED_TASK | EFLAGS_TF );
208+ TrapFrame -> EFlags = TrapEFlags & ~ (EFLAGS_VIF | EFLAGS_NESTED_TASK | EFLAGS_TF );
201209
202210 /* Add the IOPL flag to the local trap flags */
203211 V86EFlags |= EFLAGS_IOPL ;
@@ -299,11 +307,17 @@ KiVdmOpcodeIRET(IN PKTRAP_FRAME TrapFrame,
299307 }
300308
301309 /* Mask out EFlags */
302- EFlags &= ~(EFLAGS_IOPL + EFLAGS_VIF + EFLAGS_NESTED_TASK + EFLAGS_VIP );
310+ EFlags &= ~(EFLAGS_VIP | EFLAGS_VIF | EFLAGS_NESTED_TASK | EFLAGS_IOPL );
303311 V86EFlags = EFlags ;
304312
305313 /* Check for VME support */
306- ASSERT (KeI386VirtualIntExtensions == FALSE);
314+ if (KeI386VirtualIntExtensions )
315+ {
316+ if (EFlags & EFLAGS_INTERRUPT_MASK )
317+ {
318+ EFlags |= EFLAGS_VIF ;
319+ }
320+ }
307321
308322 /* Add V86 and Interrupt flag */
309323 EFlags |= EFLAGS_V86_MASK | EFLAGS_INTERRUPT_MASK ;
0 commit comments