12.7. Set I/O Handling in the Kernel PlugIn

  1. Move your I/O handling code (if needed) from the user mode to the Kernel PlugIn message handler — KP_Call [B.8.4].
  2. To activate the kernel code that performs the I/O handling from the user mode, call WDC_CallKerPlug() [B.3.23] or the low-level WD_KernelPlugInCall() function (see the WinDriver PCI Low-Level API Reference) with a relevant message for each of the different functionality that you wish to perform in the Kernel PlugIn.
    Implement a different message for each functionality.
  3. Define these messages in a header file that is shared by the user-mode application (which will send the messages) and the Kernel PlugIn driver (that implements the messages).
    In the sample/generated DriverWizard Kernel PlugIn projects, the message IDs and other information that should be shared by the user-mode application and Kernel PlugIn driver are defined in the pci_lib.h/xxx_lib.h shared library header file.