Installs a interrupt handler for the specified interrupt, allocating a wrapper function which will save registers and handle the stack switching. The passed function should return zero (in EAX) to exit the interrupt with an iret instruction, and non-zero to chain to the old handler.
IntNum, the interrupt number to install the handler for.
HandlerAddress, the address of the handler function.
Returns -1 on error (unable to allocate a wrapper), 0 on success.
A maximum of MAX_INTS interrupts may be hooked using this function.
Removes an interrupt handler installed by Install_Int(), restoring the old vector.
IntNum, the interrupt number to uninstall the handler for.
None
Restores the default IRQ masks (the masks at the time Init_IRQ() was called).
None
None
Gets a real-mode callback handler for the specified protected mode callback handler, allocating a wrapper function which will save registers and handle the stack switching. The real-mode segment and offset to pass to the real-mode function (eg, the mouse interrupt) are returned into the variables pointed to by RM_Segment and RM_Offset.
HandlerAddress, the address of the callback handler function.
ReturnTypeRETF, the return type of the handler (in real mode), 1=retf, 0=iret.
RM_Segment, the real-mode segment of the real-mode callback.
RM_Offset, the real-mode offset of the real-mode callback.
Returns 1 on error (unable to allocate a wrapper), 0 on success.
A maximum of MAX_RMCB wrappers may be allocated using this function.
Callback procedure should use the C calling convention, compatible with the following C declaration:
The Regs parameter is the starting address of a structure that's organized the same as the DPMI_Regs global structure (e.g., the same as the structure in DPMI function 0300h. However, it does not point at the global DPMI_Regs structure, so don't attempt to access the EAX value by looking at the DPMI_EAX global variable. Rather, use the DPMI_*_off constants (such as DPMI_EAX_off) to offset from the address in the Regs parameter within the ES selector, using code like the following:
proc _Callback
.Regs arg 4
mov ebx, [ebp+.Regs]
mov eax, [es:ebx+DPMI_EAX_off] ; Get eax value
ret
endproc
The values the DPMI_Regs structure pointed to by Regs contains are the real-mode register values set at the time the real mode side of the real mode callback was called (e.g., by the mouse driver).
Some outputs are passed as parameters; pass the address of a variable, and after a successful call, the variable will be filled with the output information.
Frees a real-mode callback wrapper allocated by Get_RMCB().
RM_Segment, the real-mode segment of the real-mode callback.
RM_Offset, the real-mode offset of the real-mode callback.
None