hbirr(a)svn.reactos.com wrote:
Do always set the UserIosb of an irp in
IoSecondStageCompletion.
Updated files:
trunk/reactos/ntoskrnl/io/irp.c
This is incorrect.
1) The IOSB should not always be set. Create a driver and fail an
operation that you send to yourself by an IRP. Make that IRP not
SYNCH_API, or better yet, make sure you don't have a File Object.
You will notice that the Status Block is not touched.
2) The IOSB is not checked if it exists, it should ALWAYS be there. IRPs
without a IOSB are invalid. To verify this, set the IOSB of your IRP to
0 and run Windows with a Debugger. You will see that it will break in
many places, because Windows has simply placed SEH to make sure that the
write is valid. So the correct thing to do is wrap the write in SEH,
which protects both against invalid pointers and zero ones, but that
still doesn't mean they are"valid" and should be checked that way.
Best regards,
Alex Ionescu