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)
{
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 |
ACCESS_SYSTEM_SECURITY);
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 |
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();
/* 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)