- Fixed bug #25.

svn path=/trunk/; revision=6443
This commit is contained in:
Filip Navara 2003-10-28 09:49:04 +00:00
parent db7b08f3f4
commit 92b58c12e3
2 changed files with 9 additions and 9 deletions

View file

@ -1,4 +1,4 @@
/* $Id: atom.c,v 1.17 2003/07/10 18:50:51 chorns Exp $
/* $Id: atom.c,v 1.18 2003/10/28 09:49:04 navaraf Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
@ -201,7 +201,7 @@ GlobalGetAtomNameA(ATOM nAtom,
Status = NtQueryInformationAtom(nAtom,
AtomBasicInformation,
(PVOID)&Buffer,
Buffer,
BufferSize,
&ReturnLength);
if (!NT_SUCCESS(Status))
@ -250,7 +250,7 @@ GlobalGetAtomNameW(ATOM nAtom,
Status = NtQueryInformationAtom(nAtom,
AtomBasicInformation,
(PVOID)&Buffer,
Buffer,
BufferSize,
&ReturnLength);
if (!NT_SUCCESS(Status))
@ -261,8 +261,9 @@ GlobalGetAtomNameW(ATOM nAtom,
return 0;
}
wcscpy(lpBuffer, Buffer->Name);
memcpy(lpBuffer, Buffer->Name, Buffer->NameLength);
ReturnLength = Buffer->NameLength / sizeof(WCHAR);
*(lpBuffer + ReturnLength) = 0;
RtlFreeHeap(RtlGetProcessHeap(),
0,
Buffer);

View file

@ -1,4 +1,4 @@
/* $Id: atom.c,v 1.5 2003/07/11 01:23:15 royce Exp $
/* $Id: atom.c,v 1.6 2003/10/28 09:49:04 navaraf Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -18,8 +18,6 @@
#define NDEBUG
#include <internal/debug.h>
typedef struct _RTL_ATOM_ENTRY
{
LIST_ENTRY List;
@ -635,8 +633,8 @@ RtlQueryAtomInAtomTable(IN PRTL_ATOM_TABLE AtomTable,
return STATUS_BUFFER_TOO_SMALL;
}
Length = swprintf(AtomName, L"%s", AtomEntry->Name.Buffer);
*NameLength = Length * sizeof(WCHAR);
memcpy(AtomName, AtomEntry->Name.Buffer, AtomEntry->Name.Length);
*NameLength = AtomEntry->Name.Length;
}
RtlpUnlockAtomTable(AtomTable);
@ -874,6 +872,7 @@ RtlpQueryAtomInformation(PRTL_ATOM_TABLE AtomTable,
&Flags,
AtomInformation->Name,
&NameLength);
if (!NT_SUCCESS(Status))
{
return Status;