Author: jimtabor
Date: Tue Jul 25 04:50:35 2006
New Revision: 23274
URL:
http://svn.reactos.org/svn/reactos?rev=23274&view=rev
Log:
Broken explorer popups with IsBadString, revert string pointer checking. Misc fix to
win32k menu and removed byposition flag check and save.
Modified:
trunk/reactos/dll/win32/user32/windows/menu.c
trunk/reactos/subsystems/win32/win32k/ntuser/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 Tue Jul 25 04:50:35 2006
@@ -3698,11 +3698,6 @@
mii->fType |= MFT_RIGHTJUSTIFY;
}
- if(Flags & MF_BYPOSITION)
- {
- mii->fType |= MF_BYPOSITION;
- }
-
if(Flags & MF_MENUBREAK)
{
mii->fType |= MFT_MENUBREAK;
@@ -4396,9 +4391,6 @@
((mi.fMask & MIIM_TYPE) && (MENU_ITEM_TYPE(mi.fType) == MF_STRING)))
&& mi.dwTypeData != NULL)
{
- UINT Count = lpmii->cch;
- if(!Count) Count++;
- if (IsBadStringPtrA(lpmii->dwTypeData, Count)) return FALSE;
Status = RtlCreateUnicodeStringFromAsciiz(&MenuText, (LPSTR)mi.dwTypeData);
if (!NT_SUCCESS (Status))
{
@@ -4451,9 +4443,6 @@
((mi.fMask & MIIM_TYPE) && (MENU_ITEM_TYPE(mi.fType) == MF_STRING)))
&& mi.dwTypeData != NULL)
{
- UINT Count = lpmii->cch;
- if(!Count) Count++;
- if (IsBadStringPtrW(lpmii->dwTypeData, Count)) return FALSE;
RtlInitUnicodeString(&MenuText, (PWSTR)lpmii->dwTypeData);
mi.dwTypeData = MenuText.Buffer;
mi.cch = MenuText.Length / sizeof(WCHAR);
@@ -4826,9 +4815,6 @@
&& MenuItemInfoW.dwTypeData != NULL)
{
/* cch is ignored when the content of a menu item is set by calling SetMenuItemInfo. */
- UINT Count = lpmii->cch;
- if(!Count) Count++;
- if (IsBadStringPtrA(lpmii->dwTypeData, Count )) return FALSE;
Status = RtlCreateUnicodeStringFromAsciiz(&UnicodeString,
(LPSTR)MenuItemInfoW.dwTypeData);
if (!NT_SUCCESS (Status))
@@ -4883,9 +4869,6 @@
(MENU_ITEM_TYPE(MenuItemInfoW.fType) == MF_STRING)))
&& MenuItemInfoW.dwTypeData != NULL)
{
- UINT Count = lpmii->cch;
- if (!Count) Count++;
- if (IsBadStringPtrW(lpmii->dwTypeData, Count)) return FALSE;
MenuItemInfoW.cch = strlenW(MenuItemInfoW.dwTypeData);
}
Result = NtUserMenuItemInfo(hMenu, uItem, fByPosition,
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/menu.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/menu.c (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/menu.c Tue Jul 25 04:50:35 2006
@@ -756,7 +756,7 @@
IntSetMenuItemInfo(PMENU_OBJECT MenuObject, PMENU_ITEM MenuItem, PROSMENUITEMINFO lpmii)
{
PMENU_OBJECT SubMenuObject;
- UINT fTypeMask = (MFT_BITMAP | MFT_MENUBARBREAK | MFT_MENUBREAK | MF_BYPOSITION |
MFT_OWNERDRAW | MFT_RADIOCHECK | MFT_RIGHTJUSTIFY | MFT_SEPARATOR | MF_POPUP);
+ UINT fTypeMask = (MFT_BITMAP | MFT_MENUBARBREAK | MFT_MENUBREAK | MFT_OWNERDRAW |
MFT_RADIOCHECK | MFT_RIGHTJUSTIFY | MFT_SEPARATOR | MF_POPUP);
if(!MenuItem || !MenuObject || !lpmii)
{
@@ -805,7 +805,7 @@
SetLastNtError( ERROR_INVALID_PARAMETER);
return FALSE;
}
- MenuItem->fType |= lpmii->fType;
+ MenuItem->fType |= lpmii->fType; /* Need to save all the flags, this fixed
MFT_RIGHTJUSTIFY */
}
if(lpmii->fMask & MIIM_BITMAP)
{
@@ -1058,6 +1058,7 @@
mii.hSubMenu = CurItem->hSubMenu;
mii.Rect = CurItem->Rect;
mii.XTab = CurItem->XTab;
+ mii.Text = CurItem->Text.Buffer;
Status = MmCopyToCaller(Buf, &mii, sizeof(ROSMENUITEMINFO));
if (! NT_SUCCESS(Status))