This chapter describes the user-mode functions that initiate the Kernel PlugIn
operations and activate its callbacks. For a description of the high-level
WDC user-mode Kernel PlugIn APIs, which can be used instead of the
low-level APIs described in this chapter, and for a description of the Kernel
PlugIn structures and kernel-mode APIs, refer to the WinDriver PCI Manual.
PURPOSE
• Obtain a valid handle to the Kernel PlugIn.
PROTOTYPE
DWORD WD_KernelPlugInOpen(
HANDLE hWD,
WD_KERNEL_PLUGIN *pKernelPlugIn);
PARAMETERS
DESCRIPTION
RETURN VALUE
Returns
WD_STATUS_SUCCESS(0) on success, or
an appropriate error code otherwise [
A].
EXAMPLE
WD_KERNEL_PLUGIN kernelPlugIn;
BZERO(kernelPlugIn);
/* Tells WinDriver which driver to open */
kernelPlugIn.pcDriverName = "KPDriver";
HANDLE hWD = WD_Open(); /* Validate handle here */
dwStatus = WD_KernelPlugInOpen(hWD, &kernelPlugIn);
if (dwStatus)
{
printf ("Failed opening a handle to the Kernel PlugIn. Error: 0x%x (%s)\n",
dwStatus, Stat2Str(dwStatus));
}
else
{
printf("Opened a handle to the Kernel PlugIn (0x%x)\n",
kernelPlugIn.hKernelPlugIn);
}