/*
* @implemented
*/
-NTSTATUS STDCALL
+NTSTATUS NTAPI
RtlCreateAtomTable(IN ULONG TableSize,
IN OUT PRTL_ATOM_TABLE *AtomTable)
{
return STATUS_SUCCESS;
}
+ /* Use default if size was incorrect */
+ if (TableSize <= 1) TableSize = 37;
+
/* allocate atom table */
Table = RtlpAllocAtomTable(((TableSize - 1) * sizeof(PRTL_ATOM_TABLE_ENTRY)) +
sizeof(RTL_ATOM_TABLE));
/*
* @implemented
*/
-NTSTATUS STDCALL
+NTSTATUS NTAPI
RtlDestroyAtomTable(IN PRTL_ATOM_TABLE AtomTable)
{
PRTL_ATOM_TABLE_ENTRY *CurrentBucket, *LastBucket;
/*
* @implemented
*/
-NTSTATUS STDCALL
+NTSTATUS NTAPI
RtlEmptyAtomTable(PRTL_ATOM_TABLE AtomTable,
BOOLEAN DeletePinned)
{
/*
* @implemented
*/
-NTSTATUS STDCALL
+NTSTATUS NTAPI
RtlAddAtomToAtomTable(IN PRTL_ATOM_TABLE AtomTable,
IN PWSTR AtomName,
OUT PRTL_ATOM Atom)
if (HashLink != NULL)
{
ULONG AtomNameLen = wcslen(AtomName);
+
+ if (AtomNameLen > RTL_MAXIMUM_ATOM_LENGTH)
+ {
+ Status = STATUS_INVALID_PARAMETER;
+ goto end;
+ }
Entry = RtlpAllocAtomTableEntry(sizeof(RTL_ATOM_TABLE_ENTRY) -
sizeof(Entry->Name) +
Status = STATUS_OBJECT_NAME_INVALID;
}
}
-
+end:
RtlpUnlockAtomTable(AtomTable);
return Status;
/*
* @implemented
*/
-NTSTATUS STDCALL
+NTSTATUS NTAPI
RtlDeleteAtomFromAtomTable(IN PRTL_ATOM_TABLE AtomTable,
IN RTL_ATOM Atom)
{
/*
* @implemented
*/
-NTSTATUS STDCALL
+NTSTATUS NTAPI
RtlLookupAtomInAtomTable(IN PRTL_ATOM_TABLE AtomTable,
IN PWSTR AtomName,
OUT PRTL_ATOM Atom)
}
RtlpLockAtomTable(AtomTable);
-
Status = STATUS_OBJECT_NAME_NOT_FOUND;
/* string atom */
Entry = RtlpHashAtomName(AtomTable,
AtomName,
&HashLink);
-
if (Entry != NULL)
{
Status = STATUS_SUCCESS;
FoundAtom = (RTL_ATOM)Entry->Atom;
}
-
RtlpUnlockAtomTable(AtomTable);
-
if (NT_SUCCESS(Status) && Atom != NULL)
{
*Atom = FoundAtom;
}
-
return Status;
}
/*
* @implemented
*/
-NTSTATUS STDCALL
+NTSTATUS NTAPI
RtlPinAtomInAtomTable(IN PRTL_ATOM_TABLE AtomTable,
IN RTL_ATOM Atom)
{
* (again EXCLUDING the null terminator) is returned in NameLength, at least
* on Win2k, XP and ReactOS. NT4 will return 0 in that case.
*/
-NTSTATUS STDCALL
+NTSTATUS NTAPI
RtlQueryAtomInAtomTable(PRTL_ATOM_TABLE AtomTable,
RTL_ATOM Atom,
PULONG RefCount,
PULONG NameLength)
{
ULONG Length;
+ BOOL Unlock = FALSE;
+
union
{
/* A RTL_ATOM_TABLE_ENTRY has a "WCHAR Name[1]" entry at the end.
else
{
RtlpLockAtomTable(AtomTable);
+ Unlock = TRUE;
Entry = RtlpGetAtomEntry(AtomTable,
(ULONG)((USHORT)Atom - 0xC000));
Status = STATUS_INVALID_HANDLE;
}
- if (NULL != Entry && Entry != &NumberEntry.AtomTableEntry)
- {
- RtlpUnlockAtomTable(AtomTable);
- }
+ if (Unlock) RtlpUnlockAtomTable(AtomTable);
return Status;
}
/*
* @private - only used by NtQueryInformationAtom
*/
-NTSTATUS STDCALL
+NTSTATUS NTAPI
RtlQueryAtomListInAtomTable(IN PRTL_ATOM_TABLE AtomTable,
IN ULONG MaxAtomCount,
OUT ULONG *AtomCount,