Make Home, End and Enter on the keypad work in the debugger.
[wine.git] / msdos / interrupts.c
blob4abf2e13b9d6cbad96f319b51dc45760b13988f3
1 /*
2 * Interrupt vectors emulation
4 * Copyright 1995 Alexandre Julliard
5 */
7 #include <sys/types.h>
8 #include "windef.h"
9 #include "wine/winbase16.h"
10 #include "miscemu.h"
11 #include "msdos.h"
12 #include "module.h"
13 #include "debugtools.h"
15 DEFAULT_DEBUG_CHANNEL(int);
17 static FARPROC16 INT_Vectors[256];
19 /* Ordinal number for interrupt 0 handler in WPROCS.DLL */
20 #define FIRST_INTERRUPT 100
23 /**********************************************************************
24 * INT_GetPMHandler
26 * Return the protected mode interrupt vector for a given interrupt.
28 FARPROC16 INT_GetPMHandler( BYTE intnum )
30 if (!INT_Vectors[intnum])
32 static HMODULE16 wprocs;
33 if (!wprocs)
35 if (((wprocs = GetModuleHandle16( "wprocs" )) < 32) &&
36 ((wprocs = LoadLibrary16( "wprocs" )) < 32))
38 ERR("could not load wprocs.dll\n");
39 return 0;
42 if (!(INT_Vectors[intnum] = GetProcAddress16( wprocs, (LPCSTR)(FIRST_INTERRUPT + intnum))))
44 WARN("int%x not implemented, returning dummy handler\n", intnum );
45 INT_Vectors[intnum] = GetProcAddress16( wprocs, (LPCSTR)(FIRST_INTERRUPT + 256) );
48 return INT_Vectors[intnum];
52 /**********************************************************************
53 * INT_SetPMHandler
55 * Set the protected mode interrupt handler for a given interrupt.
57 void INT_SetPMHandler( BYTE intnum, FARPROC16 handler )
59 TRACE("Set protected mode interrupt vector %02x <- %04x:%04x\n",
60 intnum, HIWORD(handler), LOWORD(handler) );
61 INT_Vectors[intnum] = handler;
65 /**********************************************************************
66 * INT_DefaultHandler (WPROCS.356)
68 * Default interrupt handler.
70 void WINAPI INT_DefaultHandler( CONTEXT86 *context )