Steward
分享是一種喜悅、更是一種幸福
驅動程式 - Windows Driver Model (WDM) - TDI處理TDI_RECEIVE_PARTIAL對策
參考資訊:
https://learn.microsoft.com/en-us/previous-versions/windows/hardware/network/ff545260%28v%3Dvs.85%29
當收到TDI_RECEIVE_PARTIAL時,可以回傳STATUS_SUCCESS,然後等待下一次的Callback來處理剩餘的封包,但是,為了避免丟包,其實可以主動發送TDI_RECEIVE並且回覆STATUS_MORE_PROCESSING_REQUIRED
When ClientEventReceive is called, it can do one of the following:
(1) Reject the indicated TSDU if it has no use for the data by returning STATUS_DATA_NOT_ACCEPTED
(2) Copy all of the data into an internal buffer if TDI_RECEIVE_ENTIRE_MESSAGE is set in the ReceiveFlags and return STATUS_SUCCESS
(3) If TDI_RECEIVE_ENTIRE_MESSAGE is clear (or TDI_RECEIVE_PARTIAL is set), copy some or all of the indicated data and return either of the following, depending on which operation it carries out:
STATUS_MORE_PROCESSING_REQUIRED if the client is supplying a TDI_RECEIVE request at IoRequestPacket to obtain the remaining TSDU data
STATUS_SUCCESS if the transport is expected to call ClientEventReceive again with the remaining TSDU data