- NtWrite/ReadFile: Don't hardcode Irp->RequestorMode to KernelMode! Instead, use the PreviousMode we saved earlier. This caused user mode APCs to be called from kernel mode, which is a...very...bad... idea.

- Spotted by bug 3607 and exposed by ntdll Winetests "file"
See issue #3607 for more details.

svn path=/trunk/; revision=37102
This commit is contained in:
Stefan Ginsberg 2008-10-30 15:59:00 +00:00
parent 7bfa0b86e3
commit f467429483

View file

@ -2070,7 +2070,7 @@ NtReadFile(IN HANDLE FileHandle,
/* Set the IRP */
Irp->Tail.Overlay.OriginalFileObject = FileObject;
Irp->Tail.Overlay.Thread = PsGetCurrentThread();
Irp->RequestorMode = KernelMode;
Irp->RequestorMode = PreviousMode;
Irp->Overlay.AsynchronousParameters.UserApcRoutine = ApcRoutine;
Irp->Overlay.AsynchronousParameters.UserApcContext = ApcContext;
Irp->UserIosb = IoStatusBlock;
@ -2929,7 +2929,7 @@ NtWriteFile(IN HANDLE FileHandle,
/* Set the IRP */
Irp->Tail.Overlay.OriginalFileObject = FileObject;
Irp->Tail.Overlay.Thread = PsGetCurrentThread();
Irp->RequestorMode = KernelMode;
Irp->RequestorMode = PreviousMode;
Irp->Overlay.AsynchronousParameters.UserApcRoutine = ApcRoutine;
Irp->Overlay.AsynchronousParameters.UserApcContext = ApcContext;
Irp->UserIosb = IoStatusBlock;