2005-12-29 08:43:45 +00:00
|
|
|
/*
|
1998-12-04 18:28:13 +00:00
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS system libraries
|
2015-11-14 14:57:11 +00:00
|
|
|
* FILE: dll/win32/kernel32/client/atom.c
|
1998-12-04 18:28:13 +00:00
|
|
|
* PURPOSE: Atom functions
|
2005-12-29 08:43:45 +00:00
|
|
|
* PROGRAMMERS: Alex Ionescu (alex@relsoft.net)
|
1998-12-04 18:28:13 +00:00
|
|
|
*/
|
|
|
|
|
2005-12-29 08:43:45 +00:00
|
|
|
/* INCLUDES ******************************************************************/
|
2003-01-15 21:24:36 +00:00
|
|
|
#include <k32.h>
|
2001-03-30 17:26:42 +00:00
|
|
|
|
2001-05-27 15:40:31 +00:00
|
|
|
#define NDEBUG
|
2007-09-02 19:42:22 +00:00
|
|
|
#include <debug.h>
|
1999-01-16 02:11:45 +00:00
|
|
|
|
2001-05-27 15:40:31 +00:00
|
|
|
/* GLOBALS *******************************************************************/
|
1996-01-23 01:02:17 +00:00
|
|
|
|
2005-12-29 08:43:45 +00:00
|
|
|
PRTL_ATOM_TABLE BaseLocalAtomTable = NULL;
|
1996-01-23 01:02:17 +00:00
|
|
|
|
2005-12-29 08:43:45 +00:00
|
|
|
/* FUNCTIONS *****************************************************************/
|
1996-01-23 01:02:17 +00:00
|
|
|
|
2005-12-29 08:43:45 +00:00
|
|
|
PVOID
|
|
|
|
WINAPI
|
|
|
|
InternalInitAtomTable(VOID)
|
|
|
|
{
|
|
|
|
/* Create or return the local table */
|
|
|
|
if (!BaseLocalAtomTable) RtlCreateAtomTable(0, &BaseLocalAtomTable);
|
|
|
|
return BaseLocalAtomTable;
|
|
|
|
}
|
|
|
|
|
|
|
|
ATOM
|
|
|
|
WINAPI
|
|
|
|
InternalAddAtom(BOOLEAN Local,
|
|
|
|
BOOLEAN Unicode,
|
|
|
|
LPCSTR AtomName)
|
|
|
|
{
|
|
|
|
NTSTATUS Status;
|
|
|
|
ANSI_STRING AnsiString;
|
|
|
|
UNICODE_STRING UnicodeString;
|
|
|
|
PUNICODE_STRING AtomNameString;
|
|
|
|
ATOM Atom = INVALID_ATOM;
|
|
|
|
|
|
|
|
/* Check if it's an integer atom */
|
|
|
|
if ((ULONG_PTR)AtomName <= 0xFFFF)
|
|
|
|
{
|
|
|
|
/* Convert the name to an atom */
|
|
|
|
Atom = (ATOM)PtrToShort((PVOID)AtomName);
|
|
|
|
if (Atom >= MAXINTATOM)
|
|
|
|
{
|
|
|
|
/* Fail, atom number too large */
|
2011-07-23 18:54:29 +00:00
|
|
|
BaseSetLastNTError(STATUS_INVALID_PARAMETER);
|
2005-12-29 08:43:45 +00:00
|
|
|
return INVALID_ATOM;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return it */
|
|
|
|
return Atom;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Check if this is a unicode atom */
|
|
|
|
if (Unicode)
|
|
|
|
{
|
|
|
|
/* Use a unicode string */
|
|
|
|
AtomNameString = &UnicodeString;
|
|
|
|
RtlInitUnicodeString(AtomNameString, (LPWSTR)AtomName);
|
|
|
|
Status = STATUS_SUCCESS;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Use an ansi string */
|
|
|
|
RtlInitAnsiString(&AnsiString, AtomName );
|
|
|
|
|
|
|
|
/* Check if we can abuse the TEB */
|
|
|
|
if (AnsiString.MaximumLength > 260)
|
|
|
|
{
|
|
|
|
/* We can't, allocate a new string */
|
|
|
|
AtomNameString = &UnicodeString;
|
|
|
|
Status = RtlAnsiStringToUnicodeString(AtomNameString,
|
|
|
|
&AnsiString,
|
|
|
|
TRUE);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2006-01-03 22:25:09 +00:00
|
|
|
/* We can! Get the TEB String */
|
2005-12-29 08:43:45 +00:00
|
|
|
AtomNameString = &NtCurrentTeb()->StaticUnicodeString;
|
2006-01-03 22:25:09 +00:00
|
|
|
|
|
|
|
/* Convert it into the TEB */
|
2005-12-29 08:43:45 +00:00
|
|
|
Status = RtlAnsiStringToUnicodeString(AtomNameString,
|
|
|
|
&AnsiString,
|
|
|
|
FALSE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Check for failure */
|
|
|
|
if (!NT_SUCCESS(Status))
|
|
|
|
{
|
2011-07-23 18:54:29 +00:00
|
|
|
BaseSetLastNTError(Status);
|
2005-12-29 08:43:45 +00:00
|
|
|
return Atom;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Check if we're doing local add */
|
|
|
|
if (Local)
|
|
|
|
{
|
|
|
|
/* Do a local add */
|
|
|
|
Status = RtlAddAtomToAtomTable(InternalInitAtomTable(),
|
|
|
|
AtomNameString->Buffer,
|
|
|
|
&Atom);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Do a global add */
|
|
|
|
Status = NtAddAtom(AtomNameString->Buffer,
|
|
|
|
AtomNameString->Length,
|
|
|
|
&Atom);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Check for failure */
|
2011-07-23 18:54:29 +00:00
|
|
|
if (!NT_SUCCESS(Status)) BaseSetLastNTError(Status);
|
2005-12-29 08:43:45 +00:00
|
|
|
|
|
|
|
/* Check if we were non-static ANSI */
|
|
|
|
if (!(Unicode) && (AtomNameString == &UnicodeString))
|
|
|
|
{
|
|
|
|
/* Free the allocated buffer */
|
|
|
|
RtlFreeUnicodeString(AtomNameString);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return the atom */
|
|
|
|
return Atom;
|
|
|
|
}
|
|
|
|
|
|
|
|
ATOM
|
|
|
|
WINAPI
|
|
|
|
InternalFindAtom(BOOLEAN Local,
|
|
|
|
BOOLEAN Unicode,
|
|
|
|
LPCSTR AtomName)
|
|
|
|
{
|
|
|
|
NTSTATUS Status;
|
|
|
|
ANSI_STRING AnsiString;
|
|
|
|
UNICODE_STRING UnicodeString;
|
|
|
|
PUNICODE_STRING AtomNameString;
|
|
|
|
ATOM Atom = INVALID_ATOM;
|
|
|
|
|
|
|
|
/* Check if it's an integer atom */
|
|
|
|
if ((ULONG_PTR)AtomName <= 0xFFFF)
|
|
|
|
{
|
|
|
|
/* Convert the name to an atom */
|
|
|
|
Atom = (ATOM)PtrToShort((PVOID)AtomName);
|
|
|
|
if (Atom >= MAXINTATOM)
|
|
|
|
{
|
|
|
|
/* Fail, atom number too large */
|
2011-07-23 18:54:29 +00:00
|
|
|
BaseSetLastNTError(STATUS_INVALID_PARAMETER);
|
2005-12-29 08:43:45 +00:00
|
|
|
DPRINT1("Invalid atom\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return it */
|
|
|
|
return Atom;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Check if this is a unicode atom */
|
|
|
|
if (Unicode)
|
|
|
|
{
|
|
|
|
/* Use a unicode string */
|
|
|
|
AtomNameString = &UnicodeString;
|
|
|
|
RtlInitUnicodeString(AtomNameString, (LPWSTR)AtomName);
|
|
|
|
Status = STATUS_SUCCESS;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Use an ansi string */
|
|
|
|
RtlInitAnsiString(&AnsiString, AtomName);
|
|
|
|
|
|
|
|
/* Check if we can abuse the TEB */
|
|
|
|
if (AnsiString.MaximumLength > 260)
|
|
|
|
{
|
|
|
|
/* We can't, allocate a new string */
|
|
|
|
AtomNameString = &UnicodeString;
|
|
|
|
Status = RtlAnsiStringToUnicodeString(AtomNameString,
|
|
|
|
&AnsiString,
|
|
|
|
TRUE);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2006-01-03 22:25:09 +00:00
|
|
|
/* We can! Get the TEB String */
|
2005-12-29 08:43:45 +00:00
|
|
|
AtomNameString = &NtCurrentTeb()->StaticUnicodeString;
|
2006-01-03 22:25:09 +00:00
|
|
|
|
|
|
|
/* Convert it into the TEB */
|
2005-12-29 08:43:45 +00:00
|
|
|
Status = RtlAnsiStringToUnicodeString(AtomNameString,
|
|
|
|
&AnsiString,
|
|
|
|
FALSE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Check for failure */
|
|
|
|
if (!NT_SUCCESS(Status))
|
|
|
|
{
|
|
|
|
DPRINT1("Failed\n");
|
2011-07-23 18:54:29 +00:00
|
|
|
BaseSetLastNTError(Status);
|
2005-12-29 08:43:45 +00:00
|
|
|
return Atom;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Check if we're doing local lookup */
|
|
|
|
if (Local)
|
|
|
|
{
|
|
|
|
/* Do a local lookup */
|
|
|
|
Status = RtlLookupAtomInAtomTable(InternalInitAtomTable(),
|
|
|
|
AtomNameString->Buffer,
|
|
|
|
&Atom);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Do a global search */
|
|
|
|
if (!AtomNameString->Length)
|
|
|
|
{
|
|
|
|
/* This is illegal in win32 */
|
|
|
|
DPRINT1("No name given\n");
|
|
|
|
Status = STATUS_OBJECT_NAME_NOT_FOUND;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Call the global function */
|
|
|
|
Status = NtFindAtom(AtomNameString->Buffer,
|
|
|
|
AtomNameString->Length,
|
|
|
|
&Atom);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Check for failure */
|
2011-07-23 18:54:29 +00:00
|
|
|
if (!NT_SUCCESS(Status)) BaseSetLastNTError(Status);
|
2005-12-29 08:43:45 +00:00
|
|
|
|
|
|
|
/* Check if we were non-static ANSI */
|
|
|
|
if (!(Unicode) && (AtomNameString == &UnicodeString))
|
|
|
|
{
|
|
|
|
/* Free the allocated buffer */
|
|
|
|
RtlFreeUnicodeString(AtomNameString);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return the atom */
|
|
|
|
return Atom;
|
|
|
|
}
|
|
|
|
|
|
|
|
ATOM
|
|
|
|
WINAPI
|
|
|
|
InternalDeleteAtom(BOOLEAN Local,
|
|
|
|
ATOM Atom)
|
|
|
|
{
|
|
|
|
NTSTATUS Status;
|
|
|
|
|
|
|
|
/* Validate it */
|
|
|
|
if (Atom >= MAXINTATOM)
|
|
|
|
{
|
|
|
|
/* Check if it's a local delete */
|
|
|
|
if (Local)
|
|
|
|
{
|
|
|
|
/* Delete it locally */
|
|
|
|
Status = RtlDeleteAtomFromAtomTable(InternalInitAtomTable(), Atom);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Delete it globall */
|
|
|
|
Status = NtDeleteAtom(Atom);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Check for success */
|
|
|
|
if (!NT_SUCCESS(Status))
|
|
|
|
{
|
|
|
|
/* Fail */
|
2011-07-23 18:54:29 +00:00
|
|
|
BaseSetLastNTError(Status);
|
2005-12-29 08:43:45 +00:00
|
|
|
return INVALID_ATOM;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return failure */
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
UINT
|
|
|
|
WINAPI
|
|
|
|
InternalGetAtomName(BOOLEAN Local,
|
|
|
|
BOOLEAN Unicode,
|
|
|
|
ATOM Atom,
|
|
|
|
LPSTR AtomName,
|
|
|
|
DWORD Size)
|
|
|
|
{
|
|
|
|
NTSTATUS Status;
|
|
|
|
DWORD RetVal = 0;
|
|
|
|
ANSI_STRING AnsiString;
|
|
|
|
UNICODE_STRING UnicodeString;
|
|
|
|
PVOID TempBuffer = NULL;
|
|
|
|
PWSTR AtomNameString;
|
|
|
|
ULONG AtomInfoLength;
|
|
|
|
ULONG AtomNameLength;
|
|
|
|
PATOM_BASIC_INFORMATION AtomInfo;
|
|
|
|
|
|
|
|
/* Normalize the size as not to overflow */
|
|
|
|
if (!Unicode && Size > 0x7000) Size = 0x7000;
|
|
|
|
|
|
|
|
/* Make sure it's valid too */
|
|
|
|
if (!Size)
|
|
|
|
{
|
2011-07-23 18:54:29 +00:00
|
|
|
BaseSetLastNTError(STATUS_BUFFER_OVERFLOW);
|
2005-12-29 08:43:45 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2009-10-24 11:51:33 +00:00
|
|
|
if (!Atom)
|
|
|
|
{
|
2011-07-23 18:54:29 +00:00
|
|
|
BaseSetLastNTError(STATUS_INVALID_PARAMETER);
|
2009-10-24 11:51:33 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2005-12-29 08:43:45 +00:00
|
|
|
|
|
|
|
/* Check if this is a global query */
|
|
|
|
if (Local)
|
|
|
|
{
|
|
|
|
/* Set the query length */
|
|
|
|
AtomNameLength = Size * sizeof(WCHAR);
|
|
|
|
|
|
|
|
/* If it's unicode, just keep the name */
|
|
|
|
if (Unicode)
|
|
|
|
{
|
|
|
|
AtomNameString = (PWSTR)AtomName;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Allocate memory for the ansi buffer */
|
|
|
|
TempBuffer = RtlAllocateHeap(RtlGetProcessHeap(),
|
|
|
|
0,
|
|
|
|
AtomNameLength);
|
|
|
|
AtomNameString = TempBuffer;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Query the name */
|
|
|
|
Status = RtlQueryAtomInAtomTable(InternalInitAtomTable(),
|
|
|
|
Atom,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
AtomNameString,
|
|
|
|
&AtomNameLength);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* We're going to do a global query, so allocate a buffer */
|
|
|
|
AtomInfoLength = sizeof(ATOM_BASIC_INFORMATION) +
|
|
|
|
(Size * sizeof(WCHAR));
|
|
|
|
AtomInfo = TempBuffer = RtlAllocateHeap(RtlGetProcessHeap(),
|
|
|
|
0,
|
|
|
|
AtomInfoLength);
|
|
|
|
|
2009-07-04 08:48:18 +00:00
|
|
|
if (!AtomInfo)
|
|
|
|
{
|
2011-07-23 18:54:29 +00:00
|
|
|
BaseSetLastNTError(STATUS_NO_MEMORY);
|
2009-07-04 08:48:18 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2005-12-29 08:43:45 +00:00
|
|
|
/* Query the name */
|
|
|
|
Status = NtQueryInformationAtom(Atom,
|
|
|
|
AtomBasicInformation,
|
|
|
|
AtomInfo,
|
|
|
|
AtomInfoLength,
|
|
|
|
&AtomInfoLength);
|
|
|
|
if (NT_SUCCESS(Status))
|
|
|
|
{
|
|
|
|
/* Success. Update the length and get the name */
|
|
|
|
AtomNameLength = (ULONG)AtomInfo->NameLength;
|
|
|
|
AtomNameString = AtomInfo->Name;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Check for global success */
|
|
|
|
if (NT_SUCCESS(Status))
|
|
|
|
{
|
|
|
|
/* Check if it was unicode */
|
|
|
|
if (Unicode)
|
|
|
|
{
|
|
|
|
/* We return the length in chars */
|
|
|
|
RetVal = AtomNameLength / sizeof(WCHAR);
|
|
|
|
|
|
|
|
/* Copy the memory if this was a global query */
|
|
|
|
if (AtomNameString != (PWSTR)AtomName)
|
|
|
|
{
|
|
|
|
RtlMoveMemory(AtomName, AtomNameString, AtomNameLength);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* And null-terminate it if the buffer was too large */
|
|
|
|
if (RetVal < Size)
|
|
|
|
{
|
|
|
|
((PWCHAR)AtomName)[RetVal] = UNICODE_NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* First create a unicode string with our data */
|
|
|
|
UnicodeString.Buffer = AtomNameString;
|
|
|
|
UnicodeString.Length = (USHORT)AtomNameLength;
|
|
|
|
UnicodeString.MaximumLength = (USHORT)(UnicodeString.Length +
|
|
|
|
sizeof(WCHAR));
|
|
|
|
|
|
|
|
/* Now prepare an ansi string for conversion */
|
|
|
|
AnsiString.Buffer = AtomName;
|
|
|
|
AnsiString.Length = 0;
|
|
|
|
AnsiString.MaximumLength = (USHORT)Size;
|
|
|
|
|
|
|
|
/* Convert it */
|
|
|
|
Status = RtlUnicodeStringToAnsiString(&AnsiString,
|
|
|
|
&UnicodeString,
|
|
|
|
FALSE);
|
|
|
|
|
|
|
|
/* Return the length */
|
|
|
|
if (NT_SUCCESS(Status)) RetVal = AnsiString.Length;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Free the temporary buffer if we have one */
|
|
|
|
if (TempBuffer) RtlFreeHeap(RtlGetProcessHeap(), 0, TempBuffer);
|
|
|
|
|
|
|
|
/* Check for failure */
|
|
|
|
if (!NT_SUCCESS(Status))
|
|
|
|
{
|
|
|
|
/* Fail */
|
2008-12-18 07:26:07 +00:00
|
|
|
DPRINT("Failed: %lx\n", Status);
|
2011-07-23 18:54:29 +00:00
|
|
|
BaseSetLastNTError(Status);
|
2005-12-29 08:43:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Return length */
|
|
|
|
return RetVal;
|
|
|
|
}
|
1996-01-23 01:02:17 +00:00
|
|
|
|
2001-05-27 15:40:31 +00:00
|
|
|
/* FUNCTIONS *****************************************************************/
|
1996-01-23 01:02:17 +00:00
|
|
|
|
2003-07-10 18:50:51 +00:00
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2005-12-29 08:43:45 +00:00
|
|
|
ATOM
|
|
|
|
WINAPI
|
2001-05-27 15:40:31 +00:00
|
|
|
GlobalAddAtomA(LPCSTR lpString)
|
1996-01-23 01:02:17 +00:00
|
|
|
{
|
2005-12-29 08:43:45 +00:00
|
|
|
return InternalAddAtom(FALSE, FALSE, lpString);
|
1996-01-23 01:02:17 +00:00
|
|
|
}
|
|
|
|
|
2003-07-10 18:50:51 +00:00
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2005-12-29 08:43:45 +00:00
|
|
|
ATOM
|
|
|
|
WINAPI
|
2001-05-27 15:40:31 +00:00
|
|
|
GlobalAddAtomW(LPCWSTR lpString)
|
1996-01-23 01:02:17 +00:00
|
|
|
{
|
2005-12-29 08:43:45 +00:00
|
|
|
return InternalAddAtom(FALSE, TRUE, (LPSTR)lpString);
|
1996-01-23 01:02:17 +00:00
|
|
|
}
|
|
|
|
|
2003-07-10 18:50:51 +00:00
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2005-12-29 08:43:45 +00:00
|
|
|
ATOM
|
|
|
|
WINAPI
|
2001-05-27 15:40:31 +00:00
|
|
|
GlobalDeleteAtom(ATOM nAtom)
|
1996-01-23 01:02:17 +00:00
|
|
|
{
|
2005-12-29 08:43:45 +00:00
|
|
|
return InternalDeleteAtom(FALSE, nAtom);
|
1996-01-23 01:02:17 +00:00
|
|
|
}
|
|
|
|
|
2003-07-10 18:50:51 +00:00
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2005-12-29 08:43:45 +00:00
|
|
|
ATOM
|
|
|
|
WINAPI
|
2001-03-30 17:26:42 +00:00
|
|
|
GlobalFindAtomA(LPCSTR lpString)
|
1996-01-23 01:02:17 +00:00
|
|
|
{
|
2005-12-29 08:43:45 +00:00
|
|
|
return InternalFindAtom(FALSE, FALSE, lpString);
|
1996-01-23 01:02:17 +00:00
|
|
|
}
|
|
|
|
|
2003-07-10 18:50:51 +00:00
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2005-12-29 08:43:45 +00:00
|
|
|
ATOM
|
|
|
|
WINAPI
|
2001-05-27 15:40:31 +00:00
|
|
|
GlobalFindAtomW(LPCWSTR lpString)
|
1996-01-23 01:02:17 +00:00
|
|
|
{
|
2005-12-29 08:43:45 +00:00
|
|
|
return InternalFindAtom(FALSE, TRUE, (LPSTR)lpString);
|
1996-01-23 01:02:17 +00:00
|
|
|
}
|
|
|
|
|
2005-12-29 08:43:45 +00:00
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
UINT
|
|
|
|
WINAPI
|
2001-03-30 17:26:42 +00:00
|
|
|
GlobalGetAtomNameA(ATOM nAtom,
|
2005-12-29 08:43:45 +00:00
|
|
|
LPSTR lpBuffer,
|
|
|
|
int nSize)
|
2001-05-27 15:40:31 +00:00
|
|
|
{
|
2005-12-29 08:43:45 +00:00
|
|
|
return InternalGetAtomName(FALSE, FALSE, nAtom, lpBuffer, (DWORD)nSize);
|
1996-01-23 01:02:17 +00:00
|
|
|
}
|
|
|
|
|
2003-07-10 18:50:51 +00:00
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2005-12-29 08:43:45 +00:00
|
|
|
UINT
|
|
|
|
WINAPI
|
2001-03-30 17:26:42 +00:00
|
|
|
GlobalGetAtomNameW(ATOM nAtom,
|
2005-12-29 08:43:45 +00:00
|
|
|
LPWSTR lpBuffer,
|
|
|
|
int nSize)
|
1996-01-23 01:02:17 +00:00
|
|
|
{
|
2005-12-29 08:43:45 +00:00
|
|
|
return InternalGetAtomName(FALSE,
|
|
|
|
TRUE,
|
|
|
|
nAtom,
|
|
|
|
(LPSTR)lpBuffer,
|
|
|
|
(DWORD)nSize);
|
1996-01-23 01:02:17 +00:00
|
|
|
}
|
|
|
|
|
2003-07-10 18:50:51 +00:00
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2005-12-29 08:43:45 +00:00
|
|
|
BOOL
|
|
|
|
WINAPI
|
2001-05-27 15:40:31 +00:00
|
|
|
InitAtomTable(DWORD nSize)
|
1996-01-23 01:02:17 +00:00
|
|
|
{
|
2005-12-29 08:43:45 +00:00
|
|
|
/* Normalize size */
|
|
|
|
if (nSize < 4 || nSize > 511) nSize = 37;
|
2005-05-09 01:46:57 +00:00
|
|
|
|
2005-12-29 08:43:45 +00:00
|
|
|
DPRINT("Here\n");
|
|
|
|
return NT_SUCCESS(RtlCreateAtomTable(nSize, &BaseLocalAtomTable));
|
1996-01-23 01:02:17 +00:00
|
|
|
}
|
|
|
|
|
2003-07-10 18:50:51 +00:00
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2005-12-29 08:43:45 +00:00
|
|
|
ATOM
|
|
|
|
WINAPI
|
2001-05-27 15:40:31 +00:00
|
|
|
AddAtomA(LPCSTR lpString)
|
1996-01-23 01:02:17 +00:00
|
|
|
{
|
2005-12-29 08:43:45 +00:00
|
|
|
return InternalAddAtom(TRUE, FALSE, lpString);
|
1996-01-23 01:02:17 +00:00
|
|
|
}
|
|
|
|
|
2003-07-10 18:50:51 +00:00
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2005-12-29 08:43:45 +00:00
|
|
|
ATOM
|
|
|
|
WINAPI
|
2001-05-27 15:40:31 +00:00
|
|
|
AddAtomW(LPCWSTR lpString)
|
1996-01-23 01:02:17 +00:00
|
|
|
{
|
2005-12-29 08:43:45 +00:00
|
|
|
return InternalAddAtom(TRUE, TRUE, (LPSTR)lpString);
|
1996-01-23 01:02:17 +00:00
|
|
|
}
|
|
|
|
|
2003-07-10 18:50:51 +00:00
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2005-12-29 08:43:45 +00:00
|
|
|
ATOM
|
|
|
|
WINAPI
|
2001-05-27 15:40:31 +00:00
|
|
|
DeleteAtom(ATOM nAtom)
|
1996-01-23 01:02:17 +00:00
|
|
|
{
|
2005-12-29 08:43:45 +00:00
|
|
|
return InternalDeleteAtom(TRUE, nAtom);
|
1996-01-23 01:02:17 +00:00
|
|
|
}
|
|
|
|
|
2003-07-10 18:50:51 +00:00
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2005-12-29 08:43:45 +00:00
|
|
|
ATOM
|
|
|
|
WINAPI
|
2001-05-27 15:40:31 +00:00
|
|
|
FindAtomA(LPCSTR lpString)
|
1996-01-23 01:02:17 +00:00
|
|
|
{
|
2005-12-29 08:43:45 +00:00
|
|
|
return InternalFindAtom(TRUE, FALSE, lpString);
|
1996-01-23 01:02:17 +00:00
|
|
|
}
|
|
|
|
|
2003-07-10 18:50:51 +00:00
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2005-12-29 08:43:45 +00:00
|
|
|
ATOM
|
|
|
|
WINAPI
|
2001-05-27 15:40:31 +00:00
|
|
|
FindAtomW(LPCWSTR lpString)
|
1996-01-23 01:02:17 +00:00
|
|
|
{
|
2005-12-29 08:43:45 +00:00
|
|
|
return InternalFindAtom(TRUE, TRUE, (LPSTR)lpString);
|
1996-01-23 01:02:17 +00:00
|
|
|
|
2005-12-29 08:43:45 +00:00
|
|
|
}
|
1996-01-23 01:02:17 +00:00
|
|
|
|
2003-07-10 18:50:51 +00:00
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2005-12-29 08:43:45 +00:00
|
|
|
UINT
|
|
|
|
WINAPI
|
2001-05-27 15:40:31 +00:00
|
|
|
GetAtomNameA(ATOM nAtom,
|
2005-12-29 08:43:45 +00:00
|
|
|
LPSTR lpBuffer,
|
|
|
|
int nSize)
|
1996-01-23 01:02:17 +00:00
|
|
|
{
|
2005-12-29 08:43:45 +00:00
|
|
|
return InternalGetAtomName(TRUE, FALSE, nAtom, lpBuffer, (DWORD)nSize);
|
1996-01-23 01:02:17 +00:00
|
|
|
}
|
|
|
|
|
2003-07-10 18:50:51 +00:00
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2005-12-29 08:43:45 +00:00
|
|
|
UINT
|
|
|
|
WINAPI
|
2001-05-27 15:40:31 +00:00
|
|
|
GetAtomNameW(ATOM nAtom,
|
2005-12-29 08:43:45 +00:00
|
|
|
LPWSTR lpBuffer,
|
|
|
|
int nSize)
|
1996-01-23 01:02:17 +00:00
|
|
|
{
|
2005-12-29 08:43:45 +00:00
|
|
|
return InternalGetAtomName(TRUE,
|
|
|
|
TRUE,
|
|
|
|
nAtom,
|
|
|
|
(LPSTR)lpBuffer,
|
|
|
|
(DWORD)nSize);
|
2001-05-27 15:40:31 +00:00
|
|
|
}
|
1999-07-17 23:10:31 +00:00
|
|
|
/* EOF */
|