TdiDeregisterDeviceObject function
The TdiDeregisterDeviceObject function is the reciprocal of TdiRegisterDeviceObject. It removes a transport-created device object, previously registered with TDI, as a valid target for clients' network I/O requests.
Syntax
NTSTATUS TdiDeregisterDeviceObject(
_In_ HANDLE DevRegistrationHandle
);
Parameters
- DevRegistrationHandle [in]
Specifies the handle returned by a preceding call to TdiRegisterDeviceObject.
Return value
TdiDeregisterDeviceObject returns STATUS_SUCCESS if the registration was released and all bound clients were notified. Otherwise, it can return STATUS_INSUFFICIENT_RESOURCES. (Because the availability of system resources is dynamic, a subsequent call from the same transport can succeed.)
Remarks
A transport driver calls TdiDeregisterDeviceObject as a consequence of an NDIS call to the ProtocolUnbindAdapter function at the bottom of the transport stack. Such a call to ProtocolUnbindAdapter indicates that an underlying NIC to which the transport is bound is being removed or disabled. Consequently, the TDI transport driver will destroy a device object that it previously created for its binding to that NIC.
If the transport previously registered this device object with TDI, it must call TdiDeregisterDeviceObject before it deletes its device object from the system. Before it deregisters its device object, the transport also must make one or more calls to TdiDeregisterNetAddress with each network address that it currently has registered with TDI on the binding. That is, the transport calls TdiDeregisterDeviceObject just after it has torn down its binding to the NIC.
TdiDeregisterDeviceObject notifies the calling transport's clients that the transport's device object is no longer a valid target for those clients' I/O requests. When this call occurs, TDI calls the ClientPnPBindingChange routines of those clients that registered themselves with TdiRegisterPnPHandlers to receive these notifications with the input PnPOpcode argument TDI_PNP_OP_DEL.
If TdiDeregisterDeviceObject returns STATUS_INSUFFICIENT_RESOURCES, the transport should fail any subsequent incoming client requests directed to its still registered device object. When convenient, the transport should call TdiDeregisterDeviceObject again because a temporary shortage of available system memory might have caused its original call to fail.
Note The TDI feature is deprecated and will be removed in future versions of Microsoft Windows. Depending on how you use TDI, use either the Winsock Kernel (WSK) or Windows Filtering Platform (WFP). For more information about WFP and WSK, see Windows Filtering Platform and Winsock Kernel. For a Windows Core Networking blog entry about WSK and TDI, see Introduction to Winsock Kernel (WSK).
Requirements
Target platform |
Universal |
Header |
Tdikrnl.h (include TdiKrnl.h) |
Library |
Tdi.lib |
IRQL |
< DISPATCH_LEVEL |
See also