When calling WDC_IntEnable() [B.3.46] (after having opened a handle to the device
using a Kernel PlugIn driver, by calling WDC_xxxDeviceOpen()
with the name of a Kernel PlugIn driver, as explained in section 12.4), set the fUseKP function
parameter to TRUE to indicate that you wish to enable
interrupts in the Kernel PlugIn driver with which the device was
opened.
The generated DriverWizard and the sample
pci_diag shared library
(xxx_lib.c /
pci_lib.c) demonstrate how this should be
done – see the generated/sample
XXX_IntEnable()/PCI_IntEnable() library function
(which is called from the generated/sample
xxx_diag/pci_diag
user-mode application.)
If you are not using the WDC_xxx API [B.2], in order to enable interrupts in the Kernel
PlugIn call WD_IntEnable() or InterruptEnable()
(which calls WD_IntEnable()), and pass the handle to the
Kernel PlugIn driver that you received from
WD_KernelPlugInOpen() (within the hKernelPlugIn
field of the WD_KERNEL_PLUGIN structure that was passed to the
function). For details regarding these APIs, refer to the WinDriver PCI Manual.
WDC_IntEnable()/InterruptEnable()/WD_IntEnable()
to enable interrupts in the Kernel PlugIn, WinDriver will activate your Kernel
PlugIn's KP_IntEnable() callback function [B.6.6]. You can implement this function to set the
interrupt context that will be passed to the high-IRQL and DPC Kernel
PlugIn interrupt handler routines, as well as write to the device to
actually enable the interrupts in the hardware, for example, or implement
any other code required in order to correctly enable your device's
interrupts.
KP_IntAtIrql() [B.6.8] (legacy
interrupts) or KP_IntAtIrqlMSI() [B.6.10]
(MSI/MSI-X) – which runs
at high interrupt request level. Deferred processing of the interrupt can
be moved to the relevant DPC handler – KP_IntAtDpc() [B.6.9] or KP_IntAtDpcMSI() [B.6.11] –
which will be executed once the high-IRQL handler completes it processing
and returns TRUE. You can also modify the code to make it more
efficient, due to the advantages of handling the interrupts directly in the
kernel, which provides you with greater flexibility (e.g., you can read
from a specific register and write back the value that was read, or toggle
specific register bits.) For a detailed explanation on how to handle
interrupts in the kernel using a Kernel PlugIn, refer to
section 11.6.5 of the manual.