Author: fireball Date: Wed May 3 14:48:38 2006 New Revision: 21781
URL: http://svn.reactos.ru/svn/reactos?rev=21781&view=rev Log: - Bug 1450: Patch by Thomas Weidenmueller "Some window class fixes"
This patch makes registering the "Abiword" window class succeed. However, Abiword now crashes with a stack overflow recursively delivering the WM_NOTIFYFORMAT message to a subclassed rebar control...
Modified: trunk/reactos/dll/win32/user32/windows/class.c trunk/reactos/subsystems/win32/win32k/ntuser/class.c trunk/reactos/subsystems/win32/win32k/ntuser/window.c
Modified: trunk/reactos/dll/win32/user32/windows/class.c URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/user32/windows/cla... ============================================================================== --- trunk/reactos/dll/win32/user32/windows/class.c (original) +++ trunk/reactos/dll/win32/user32/windows/class.c Wed May 3 14:48:38 2006 @@ -553,18 +553,22 @@ WndClass.hIconSm = CreateSmallIcon(WndClass.hIcon); }
- if (lpwcx->lpszMenuName != NULL) - { - if (HIWORD(lpwcx->lpszMenuName)) + if (WndClass.lpszMenuName != NULL) + { + if (!IS_INTRESOURCE(WndClass.lpszMenuName)) { - RtlCreateUnicodeStringFromAsciiz(&MenuName, WndClass.lpszMenuName); + if (WndClass.lpszMenuName[0]) + { + RtlCreateUnicodeStringFromAsciiz(&MenuName, WndClass.lpszMenuName); + } } else { MenuName.Buffer = (LPWSTR)WndClass.lpszMenuName; }
- hMenu = LoadMenuA(WndClass.hInstance, lpwcx->lpszMenuName); + if (MenuName.Buffer != NULL) + hMenu = LoadMenuA(WndClass.hInstance, WndClass.lpszMenuName); }
if (IS_ATOM(WndClass.lpszClassName)) @@ -585,7 +589,7 @@ REGISTERCLASS_ANSI, hMenu);
- if (!IS_ATOM(WndClass.lpszMenuName)) + if (!IS_INTRESOURCE(WndClass.lpszMenuName)) RtlFreeUnicodeString(&MenuName); if (!IS_ATOM(WndClass.lpszClassName)) RtlFreeUnicodeString(&ClassName); @@ -637,17 +641,22 @@ WndClass.hIconSm = CreateSmallIcon(WndClass.hIcon); }
- if (lpwcx->lpszMenuName != NULL) - { - if (HIWORD(lpwcx->lpszMenuName)) + if (WndClass.lpszMenuName != NULL) + { + if (!IS_INTRESOURCE(WndClass.lpszMenuName)) { - RtlInitUnicodeString(&MenuName, WndClass.lpszMenuName); + if (WndClass.lpszMenuName[0]) + { + RtlInitUnicodeString(&MenuName, WndClass.lpszMenuName); + } } else { MenuName.Buffer = (LPWSTR)WndClass.lpszMenuName; } - hMenu = LoadMenuW(WndClass.hInstance, lpwcx->lpszMenuName); + + if (MenuName.Buffer != NULL) + hMenu = LoadMenuW(WndClass.hInstance, WndClass.lpszMenuName); }
if (IS_ATOM(WndClass.lpszClassName))
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/class.c URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntus... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/class.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/class.c Wed May 3 14:48:38 2006 @@ -1432,6 +1432,8 @@ /* unlink the class */ *Link = Class->Next;
+ IntDeregisterClassAtom(Class->Atom); + /* finally free the resources */ IntDestroyClass(Class); return TRUE;
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/window.c URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntus... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/window.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/window.c Wed May 3 14:48:38 2006 @@ -1491,7 +1491,7 @@ } else { - DPRINT1("Class %wZ not found\n", ClassName); + DPRINT1("Class "%wZ" not found\n", ClassName); }
SetLastWin32Error(ERROR_CANNOT_FIND_WND_CLASS); @@ -2073,7 +2073,7 @@ RETURN( NULL); } } - else if (! IS_INTRESOURCE(ClassName.Buffer)) + else if (! IS_ATOM(ClassName.Buffer)) { SetLastWin32Error(ERROR_INVALID_PARAMETER); return NULL;