X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=reactos%2Flib%2Frtl%2Fatom.c;h=1c643df3d95e410a7ae4f8949f5e0911c1ec97a6;hp=fc54bb3044e67f29f2b384538927b0653c9d86f8;hb=cf56f16a98daf0e77976ac5d1f8173f3c053523a;hpb=5fa3cc8c0fe6c96534007a45bde5d431c52a24e5;ds=sidebyside diff --git a/reactos/lib/rtl/atom.c b/reactos/lib/rtl/atom.c index fc54bb3044e..1c643df3d95 100644 --- a/reactos/lib/rtl/atom.c +++ b/reactos/lib/rtl/atom.c @@ -135,7 +135,7 @@ RtlpCheckIntegerAtom(PWSTR AtomName, /* * @implemented */ -NTSTATUS STDCALL +NTSTATUS NTAPI RtlCreateAtomTable(IN ULONG TableSize, IN OUT PRTL_ATOM_TABLE *AtomTable) { @@ -150,6 +150,9 @@ RtlCreateAtomTable(IN ULONG TableSize, 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)); @@ -183,7 +186,7 @@ RtlCreateAtomTable(IN ULONG TableSize, /* * @implemented */ -NTSTATUS STDCALL +NTSTATUS NTAPI RtlDestroyAtomTable(IN PRTL_ATOM_TABLE AtomTable) { PRTL_ATOM_TABLE_ENTRY *CurrentBucket, *LastBucket; @@ -232,7 +235,7 @@ RtlDestroyAtomTable(IN PRTL_ATOM_TABLE AtomTable) /* * @implemented */ -NTSTATUS STDCALL +NTSTATUS NTAPI RtlEmptyAtomTable(PRTL_ATOM_TABLE AtomTable, BOOLEAN DeletePinned) { @@ -286,7 +289,7 @@ RtlEmptyAtomTable(PRTL_ATOM_TABLE AtomTable, /* * @implemented */ -NTSTATUS STDCALL +NTSTATUS NTAPI RtlAddAtomToAtomTable(IN PRTL_ATOM_TABLE AtomTable, IN PWSTR AtomName, OUT PRTL_ATOM Atom) @@ -348,7 +351,7 @@ RtlAddAtomToAtomTable(IN PRTL_ATOM_TABLE AtomTable, { ULONG AtomNameLen = wcslen(AtomName); - if (AtomNameLen > MAX_ATOM_LEN) + if (AtomNameLen > RTL_MAXIMUM_ATOM_LENGTH) { Status = STATUS_INVALID_PARAMETER; goto end; @@ -406,7 +409,7 @@ end: /* * @implemented */ -NTSTATUS STDCALL +NTSTATUS NTAPI RtlDeleteAtomFromAtomTable(IN PRTL_ATOM_TABLE AtomTable, IN RTL_ATOM Atom) { @@ -478,7 +481,7 @@ RtlDeleteAtomFromAtomTable(IN PRTL_ATOM_TABLE AtomTable, /* * @implemented */ -NTSTATUS STDCALL +NTSTATUS NTAPI RtlLookupAtomInAtomTable(IN PRTL_ATOM_TABLE AtomTable, IN PWSTR AtomName, OUT PRTL_ATOM Atom) @@ -507,27 +510,22 @@ RtlLookupAtomInAtomTable(IN PRTL_ATOM_TABLE AtomTable, } 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; } @@ -535,7 +533,7 @@ RtlLookupAtomInAtomTable(IN PRTL_ATOM_TABLE AtomTable, /* * @implemented */ -NTSTATUS STDCALL +NTSTATUS NTAPI RtlPinAtomInAtomTable(IN PRTL_ATOM_TABLE AtomTable, IN RTL_ATOM Atom) { @@ -589,7 +587,7 @@ 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 STDCALL +NTSTATUS NTAPI RtlQueryAtomInAtomTable(PRTL_ATOM_TABLE AtomTable, RTL_ATOM Atom, PULONG RefCount, @@ -694,7 +692,7 @@ RtlQueryAtomInAtomTable(PRTL_ATOM_TABLE AtomTable, /* * @private - only used by NtQueryInformationAtom */ -NTSTATUS STDCALL +NTSTATUS NTAPI RtlQueryAtomListInAtomTable(IN PRTL_ATOM_TABLE AtomTable, IN ULONG MaxAtomCount, OUT ULONG *AtomCount,