[ros-diffs] [fireball] 28280: - Minor code changes, plus a temporary (DPRINT1) change for the HandleCount != 0 problem.

fireball at svn.reactos.org fireball at svn.reactos.org
Sat Aug 11 11:04:17 CEST 2007


Author: fireball
Date: Sat Aug 11 13:04:17 2007
New Revision: 28280

URL: http://svn.reactos.org/svn/reactos?rev=28280&view=rev
Log:
- Minor code changes, plus a temporary (DPRINT1) change for the HandleCount != 0 problem.

Modified:
    trunk/reactos/ntoskrnl/ob/obhandle.c

Modified: trunk/reactos/ntoskrnl/ob/obhandle.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ob/obhandle.c?rev=28280&r1=28279&r2=28280&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/ob/obhandle.c (original)
+++ trunk/reactos/ntoskrnl/ob/obhandle.c Sat Aug 11 13:04:17 2007
@@ -1259,6 +1259,12 @@
             ObjectHeader->HandleCount,
             ObjectHeader->PointerCount);
 
+    /* Save the object header */
+    NewEntry.Object = ObjectHeader;
+
+    /* Mask out the internal attributes */
+    NewEntry.ObAttributes |= HandleAttributes & OBJ_HANDLE_ATTRIBUTES;
+
     /* Check if this is a kernel handle */
     if (HandleAttributes & OBJ_KERNEL_HANDLE)
     {
@@ -1295,12 +1301,6 @@
         if (AttachedToProcess) KeUnstackDetachProcess(&ApcState);
         return Status;
     }
-
-    /* Save the object header */
-    NewEntry.Object = ObjectHeader;
-
-    /* Mask out the internal attributes */
-    NewEntry.ObAttributes |= HandleAttributes & OBJ_HANDLE_ATTRIBUTES;
 
     /* Remove what's not in the valid access mask */
     GrantedAccess = DesiredAccess & (ObjectType->TypeInfo.ValidAccessMask |
@@ -1503,11 +1503,11 @@
     if (AccessState->GenerateOnClose)
     {
         /* Force the attribute on */
-        HandleAttributes|= OBJ_AUDIT_OBJECT_CLOSE;
+        HandleAttributes |= OBJ_AUDIT_OBJECT_CLOSE;
     }
 
     /* Mask out the internal attributes */
-    NewEntry.ObAttributes |= HandleAttributes & OBJ_HANDLE_ATTRIBUTES;
+    NewEntry.ObAttributes |= (HandleAttributes & OBJ_HANDLE_ATTRIBUTES);
 
     /* Get the original desired access */
     DesiredAccess = AccessState->RemainingDesiredAccess |
@@ -2031,7 +2031,12 @@
     ExSweepHandleTable(HandleTable,
                        ObpCloseHandleCallback,
                        &Context);
-    ASSERT(HandleTable->HandleCount == 0);
+    //ASSERT(HandleTable->HandleCount == 0);
+    /* HACK: Until the problem is investigated... */
+    if (HandleTable->HandleCount != 0)
+    {
+        DPRINT1("Leaking %d handles!\n", HandleTable->HandleCount);
+    }
 
     /* Leave the critical region */
     KeLeaveCriticalRegion();
@@ -2197,7 +2202,7 @@
     /* Fill out the entry */
     RtlZeroMemory(&NewHandleEntry, sizeof(HANDLE_TABLE_ENTRY));
     NewHandleEntry.Object = ObjectHeader;
-    NewHandleEntry.ObAttributes |= HandleAttributes & OBJ_HANDLE_ATTRIBUTES;
+    NewHandleEntry.ObAttributes |= (HandleAttributes & OBJ_HANDLE_ATTRIBUTES);
 
     /* Check if we're using a generic mask */
     if (DesiredAccess & GENERIC_ACCESS)




More information about the Ros-diffs mailing list