TDI problem

hi,everyone!
I’m a newbie to WDM field. According to some folks’ suggestion in this
list, i use IoAllocIrp instead of TdiBuildInternalDeviceControlIrp to
allocate irp because i wanna allocate irp in the irql > PASSIVE_LEVEL.
The questions are:

  1. If I allocate irp by IoAllocIrp, do I have to free the mdls in my
    completion routine which are created by myself ? In my opinion, the Io
    manager will not help me if I return STATUS_MORE_PROCESSING_REQUIRED in
    the completion routine.
  2. When the TdiSend Irp is completed with IoStatus.Status ==
    STATUS_SUCCESS,will the tcpip.sys assure that data has been received by
    the other node? In other words, have the ACKs for these data been
    received by the tcpip.sys?

Any help will be appreciated!


Best Regards,
hanzhu

There are just another two questions:
3)If I use TDI_SEND_NON_BLOCKING to send the data, how can I recovery
the data when the protocol driver failed on sending these data? When the
protocol driver copy all the data into their internal buffer, I have
no way to control my packet! Even if I use the tcp protocol, I have to
assure that none of my data have been dropped by the following protocol
driver. If I don’t use TDI_SEND_NON_BLOCKING mode to send the data, is
it a appropriate way to begin my recovery process in the completion
routine for the irp?

4)Can I call IoCancelIrp safely to cancel the irps which have not been
sent but been queued by tcpip.sys?
hanzhu wrote:

hi,everyone!
I’m a newbie to WDM field. According to some folks’ suggestion in this
list, i use IoAllocIrp instead of TdiBuildInternalDeviceControlIrp to
allocate irp because i wanna allocate irp in the irql > PASSIVE_LEVEL.
The questions are:

  1. If I allocate irp by IoAllocIrp, do I have to free the mdls in my
    completion routine which are created by myself ? In my opinion, the Io
    manager will not help me if I return STATUS_MORE_PROCESSING_REQUIRED in
    the completion routine.
  2. When the TdiSend Irp is completed with IoStatus.Status ==
    STATUS_SUCCESS,will the tcpip.sys assure that data has been received by
    the other node? In other words, have the ACKs for these data been
    received by the tcpip.sys?

Any help will be appreciated!


Best Regards,
hanzhu

> 1) If I allocate irp by IoAllocIrp, do I have to free
the mdls in my

completion routine which are created by myself ? In my

Yes, free your own MDLs.

STATUS_SUCCESS,will the tcpip.sys assure that data
has been received by
the other node? In other words, have the ACKs for
these data been
received by the tcpip.sys?

Yes. TDI_SEND is completed only when all ACKs have arrived for the data
portion.

The reason is that TCPIP has no internal copying/buffering, so it must pend the
original data portion for a case a retransmit will be necessary.

After all ACKs have arrived (and not earlier), no more retransmit will be
needed, so, the data can be released by completing the TDI_SEND IRP.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com