mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 14:43:02 +00:00
- 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... svn path=/trunk/; revision=21781
This commit is contained in:
parent
fd9ff56f6d
commit
549d2f7cbd
3 changed files with 22 additions and 11 deletions
|
@ -553,18 +553,22 @@ RegisterClassExA(CONST WNDCLASSEXA *lpwcx)
|
||||||
WndClass.hIconSm = CreateSmallIcon(WndClass.hIcon);
|
WndClass.hIconSm = CreateSmallIcon(WndClass.hIcon);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lpwcx->lpszMenuName != NULL)
|
if (WndClass.lpszMenuName != NULL)
|
||||||
{
|
{
|
||||||
if (HIWORD(lpwcx->lpszMenuName))
|
if (!IS_INTRESOURCE(WndClass.lpszMenuName))
|
||||||
{
|
{
|
||||||
RtlCreateUnicodeStringFromAsciiz(&MenuName, WndClass.lpszMenuName);
|
if (WndClass.lpszMenuName[0])
|
||||||
|
{
|
||||||
|
RtlCreateUnicodeStringFromAsciiz(&MenuName, WndClass.lpszMenuName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MenuName.Buffer = (LPWSTR)WndClass.lpszMenuName;
|
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))
|
if (IS_ATOM(WndClass.lpszClassName))
|
||||||
|
@ -585,7 +589,7 @@ RegisterClassExA(CONST WNDCLASSEXA *lpwcx)
|
||||||
REGISTERCLASS_ANSI,
|
REGISTERCLASS_ANSI,
|
||||||
hMenu);
|
hMenu);
|
||||||
|
|
||||||
if (!IS_ATOM(WndClass.lpszMenuName))
|
if (!IS_INTRESOURCE(WndClass.lpszMenuName))
|
||||||
RtlFreeUnicodeString(&MenuName);
|
RtlFreeUnicodeString(&MenuName);
|
||||||
if (!IS_ATOM(WndClass.lpszClassName))
|
if (!IS_ATOM(WndClass.lpszClassName))
|
||||||
RtlFreeUnicodeString(&ClassName);
|
RtlFreeUnicodeString(&ClassName);
|
||||||
|
@ -637,17 +641,22 @@ RegisterClassExW(CONST WNDCLASSEXW *lpwcx)
|
||||||
WndClass.hIconSm = CreateSmallIcon(WndClass.hIcon);
|
WndClass.hIconSm = CreateSmallIcon(WndClass.hIcon);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lpwcx->lpszMenuName != NULL)
|
if (WndClass.lpszMenuName != NULL)
|
||||||
{
|
{
|
||||||
if (HIWORD(lpwcx->lpszMenuName))
|
if (!IS_INTRESOURCE(WndClass.lpszMenuName))
|
||||||
{
|
{
|
||||||
RtlInitUnicodeString(&MenuName, WndClass.lpszMenuName);
|
if (WndClass.lpszMenuName[0])
|
||||||
|
{
|
||||||
|
RtlInitUnicodeString(&MenuName, WndClass.lpszMenuName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MenuName.Buffer = (LPWSTR)WndClass.lpszMenuName;
|
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))
|
if (IS_ATOM(WndClass.lpszClassName))
|
||||||
|
|
|
@ -1432,6 +1432,8 @@ UserUnregisterClass(IN PUNICODE_STRING ClassName,
|
||||||
/* unlink the class */
|
/* unlink the class */
|
||||||
*Link = Class->Next;
|
*Link = Class->Next;
|
||||||
|
|
||||||
|
IntDeregisterClassAtom(Class->Atom);
|
||||||
|
|
||||||
/* finally free the resources */
|
/* finally free the resources */
|
||||||
IntDestroyClass(Class);
|
IntDestroyClass(Class);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -1491,7 +1491,7 @@ co_IntCreateWindowEx(DWORD dwExStyle,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DPRINT1("Class %wZ not found\n", ClassName);
|
DPRINT1("Class \"%wZ\" not found\n", ClassName);
|
||||||
}
|
}
|
||||||
|
|
||||||
SetLastWin32Error(ERROR_CANNOT_FIND_WND_CLASS);
|
SetLastWin32Error(ERROR_CANNOT_FIND_WND_CLASS);
|
||||||
|
@ -2073,7 +2073,7 @@ NtUserCreateWindowEx(DWORD dwExStyle,
|
||||||
RETURN( NULL);
|
RETURN( NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (! IS_INTRESOURCE(ClassName.Buffer))
|
else if (! IS_ATOM(ClassName.Buffer))
|
||||||
{
|
{
|
||||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue