From 5005c577551b7fc22b9469869ef091ed40f0e80b Mon Sep 17 00:00:00 2001 From: Mike Nordell Date: Fri, 12 Oct 2007 09:52:23 +0000 Subject: [PATCH] Added some descriptive comments for otherwise hard-to-understand bitwise operations svn path=/trunk/; revision=29530 --- reactos/ntoskrnl/ob/obref.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/reactos/ntoskrnl/ob/obref.c b/reactos/ntoskrnl/ob/obref.c index 87e33d5db8f..b4e354aa7d0 100644 --- a/reactos/ntoskrnl/ob/obref.c +++ b/reactos/ntoskrnl/ob/obref.c @@ -494,6 +494,9 @@ ObReferenceObjectByHandle(IN HANDLE Handle, GrantedAccess = CurrentProcess->GrantedAccess; /* Validate access */ + /* ~GrantedAccess = RefusedAccess.*/ + /* ~GrantedAccess & DesiredAccess = list of refused bits. */ + /* !(~GrantedAccess & DesiredAccess) == TRUE means ALL requested rights are granted */ if ((AccessMode == KernelMode) || !(~GrantedAccess & DesiredAccess)) { @@ -539,6 +542,9 @@ ObReferenceObjectByHandle(IN HANDLE Handle, GrantedAccess = CurrentThread->GrantedAccess; /* Validate access */ + /* ~GrantedAccess = RefusedAccess.*/ + /* ~GrantedAccess & DesiredAccess = list of refused bits. */ + /* !(~GrantedAccess & DesiredAccess) == TRUE means ALL requested rights are granted */ if ((AccessMode == KernelMode) || !(~GrantedAccess & DesiredAccess)) { @@ -608,6 +614,9 @@ ObReferenceObjectByHandle(IN HANDLE Handle, GrantedAccess = HandleEntry->GrantedAccess; /* Validate access */ + /* ~GrantedAccess = RefusedAccess.*/ + /* ~GrantedAccess & DesiredAccess = list of refused bits. */ + /* !(~GrantedAccess & DesiredAccess) == TRUE means ALL requested rights are granted */ if ((AccessMode == KernelMode) || !(~GrantedAccess & DesiredAccess)) {