PURPOSE
Obtain a valid handle to the Kernel PlugIn.
PROTOTYPE
DWORD WD_KernelPlugInOpen(
HANDLE hWD,
WD_KERNEL_PLUGIN *pKernelPlugIn);
PARAMETERS
| Name | Type | Input/Output |
|---|---|---|
| HANDLE | Output | |
| WD_KERNEL_PLUGIN* | ||
| DWORD | Output | |
| PCHAR | Input | |
| PCHAR | Input | |
| PVOID | Input |
DESCRIPTION
| Name | Description |
|---|---|
| hWD | Handle to WinDriver |
| pKernelPlugIn | Pointer to Kernel PlugIn information structure: |
| Returns the handle to the Kernel PlugIn | |
| Name of Kernel PlugIn to load, up to 8 characters | |
| This field should be set to NULL. WinDriver will search for the driver in the operating system's drivers/modules directory. | |
| Pointer to data that will be passed to the KP_Open() callback in the Kernel PlugIn |
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);
}