[ros-diffs] [cwittich] 34467: more correct fix by Alex

cwittich at svn.reactos.org cwittich at svn.reactos.org
Sun Jul 13 21:14:39 CEST 2008


Author: cwittich
Date: Sun Jul 13 14:14:39 2008
New Revision: 34467

URL: http://svn.reactos.org/svn/reactos?rev=34467&view=rev
Log:
more correct fix by Alex

Modified:
    trunk/reactos/ntoskrnl/ex/handle.c

Modified: trunk/reactos/ntoskrnl/ex/handle.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/handle.c?rev=34467&r1=34466&r2=34467&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/ex/handle.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ex/handle.c [iso-8859-1] Sun Jul 13 14:14:39 2008
@@ -209,17 +209,11 @@
 {
     PEPROCESS Process = HandleTable->QuotaProcess;
     ULONG i, j;
-    ULONG TableLevel;
-    ULONG_PTR TableBase;
+    ULONG_PTR TableCode = HandleTable->TableCode;
+    ULONG TableLevel = TableCode & 3;
+    ULONG_PTR TableBase = TableCode & ~3;
     PHANDLE_TABLE_ENTRY Level1, *Level2, **Level3;
     PAGED_CODE();
-
-    /* Get the table code */
-    TableBase = *(volatile ULONG_PTR*)&HandleTable->TableCode;
-
-    /* Extract the table level and actual table base */
-    TableLevel = (ULONG)(TableBase & 3);
-    TableBase = TableBase - TableLevel;
 
     /* Check which level we're at */
     if (!TableLevel)
@@ -504,16 +498,10 @@
     PHANDLE_TABLE_ENTRY Low = NULL, *Mid, **High, *SecondLevel, **ThirdLevel;
     ULONG NewFree, FirstFree;
     PVOID Value;
-    ULONG_PTR TableBase;
-    ULONG TableLevel;
-    PAGED_CODE();
-
-    /* Get the table code */
-    TableBase = *(volatile ULONG_PTR*)&HandleTable->TableCode;
-
-    /* Extract the table level and actual table base */
-    TableLevel = (ULONG)(TableBase & 3);
-    TableBase = TableBase - TableLevel;
+    ULONG_PTR TableCode = HandleTable->TableCode;
+    ULONG_PTR TableBase = TableCode & ~3;
+    ULONG TableLevel = (ULONG)(TableCode & 3);
+    PAGED_CODE();
 
     /* Check how many levels we already have */
     if (!TableLevel)



More information about the Ros-diffs mailing list