- 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 * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries * PROJECT: ReactOS system libraries
@ -201,7 +201,7 @@ GlobalGetAtomNameA(ATOM nAtom,
Status = NtQueryInformationAtom(nAtom, Status = NtQueryInformationAtom(nAtom,
AtomBasicInformation, AtomBasicInformation,
(PVOID)&Buffer, Buffer,
BufferSize, BufferSize,
&ReturnLength); &ReturnLength);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
@ -250,7 +250,7 @@ GlobalGetAtomNameW(ATOM nAtom,
Status = NtQueryInformationAtom(nAtom, Status = NtQueryInformationAtom(nAtom,
AtomBasicInformation, AtomBasicInformation,
(PVOID)&Buffer, Buffer,
BufferSize, BufferSize,
&ReturnLength); &ReturnLength);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
@ -261,8 +261,9 @@ GlobalGetAtomNameW(ATOM nAtom,
return 0; return 0;
} }
wcscpy(lpBuffer, Buffer->Name); memcpy(lpBuffer, Buffer->Name, Buffer->NameLength);
ReturnLength = Buffer->NameLength / sizeof(WCHAR); ReturnLength = Buffer->NameLength / sizeof(WCHAR);
*(lpBuffer + ReturnLength) = 0;
RtlFreeHeap(RtlGetProcessHeap(), RtlFreeHeap(RtlGetProcessHeap(),
0, 0,
Buffer); 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 * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -18,8 +18,6 @@
#define NDEBUG #define NDEBUG
#include <internal/debug.h> #include <internal/debug.h>
typedef struct _RTL_ATOM_ENTRY typedef struct _RTL_ATOM_ENTRY
{ {
LIST_ENTRY List; LIST_ENTRY List;
@ -635,8 +633,8 @@ RtlQueryAtomInAtomTable(IN PRTL_ATOM_TABLE AtomTable,
return STATUS_BUFFER_TOO_SMALL; return STATUS_BUFFER_TOO_SMALL;
} }
Length = swprintf(AtomName, L"%s", AtomEntry->Name.Buffer); memcpy(AtomName, AtomEntry->Name.Buffer, AtomEntry->Name.Length);
*NameLength = Length * sizeof(WCHAR); *NameLength = AtomEntry->Name.Length;
} }
RtlpUnlockAtomTable(AtomTable); RtlpUnlockAtomTable(AtomTable);
@ -874,6 +872,7 @@ RtlpQueryAtomInformation(PRTL_ATOM_TABLE AtomTable,
&Flags, &Flags,
AtomInformation->Name, AtomInformation->Name,
&NameLength); &NameLength);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
return Status; return Status;