From 7c29439d2b941c8fe5ded5c01de5a74a9b42b412 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sat, 19 Aug 2000 01:21:17 +0000 Subject: [PATCH] Fixed the real bug svn path=/trunk/; revision=1308 --- reactos/ntoskrnl/io/device.c | 4 ++-- reactos/ntoskrnl/ob/handle.c | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/reactos/ntoskrnl/io/device.c b/reactos/ntoskrnl/io/device.c index cb68e232888..dcabf5a9038 100644 --- a/reactos/ntoskrnl/io/device.c +++ b/reactos/ntoskrnl/io/device.c @@ -1,4 +1,4 @@ -/* $Id: device.c,v 1.19 2000/08/19 00:02:55 ekohl Exp $ +/* $Id: device.c,v 1.20 2000/08/19 01:20:52 ekohl Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -136,7 +136,7 @@ IoGetDeviceObjectPointer ( return Status; Status = ObReferenceObjectByHandle (FileHandle, - DesiredAccess, + 0, IoFileObjectType, KernelMode, (PVOID*)&LocalFileObject, diff --git a/reactos/ntoskrnl/ob/handle.c b/reactos/ntoskrnl/ob/handle.c index 0e40ebfca36..32331c1cfcb 100644 --- a/reactos/ntoskrnl/ob/handle.c +++ b/reactos/ntoskrnl/ob/handle.c @@ -1,4 +1,4 @@ -/* $Id: handle.c,v 1.23 2000/07/04 08:52:46 dwelch Exp $ +/* $Id: handle.c,v 1.24 2000/08/19 01:21:17 ekohl Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -552,8 +552,9 @@ NTSTATUS STDCALL ObReferenceObjectByHandle(HANDLE Handle, DPRINT("Reference from %x\n", ((PULONG)&Handle)[-1]); } - if (!(GrantedAccess & DesiredAccess) && - !((~GrantedAccess) & DesiredAccess)) + if ((AccessMode == UserMode) && + (!(GrantedAccess & DesiredAccess) && + !((~GrantedAccess) & DesiredAccess))) { CHECKPOINT; return(STATUS_ACCESS_DENIED);