RtlLookupAtomInAtomTable
NTSTATUS __stdcall RtlLookupAtomInAtomTable(PVOID AtomTableHandle, PWCHAR AtomName, UINT16 *Atom){
_RTL_ATOM_TABLE_ENTRY *v6;
UINT16 v7;
NTSTATUS v9;
_RTL_ATOM_TABLE_ENTRY *pAtomEntry;
void *pLowBox[5];
UINT16 Atoma;
pAtomEntry = 0i64;
Atoma = 0;
if( !RtlpLockAtomTable((_RTL_ATOM_TABLE *)AtomTableHandle) )
return -1073741811;
if( RtlGetIntegerAtom(AtomName, &Atoma) )
{
v7 = Atoma;
if( Atoma >= 0xC000u )
{
v7 = 0;
Atoma = 0;
v9 = -1073741811;
}
else
{
v9 = 0;
}
if( !Atom )
goto LABEL_18;
goto LABEL_9;
}
if( !*AtomName )
{
v9 = -1073741773;
goto LABEL_18;
}
v9 = RtlpHashStringToAtom(
(_RTL_ATOM_TABLE *)AtomTableHandle,
AtomName,
1u,
0i64,
0i64,
(_RTL_ATOM_TABLE_REFERENCE **)pLowBox,
&pAtomEntry);
if( v9 >= 0 )
{
v6 = pAtomEntry;
if( !pAtomEntry )
{
v9 = -1073741772;
goto LABEL_18;
}
if( !RtlpAtomMapAtomToHandleEntry((_RTL_ATOM_TABLE *)AtomTableHandle, pAtomEntry->HandleIndex) )
{
v9 = -1073741816;
goto LABEL_18;
}
v9 = 0;
if( Atom )
{
v7 = v6->Atom;
LABEL_9:
*Atom = v7;
}
}
LABEL_18:
if( (_InterlockedExchangeAdd64((volatile signed __int64 *)AtomTableHandle + 1, 0xFFFFFFFFFFFFFFFFui64) & 6) == 2 )
ExfTryToWakePushLock((volatile INT64 *)AtomTableHandle + 1);
KeAbPostRelease((char *)AtomTableHandle + 8);
KeLeaveCriticalRegion();
return v9;
}Referenced by:
NtFindAtom