mirror of
https://github.com/reactos/reactos.git
synced 2025-05-18 16:51:18 +00:00
- Implement !DeletePinned case in RtlEmptyAtomTable.
- Fix error checking in RtlAddAtomToAtomTable / RtlpCheckIntegerAtom. svn path=/trunk/; revision=16998
This commit is contained in:
parent
5327167d43
commit
1eaff64466
1 changed files with 15 additions and 9 deletions
|
@ -98,9 +98,6 @@ RtlpCheckIntegerAtom(PWSTR AtomName,
|
||||||
{
|
{
|
||||||
LoValue = (USHORT)((ULONG)AtomName & 0xFFFF);
|
LoValue = (USHORT)((ULONG)AtomName & 0xFFFF);
|
||||||
|
|
||||||
if (LoValue >= 0xC000)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
if (LoValue == 0)
|
if (LoValue == 0)
|
||||||
LoValue = 0xC000;
|
LoValue = 0xC000;
|
||||||
|
|
||||||
|
@ -244,7 +241,7 @@ RtlEmptyAtomTable(PRTL_ATOM_TABLE AtomTable,
|
||||||
BOOLEAN DeletePinned)
|
BOOLEAN DeletePinned)
|
||||||
{
|
{
|
||||||
PRTL_ATOM_TABLE_ENTRY *CurrentBucket, *LastBucket;
|
PRTL_ATOM_TABLE_ENTRY *CurrentBucket, *LastBucket;
|
||||||
PRTL_ATOM_TABLE_ENTRY CurrentEntry, NextEntry;
|
PRTL_ATOM_TABLE_ENTRY CurrentEntry, NextEntry, *PtrEntry;
|
||||||
|
|
||||||
DPRINT("RtlEmptyAtomTable (AtomTable %p DeletePinned %x)\n",
|
DPRINT("RtlEmptyAtomTable (AtomTable %p DeletePinned %x)\n",
|
||||||
AtomTable, DeletePinned);
|
AtomTable, DeletePinned);
|
||||||
|
@ -261,18 +258,27 @@ RtlEmptyAtomTable(PRTL_ATOM_TABLE AtomTable,
|
||||||
CurrentBucket++)
|
CurrentBucket++)
|
||||||
{
|
{
|
||||||
NextEntry = *CurrentBucket;
|
NextEntry = *CurrentBucket;
|
||||||
*CurrentBucket = NULL;
|
PtrEntry = CurrentBucket;
|
||||||
|
|
||||||
while (NextEntry != NULL)
|
while (NextEntry != NULL)
|
||||||
{
|
{
|
||||||
CurrentEntry = NextEntry;
|
CurrentEntry = NextEntry;
|
||||||
NextEntry = NextEntry->HashLink;
|
NextEntry = NextEntry->HashLink;
|
||||||
|
|
||||||
|
if (DeletePinned || !(CurrentEntry->Flags & RTL_ATOM_IS_PINNED))
|
||||||
|
{
|
||||||
|
*PtrEntry = NextEntry;
|
||||||
|
|
||||||
RtlpFreeAtomHandle(AtomTable,
|
RtlpFreeAtomHandle(AtomTable,
|
||||||
CurrentEntry);
|
CurrentEntry);
|
||||||
|
|
||||||
RtlpFreeAtomTableEntry(CurrentEntry);
|
RtlpFreeAtomTableEntry(CurrentEntry);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
PtrEntry = &CurrentEntry->HashLink;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RtlpUnlockAtomTable(AtomTable);
|
RtlpUnlockAtomTable(AtomTable);
|
||||||
|
@ -385,7 +391,7 @@ RtlAddAtomToAtomTable(IN PRTL_ATOM_TABLE AtomTable,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* The caller supplied an empty atom name! */
|
/* The caller supplied an empty atom name! */
|
||||||
Status = STATUS_INVALID_PARAMETER;
|
Status = STATUS_OBJECT_NAME_INVALID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue