[ros-diffs] [gadamopoulos] 48003: [kernel32] -Revert r42201 [user32] -Fix atom usage. Create a local copy of atom.c that calls the wineserver to manage user atoms. Wine code assumes that kernel32 will use the same global atom table with win32k (and this is how windows really work) However reactos doesn't do it and as a result some functions use atoms created by kernel32 and some created by win32k. To solve this issue, user32 parts that use kernel32 atoms will use kernel32 atom functions and the parts that use win32k atoms will use the local user atom functions

gadamopoulos at svn.reactos.org gadamopoulos at svn.reactos.org
Mon Jul 12 10:10:12 UTC 2010


Author: gadamopoulos
Date: Mon Jul 12 10:10:10 2010
New Revision: 48003

URL: http://svn.reactos.org/svn/reactos?rev=48003&view=rev
Log:
[kernel32]
-Revert r42201

[user32]
-Fix atom usage. Create a local copy of atom.c that calls the wineserver to manage user atoms.
Wine code assumes that kernel32 will use the same global atom table with win32k (and this is how windows really work)
However reactos doesn't do it and as a result some functions use atoms created by kernel32 and some created by win32k.
To solve this issue, user32 parts that use kernel32 atoms will use kernel32 atom functions and the parts that use win32k atoms will use the local user atom functions

Added:
    branches/arwinss/reactos/dll/win32/user32/atom.c
      - copied, changed from r47977, branches/arwinss/reactos/dll/win32/kernel32/misc/atom.c
Modified:
    branches/arwinss/reactos/dll/win32/kernel32/kernel32.rbuild
    branches/arwinss/reactos/dll/win32/kernel32/misc/atom.c
    branches/arwinss/reactos/dll/win32/user32/class.c
    branches/arwinss/reactos/dll/win32/user32/message.c
    branches/arwinss/reactos/dll/win32/user32/property.c
    branches/arwinss/reactos/dll/win32/user32/spy.c
    branches/arwinss/reactos/dll/win32/user32/user32.rbuild
    branches/arwinss/reactos/dll/win32/user32/user_private.h

