I’m updating the TDI interface in our FSD to use ClientEventReceive()
for our TCP receive interface instead of just always posting
a TDI_RECEIVE, and am having problems on XP SP1.
I know this issues has been dealt with in the past and I
looked through the archives multiple times, and have
read through Maxim Shatskih’s replies on the subject – they
have been helpful, but I’m still running into a problem
and need help from those who have more patience with the
TDI than I do.
I have both a ClientEventReceive and it’s chained counterpart.
As long as BytesAvailable == BytesIndicated in ClientEventReceive
everything seems to work fine.
First off, what (or why?) causes BytesAvailable > BytesIndicated?
Isn’t this a tease? It seems that regardless of what I return
to the TDI (tcp), I end up in a situation where I get no
more data after returning STATUS_MORE_PROCESSING_REQUIRED.
I’ve tried setting *BytesTaken to both BytesAvailable and BytesIndicated
in this case – which should it be?
I’ve tried sending back an IRP/MDL built with TdiBuildReceive()
directly via IoCallDriver from the event handler with no luck.
I’ve tried to send back an IRP/MDL via *IoRequestPacket,
where after setting my completion routine in the current stack
location, I set the params like TdiBuildReceive() in the next
stack location. The buffer length in the MDL is set to the remaining
(ie, BytesAvailable - BytesIndicated). Is this correct?
It also seems like whatever buffer I hand back to the TDI has
to be pinned/locked, as if I don’t ProbeAndLockPages on it,
TCP barfs as it tries to unlock some pages. I wouldn’t have
thought I needed to ProbeAndLock a nonpaged pool buffer – is
it that the TDI is confused by what I sent back?
Any hints on how to correctly respond when BytesAvailable !=
BytesIndicated would be sincerely appreciated!
Thanks.