Technical Document #101

Technical Document #101
I need to be able to count the number of interrupts occurring and possibly call a routine every time an interrupt occurs. Is this possible with WinDriver?

Yes. You can use the DriverWizard to generate a diagnostics code for your device, which includes a skeletal interrupt handling mechanism that also monitors the number of interrupts received. (You may need to modify the code slightly to suit your hardware's specification with regard to interrupt handling).

You can also refer to the int_io sample, which is available under the WinDriver/samples/int_io/ directory, for an example of handling ISA interrupts with WinDriver.

Both the sample and the generated code will install an interrupt and spawn a thread that waits on it. The number of interrupts received is returned in the dwCounter field of the WD_INTERRUPT structure.