Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The PnP manager stops a NIC so that it can reconfigure or rebalance the hardware resources that it assigned to the NIC. The following steps describe how NDIS participates in the stopping of a NIC:
The PnP manager issues an IRP_MN_QUERY_STOP_DEVICE request.
When NDIS receives this IRP, it calls the FilterNetPnPEvent function of the lowest filter driver that is attached to the NIC in the driver stack. In this call, NDIS specifies an event code of NetEventQueryRemoveDevice.
Note NDIS performs this step only for filter drivers that advertise an entry point for the FilterNetPnPEvent function. A filter driver advertises this entry point when it calls the NdisFRegisterFilterDriver function.
Within the context of the call to its FilterNetPnPEvent function, the filter driver must call NdisFNetPnPEvent to forward the NetEventQueryRemoveDevice event up to the next filter driver in the driver stack. This causes NDIS to call that filter driver's FilterNetPnPEvent function with an event code of NetEventQueryRemoveDevice.
Note NDIS performs this step only for the next filter driver in the driver stack that advertises an entry point for the FilterNetPnPEvent function.
Each filter driver in the driver stack repeats the previous step until the highest filter driver in the stack has forwarded the NetEventQueryRemoveDevice event.
When this happens, NDIS calls the ProtocolNetPnPEvent function of all protocol drivers that are bound to the NIC. In this call, NDIS specifies an event code of NetEventQueryRemoveDevice.
If a protocol driver fails the NetEventQueryRemoveDevice event by returning a failure code from ProtocolNetPnPEvent, NDIS or the PnP manager might ignore the failure and subsequently succeed the IRP_MN_QUERY_STOP_DEVICE request. A protocol driver must, therefore, be prepared to handle the removal of the NIC even though the protocol driver failed the NetEventQueryRemoveDevice event.
The PnP manager issues an IRP_MN_STOP_DEVICE request to stop the device or an IRP_MN_CANCEL_STOP_DEVICE request to cancel the pending stop.
If the PnP manager issues an IRP_MN_CANCEL_STOP_DEVICE request, NDIS calls the FilterNetPnPEvent function of the lowest filter driver that is attached to the NIC in the driver stack. In this call, NDIS specifies an event code of NetEventCancelRemoveDevice.
Note NDIS performs this step only for filter drivers that advertise an entry point for the FilterNetPnPEvent function.
Within the context of the call to its FilterNetPnPEvent function, the filter driver must call NdisFNetPnPEvent to forward the NetEventCancelRemoveDevice event up to the next filter driver in the driver stack. This causes NDIS to call that filter driver's FilterNetPnPEvent function with an event code of NetEventCancelRemoveDevice.
Note NDIS performs this step only for the next filter driver in the driver stack that advertises an entry point for the FilterNetPnPEvent function.
Each filter driver in the driver stack repeats the previous step until the highest filter driver in the stack has forwarded the NetEventCancelRemoveDevice event.
When this happens, NDIS calls the ProtocolNetPnPEvent function of all protocol drivers that are bound to the NIC. In this call, NDIS specifies an event code of NetEventCancelRemoveDevice.
If the PnP manager issues an IRP_MN_STOP_DEVICE request, NDIS performs these steps:
It pauses all protocol drivers that are bound to the NIC.
It pauses all filter drivers that are attached to the NIC.
It pauses the miniport driver for the NIC.
It calls the ProtocolUnbindAdapterEx function of all protocol drivers that are bound to the NIC.
It calls the FilterDetach function of all filter modules that are attached to the NIC.
After all protocol and filter drivers are unbound and detached from the NIC, NDIS calls the miniport driver's MiniportHaltEx function. NDIS sets the HaltAction parameter of MiniportHaltEx to NdisHaltDeviceStopped.
When processing an IRP_MN_STOP_DEVICE request, NDIS does not destroy the functional device object (FDO) that it created for the NIC when the AddDevice routine was called. NDIS destroys the device object only after receiving an IRP_MN_REMOVE_DEVICE request for the NIC.
If the PnP manager issues an IRP_MN_START_DEVICE to restart the NIC, NDIS will reuse the FDO that was previously created for the NIC. NDIS will then restart the NIC. For more information on this procedure, see Starting a NIC.