NdisDeregisterProtocol

VOID
    NdisDeregisterProtocol(
        OUT PNDIS_STATUS
  Status,
        IN NDIS_HANDLE  NdisProtocolHandle
        );

NdisDeregisterProtocol releases the resources allocated when the driver called NdisRegisterProtocol.

Parameters

Status
Points to a caller-supplied variable that is set to NDIS_STATUS_SUCCESS on return from this function.
NdisProtocolHandle
Specifies the handle returned by NdisRegisterProtocol when the driver initialized.

Comments

Registered protocol drivers call NdisDeregisterProtocol in any of the following circumstances:

Before calling NdisDeregisterProtocol, the driver should call NdisCloseAdapter with each binding handle that it obtained from NdisOpenAdapter but has not yet closed.

NdisDeregisterProtocol calls the driver’s ProtocolStatus function with NDIS_STATUS_CLOSING to allow its caller to release any resources the protocol driver has allocated for open bindings. If the protocol driver has any outstanding bindings, the NDIS library closes them and NdisDeregisterProtocol forwards close-adapter requests to any underlying driver(s) that registered a close-adapter handler. If such an underlying driver returns NDIS_STATUS_PENDING for a close-adapter request, the caller’s ProtocolCloseAdapterComplete function is called before NdisDeregisterProtocol returns control.

When outstanding opens, if any, have been closed, NdisDeregisterProtocol releases all filters its caller has set up and frees the memory NDIS allocated to track bindings and filters for the protocol driver.

Callers of NdisDeregisterProtocol run at IRQL <= DISPATCH_LEVEL.

See Also

NdisCloseAdapter, NdisIMDeInitializeDeviceInstance, NdisOpenAdapter, NdisRegisterProtocol, ProtocolCloseAdapterComplete, ProtocolStatus, ProtocolUnbindAdapter