Technical Document #46

Technical Document #46
Why does my WD_KernelPlugInOpen() call fail?

WDKernelPlugInOpen() is also called from the high-level WDC_KernelPlugInOpen() function, and from the WDC_xxxxDeviceOpen() functions — when they are called with the name of a Kernel PlugIn driver.

There are several reasons why the call to WD_KernelPlugInOpen() might fail:

  • You did not set up the parameters correctly in the call to WD_KernelPlugInOpen(). Please check this carefully.

  • You did not set up the driver name correctly in all locations in the code: Please verify that you are using the correct Kernel PlugIn driver name in all the relevant locations in the code. Look specifically at the Kernel PlugIn KP_Init() implementation and at kernelPlugIn.pcDriverName in the user mode project. [Please indicate the driver name in capital letters and without the file extension (*.sys/.vxd/.kext/.o/.ko)].

  • You did not install the driver properly: Make sure you copied the driver file that was created to the correct location (e.g., %windir%\system32\drivers — to install a SYS Kernel PlugIn driver on Windows) and that you installed the Kernel PlugIn kernel module correctly, as explained in the WinDriver PCI User's Manual. For general guidelines on how to install your Kernel PlugIn driver, refer to Technical Document #62. For Windows, for example, make sure to use the correct wdreg/wdreg_gui/wdreg16 installation syntax: For SYS drivers:
    wdreg -name <your KP driver name> install.
    For VxD drivers (supported in earlier versions of WinDriver):
    wdreg -vxd -name <KP driver name> install.
    (Note: On Windows 98/Me you need to reboot the OS in order to complete the installation.)

  • For registered users: You did not call WD_License() before calling WD_KernelPlugInOpen().
    If you are using a registered version of WinDriver, remember to call WD_License() (or a registration function, which calls WD_License()) before calling WD_KernelPlugInOpen().