Modified: branches/arwinss/reactos/dll/win32/kernel32/kernel32.rbuild
URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/kernel32/kernel32.rbuild?rev=48003&r1=48002&r2=48003&view=diff
==============================================================================
--- branches/arwinss/reactos/dll/win32/kernel32/kernel32.rbuild [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/kernel32/kernel32.rbuild [iso-8859-1] Mon Jul 12 10:10:10 2010
@@ -10,7 +10,6 @@
 	<library>pseh</library>
 	<library>normalize</library>
 	<library>ntdll</library>
-	<library>win32ksys</library>
 	<define name="_KERNEL32_" />
 	<redefine name="_WIN32_WINNT">0x0600</redefine>
 	<dependency>errcodes</dependency>

Modified: branches/arwinss/reactos/dll/win32/kernel32/misc/atom.c
URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/kernel32/misc/atom.c?rev=48003&r1=48002&r2=48003&view=diff
==============================================================================
--- branches/arwinss/reactos/dll/win32/kernel32/misc/atom.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/kernel32/misc/atom.c [iso-8859-1] Mon Jul 12 10:10:10 2010
@@ -8,7 +8,6 @@
 
 /* INCLUDES ******************************************************************/
 #include <k32.h>
-#include "wine/server.h"
 
 #define NDEBUG
 #include <debug.h>
@@ -16,206 +15,6 @@
 /* GLOBALS *******************************************************************/
 
 PRTL_ATOM_TABLE BaseLocalAtomTable = NULL;
-
-/* DEAR GOD, FORGIVE ME ******************************************************/
-
-#define MAX_ATOM_LEN              255
-
-/******************************************************************
- *		is_integral_atom
- * Returns STATUS_SUCCESS if integral atom and 'pAtom' is filled
- *         STATUS_INVALID_PARAMETER if 'atomstr' is too long
- *         STATUS_MORE_ENTRIES otherwise
- */
-static NTSTATUS is_integral_atom( LPCWSTR atomstr, size_t len, RTL_ATOM* pAtom )
-{
-    RTL_ATOM atom;
-
-    if (HIWORD( atomstr ))
-    {
-        const WCHAR* ptr = atomstr;
-        if (!len) return STATUS_OBJECT_NAME_INVALID;
-
-        if (*ptr++ == '#')
-        {
-            atom = 0;
-            while (ptr < atomstr + len && *ptr >= '0' && *ptr <= '9')
-            {
-                atom = atom * 10 + *ptr++ - '0';
-            }
-            if (ptr > atomstr + 1 && ptr == atomstr + len) goto done;
-        }
-        if (len > MAX_ATOM_LEN) return STATUS_INVALID_PARAMETER;
-        return STATUS_MORE_ENTRIES;
-    }
-    else atom = LOWORD( atomstr );
-done:
-    if (!atom || atom >= MAXINTATOM) return STATUS_INVALID_PARAMETER;
-    *pAtom = atom;
-    return STATUS_SUCCESS;
-}
-
-/******************************************************************
- *		integral_atom_name (internal)
- *
- * Helper for fetching integral (local/global) atoms names.
- */
-static ULONG integral_atom_name(WCHAR* buffer, ULONG len, RTL_ATOM atom)
-{
-    static const WCHAR fmt[] = {'#','%','u',0};
-    WCHAR tmp[16];
-    int ret;
-
-    ret = swprintf( tmp, fmt, atom );
-    if (!len) return ret * sizeof(WCHAR);
-    if (len <= ret) ret = len - 1;
-    memcpy( buffer, tmp, ret * sizeof(WCHAR) );
-    buffer[ret] = 0;
-    return ret * sizeof(WCHAR);
-}
-
-/*************************************************
- *        Global handle table management
- *************************************************/
-
-/******************************************************************
- *		NtAddAtom (NTDLL.@)
- */
-NTSTATUS WINAPI WineNtAddAtom( const WCHAR* name, ULONG length, RTL_ATOM* atom )
-{
-    NTSTATUS    status;
-
-    status = is_integral_atom( name, length / sizeof(WCHAR), atom );
-    if (status == STATUS_MORE_ENTRIES)
-    {
-        SERVER_START_REQ( add_atom )
-        {
-            wine_server_add_data( req, name, length );
-            req->table = 0;
-            status = wine_server_call( req );
-            *atom = reply->atom;
-        }
-        SERVER_END_REQ;
-    }
-    //TRACE( "%s -> %x\n",
-    //       debugstr_wn(name, length/sizeof(WCHAR)), status == STATUS_SUCCESS ? *atom : 0 );
-    return status;
-}
-
-/******************************************************************
- *		NtDeleteAtom (NTDLL.@)
- */
-NTSTATUS WINAPI WineNtDeleteAtom(RTL_ATOM atom)
-{
-    NTSTATUS    status;
-
-    SERVER_START_REQ( delete_atom )
-    {
-        req->atom = atom;
-        req->table = 0;
-        status = wine_server_call( req );
-    }
-    SERVER_END_REQ;
-    return status;
-}
-
-/******************************************************************
- *		NtFindAtom (NTDLL.@)
- */
-NTSTATUS WINAPI WineNtFindAtom( const WCHAR* name, ULONG length, RTL_ATOM* atom )
-{
-    NTSTATUS    status;
-
-    status = is_integral_atom( name, length / sizeof(WCHAR), atom );
-    if (status == STATUS_MORE_ENTRIES)
-    {
-        SERVER_START_REQ( find_atom )
-        {
-            wine_server_add_data( req, name, length );
-            req->table = 0;
-            status = wine_server_call( req );
-            *atom = reply->atom;
-        }
-        SERVER_END_REQ;
-    }
-    //TRACE( "%s -> %x\n",
-    //       debugstr_wn(name, length/sizeof(WCHAR)), status == STATUS_SUCCESS ? *atom : 0 );
-    return status;
-}
-
-/******************************************************************
- *		NtQueryInformationAtom (NTDLL.@)
- */
-NTSTATUS WINAPI WineNtQueryInformationAtom( RTL_ATOM atom, ATOM_INFORMATION_CLASS class,
-                                        PVOID ptr, ULONG size, PULONG psize )
-{
-    NTSTATUS status;
-
-    switch (class)
-    {
-    case AtomBasicInformation:
-        {
-            ULONG name_len;
-            ATOM_BASIC_INFORMATION* abi = ptr;
-
-            if (size < sizeof(ATOM_BASIC_INFORMATION))
-                return STATUS_INVALID_PARAMETER;
-            name_len = size - sizeof(ATOM_BASIC_INFORMATION);
-
-            if (atom < MAXINTATOM)
-            {
-                if (atom)
-                {
-                    abi->NameLength = integral_atom_name( abi->Name, name_len, atom );
-                    status = (name_len) ? STATUS_SUCCESS : STATUS_BUFFER_TOO_SMALL;
-                    //abi->ReferenceCount = 1;
-                    //abi->Pinned = 1;
-                }
-                else status = STATUS_INVALID_PARAMETER;
-            }
-            else
-            {
-                SERVER_START_REQ( get_atom_information )
-                {
-                    req->atom = atom;
-                    req->table = 0;
-                    if (name_len) wine_server_set_reply( req, abi->Name, name_len );
-                    status = wine_server_call( req );
-                    if (status == STATUS_SUCCESS)
-                    {
-                        name_len = wine_server_reply_size( reply );
-                        if (name_len)
-                        {
-                            abi->NameLength = name_len;
-                            abi->Name[name_len / sizeof(WCHAR)] = '\0';
-                        }
-                        else
-                        {
-                            name_len = reply->total;
-                            abi->NameLength = name_len;
-                            status = STATUS_BUFFER_TOO_SMALL;
-                        }
-                        //abi->ReferenceCount = reply->count;
-                        //abi->Pinned = reply->pinned;
-                    }
-                    else name_len = 0;
-                }
-                SERVER_END_REQ;
-            }
-            //TRACE( "%x -> %s (%u)\n", 
-            //       atom, debugstr_wn(abi->Name, abi->NameLength / sizeof(WCHAR)),
-            //       status );
-            if (psize)
-                *psize = sizeof(ATOM_BASIC_INFORMATION) + name_len;
-        }
-        break;
-    default:
-        DPRINT1( "Unsupported class %u\n", class );
-        status = STATUS_INVALID_INFO_CLASS;
-        break;
-    }
-    return status;
-}
 
 /* FUNCTIONS *****************************************************************/
 
@@ -239,11 +38,6 @@
     UNICODE_STRING UnicodeString;
     PUNICODE_STRING AtomNameString;
     ATOM Atom = INVALID_ATOM;
-
-    if (Unicode)
-        DPRINT("InternalAddAtom local %d name %S\n", Local, AtomName);
-    else
-        DPRINT("InternalAddAtom local %d name %s\n", Local, AtomName);
 
     /* Check if it's an integer atom */
     if ((ULONG_PTR)AtomName <= 0xFFFF)
@@ -315,7 +109,7 @@
     else
     {
         /* Do a global add */
-        Status = WineNtAddAtom(AtomNameString->Buffer,
+        Status = NtAddAtom(AtomNameString->Buffer,
                            AtomNameString->Length,
                            &Atom);
     }
@@ -345,11 +139,6 @@
     UNICODE_STRING UnicodeString;
     PUNICODE_STRING AtomNameString;
     ATOM Atom = INVALID_ATOM;
-
-    if (Unicode)
-        DPRINT("InternalFindAtom local %d name %S\n", Local, AtomName);
-    else
-        DPRINT("InternalFindAtom local %d name %s\n", Local, AtomName);
 
     /* Check if it's an integer atom */
     if ((ULONG_PTR)AtomName <= 0xFFFF)
@@ -431,7 +220,7 @@
         else
         {
             /* Call the global function */
-            Status = WineNtFindAtom(AtomNameString->Buffer,
+            Status = NtFindAtom(AtomNameString->Buffer,
                                 AtomNameString->Length,
                                 &Atom);
         }
@@ -458,8 +247,6 @@
 {
     NTSTATUS Status;
 
-    DPRINT("InternalDeleteAtom local %d atom %x\n", Local, Atom);
-
     /* Validate it */
     if (Atom >= MAXINTATOM)
     {
@@ -472,7 +259,7 @@
         else
         {
             /* Delete it globall */
-            Status = WineNtDeleteAtom(Atom);
+            Status = NtDeleteAtom(Atom);
         }
 
         /* Check for success */
@@ -506,8 +293,6 @@
     ULONG AtomNameLength;
     PATOM_BASIC_INFORMATION AtomInfo;
 
-    DPRINT("InternalGetAtomName local %d atom %x size %x\n", Local, Atom, Size);
-
     /* Normalize the size as not to overflow */
     if (!Unicode && Size > 0x7000) Size = 0x7000;
 
@@ -567,7 +352,7 @@
         }
 
         /* Query the name */
-        Status = WineNtQueryInformationAtom(Atom,
+        Status = NtQueryInformationAtom(Atom,
                                         AtomBasicInformation,
                                         AtomInfo,
                                         AtomInfoLength,
@@ -635,11 +420,6 @@
         SetLastErrorByStatus(Status);
     }
 
-    if (Unicode)
-        DPRINT("InternalGetAtomName name %S\n", AtomName);
-    else
-        DPRINT("InternalGetAtomName name %s\n", AtomName);
-
     /* Return length */
     return RetVal;
 }

Copied: branches/arwinss/reactos/dll/win32/user32/atom.c (from r47977, branches/arwinss/reactos/dll/win32/kernel32/misc/atom.c)
URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/user32/atom.c?p2=branches/arwinss/reactos/dll/win32/user32/atom.c&p1=branches/arwinss/reactos/dll/win32/kernel32/misc/atom.c&r1=47977&r2=48003&rev=48003&view=diff
==============================================================================
--- branches/arwinss/reactos/dll/win32/kernel32/misc/atom.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/user32/atom.c [iso-8859-1] Mon Jul 12 10:10:10 2010
@@ -7,15 +7,18 @@
  */
 
 /* INCLUDES ******************************************************************/
-#include <k32.h>
+
+
+#define WIN32_NO_STATUS
+#include <windows.h>
+#include <ndk/ntndk.h>
+#include "wine/debug.h"
 #include "wine/server.h"
 
-#define NDEBUG
-#include <debug.h>
-
-/* GLOBALS *******************************************************************/
-
-PRTL_ATOM_TABLE BaseLocalAtomTable = NULL;
+WINE_DEFAULT_DEBUG_CHANNEL(useratom);
+
+#define SetLastErrorByStatus(__S__) \
+ ((void)SetLastError(RtlNtStatusToDosError(__S__)))
 
 /* DEAR GOD, FORGIVE ME ******************************************************/
 
@@ -58,7 +61,7 @@
 /******************************************************************
  *		integral_atom_name (internal)
  *
- * Helper for fetching integral (local/global) atoms names.
+ * Helper for fetching integral atoms names.
  */
 static ULONG integral_atom_name(WCHAR* buffer, ULONG len, RTL_ATOM atom)
 {
@@ -210,7 +213,7 @@
         }
         break;
     default:
-        DPRINT1( "Unsupported class %u\n", class );
+        ERR( "Unsupported class %u\n", class );
         status = STATUS_INVALID_INFO_CLASS;
         break;
     }
@@ -219,19 +222,9 @@
 
 /* FUNCTIONS *****************************************************************/
 
-PVOID
+ATOM
 WINAPI
-InternalInitAtomTable(VOID)
-{
-    /* Create or return the local table */
-    if (!BaseLocalAtomTable) RtlCreateAtomTable(0, &BaseLocalAtomTable);
-    return BaseLocalAtomTable;
-}
-
-ATOM
-WINAPI
-InternalAddAtom(BOOLEAN Local,
-                BOOLEAN Unicode,
+InternalAddAtom(BOOLEAN Unicode,
                 LPCSTR AtomName)
 {
     NTSTATUS Status;
@@ -241,9 +234,9 @@
     ATOM Atom = INVALID_ATOM;
 
     if (Unicode)
-        DPRINT("InternalAddAtom local %d name %S\n", Local, AtomName);
+        WARN("InternalAddAtom name %S\n", AtomName);
     else
-        DPRINT("InternalAddAtom local %d name %s\n", Local, AtomName);
+        WARN("InternalAddAtom name %s\n", AtomName);
 
     /* Check if it's an integer atom */
     if ((ULONG_PTR)AtomName <= 0xFFFF)
@@ -304,21 +297,10 @@
         }
     }
 
-    /* Check if we're doing local add */
-    if (Local)
-    {
-        /* Do a local add */
-        Status = RtlAddAtomToAtomTable(InternalInitAtomTable(),
-                                       AtomNameString->Buffer,
-                                       &Atom);
-    }
-    else
-    {
-        /* Do a global add */
-        Status = WineNtAddAtom(AtomNameString->Buffer,
-                           AtomNameString->Length,
-                           &Atom);
-    }
+    /* Do a global add */
+    Status = WineNtAddAtom(AtomNameString->Buffer,
+                       AtomNameString->Length,
+                       &Atom);
 
     /* Check for failure */
     if (!NT_SUCCESS(Status)) SetLastErrorByStatus(Status);
@@ -336,9 +318,7 @@
 
 ATOM
 WINAPI
-InternalFindAtom(BOOLEAN Local,
-                 BOOLEAN Unicode,
-                 LPCSTR AtomName)
+InternalFindAtom(BOOLEAN Unicode,LPCSTR AtomName)
 {
     NTSTATUS Status;
     ANSI_STRING AnsiString;
@@ -347,9 +327,9 @@
     ATOM Atom = INVALID_ATOM;
 
     if (Unicode)
-        DPRINT("InternalFindAtom local %d name %S\n", Local, AtomName);
+        WARN("InternalFindAtom name %S\n", AtomName);
     else
-        DPRINT("InternalFindAtom local %d name %s\n", Local, AtomName);
+        WARN("InternalFindAtom name %s\n", AtomName);
 
     /* Check if it's an integer atom */
     if ((ULONG_PTR)AtomName <= 0xFFFF)
@@ -360,7 +340,7 @@
         {
             /* Fail, atom number too large */
             SetLastErrorByStatus(STATUS_INVALID_PARAMETER);
-            DPRINT1("Invalid atom\n");
+            ERR("Invalid atom\n");
         }
 
         /* Return it */
@@ -405,37 +385,27 @@
         /* Check for failure */
         if (!NT_SUCCESS(Status))
         {
-            DPRINT1("Failed\n");
+            ERR("Failed\n");
             SetLastErrorByStatus(Status);
             return Atom;
         }
     }
 
-    /* Check if we're doing local lookup */
-    if (Local)
-    {
-        /* Do a local lookup */
-        Status = RtlLookupAtomInAtomTable(InternalInitAtomTable(),
-                                          AtomNameString->Buffer,
-                                          &Atom);
+    /* Do a global search */
+    if (!AtomNameString->Length)
+    {
+        /* This is illegal in win32 */
+        ERR("No name given\n");
+        Status = STATUS_OBJECT_NAME_NOT_FOUND;
     }
     else
     {
-        /* Do a global search */
-        if (!AtomNameString->Length)
-        {
-            /* This is illegal in win32 */
-            DPRINT1("No name given\n");
-            Status = STATUS_OBJECT_NAME_NOT_FOUND;
-        }
-        else
-        {
-            /* Call the global function */
-            Status = WineNtFindAtom(AtomNameString->Buffer,
-                                AtomNameString->Length,
-                                &Atom);
-        }
-    }
+        /* Call the global function */
+        Status = WineNtFindAtom(AtomNameString->Buffer,
+                            AtomNameString->Length,
+                            &Atom);
+    }
+
 
     /* Check for failure */
     if (!NT_SUCCESS(Status)) SetLastErrorByStatus(Status);
@@ -453,27 +423,17 @@
 
 ATOM
 WINAPI
-InternalDeleteAtom(BOOLEAN Local,
-                   ATOM Atom)
+InternalDeleteAtom(ATOM Atom)
 {
     NTSTATUS Status;
 
-    DPRINT("InternalDeleteAtom local %d atom %x\n", Local, Atom);
+    WARN("InternalDeleteAtom atom %x\n", Atom);
 
     /* Validate it */
     if (Atom >= MAXINTATOM)
     {
-        /* Check if it's a local delete */
-        if (Local)
-        {
-            /* Delete it locally */
-            Status = RtlDeleteAtomFromAtomTable(InternalInitAtomTable(), Atom);
-        }
-        else
-        {
-            /* Delete it globall */
-            Status = WineNtDeleteAtom(Atom);
-        }
+        /* Delete it globall */
+        Status = WineNtDeleteAtom(Atom);
 
         /* Check for success */
         if (!NT_SUCCESS(Status))
@@ -490,8 +450,7 @@
 
 UINT
 WINAPI
-InternalGetAtomName(BOOLEAN Local,
-                    BOOLEAN Unicode,
+InternalGetAtomName(BOOLEAN Unicode,
                     ATOM Atom,
                     LPSTR AtomName,
                     DWORD Size)
@@ -506,7 +465,7 @@
     ULONG AtomNameLength;
     PATOM_BASIC_INFORMATION AtomInfo;
 
-    DPRINT("InternalGetAtomName local %d atom %x size %x\n", Local, Atom, Size);
+    WARN("InternalGetAtomName atom %x size %x\n", Atom, Size);
 
     /* Normalize the size as not to overflow */
     if (!Unicode && Size > 0x7000) Size = 0x7000;
@@ -523,62 +482,32 @@
         return 0;
     }
 
-    /* Check if this is a global query */
-    if (Local)
-    {
-        /* Set the query length */
-        AtomNameLength = Size * sizeof(WCHAR);
-
-        /* If it's unicode, just keep the name */
-        if (Unicode)
-        {
-            AtomNameString = (PWSTR)AtomName;
-        }
-        else
-        {
-            /* Allocate memory for the ansi buffer */
-            TempBuffer = RtlAllocateHeap(RtlGetProcessHeap(),
-                                         0,
-                                         AtomNameLength);
-            AtomNameString = TempBuffer;
-        }
-
-        /* Query the name */
-        Status = RtlQueryAtomInAtomTable(InternalInitAtomTable(),
-                                         Atom,
-                                         NULL,
-                                         NULL,
-                                         AtomNameString,
-                                         &AtomNameLength);
-    }
-    else
-    {
-        /* We're going to do a global query, so allocate a buffer */
-        AtomInfoLength = sizeof(ATOM_BASIC_INFORMATION) +
-                         (Size * sizeof(WCHAR));
-        AtomInfo = TempBuffer = RtlAllocateHeap(RtlGetProcessHeap(),
-                                                0,
-                                                AtomInfoLength);
-
-        if (!AtomInfo)
-        {
-            SetLastErrorByStatus(STATUS_NO_MEMORY);
-            return 0;
-        }
-
-        /* Query the name */
-        Status = WineNtQueryInformationAtom(Atom,
-                                        AtomBasicInformation,
-                                        AtomInfo,
-                                        AtomInfoLength,
-                                        &AtomInfoLength);
-        if (NT_SUCCESS(Status))
-        {
-            /* Success. Update the length and get the name */
-            AtomNameLength = (ULONG)AtomInfo->NameLength;
-            AtomNameString = AtomInfo->Name;
-        }
-    }
+    /* We're going to do a global query, so allocate a buffer */
+    AtomInfoLength = sizeof(ATOM_BASIC_INFORMATION) +
+                     (Size * sizeof(WCHAR));
+    AtomInfo = TempBuffer = RtlAllocateHeap(RtlGetProcessHeap(),
+                                            0,
+                                            AtomInfoLength);
+
+    if (!AtomInfo)
+    {
+        SetLastErrorByStatus(STATUS_NO_MEMORY);
+        return 0;
+    }
+
+    /* Query the name */
+    Status = WineNtQueryInformationAtom(Atom,
+                                    AtomBasicInformation,
+                                    AtomInfo,
+                                    AtomInfoLength,
+                                    &AtomInfoLength);
+    if (NT_SUCCESS(Status))
+    {
+        /* Success. Update the length and get the name */
+        AtomNameLength = (ULONG)AtomInfo->NameLength;
+        AtomNameString = AtomInfo->Name;
+    }
+ 
 
     /* Check for global success */
     if (NT_SUCCESS(Status))
@@ -631,14 +560,14 @@
     if (!NT_SUCCESS(Status))
     {
         /* Fail */
-        DPRINT("Failed: %lx\n", Status);
+        WARN("Failed: %lx\n", Status);
         SetLastErrorByStatus(Status);
     }
 
     if (Unicode)
-        DPRINT("InternalGetAtomName name %S\n", AtomName);
+        WARN("InternalGetAtomName name %S\n", AtomName);
     else
-        DPRINT("InternalGetAtomName name %s\n", AtomName);
+        WARN("InternalGetAtomName name %s\n", AtomName);
 
     /* Return length */
     return RetVal;
@@ -650,170 +579,71 @@
  * @implemented
  */
 ATOM
-WINAPI
-GlobalAddAtomA(LPCSTR lpString)
-{
-    return InternalAddAtom(FALSE, FALSE, lpString);
+UserAddAtomA(LPCSTR lpString)
+{
+    return InternalAddAtom(FALSE, lpString);
 }
 
 /*
  * @implemented
  */
 ATOM
-WINAPI
-GlobalAddAtomW(LPCWSTR lpString)
-{
-    return InternalAddAtom(FALSE, TRUE, (LPSTR)lpString);
+UserAddAtomW(LPCWSTR lpString)
+{
+    return InternalAddAtom(TRUE, (LPSTR)lpString);
 }
 
 /*
  * @implemented
  */
 ATOM
-WINAPI
-GlobalDeleteAtom(ATOM nAtom)
-{
-    return InternalDeleteAtom(FALSE, nAtom);
+UserDeleteAtom(ATOM nAtom)
+{
+    return InternalDeleteAtom(nAtom);
 }
 
 /*
  * @implemented
  */
 ATOM
-WINAPI
-GlobalFindAtomA(LPCSTR lpString)
-{
-    return InternalFindAtom(FALSE, FALSE, lpString);
+UserFindAtomA(LPCSTR lpString)
+{
+    return InternalFindAtom(FALSE, lpString);
 }
 
 /*
  * @implemented
  */
 ATOM
-WINAPI
-GlobalFindAtomW(LPCWSTR lpString)
-{
-    return InternalFindAtom(FALSE, TRUE, (LPSTR)lpString);
+UserFindAtomW(LPCWSTR lpString)
+{
+    return InternalFindAtom(TRUE, (LPSTR)lpString);
 }
 
 /*
  * @implemented
  */
 UINT
-WINAPI
-GlobalGetAtomNameA(ATOM nAtom,
+UserGetAtomNameA(ATOM nAtom,
                    LPSTR lpBuffer,
                    int nSize)
 {
-    return InternalGetAtomName(FALSE, FALSE, nAtom, lpBuffer, (DWORD)nSize);
+    return InternalGetAtomName(FALSE, nAtom, lpBuffer, (DWORD)nSize);
 }
 
 /*
  * @implemented
  */
 UINT
-WINAPI
-GlobalGetAtomNameW(ATOM nAtom,
+UserGetAtomNameW(ATOM nAtom,
                    LPWSTR lpBuffer,
                    int nSize)
 {
-    return InternalGetAtomName(FALSE,
-                               TRUE,
+    return InternalGetAtomName(TRUE,
                                nAtom,
                                (LPSTR)lpBuffer,
                                (DWORD)nSize);
 }
 
-/*
- * @implemented
- */
-BOOL
-WINAPI
-InitAtomTable(DWORD nSize)
-{
-    /* Normalize size */
-    if (nSize < 4 || nSize > 511) nSize = 37;
-
-    DPRINT("Here\n");
-    return NT_SUCCESS(RtlCreateAtomTable(nSize, &BaseLocalAtomTable));
-}
-
-/*
- * @implemented
- */
-ATOM
-WINAPI
-AddAtomA(LPCSTR lpString)
-{
-    return InternalAddAtom(TRUE, FALSE, lpString);
-}
-
-/*
- * @implemented
- */
-ATOM
-WINAPI
-AddAtomW(LPCWSTR lpString)
-{
-    return InternalAddAtom(TRUE, TRUE, (LPSTR)lpString);
-}
-
-/*
- * @implemented
- */
-ATOM
-WINAPI
-DeleteAtom(ATOM nAtom)
-{
-    return InternalDeleteAtom(TRUE, nAtom);
-}
-
-/*
- * @implemented
- */
-ATOM
-WINAPI
-FindAtomA(LPCSTR lpString)
-{
-    return InternalFindAtom(TRUE, FALSE, lpString);
-}
-
-/*
- * @implemented
- */
-ATOM
-WINAPI
-FindAtomW(LPCWSTR lpString)
-{
-    return InternalFindAtom(TRUE, TRUE, (LPSTR)lpString);
-
-}
-
-/*
- * @implemented
- */
-UINT
-WINAPI
-GetAtomNameA(ATOM nAtom,
-             LPSTR lpBuffer,
-             int nSize)
-{
-    return InternalGetAtomName(TRUE, FALSE, nAtom, lpBuffer, (DWORD)nSize);
-}
-
-/*
- * @implemented
- */
-UINT
-WINAPI
-GetAtomNameW(ATOM nAtom,
-             LPWSTR lpBuffer,
-             int nSize)
-{
-    return InternalGetAtomName(TRUE,
-                               TRUE,
-                               nAtom,
-                               (LPSTR)lpBuffer,
-                               (DWORD)nSize);
-}
+
 /* EOF */

Modified: branches/arwinss/reactos/dll/win32/user32/class.c
URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/user32/class.c?rev=48003&r1=48002&r2=48003&view=diff
==============================================================================
--- branches/arwinss/reactos/dll/win32/user32/class.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/user32/class.c [iso-8859-1] Mon Jul 12 10:10:10 2010
@@ -316,7 +316,7 @@
 
     classPtr->atomName = get_int_atom_value( name );
     if (!classPtr->atomName && name) strcpyW( classPtr->name, name );
-    else GlobalGetAtomNameW( classPtr->atomName, classPtr->name, sizeof(classPtr->name)/sizeof(WCHAR) );
+    else UserGetAtomNameW( classPtr->atomName, classPtr->name, sizeof(classPtr->name)/sizeof(WCHAR) );
 
     SERVER_START_REQ( create_class )
     {
@@ -908,7 +908,7 @@
         if (!set_server_info( hwnd, offset, newval, size )) break;
         retval = class->atomName;
         class->atomName = newval;
-        GlobalGetAtomNameW( newval, class->name, sizeof(class->name)/sizeof(WCHAR) );
+        UserGetAtomNameW( newval, class->name, sizeof(class->name)/sizeof(WCHAR) );
         break;
     case GCL_CBCLSEXTRA:  /* cannot change this one */
         SetLastError( ERROR_INVALID_PARAMETER );
@@ -974,7 +974,7 @@
     {
         WCHAR tmpbuf[MAX_ATOM_LEN + 1];
 
-        ret = GlobalGetAtomNameW( GetClassLongW( hwnd, GCW_ATOM ), tmpbuf, MAX_ATOM_LEN + 1 );
+        ret = UserGetAtomNameW( GetClassLongW( hwnd, GCW_ATOM ), tmpbuf, MAX_ATOM_LEN + 1 );
         if (ret)
         {
             ret = min(count - 1, ret);
@@ -1173,7 +1173,7 @@
     }
     pClassEntry->hInst = class->hInstance;
     pClassEntry->wNext++;
-    GlobalGetAtomNameA( class->atomName, pClassEntry->szClassName,
+    UserGetAtomNameA( class->atomName, pClassEntry->szClassName,
                           sizeof(pClassEntry->szClassName) );
     return TRUE;
 }

Modified: branches/arwinss/reactos/dll/win32/user32/message.c
URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/user32/message.c?rev=48003&r1=48002&r2=48003&view=diff
==============================================================================
--- branches/arwinss/reactos/dll/win32/user32/message.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/user32/message.c [iso-8859-1] Mon Jul 12 10:10:10 2010
@@ -3919,7 +3919,7 @@
  */
 UINT WINAPI RegisterWindowMessageA( LPCSTR str )
 {
-    UINT ret = GlobalAddAtomA(str);
+    UINT ret = UserAddAtomA(str);
     TRACE("%s, ret=%x\n", str, ret);
     return ret;
 }
@@ -3930,7 +3930,7 @@
  */
 UINT WINAPI RegisterWindowMessageW( LPCWSTR str )
 {
-    UINT ret = GlobalAddAtomW(str);
+    UINT ret = UserAddAtomW(str);
     TRACE("%s ret=%x\n", debugstr_w(str), ret);
     return ret;
 }

Modified: branches/arwinss/reactos/dll/win32/user32/property.c
URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/user32/property.c?rev=48003&r1=48002&r2=48003&view=diff
==============================================================================
--- branches/arwinss/reactos/dll/win32/user32/property.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/user32/property.c [iso-8859-1] Mon Jul 12 10:10:10 2010
@@ -223,7 +223,7 @@
         for (i = 0; i < count; i++)
         {
             char string[ATOM_BUFFER_SIZE];
-            if (!GlobalGetAtomNameA( list[i].atom, string, ATOM_BUFFER_SIZE )) continue;
+            if (!UserGetAtomNameA( list[i].atom, string, ATOM_BUFFER_SIZE )) continue;
             if (!(ret = func( hwnd, string, (HANDLE)(ULONG_PTR)list[i].data, lParam ))) break;
         }
         HeapFree( GetProcessHeap(), 0, list );
@@ -245,7 +245,7 @@
         for (i = 0; i < count; i++)
         {
             WCHAR string[ATOM_BUFFER_SIZE];
-            if (!GlobalGetAtomNameW( list[i].atom, string, ATOM_BUFFER_SIZE )) continue;
+            if (!UserGetAtomNameW( list[i].atom, string, ATOM_BUFFER_SIZE )) continue;
             if (!(ret = func( hwnd, string, (HANDLE)(ULONG_PTR)list[i].data, lParam ))) break;
         }
         HeapFree( GetProcessHeap(), 0, list );

Modified: branches/arwinss/reactos/dll/win32/user32/spy.c
URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/user32/spy.c?rev=48003&r1=48002&r2=48003&view=diff
==============================================================================
--- branches/arwinss/reactos/dll/win32/user32/spy.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/user32/spy.c [iso-8859-1] Mon Jul 12 10:10:10 2010
@@ -2148,7 +2148,7 @@
 
         if (sp_e->msgnum >= 0xc000)
         {
-            if (GlobalGetAtomNameA( sp_e->msgnum, sp_e->msg_name+1, sizeof(sp_e->msg_name)-2 ))
+            if (UserGetAtomNameA( sp_e->msgnum, sp_e->msg_name+1, sizeof(sp_e->msg_name)-2 ))
             {
                 sp_e->msg_name[0] = '\"';
                 strcat( sp_e->msg_name, "\"" );

Modified: branches/arwinss/reactos/dll/win32/user32/user32.rbuild
URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/user32/user32.rbuild?rev=48003&r1=48002&r2=48003&view=diff
==============================================================================
--- branches/arwinss/reactos/dll/win32/user32/user32.rbuild [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/user32/user32.rbuild [iso-8859-1] Mon Jul 12 10:10:10 2010
@@ -17,6 +17,7 @@
 	<library>win32ksys</library>
 	<library>pseh</library>
 
+	<file>atom.c</file>
 	<file>button.c</file>
 	<file>caret.c</file>
 	<file>class.c</file>

Modified: branches/arwinss/reactos/dll/win32/user32/user_private.h
URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/user32/user_private.h?rev=48003&r1=48002&r2=48003&view=diff
==============================================================================
--- branches/arwinss/reactos/dll/win32/user32/user_private.h [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/user32/user_private.h [iso-8859-1] Mon Jul 12 10:10:10 2010
@@ -258,6 +258,14 @@
                              LRESULT lReturn, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
 extern int SPY_Init(void) DECLSPEC_HIDDEN;
 
+extern ATOM UserAddAtomA(LPCSTR lpString);
+extern ATOM UserAddAtomW(LPCWSTR lpString);
+extern ATOM UserDeleteAtom(ATOM nAtom);
+extern ATOM UserFindAtomA(LPCSTR lpString);
+extern ATOM UserFindAtomW(LPCWSTR lpString);
+extern UINT UserGetAtomNameA(ATOM nAtom, LPSTR lpBuffer, int nSize);
+extern UINT UserGetAtomNameW(ATOM nAtom, LPWSTR lpBuffer, int nSize);
+
 #include "pshpack1.h"
 
 typedef struct




More information about the Ros-diffs mailing list