NdisIMNotifyPnPEvent function (ndis.h)

Note   NDIS 5. x has been deprecated and is superseded by NDIS 6. x. For new NDIS driver development, see Network Drivers Starting with Windows Vista. For information about porting NDIS 5. x drivers to NDIS 6. x, see Porting NDIS 5.x Drivers to NDIS 6.0.

NdisIMNotifyPnPEvent propagates notification of a Plug and Play or Power Management event to an overlying driver.

Syntax

NDIS_STATUS NdisIMNotifyPnPEvent(
  [in] NDIS_HANDLE    MiniportHandle,
  [in] PNET_PNP_EVENT NetPnPEvent
);

Parameters

[in] MiniportHandle

The handle input to MiniportInitialize. This handle represents the miniport driver affected by the Plug and Play or Power Management event passed to the caller's ProtocolPnPEvent function.

[in] NetPnPEvent

Pointer to a NET_PNP_EVENT structure, which describes the Plug and Play event or Power Management event being indicated to the protocol driver.

Return value

NdisIMNotifyPnPEvent can return either of the following:

Return code Description
NDIS_STATUS_SUCCESS The overlying driver succeeded propagated Plug and Play event was succeeded.
NDIS_STATUS_FAILURE The overlying driver failed the propagated Plug and Play event.

The return value is significant only when the propagated event is a NetEventQueryPower or a NetEventQueryRemove. For all other propagated events, the return value is always NDIS_STATUS_SUCCESS.

Remarks

An NDIS intermediate driver calls NdisIMNotifyPnPEvent in the context of the driver's ProtocolPnPEvent function to propagate notification of a Plug and Play or Power Management event to the overlying driver.

If the propagated event is a NetEventQueryPower or a NetEventQueryRemove, the intermediate driver must check the NDIS_STATUS value returned by NdisIMNotifyPnPEvent. If the returned status is NDIS_STATUS_SUCCESS, the intermediate driver should handle the event internally as usual and then return NDIS_STATUS_SUCCESS from its ProtocolPnPEvent function. If the returned status is NDIS_STATUS_FAILURE, the intermediate driver should return NDIS_STATUS_FAILURE from its ProtocolPnPEvent without further processing.

For all other propagated events, NdisIMNotifyPnPEvent always returns NDIS_STATUS_SUCCESS. The intermediate driver's ProtocolPnPEvent function in such cases should propagate the NDIS_STATUS returned by NdisIMNotifyPnPEvent.

How the intermediate driver processes a NetEventSetPower received by its ProtocolPnPEvent function depends on the specified device power state. If the specified device power state is NdisDeviceStateD0, the intermediate driver should handle the event internally as usual and then call NdisIMNotifyPnPEvent. For any other specified device power state, the intermediate driver should first call NdisIMNotifyPnPEvent and then handle the event internally as usual.

An intermediate driver should call NdisIMNotifyPnPEvent to propagate a NetEventReconfigure or NetEventBindList only if the NetEventReconfigure or NetEventBindList is indicated on a non-NULLProtocolBindingContext. If a NetEventReconfigure or NetEventBindList is indicated on a NULLProtocolBindingContext, the intermediate driver should not call NdisIMNotifyPnPEvent to propagate the event.

If an intermediate driver handles a NetEventReconfigure or a NetEventBindList, it should validate any data associated with the event. (For more information about such data, see NET_PNP_EVENT for Protocol Drivers.)

System support for NdisIMNotifyPnPEvent is available in Windows XP and later versions.

  • Target platform: Universal
  • Version: Not supported for NDIS 6.0 drivers in Windows Vista. Use NdisMNetPnPEventinstead. Supported for NDIS 5.1 drivers in Windows Vista and Windows XP.

Requirements

Requirement Value
Header ndis.h (include Ndis.h)
Library Ndis.lib
IRQL PASSIVE_LEVEL

See also