Lock the handle table if we trying to get a pointer from a handle.
Modified: trunk/reactos/ntoskrnl/ex/handle.c
_____
Modified: trunk/reactos/ntoskrnl/ex/handle.c
--- trunk/reactos/ntoskrnl/ex/handle.c 2005-07-26 19:38:33 UTC (rev
16757)
+++ trunk/reactos/ntoskrnl/ex/handle.c 2005-07-26 19:46:07 UTC (rev
16758)
@@ -910,14 +910,16 @@
ASSERT(HandleTable);
+ ExAcquireHandleTableLockShared(HandleTable);
HandleTableEntry = ExpLookupHandleTableEntry(HandleTable,
Handle);
if (HandleTableEntry != NULL && ExLockHandleTableEntry(HandleTable,
HandleTableEntry))
{
DPRINT("ExMapHandleToPointer HT:0x%p Entry:0x%p locked\n",
HandleTable, HandleTableEntry);
+ ExReleaseHandleTableLock(HandleTable);
return HandleTableEntry;
}
-
+ ExReleaseHandleTableLock(HandleTable);
return NULL;
}
@@ -936,12 +938,14 @@
ASSERT(ChangeHandleCallback);
KeEnterCriticalRegion();
+ ExAcquireHandleTableLockShared(HandleTable);
HandleTableEntry = ExpLookupHandleTableEntry(HandleTable,
Handle);
if(HandleTableEntry != NULL && ExLockHandleTableEntry(HandleTable,
HandleTableEntry))
{
+ ExReleaseHandleTableLock(HandleTable);
Ret = ChangeHandleCallback(HandleTable,
HandleTableEntry,
NULL);
@@ -949,7 +953,10 @@
ExUnlockHandleTableEntry(HandleTable,
HandleTableEntry);
}
-
+ else
+ {
+ ExReleaseHandleTableLock(HandleTable);
+ }
KeLeaveCriticalRegion();
return Ret;
Show replies by date