From bcbeefce988508397906b696275a80fa16b2ee0a Mon Sep 17 00:00:00 2001 From: James Tabor Date: Thu, 16 Jul 2009 19:07:04 +0000 Subject: [PATCH] - Implementation of registering system atom listings with table references. Se bug 4705. svn path=/trunk/; revision=41993 --- .../subsystems/win32/win32k/ntuser/class.c | 43 +++++++++++++++++++ .../subsystems/win32/win32k/ntuser/window.c | 5 +-- 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/reactos/subsystems/win32/win32k/ntuser/class.c b/reactos/subsystems/win32/win32k/ntuser/class.c index 6559fbff342..498b07c6c41 100644 --- a/reactos/subsystems/win32/win32k/ntuser/class.c +++ b/reactos/subsystems/win32/win32k/ntuser/class.c @@ -35,6 +35,43 @@ #define WARN DPRINT1 #define ERR DPRINT1 +static struct +{ + int FnId; + INT ClsId; +} FnidToiCls[] = +{ + { FNID_BUTTON, ICLS_BUTTON}, + { FNID_EDIT, ICLS_EDIT}, + { FNID_STATIC, ICLS_STATIC}, + { FNID_LISTBOX, ICLS_LISTBOX}, + { FNID_SCROLLBAR, ICLS_SCROLLBAR}, + { FNID_COMBOBOX, ICLS_COMBOBOX}, + { FNID_MDICLIENT, ICLS_MDICLIENT}, + { FNID_COMBOLBOX, ICLS_COMBOLBOX}, + { FNID_DIALOG, ICLS_DIALOG}, + { FNID_MENU, ICLS_MENU}, + { FNID_ICONTITLE, ICLS_ICONTITLE} +}; + +static +BOOL +FASTCALL +LockupFnIdToiCls(int FnId, int *iCls ) +{ + int i; + + for ( i = 0; i < 10; i++) + { + if (FnidToiCls[i].FnId == FnId) + { + *iCls = FnidToiCls[i].ClsId; + return TRUE; + } + } + return FALSE; +} + /* WINDOWCLASS ***************************************************************/ static VOID @@ -1869,7 +1906,13 @@ UserRegisterSystemClasses(IN ULONG Count, pi); if (Class != NULL) { + int iCls; + Class->fnID = SystemClasses[i].ClassId; + if (LockupFnIdToiCls(Class->fnID, &iCls)) + { + gpsi->atomSysClass[iCls] = Class->Atom; + } ASSERT(Class->System); Class->Next = pi->SystemClassList; diff --git a/reactos/subsystems/win32/win32k/ntuser/window.c b/reactos/subsystems/win32/win32k/ntuser/window.c index b558f0448e0..8398e0f6099 100644 --- a/reactos/subsystems/win32/win32k/ntuser/window.c +++ b/reactos/subsystems/win32/win32k/ntuser/window.c @@ -2248,11 +2248,10 @@ AllocErr: } } - /* BugBoy Comments: if the window being created is a edit control, ATOM 0xC007, + /* BugBoy Comments: if the window being created is a edit control, ATOM 0xCxxx, then my testing shows that windows (2k and XP) creates a CallProc for it immediately Dont understand why it does this. */ -// if (ClassAtom == gpsi->atomSysClass[ICLS_EDIT]) <--- real fix! - if (ClassAtom == 0XC008) // <--- HACK!!!! + if (ClassAtom == gpsi->atomSysClass[ICLS_EDIT]) { PCALLPROC CallProc; //CallProc = CreateCallProc(NULL, Wnd->WndProc, bUnicodeWindow, Wnd->ti->ppi);