From cb0c6e6a48678e6841ab9ed9b3974e697dbc8d92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9=20van=20Geldorp?= Date: Thu, 22 Sep 2005 20:24:50 +0000 Subject: [PATCH] Return atom length when requested. Fixes bug 793. svn path=/trunk/; revision=17985 --- reactos/lib/rtl/atom.c | 8 ++++++++ reactos/subsys/win32k/ntuser/class.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/reactos/lib/rtl/atom.c b/reactos/lib/rtl/atom.c index 1720e64666e..b2f43c9a627 100644 --- a/reactos/lib/rtl/atom.c +++ b/reactos/lib/rtl/atom.c @@ -610,6 +610,10 @@ RtlQueryAtomInAtomTable(PRTL_ATOM_TABLE AtomTable, *NameLength = Length; } } + else if (NameLength != NULL) + { + *NameLength = (Entry->NameLength + 1) * sizeof(WCHAR); + } return Status; } @@ -651,6 +655,10 @@ RtlQueryAtomInAtomTable(PRTL_ATOM_TABLE AtomTable, *NameLength = Length; } } + else if (NameLength != NULL) + { + *NameLength = (Entry->NameLength + 1) * sizeof(WCHAR); + } } else { diff --git a/reactos/subsys/win32k/ntuser/class.c b/reactos/subsys/win32k/ntuser/class.c index 8082196c97a..915b9662b6f 100644 --- a/reactos/subsys/win32k/ntuser/class.c +++ b/reactos/subsys/win32k/ntuser/class.c @@ -208,7 +208,7 @@ IntGetClassName(struct _WINDOW_OBJECT *WindowObject, LPWSTR lpClassName, Length = 0; Status = RtlQueryAtomInAtomTable(WinStaObject->AtomTable, WindowObject->Class->Atom, NULL, NULL, NULL, &Length); - Name = ExAllocatePoolWithTag(PagedPool, Length + sizeof(UNICODE_NULL), TAG_STRING); + Name = ExAllocatePoolWithTag(PagedPool, Length, TAG_STRING); Status = RtlQueryAtomInAtomTable(WinStaObject->AtomTable, WindowObject->Class->Atom, NULL, NULL, Name, &Length); if (!NT_SUCCESS(Status))