PEPROCESS FoundProcess;
NTSTATUS Status = STATUS_INVALID_PARAMETER;
PAGED_CODE();
+
+ KeEnterCriticalRegion();
/* Get the CID Handle Entry */
if ((CidEntry = ExMapHandleToPointer(PspCidTable,
/* Unlock the Entry */
ExUnlockHandleTableEntry(PspCidTable, CidEntry);
}
+
+ KeLeaveCriticalRegion();
/* Return to caller */
return Status;
PETHREAD FoundThread;
NTSTATUS Status = STATUS_INVALID_CID;
PAGED_CODE();
+
+ KeEnterCriticalRegion();
/* Get the CID Handle Entry */
if ((CidEntry = ExMapHandleToPointer(PspCidTable,
/* Unlock the Entry */
ExUnlockHandleTableEntry(PspCidTable, CidEntry);
}
+
+ KeLeaveCriticalRegion();
/* Return to caller */
return Status;
PETHREAD FoundThread;
NTSTATUS Status = STATUS_INVALID_PARAMETER;
PAGED_CODE();
+
+ KeEnterCriticalRegion();
/* Get the CID Handle Entry */
if ((CidEntry = ExMapHandleToPointer(PspCidTable,
/* Unlock the Entry */
ExUnlockHandleTableEntry(PspCidTable, CidEntry);
}
+
+ KeLeaveCriticalRegion();
/* Return to caller */
return Status;
Handle = ExCreateHandle(AtomTable->ExHandleTable,
&ExEntry);
- HandleIndex = (USHORT)((ULONG_PTR)Handle >> 2);
if (Handle != NULL)
{
+ HandleIndex = (USHORT)((ULONG_PTR)Handle >> 2);
/* FIXME - Handle Indexes >= 0xC000 ?! */
- if (HandleIndex < 0xC000)
+ if ((ULONG_PTR)HandleIndex >> 2 < 0xC000)
{
Entry->HandleIndex = HandleIndex;
Entry->Atom = 0xC000 + HandleIndex;
RtlpGetAtomEntry(PRTL_ATOM_TABLE AtomTable, ULONG Index)
{
PHANDLE_TABLE_ENTRY ExEntry;
+ PRTL_ATOM_TABLE_ENTRY Entry = NULL;
+
+ /* NOTE: There's no need to explicitly enter a critical region because it's
+ guaranteed that we're in a critical region right now (as we hold
+ the atom table lock) */
ExEntry = ExMapHandleToPointer(AtomTable->ExHandleTable,
(HANDLE)((ULONG_PTR)Index << 2));
if (ExEntry != NULL)
{
- PRTL_ATOM_TABLE_ENTRY Entry;
-
Entry = ExEntry->u1.Object;
ExUnlockHandleTableEntry(AtomTable->ExHandleTable,
ExEntry);
- return Entry;
}
- return NULL;
+ return Entry;
}
/* FIXME - RtlpCreateUnicodeString is obsolete and should be removed ASAP! */