Buffers for WskSend/WskReceive calls are represented by WSK_BUF structures as memory descriptor lists (MDLs). Since the caller is responsible for making them fully initialized, there is no need to use MmProbeAndLockPages to lock the buffer memory in place (IoBuildAsynchronousFsdRequest does that under the hood). Since, the Socket Driver device object works in so-called direct mode, we just need to copy buffer MDLs through IoBuildPartialMdl and pass these copies to the Socket Driver within corresponding IRP_MJ_READ/IRP_MJ_WRITE IRPs. Such approach simplifies the code and also makes WskSend/WskReceive usable at IRQL = DISPATCH_LEVEL (which they should be from the beginning).
Buffers for WskSend/WskReceive calls are represented by WSK_BUF structures as memory descriptor lists (MDLs). Since the caller is responsible for making them fully initialized, there is no need to use
MmProbeAndLockPages
to lock the buffer memory in place (IoBuildAsynchronousFsdRequest
does that under the hood). Since, the Socket Driver device object works in so-called direct mode, we just need to copy buffer MDLs throughIoBuildPartialMdl
and pass these copies to the Socket Driver within correspondingIRP_MJ_READ/IRP_MJ_WRITE
IRPs. Such approach simplifies the code and also makesWskSend/WskReceive
usable at IRQL =DISPATCH_LEVEL
(which they should be from the beginning).