12.4  Create a Handle to the Kernel PlugIn

In your user-mode application or library source code, call WDC_PciDeviceOpen() [B.3.10] / WDC_PcmciaDeviceOpen() [B.3.11] / WDC_IsaDeviceOpen() [B.3.12] (depending on the type of your device) with the name of your Kernel PlugIn driver in order to open a handle to the device using the Kernel PlugIn driver.
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_DeviceOpen()/PCI_DeviceOpen() library function (which is called from the generated/sample xxx_diag/pci_diag user-mode application.)

If you are not using the WDC library from your code [B.2], you need to call WD_KernelPlugInOpen() at the beginning of your code in order to open a handle to your Kernel PlugIn driver, and call WD_KernelPlugInClose() before terminating the application or when you no longer wish to use the Kernel PlugIn driver. WD_KernelPlugInOpen() returns a handle to the Kernel PlugIn driver 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.