2 * Interrupt vectors emulation
4 * Copyright 1995 Alexandre Julliard
9 #include "wine/winbase16.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 /**********************************************************************
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
;
35 if (((wprocs
= GetModuleHandle16( "wprocs" )) < 32) &&
36 ((wprocs
= LoadLibrary16( "wprocs" )) < 32))
38 ERR("could not load wprocs.dll\n");
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 /**********************************************************************
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
)