[ros-kernel] Bugs in NtRead/WriteFile (Eric)
Gunnar André Dalsnes
hardon at online.no
Fri Nov 28 06:07:07 CET 2003
Hi,
Eric, lately you have made some changes to NtRead/WriteFile (and others?)
where you use a local "safe" variable for the IoStatusBlock in the irp. This
surely breaks asynchronous io! When the io completes (after the call to
NtRead/WriteFile has returned!!) it will try to copy Irp->IoStatus to what
Irp->UserIosb points to, but since Irp->UserIosb points to a "safe" stack
variable now out of scope, it will crash!
And another change you made I don't understand:
You changed
Status = IoCallDriver(FileObject->DeviceObject, Irp);
if (Status == STATUS_PENDING && FileObject->Flags & FO_SYNCHRONOUS_IO)
Into
Status = IoCallDriver(FileObject->DeviceObject, Irp);
if (Event == NULL && Status == STATUS_PENDING && (FileObject->Flags &
FO_SYNCHRONOUS_IO))
This looks very wrong, since NtRead/WriteFile should *allways* wait for
io-completion in case of synchronous operations, event when the user
supplies an event!!!
Asynchronous operations are different thou: when supplying an event, only
the event will become signaled and not the file object. But this is allready
taken care of in IoSecondStageCompletion.
Regards,
Gunnar
More information about the Ros-kernel
mailing list