PURPOSE
• A convenient function for shutting down interrupt handling.
PROTOTYPE
DWORD InterruptDisable(HANDLE hThread);
PARAMETERS
DESCRIPTION
RETURN VALUE
Returns
WD_STATUS_SUCCESS(0) on success, or
an appropriate error code otherwise [
A].
REMARKS
-
You can view the implementation of this function in
WinDriver/src/wdapi/windrvr_int_thread.c.
InterruptDisable uses the low-level
WD_IntDisable [3.5] function.
When using InterruptEnable [2.18] to enable interrupts, instead of calling the
low-level WD_IntEnable [3.2],
WD_IntWait [3.3] and
WD_IntCount [3.4] functions
separately, the interrupts should be disabled using
InterruptDisable and not WD_IntDisable
EXAMPLE
main()
{
....
if (InterruptEnable(&thread_handle, hWD, &Intrp,
interrupt_handler, pData))
{
printf("failed enabling interrupt\n");
}
else
{
printf("Press Enter to uninstall interrupt\n");
fgets(line, sizeof(line), stdin);
InterruptDisable(thread_handle); /* Calls WD_IntDisable() */
}
....
}