Author: jimtabor
Date: Sun Jul 16 04:33:50 2006
New Revision: 23070
URL:
http://svn.reactos.org/svn/reactos?rev=23070&view=rev
Log:
User32: Menu.c I found a small problem with drawing menu popups. This fixes the problem.
Modified:
trunk/reactos/dll/win32/user32/windows/menu.c
Modified: trunk/reactos/dll/win32/user32/windows/menu.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/m…
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/menu.c (original)
+++ trunk/reactos/dll/win32/user32/windows/menu.c Sun Jul 16 04:33:50 2006
@@ -4008,9 +4008,12 @@
if (!NtUserMenuItemInfo(Menu, Item, ByPosition, (PROSMENUITEMINFO)&miiW, FALSE))
return FALSE;
+ RtlCopyMemory(mii, &miiW, miiW.cbSize);
+
if (!AnsiBuffer || !Count)
{
if (miiW.dwTypeData) RtlFreeHeap(GetProcessHeap(), 0, miiW.dwTypeData);
+ mii->dwTypeData = AnsiBuffer;
mii->cch = miiW.cch;
return TRUE;
}
@@ -4022,7 +4025,6 @@
}
RtlFreeHeap(GetProcessHeap(), 0, miiW.dwTypeData);
- RtlCopyMemory(mii, &miiW, miiW.cbSize);
mii->dwTypeData = AnsiBuffer;
mii->cch = strlen(AnsiBuffer);
return TRUE;
@@ -4071,9 +4073,12 @@
if (!NtUserMenuItemInfo(Menu, Item, ByPosition, (PROSMENUITEMINFO) &miiW, FALSE))
return FALSE;
+ RtlCopyMemory(mii, &miiW, miiW.cbSize); // looks okay to over right user data.
+
if (!String || !Count)
{
if (miiW.dwTypeData) RtlFreeHeap(GetProcessHeap(), 0, miiW.dwTypeData);
+ mii->dwTypeData = String; // may not be zero.
mii->cch = miiW.cch;
return TRUE;
}
@@ -4084,7 +4089,6 @@
}
RtlFreeHeap(GetProcessHeap(), 0, miiW.dwTypeData);
- RtlCopyMemory(mii, &miiW, miiW.cbSize);
mii->dwTypeData = String;
mii->cch = strlenW(String);
return TRUE;