gvg@svn.reactos.com wrote:
Return atom length when requested. Fixes bug 793.
Modified: trunk/reactos/lib/rtl/atom.c Modified: trunk/reactos/subsys/win32k/ntuser/class.c
*Modified: trunk/reactos/lib/rtl/atom.c*
--- trunk/reactos/lib/rtl/atom.c 2005-09-22 20:17:55 UTC (rev 17984) +++ trunk/reactos/lib/rtl/atom.c 2005-09-22 20:24:50 UTC (rev 17985) @@ -610,6 +610,10 @@
*NameLength = Length; } }
else if (NameLength != NULL){*NameLength = (Entry->NameLength + 1) * sizeof(WCHAR);} return Status;}
@@ -651,6 +655,10 @@
*NameLength = Length; } }
else if (NameLength != NULL){*NameLength = (Entry->NameLength + 1) * sizeof(WCHAR);}} else {
Entry is uninitialized at this two points.
- Hartmut
From: Hartmut Birr
Entry is uninitialized at this two points.
Actually, it wasn't at the second point. I've done some more compatibility testing on Windows and changed our RtlQueryAtomInAtomTable accordingly.
Gé van Geldorp.
Ge van Geldorp wrote:
From: Hartmut Birr
Entry is uninitialized at this two points.
Actually, it wasn't at the second point. I've done some more compatibility testing on Windows and changed our RtlQueryAtomInAtomTable accordingly.
I don't unterstand your mail. If I look at RtlQueryAtomInAtomTable, Entry->NameLength is used but Entry was never initialized.
- Hartmut
From: Hartmut Birr
I don't unterstand your mail. If I look at RtlQueryAtomInAtomTable, Entry->NameLength is used but Entry was never initialized.
You said "Entry is uninitialized at this two points.", but it was uninitialized at "only" one point. After r17985 the code looked like this:
if (Atom < 0xC000) { /* ... */ if ((AtomName != NULL) && (NameLength != NULL) && (NameLength > 0)) { /* ... */ } else if (NameLength != NULL) { /* This one is wrong, Entry is not initialized here */ *NameLength = (Entry->NameLength + 1) * sizeof(WCHAR); } /* ... */ return; } /* ... */
Entry = RtlpGetAtomEntry(AtomTable, (ULONG)((USHORT)Atom - 0xC000));
if (Entry != NULL && Entry->Atom == (USHORT)Atom) { /* Entry is guaranteed to be pointing at the correct entry */
/* ... */
if ((AtomName != NULL) && (NameLength != NULL)) { /* ... */ } else if (NameLength != NULL) { /* This one was ok */ *NameLength = (Entry->NameLength + 1) * sizeof(WCHAR); } }
r18020 fixed this function.
Gé van Geldorp.