don't share some protected mode interrupts in winedos

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Patch updated with Jukka's recommendation (changed TASK_GetCurrent() to GlobalLock(GetCurrentTask()) ... )


ChangeLog:
* don't share some protected mode interrupts in winedos
Index: include/task.h
===================================================================
RCS file: /home/wine/wine/include/task.h,v
retrieving revision 1.32
diff -u -r1.32 task.h
--- include/task.h	28 Aug 2003 21:43:35 -0000	1.32
+++ include/task.h	8 Oct 2003 06:48:46 -0000
@@ -98,13 +98,13 @@
     FARPROC16 sighandler WINE_PACKED;     /* 26 Signal handler */
     FARPROC16 userhandler WINE_PACKED;    /* 2a USER signal handler */
     FARPROC16 discardhandler WINE_PACKED; /* 2e Handler for GlobalNotify() */
-    DWORD     int0 WINE_PACKED;           /* 32 int 0 (divide by 0) handler */
-    DWORD     int2 WINE_PACKED;           /* 36 int 2 (NMI) handler */
-    DWORD     int4 WINE_PACKED;           /* 3a int 4 (INTO) handler */
-    DWORD     int6 WINE_PACKED;           /* 3e int 6 (invalid opc) handler */
-    DWORD     int7 WINE_PACKED;           /* 42 int 7 (coprocessor) handler */
-    DWORD     int3e WINE_PACKED;          /* 46 int 3e (80x87 emu) handler */
-    DWORD     int75 WINE_PACKED;          /* 4a int 75 (80x87 error) handler */
+    FARPROC16 int0 WINE_PACKED;           /* 32 int 0 (divide by 0) handler */
+    FARPROC16 int2 WINE_PACKED;           /* 36 int 2 (NMI) handler */
+    FARPROC16 int4 WINE_PACKED;           /* 3a int 4 (INTO) handler */
+    FARPROC16 int6 WINE_PACKED;           /* 3e int 6 (invalid opc) handler */
+    FARPROC16 int7 WINE_PACKED;           /* 42 int 7 (coprocessor) handler */
+    FARPROC16 int3e WINE_PACKED;          /* 46 int 3e (80x87 emu) handler */
+    FARPROC16 int75 WINE_PACKED;          /* 4a int 75 (80x87 error) handler */
     DWORD     compat_flags WINE_PACKED;   /* 4e Compatibility flags */
     BYTE      unused4[2];                 /* 52 */
     struct _TEB *teb;                     /* 54 Pointer to thread database */
Index: dlls/winedos/interrupts.c
===================================================================
RCS file: /home/wine/wine/dlls/winedos/interrupts.c,v
retrieving revision 1.22
diff -u -r1.22 interrupts.c
--- dlls/winedos/interrupts.c	7 Oct 2003 03:32:03 -0000	1.22
+++ dlls/winedos/interrupts.c	8 Oct 2003 06:48:47 -0000
@@ -25,6 +25,7 @@
 #include "wine/winbase16.h"
 
 #include "thread.h"
+#include "task.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(int);
 WINE_DECLARE_DEBUG_CHANNEL(relay);
@@ -562,9 +563,42 @@
  */
 FARPROC16 DOSVM_GetPMHandler16( BYTE intnum )
 {
+    TDB *pTask;
+    FARPROC16 proc = 0;
+
+    pTask = GlobalLock16(GetCurrentTask());
+    if (pTask)
+    {
+        switch( intnum )
+        {
+        case 0x00:
+            proc = pTask->int0;
+            break;
+        case 0x02:
+            proc = pTask->int2;
+            break;
+        case 0x04:
+            proc = pTask->int4;
+            break;
+        case 0x06:
+            proc = pTask->int6;
+            break;
+        case 0x07:
+            proc = pTask->int7;
+            break;
+        case 0x3e:
+            proc = pTask->int3e;
+            break;
+        case 0x75:
+            proc = pTask->int75;
+            break;
+        }
+        if( proc )
+            return proc;
+    }
     if (!DOSVM_Vectors16[intnum])
     {
-        FARPROC16 proc = (FARPROC16)MAKESEGPTR( DOSVM_dpmi_segments->int16_sel,
+        proc = (FARPROC16)MAKESEGPTR( DOSVM_dpmi_segments->int16_sel,
                                                 DOSVM_STUB_PM16 * intnum );
         DOSVM_Vectors16[intnum] = proc;
     }
@@ -579,9 +613,41 @@
  */
 void DOSVM_SetPMHandler16( BYTE intnum, FARPROC16 handler )
 {
+  TDB *pTask;
+
   TRACE("Set protected mode interrupt vector %02x <- %04x:%04x\n",
        intnum, HIWORD(handler), LOWORD(handler) );
-  DOSVM_Vectors16[intnum] = handler;
+
+  pTask = GlobalLock16(GetCurrentTask());
+  if (!pTask)
+    return;
+  switch( intnum )
+  {
+  case 0x00:
+    pTask->int0 = handler;
+    break;
+  case 0x02:
+    pTask->int2 = handler;
+    break;
+  case 0x04:
+    pTask->int4 = handler;
+    break;
+  case 0x06:
+    pTask->int6 = handler;
+    break;
+  case 0x07:
+    pTask->int7 = handler;
+    break;
+  case 0x3e:
+    pTask->int3e = handler;
+    break;
+  case 0x75:
+    pTask->int75 = handler;
+    break;
+  default:
+    DOSVM_Vectors16[intnum] = handler;
+    break;
+  }
 }
 
 

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux