Porting TDI Drivers to Winsock Kernel

To port your TDI driver to Winsock Kernel (WSK), you'll need to convert TDI tasks to their WSK equivalents as shown in the following table.

Tasks TDI Winsock Kernel (WSK)
Register and Deregister N/A WskRegister and WskDeregister
Capture and Release Provider NPI N/A WskCaptureProviderNPI and WskReleaseProviderNPI
Create Address File Object Create EaBuffer, then call ZwCreateFile No longer necessary. See WskSocket.
Create Connection File Object Create connection EaBuffer, then call ZwCreateFile No longer necessary. See WskSocket and WskAcceptEvent.
Associate Address TDI_ASSOCIATE_ADDRESS WskBind
Set Event Handlers TDI_SET_EVENT_HANDLER WskControlSocket or static variation using WskControlClient
Clear Event Handlers TDI_SET_EVENT_HANDLER WskControlSocket
Connect TDI_CONNECT WskConnect
Disconnect TDI_DISCONNECT WskDisconnect
Send TDI_SEND WskSend
Receive TDI_RECEIVE WskReceive
Receive Handler ClientEventReceive, TDI_RECEIVE WskReceiveEvent
Connect Handler ClientEventConnect, TDI_CONNECT WskAccept
Close Socket or Connection ObDereferenceObject or ZwClose WskCloseSocket