Author: jimtabor
Date: Thu Aug 13 01:37:26 2009
New Revision: 42643
URL:
http://svn.reactos.org/svn/reactos?rev=42643&view=rev
Log:
- Fix menu window callback. Only use it when the menu name is not null.
Modified:
trunk/reactos/subsystems/win32/win32k/ntuser/callback.c
trunk/reactos/subsystems/win32/win32k/ntuser/window.c
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/callback.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/callback.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/callback.c [iso-8859-1] Thu Aug 13
01:37:26 2009
@@ -1,23 +1,4 @@
/*
- * ReactOS W32 Subsystem
- * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-/* $Id$
- *
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* PURPOSE: Window classes
@@ -694,7 +675,10 @@
Common->hModule = hModule;
- RtlCopyMemory(&Common->MenuName, pMenuName->Buffer, pMenuName->Length);
+ if (pMenuName->Length)
+ RtlCopyMemory(&Common->MenuName, pMenuName->Buffer,
pMenuName->Length);
+ else
+ RtlCopyMemory(&Common->MenuName, &pMenuName->Buffer, sizeof(WCHAR));
ResultPointer = NULL;
ResultLength = sizeof(LRESULT);
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/window.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] Thu Aug 13 01:37:26
2009
@@ -1837,12 +1837,19 @@
{
if (hMenu)
IntSetMenu(Window, hMenu, &MenuChanged);
- else // Take it from the parent.
+ else if (Wnd->pcls->lpszMenuName) // Take it from the parent.
{
UNICODE_STRING MenuName;
-
- RtlInitUnicodeString( &MenuName, Wnd->pcls->lpszMenuName);
-
+ if (IS_INTRESOURCE(Wnd->pcls->lpszMenuName))
+ {
+ MenuName.Length = 0;
+ MenuName.MaximumLength = 0;
+ MenuName.Buffer = Wnd->pcls->lpszMenuName;
+ }
+ else
+ {
+ RtlInitUnicodeString( &MenuName, Wnd->pcls->lpszMenuName);
+ }
hMenu = co_IntCallLoadMenu( Wnd->pcls->hModule, &MenuName);
if (hMenu) IntSetMenu(Window, hMenu, &MenuChanged);
}