Hello all,
I am currently debugging behavior of a disk drive.
The drive was open using windows handle and I am issuing a simple blocking ‘write’ IOCTL from user mode.
WriteFile(diskHandle, data, sectorsAmount, &NumberOfBytesWritten, NULL);
Due to irrelevant disk FW issues, the call is stuck forever, which is OK in this regard.
The interesting thing is - even if I disable the disk device in device manager, the device is marked as ‘disabled’, but the ‘WriteFile’ call doesn’t return.
How can this happen ?
I mean, i always thought that disabling a device causes cancelling of all IRPs currently pending for the device.
Thank you,
Sagi Bar
xxxxx@walla.co.il wrote:
Due to irrelevant disk FW issues, the call is stuck forever, which is OK in this regard.
The interesting thing is - even if I disable the disk device in device manager, the device is marked as ‘disabled’, but the ‘WriteFile’ call doesn’t return.
How can this happen ?
I mean, i always thought that disabling a device causes cancelling of all IRPs currently pending for the device.
Well, yes, but just because you requested that an IRP be canceled does
not mean that it actually gets canceled. Cancellation in Windows is
just a polite suggestion. The driver holding the IRP has to notice,
acknowledge and process the cancellation request. If the driver is hung
up and cannot handle the cancel request, then the IRP will hang around
forever, and the disable operation cannot complete.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.