This section contains detailed information about the different Kernel PlugIn
related structures. WD_XXX structures are used in user-mode
functions and KP_XXX structures are used in kernel-mode
functions.
The Kernel PlugIn synchronization types are documented in
Defines a Kernel PlugIn open command.
This structure is used by the low-level WD_KernelPlugInOpen()
and WD_KernelPlugInClose() functions — see the
WinDriver PCI Low-Level API Reference.
| Field | Type | Description |
|---|---|---|
| hKernelPlugIn | DWORD | Handle to a Kernel PlugIn |
| pcDriverName | PCHAR | Name of Kernel PlugIn driver. Should be no longer than 12 characters. Should not include the VXD or SYS extension. |
| pcDriverPath | PCHAR | This field should be set to NULL. WinDriver will search for the driver in the operating system's drivers/modules directory. |
| pOpenData | PVOID |
Data to pass to the KP_Open |
Interrupt information structure.
This structure is used by the low-level InterruptEnable(),
InterruptDisable(), WD_IntEnable(),
WD_IntDisable(), WD_IntWait() and
WD_IntCount() functions.
WDC_IntEnable()InterruptEnable(), which in turn
calls WD_IntEnable(), WD_IntWait() and
WD_IntCount(). WDC_IntDisable()InterruptDisable(), which calls WD_IntDisable().
| Field | Type | Description |
|---|---|---|
| kpCall | WD_KERNEL_ PLUGIN_CALL |
Kernel PlugIn message information structureKP_IntEnable |
For information about the other members of WD_INTERRUPT, see the
description of InterruptEnable() in the WinDriver PCI Low-Level API Reference.
Kernel PlugIn message information structure. This structure contains information that will be passed between a user-mode process and the Kernel PlugIn. The structure is used when passing messages to the Kernel PlugIn or when installing a Kernel PlugIn interrupt.
This structure is passed as a parameter to the Kernel PlugIn
KP_CallKP_IntEnableWD_KernelPlugInCall(),
InterruptEnable() and WD_IntEnable() functions.
WD_KernelPlugInCall() is called from the high-level
WDC_CallKerPlug() functionInterruptEnable()
(which calls WD_IntEnable()) is called from the high-level
WDC_IntEnable() function
| Field | Type | Description |
|---|---|---|
| hKernelPlugIn | DWORD |
Handle to a Kernel PlugIn, returned by WD_KernelPlugInOpen()
(see the WinDriver PCI Low-Level API Reference) — which is called from
WDC_KernelPlugInOpen()WDC_xxxDeviceOpen() functions (PCI |
| dwMessage | DWORD | Message ID to pass to the Kernel PlugIn |
| pData | PVOID | Pointer to data to pass to the Kernel PlugIn |
| dwResult | DWORD | Value set by the Kernel PlugIn, to return back to user mode |
This structure is used by the Kernel PlugIn
KP_Init functionWD_KernelPlugInOpen() (see WinDriver PCI Low-Level API Reference) is called from the
user mode.
![]() | |
WD_KernelPlugInOpen() is called from the high-level
WDC_KernelPlugInOpen()It is also called from the WDC_xxxDeviceOpen() functions (PCIpcKPDriverName
parameter). However, to ensure the correct execution of your code in all
scenarios — including execution of a 32-bit application with a 64-bit
Kernel PlugIn driver — do not use the device-open functions to open a
handle to the Kernel PlugIn driver.
|
| Field | Type | Description |
|---|---|---|
| dwVerWD | DWORD | The version of the WinDriver Kernel PlugIn library. |
| cDriverName | CHAR[12] | The device driver name, up to 12 characters. |
| funcOpen | KP_FUNC_OPEN |
Standard KP_Open callback functionfuncOpen_32_64 will be used).
|
| funcOpen_32_64 | KP_FUNC_OPEN |
KP_Open callback functionfuncOpen_32_64 will be
used) |
This is the structure through which the Kernel PlugIn defines the names of its
callback functions (other than KP_Open). It is used from the
KP_Open
A Kernel PlugIn may implement the following callback functions (other than
KP_Open
WDC_CallKerPlug()WD_KernelPlugInCall() function (see the WinDriver PCI Low-Level API Reference),
which is called from WDC_CallKerPlug().funcCall callback
determines which function to execute according to the message passed to
it from the user mode.
WD_IntEnable() with a Kernel PlugIn handle.
WD_IntEnable() is called from InterruptEnable()
(see WinDriver PCI Low-Level API Reference), which is called from the high-level
WDC_IntEnable() functionWDC_IntEnable() with fUseKP = TRUE, the function
calls InterruptEnable() with a Kernel PlugIn handle.WD_IntDisable() —
called from InterruptDisable() (see WinDriver PCI Low-Level API Reference), which
is called from WDC_IntDisable()funcIntAtDpc() callback is called as a Deferred Procedure Call (DPC).
funcIntAtIrql() returned a value greater than zero.
funcIntAtDpcMSI() callback is called as a
Deferred Procedure Call (DPC).funcIntAtIrqlMSI() returned a value greater than zero.WDC_EventRegister()fUseKP = TRUE (or if the
low-level EventRegister() function was called with a
Kernel PlugIn handle — see WinDriver PCI Low-Level API Reference). This callback
function should implement the desired kernel handling for Plug-and-Play and power
management events.
| Field | Type | Description |
|---|---|---|
| funcClose | KP_FUNC_CLOSE | Name of your KP_Close |
| funcCall | KP_FUNC_CALL | Name of your KP_Call |
| funcIntEnable | KP_FUNC_INT_ENABLE | Name of your KP_IntEnable |
| funcIntDisable | KP_FUNC_INT_DISABLE |
Name of your KP_IntDisable |
| funcIntAtIrql | KP_FUNC_INT_AT_IRQL | Name of your KP_IntAtIrql |
| funcIntAtDpc | KP_FUNC_INT_AT_DPC |
Name of your KP_IntAtDpc |
| funcIntAtIrqlMSI | KP_FUNC_INT_AT_IRQL_MSI |
Name of your KP_IntAtIrqlMSINote: MSI/MSI-X is supported on Linux and Windows Vista and higher. |
| funcIntAtDpcMSI | KP_FUNC_INT_AT_DPC_MSI |
Name of your KP_IntAtDpcMSINote: MSI/MSI-X is supported on Linux and Windows Vista and higher. |
| funcEvent | KP_FUNC_EVENT | Name of your KP_Event |