Srb->DataTransferLength and SRB_STATUS_DATA_OVERRUN

The DDK says of SRB_STATUS_DATA_OVERRUN:

“Indicates that a data overrun or underrun error occurred. The miniport
driver also must update the SRB’s DataTransferLength member to indicate
how much data actually was transferred if an underrun occurs.”

When I talk to my ‘card’ (xen backend actually), it gives me a
‘residual’ value, which indicates the amount of the supplied data buffer
that wasn’t used.

Based on the DDK, it could be interpreted that if there is ‘residual’
data indicated then I should set DataTransferLength -= residual data and
set SRB_STATUS_DATA_OVERRUN. Is this the correct interpretation? I
suspect not as I am getting some strange errors…

Thanks

James