next up previous contents
Next: 6.4 WD_IntEnable() Up: 6. Kernel PlugIn User-Mode Previous: 6.2 WD_KernelPlugInClose()   Contents


6.3 WD_KernelPlugInCall()


PURPOSE

$\bullet$Calls a routine in the Kernel PlugIn to be executed.


PROTOTYPE

DWORD WD_KernelPlugInCall(
    HANDLE hWD,
    WD_KERNEL_PLUGIN_CALL *pKernelPlugInCall);


PARAMETERS

Name Type Input/Output
$\bullet$hWD HANDLE Input
$\bullet$pKernelPlugInCall WD_KERNEL_PLUGIN_CALL* Input
$\gg$hKernelPlugIn DWORD Input
$\gg$dwMessage DWORD Input
$\gg$pData PVOID Input/Output
$\gg$dwResult DWORD Output


DESCRIPTION

Name Description
hWD Handle to WinDriver
pKernelPlugInCall Pointer to a Kernel PlugIn message structure:
$\bullet$ hKernelPlugIn Handle to the Kernel PlugIn
$\bullet$ dwMessage Message ID to pass to the KP_Call() callback
$\bullet$ pData Pointer to data to pass between the Kernel PlugIn driver and the user-mode application, via the KP_Call() callback
$\bullet$ dwResult Value set by KP_Call() callback


RETURN VALUE

Returns WD_STATUS_SUCCESS (0) on success, or an appropriate error code otherwise [A].


REMARKS


EXAMPLE

WD_KERNEL_PLUGIN_CALL kpCall;

BZERO (kpCall);    
/* Prepare the kpCall structure from WD_KernelPlugInOpen(): */
kpCall.hKernelPlugIn = hKernelPlugIn;
/* Set the message to pass to KP_Call(). This will determine
   the action performed in the kernel: */
kpCall.dwMessage = MY_DRV_MSG;

kpCall.pData = &mydrv;  /* The data to pass to the Kernel PlugIn */
dwStatus = WD_KernelPlugInCall(hWD, &kpCall);
if (dwStatus == WD_STATUS_SUCCESS)
{
    printf("Result = 0x%x\n", kpCall.dwResult); 
}
else
{
    printf("WD_KernelPlugInCall() failed. Error: 0x%x (%s)\n", 
            dwStatus, Stat2Str(dwStatus));
}