From dfcf0aade2363e0975af8883fda073a0bc7fab76 Mon Sep 17 00:00:00 2001 From: Phillip Susi Date: Mon, 9 May 2005 22:12:43 +0000 Subject: [PATCH] Fixed backwards access check that was causing NtWriteFile to fail when given a read only buffer svn path=/trunk/; revision=15194 --- reactos/ntoskrnl/io/irp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reactos/ntoskrnl/io/irp.c b/reactos/ntoskrnl/io/irp.c index 71f265c2264..9e7be737176 100644 --- a/reactos/ntoskrnl/io/irp.c +++ b/reactos/ntoskrnl/io/irp.c @@ -472,14 +472,14 @@ IoBuildAsynchronousFsdRequest(ULONG MajorFunction, /* Use an MDL for Direct I/O */ Irp->MdlAddress = MmCreateMdl(NULL, Buffer, Length); - /* Use the right Access Type */ + if (MajorFunction == IRP_MJ_READ) { - AccessType = IoReadAccess; + AccessType = IoWriteAccess; } else { - AccessType = IoWriteAccess; + AccessType = IoReadAccess; } /* Probe and Lock */