mirror of
https://github.com/reactos/reactos.git
synced 2025-01-06 06:20:13 +00:00
[RTL]
Formatting, no code change. svn path=/trunk/; revision=58433
This commit is contained in:
parent
09e3d1eace
commit
74f7fce21f
1 changed files with 435 additions and 433 deletions
|
@ -33,16 +33,17 @@ extern PRTL_ATOM_TABLE_ENTRY RtlpGetAtomEntry(PRTL_ATOM_TABLE AtomTable, ULONG I
|
|||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
static PRTL_ATOM_TABLE_ENTRY
|
||||
RtlpHashAtomName(IN PRTL_ATOM_TABLE AtomTable,
|
||||
static
|
||||
PRTL_ATOM_TABLE_ENTRY
|
||||
RtlpHashAtomName(
|
||||
IN PRTL_ATOM_TABLE AtomTable,
|
||||
IN PWSTR AtomName,
|
||||
OUT PRTL_ATOM_TABLE_ENTRY **HashLink)
|
||||
{
|
||||
UNICODE_STRING Name;
|
||||
ULONG Hash;
|
||||
|
||||
RtlInitUnicodeString(&Name,
|
||||
AtomName);
|
||||
RtlInitUnicodeString(&Name, AtomName);
|
||||
|
||||
if (Name.Length != 0 &&
|
||||
NT_SUCCESS(RtlHashUnicodeString(&Name,
|
||||
|
@ -65,6 +66,7 @@ RtlpHashAtomName(IN PRTL_ATOM_TABLE AtomTable,
|
|||
*HashLink = Link;
|
||||
return Current;
|
||||
}
|
||||
|
||||
Link = &Current->HashLink;
|
||||
Current = Current->HashLink;
|
||||
}
|
||||
|
@ -78,8 +80,10 @@ RtlpHashAtomName(IN PRTL_ATOM_TABLE AtomTable,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static BOOLEAN
|
||||
RtlpCheckIntegerAtom(PWSTR AtomName,
|
||||
static
|
||||
BOOLEAN
|
||||
RtlpCheckIntegerAtom(
|
||||
PWSTR AtomName,
|
||||
PUSHORT AtomValue)
|
||||
{
|
||||
UNICODE_STRING AtomString;
|
||||
|
@ -123,12 +127,11 @@ RtlpCheckIntegerAtom(PWSTR AtomName,
|
|||
|
||||
p = AtomName;
|
||||
p++;
|
||||
RtlInitUnicodeString(&AtomString,
|
||||
p);
|
||||
RtlInitUnicodeString(&AtomString, p);
|
||||
|
||||
DPRINT("AtomString: %wZ\n", &AtomString);
|
||||
|
||||
RtlUnicodeStringToInteger(&AtomString,10, &LongValue);
|
||||
RtlUnicodeStringToInteger(&AtomString, 10, &LongValue);
|
||||
|
||||
DPRINT("LongValue: %lu\n", LongValue);
|
||||
|
||||
|
@ -141,8 +144,10 @@ RtlpCheckIntegerAtom(PWSTR AtomName,
|
|||
/*
|
||||
* @implemented
|
||||
*/
|
||||
NTSTATUS NTAPI
|
||||
RtlCreateAtomTable(IN ULONG TableSize,
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
RtlCreateAtomTable(
|
||||
IN ULONG TableSize,
|
||||
IN OUT PRTL_ATOM_TABLE *AtomTable)
|
||||
{
|
||||
PRTL_ATOM_TABLE Table;
|
||||
|
@ -192,8 +197,10 @@ RtlCreateAtomTable(IN ULONG TableSize,
|
|||
/*
|
||||
* @implemented
|
||||
*/
|
||||
NTSTATUS NTAPI
|
||||
RtlDestroyAtomTable(IN PRTL_ATOM_TABLE AtomTable)
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
RtlDestroyAtomTable(
|
||||
IN PRTL_ATOM_TABLE AtomTable)
|
||||
{
|
||||
PRTL_ATOM_TABLE_ENTRY *CurrentBucket, *LastBucket;
|
||||
PRTL_ATOM_TABLE_ENTRY CurrentEntry, NextEntry;
|
||||
|
@ -241,8 +248,10 @@ RtlDestroyAtomTable(IN PRTL_ATOM_TABLE AtomTable)
|
|||
/*
|
||||
* @implemented
|
||||
*/
|
||||
NTSTATUS NTAPI
|
||||
RtlEmptyAtomTable(PRTL_ATOM_TABLE AtomTable,
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
RtlEmptyAtomTable(
|
||||
PRTL_ATOM_TABLE AtomTable,
|
||||
BOOLEAN DeletePinned)
|
||||
{
|
||||
PRTL_ATOM_TABLE_ENTRY *CurrentBucket, *LastBucket;
|
||||
|
@ -274,8 +283,7 @@ RtlEmptyAtomTable(PRTL_ATOM_TABLE AtomTable,
|
|||
{
|
||||
*PtrEntry = NextEntry;
|
||||
|
||||
RtlpFreeAtomHandle(AtomTable,
|
||||
CurrentEntry);
|
||||
RtlpFreeAtomHandle(AtomTable, CurrentEntry);
|
||||
|
||||
RtlpFreeAtomTableEntry(CurrentEntry);
|
||||
}
|
||||
|
@ -326,9 +334,7 @@ RtlAddAtomToAtomTable(IN PRTL_ATOM_TABLE AtomTable,
|
|||
RtlpLockAtomTable(AtomTable);
|
||||
|
||||
/* string atom, hash it and try to find an existing atom with the same name */
|
||||
Entry = RtlpHashAtomName(AtomTable,
|
||||
AtomName,
|
||||
&HashLink);
|
||||
Entry = RtlpHashAtomName(AtomTable, AtomName, &HashLink);
|
||||
|
||||
if (Entry != NULL)
|
||||
{
|
||||
|
@ -377,8 +383,7 @@ RtlAddAtomToAtomTable(IN PRTL_ATOM_TABLE AtomTable,
|
|||
AtomName,
|
||||
(AtomNameLen + 1) * sizeof(WCHAR));
|
||||
|
||||
if (RtlpCreateAtomHandle(AtomTable,
|
||||
Entry))
|
||||
if (RtlpCreateAtomHandle(AtomTable, Entry))
|
||||
{
|
||||
/* append the atom to the list */
|
||||
*HashLink = Entry;
|
||||
|
@ -415,8 +420,10 @@ end:
|
|||
/*
|
||||
* @implemented
|
||||
*/
|
||||
NTSTATUS NTAPI
|
||||
RtlDeleteAtomFromAtomTable(IN PRTL_ATOM_TABLE AtomTable,
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
RtlDeleteAtomFromAtomTable(
|
||||
IN PRTL_ATOM_TABLE AtomTable,
|
||||
IN RTL_ATOM Atom)
|
||||
{
|
||||
PRTL_ATOM_TABLE_ENTRY Entry;
|
||||
|
@ -429,8 +436,7 @@ RtlDeleteAtomFromAtomTable(IN PRTL_ATOM_TABLE AtomTable,
|
|||
{
|
||||
RtlpLockAtomTable(AtomTable);
|
||||
|
||||
Entry = RtlpGetAtomEntry(AtomTable,
|
||||
(ULONG)((USHORT)Atom - 0xC000));
|
||||
Entry = RtlpGetAtomEntry(AtomTable, (ULONG)((USHORT)Atom - 0xC000));
|
||||
|
||||
if (Entry != NULL && Entry->Atom == (USHORT)Atom)
|
||||
{
|
||||
|
@ -446,15 +452,12 @@ RtlDeleteAtomFromAtomTable(IN PRTL_ATOM_TABLE AtomTable,
|
|||
the hash bucket or the previous atom that links to the
|
||||
one we want to delete. This way we can easily bypass
|
||||
this item. */
|
||||
if (RtlpHashAtomName(AtomTable,
|
||||
Entry->Name,
|
||||
&HashLink) != NULL)
|
||||
if (RtlpHashAtomName(AtomTable, Entry->Name, &HashLink) != NULL)
|
||||
{
|
||||
/* bypass this atom */
|
||||
*HashLink = Entry->HashLink;
|
||||
|
||||
RtlpFreeAtomHandle(AtomTable,
|
||||
Entry);
|
||||
RtlpFreeAtomHandle(AtomTable, Entry);
|
||||
|
||||
RtlpFreeAtomTableEntry(Entry);
|
||||
}
|
||||
|
@ -519,14 +522,13 @@ RtlLookupAtomInAtomTable(IN PRTL_ATOM_TABLE AtomTable,
|
|||
Status = STATUS_OBJECT_NAME_NOT_FOUND;
|
||||
|
||||
/* string atom */
|
||||
Entry = RtlpHashAtomName(AtomTable,
|
||||
AtomName,
|
||||
&HashLink);
|
||||
Entry = RtlpHashAtomName(AtomTable, AtomName, &HashLink);
|
||||
if (Entry != NULL)
|
||||
{
|
||||
Status = STATUS_SUCCESS;
|
||||
FoundAtom = (RTL_ATOM)Entry->Atom;
|
||||
}
|
||||
|
||||
RtlpUnlockAtomTable(AtomTable);
|
||||
if (NT_SUCCESS(Status) && Atom != NULL)
|
||||
{
|
||||
|
@ -554,8 +556,7 @@ RtlPinAtomInAtomTable(IN PRTL_ATOM_TABLE AtomTable,
|
|||
|
||||
RtlpLockAtomTable(AtomTable);
|
||||
|
||||
Entry = RtlpGetAtomEntry(AtomTable,
|
||||
(ULONG)((USHORT)Atom - 0xC000));
|
||||
Entry = RtlpGetAtomEntry(AtomTable, (ULONG)((USHORT)Atom - 0xC000));
|
||||
|
||||
if (Entry != NULL && Entry->Atom == (USHORT)Atom)
|
||||
{
|
||||
|
@ -593,8 +594,10 @@ RtlPinAtomInAtomTable(IN PRTL_ATOM_TABLE AtomTable,
|
|||
* (again EXCLUDING the null terminator) is returned in NameLength, at least
|
||||
* on Win2k, XP and ReactOS. NT4 will return 0 in that case.
|
||||
*/
|
||||
NTSTATUS NTAPI
|
||||
RtlQueryAtomInAtomTable(PRTL_ATOM_TABLE AtomTable,
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
RtlQueryAtomInAtomTable(
|
||||
PRTL_ATOM_TABLE AtomTable,
|
||||
RTL_ATOM Atom,
|
||||
PULONG RefCount,
|
||||
PULONG PinCount,
|
||||
|
@ -630,8 +633,7 @@ RtlQueryAtomInAtomTable(PRTL_ATOM_TABLE AtomTable,
|
|||
RtlpLockAtomTable(AtomTable);
|
||||
Unlock = TRUE;
|
||||
|
||||
Entry = RtlpGetAtomEntry(AtomTable,
|
||||
(ULONG)((USHORT)Atom - 0xC000));
|
||||
Entry = RtlpGetAtomEntry(AtomTable, (ULONG)((USHORT)Atom - 0xC000));
|
||||
}
|
||||
|
||||
if (Entry != NULL && Entry->Atom == (USHORT)Atom)
|
||||
|
@ -667,9 +669,7 @@ RtlQueryAtomInAtomTable(PRTL_ATOM_TABLE AtomTable,
|
|||
}
|
||||
if (NT_SUCCESS(Status))
|
||||
{
|
||||
RtlCopyMemory(AtomName,
|
||||
Entry->Name,
|
||||
Length);
|
||||
RtlCopyMemory(AtomName, Entry->Name, Length);
|
||||
AtomName[Length / sizeof(WCHAR)] = L'\0';
|
||||
*NameLength = Length;
|
||||
}
|
||||
|
@ -698,8 +698,10 @@ RtlQueryAtomInAtomTable(PRTL_ATOM_TABLE AtomTable,
|
|||
/*
|
||||
* @private - only used by NtQueryInformationAtom
|
||||
*/
|
||||
NTSTATUS NTAPI
|
||||
RtlQueryAtomListInAtomTable(IN PRTL_ATOM_TABLE AtomTable,
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
RtlQueryAtomListInAtomTable(
|
||||
IN PRTL_ATOM_TABLE AtomTable,
|
||||
IN ULONG MaxAtomCount,
|
||||
OUT ULONG *AtomCount,
|
||||
OUT RTL_ATOM *AtomList)
|
||||
|
|
Loading…
Reference in a new issue