2 * Interrupt vectors emulation
4 * Copyright 1995 Alexandre Julliard
13 static SEGPTR INT_Vectors
[256];
15 /* Ordinal number for interrupt 0 handler in WINPROCS.DLL */
16 #define FIRST_INTERRUPT_ORDINAL 100
19 /**********************************************************************
24 SEGPTR addr
, dummyHandler
;
26 HMODULE hModule
= GetModuleHandle( "WINPROCS" );
28 dummyHandler
= MODULE_GetEntryPoint( hModule
, FIRST_INTERRUPT_ORDINAL
+256);
29 for (vector
= 0; vector
< 256; vector
++)
31 addr
= MODULE_GetEntryPoint( hModule
, FIRST_INTERRUPT_ORDINAL
+vector
);
32 INT_Vectors
[vector
] = addr
? addr
: dummyHandler
;
38 /**********************************************************************
41 * Return the interrupt vector for a given interrupt.
43 SEGPTR
INT_GetHandler( BYTE intnum
)
45 dprintf_int( stddeb
, "Get interrupt vector %02x -> %04x:%04x\n",
46 intnum
, HIWORD(INT_Vectors
[intnum
]),
47 LOWORD(INT_Vectors
[intnum
]) );
48 return INT_Vectors
[intnum
];
52 /**********************************************************************
55 * Set the interrupt handler for a given interrupt.
57 void INT_SetHandler( BYTE intnum
, SEGPTR handler
)
59 dprintf_int( stddeb
, "Set interrupt vector %02x <- %04x:%04x\n",
60 intnum
, HIWORD(handler
), LOWORD(handler
) );
61 INT_Vectors
[intnum
] = handler
;
65 /**********************************************************************
68 void INT_DummyHandler( struct sigcontext_struct context
)
70 dprintf_int( stddeb
, "Dummy handler called!\n" );
73 /**********************************************************************
76 void INT_Int10Handler( struct sigcontext_struct context
)
78 dprintf_int( stddeb
, "int 10 called indirectly through handler!\n" );
83 /**********************************************************************
86 void INT_Int13Handler( struct sigcontext_struct context
)
88 dprintf_int( stddeb
, "int 13 called indirectly through handler!\n" );
93 /**********************************************************************
96 void INT_Int15Handler( struct sigcontext_struct context
)
98 dprintf_int( stddeb
, "int 15 called indirectly through handler!\n" );
103 /**********************************************************************
106 void INT_Int16Handler( struct sigcontext_struct context
)
108 dprintf_int( stddeb
, "int 16 called indirectly through handler!\n" );
109 do_int16( &context
);
113 /**********************************************************************
116 void INT_Int1aHandler( struct sigcontext_struct context
)
118 dprintf_int( stddeb
, "int 1a called indirectly through handler!\n" );
119 do_int1a( &context
);
123 /**********************************************************************
126 void INT_Int21Handler( struct sigcontext_struct context
)
128 dprintf_int( stddeb
, "int 21 called indirectly through handler!\n" );
129 do_int21( &context
);
133 /**********************************************************************
136 void INT_Int25Handler( struct sigcontext_struct context
)
138 dprintf_int( stddeb
, "int 25 called indirectly through handler!\n" );
139 do_int25( &context
);
143 /**********************************************************************
146 void INT_Int26Handler( struct sigcontext_struct context
)
148 dprintf_int( stddeb
, "int 26 called indirectly through handler!\n" );
149 do_int26( &context
);
153 /**********************************************************************
156 void INT_Int2aHandler( struct sigcontext_struct context
)
158 dprintf_int( stddeb
, "int 2a called indirectly through handler!\n" );
159 do_int2a( &context
);
163 /**********************************************************************
166 void INT_Int2fHandler( struct sigcontext_struct context
)
168 dprintf_int( stddeb
, "int 2f called indirectly through handler!\n" );
169 do_int2f( &context
);
173 /**********************************************************************
176 void INT_Int31Handler( struct sigcontext_struct context
)
178 dprintf_int( stddeb
, "int 31 called indirectly through handler!\n" );
179 do_int31( &context
);
183 /**********************************************************************
186 void INT_Int5cHandler( struct sigcontext_struct context
)
188 dprintf_int( stddeb
, "int 5c called indirectly through handler!\n" );
189 do_int5c( &context
);