[ros-diffs] [hbirr] 16627: If the user mode is intercepted by an interrupt, we must deliver user mode apc's.

hbirr at svn.reactos.com hbirr at svn.reactos.com
Sun Jul 17 20:36:08 CEST 2005


If the user mode is intercepted by an interrupt, we must deliver user
mode apc's.
Modified: trunk/reactos/ntoskrnl/ke/i386/irq.c
  _____  

Modified: trunk/reactos/ntoskrnl/ke/i386/irq.c
--- trunk/reactos/ntoskrnl/ke/i386/irq.c	2005-07-17 18:34:23 UTC
(rev 16626)
+++ trunk/reactos/ntoskrnl/ke/i386/irq.c	2005-07-17 18:36:01 UTC
(rev 16627)
@@ -306,12 +306,12 @@

     */
    Ke386DisableInterrupts();
 
-   HalEndSystemInterrupt (old_level, 0);
-
    if (old_level==PASSIVE_LEVEL && Trapframe->Cs != KERNEL_CS)
      {
+       HalEndSystemInterrupt (APC_LEVEL, 0);
+
        CurrentThread = KeGetCurrentThread();
-       if (CurrentThread!=NULL && CurrentThread->Alerted[1])
+       if (CurrentThread!=NULL &&
CurrentThread->ApcState.UserApcPending)
          {
            DPRINT("PID: %d, TID: %d CS %04x/%04x\n",
 
((PETHREAD)CurrentThread)->ThreadsProcess->UniqueProcessId,
@@ -325,8 +325,8 @@
 	       CurrentThread->TrapFrame = &KernelTrapFrame;
 	     }
 
-	   Ke386EnableInterrupts();
-           KiDeliverApc(KernelMode, NULL, NULL);
+           Ke386EnableInterrupts();
+           KiDeliverApc(UserMode, NULL, NULL);
            Ke386DisableInterrupts();
 
 	   ASSERT(KeGetCurrentThread() == CurrentThread);
@@ -336,7 +336,13 @@
 	       CurrentThread->TrapFrame = OldTrapFrame;
 	     }
 	 }
+       KeLowerIrql(PASSIVE_LEVEL);
      }
+   else
+     {
+       HalEndSystemInterrupt (old_level, 0);
+     }
+
 }
 
 static VOID
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.reactos.org/pipermail/ros-diffs/attachments/20050717/dfae84f7/attachment.html


More information about the Ros-diffs mailing list