• A convenient function for shutting down interrupt handling.
DWORD InterruptDisable(HANDLE hThread);
| Name | Type | Input/Output |
|---|---|---|
| hThread | HANDLE | Input |
| Name | Description |
|---|---|
| hThread |
Interrupt thread handle, as received from
InterruptEnable() [2.18]
(*phThread)
|
Returns WD_STATUS_SUCCESS (0) on success, or an appropriate
error code otherwise [A].
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()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() */
}
....
}