FILTER_DEVICE_PNP_EVENT_NOTIFY callback function (ndis.h)
NDIS calls a filter driver's FilterDevicePnPEventNotify function to notify the driver of device Plug and Play (PnP) and Power Management events.
Syntax
FILTER_DEVICE_PNP_EVENT_NOTIFY FilterDevicePnpEventNotify;
void FilterDevicePnpEventNotify(
[in] NDIS_HANDLE FilterModuleContext,
[in] PNET_DEVICE_PNP_EVENT NetDevicePnPEvent
)
{...}
Parameters
[in] FilterModuleContext
A handle to the context area for the filter module. The filter driver created and initialized this context area in the FilterAttach function.
[in] NetDevicePnPEvent
A pointer to a NET_DEVICE_PNP_EVENT structure that describes a device Plug and Play event.
Return value
None
Remarks
FilterDevicePnPEventNotify is an optional function. If a filter driver does not use device PnP requests, it can set the entry point for this function to NULL when it calls the NdisFRegisterFilterDriver function.
FilterDevicePnPEventNotify is similar to a miniport driver's MiniportDevicePnPEventNotify function. Filter drivers can forward these notifications to underlying drivers. To forward a request, call the NdisFDevicePnPEventNotify function.
NDIS calls FilterDevicePnPEventNotify at IRQL = PASSIVE_LEVEL.
Examples
To define a FilterDevicePnPEventNotify function, you must first provide a function declaration that identifies the type of function you're defining. Windows provides a set of function types for drivers. Declaring a function using the function types helps Code Analysis for Drivers, Static Driver Verifier (SDV), and other verification tools find errors, and it's a requirement for writing drivers for the Windows operating system.For example, to define a FilterDevicePnPEventNotify function that is named "MyDevicePnPEventNotify", use the FILTER_DEVICE_PNP_EVENT_NOTIFY type as shown in this code example:
FILTER_DEVICE_PNP_EVENT_NOTIFY MyDevicePnPEventNotify;
Then, implement your function as follows:
_Use_decl_annotations_
VOID
MyDevicePnPEventNotify(
NDIS_HANDLE FilterModuleContext,
PNET_DEVICE_PNP_EVENT NetDevicePnPEvent
)
{...}
The FILTER_DEVICE_PNP_EVENT_NOTIFY function type is defined in the Ndis.h header file. To more accurately identify errors when you run the code analysis tools, be sure to add the Use_decl_annotations annotation to your function definition. The Use_decl_annotations annotation ensures that the annotations that are applied to the FILTER_DEVICE_PNP_EVENT_NOTIFY function type in the header file are used. For more information about the requirements for function declarations, see Declaring Functions by Using Function Role Types for NDIS Drivers.
For information about Use_decl_annotations, see Annotating Function Behavior.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Supported in NDIS 6.0 and later. |
Target Platform | Windows |
Header | ndis.h (include Ndis.h) |
IRQL | PASSIVE_LEVEL |