[ros-dev] 17985: Return atom length whenrequested. Fixes bug 793.

Ge van Geldorp gvg at reactos.com
Sat Sep 24 00:18:49 CEST 2005


> 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.




More information about the Ros-dev mailing list