mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
Broken explorer popups with IsBadString, revert string pointer checking. Misc fix to win32k menu and removed byposition flag check and save.
svn path=/trunk/; revision=23274
This commit is contained in:
parent
f1470917fa
commit
b8da24b40b
2 changed files with 3 additions and 19 deletions
|
@ -3698,11 +3698,6 @@ MenuSetItemData(
|
|||
mii->fType |= MFT_RIGHTJUSTIFY;
|
||||
}
|
||||
|
||||
if(Flags & MF_BYPOSITION)
|
||||
{
|
||||
mii->fType |= MF_BYPOSITION;
|
||||
}
|
||||
|
||||
if(Flags & MF_MENUBREAK)
|
||||
{
|
||||
mii->fType |= MFT_MENUBREAK;
|
||||
|
@ -4396,9 +4391,6 @@ InsertMenuItemA(
|
|||
((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 @@ InsertMenuItemW(
|
|||
((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 @@ SetMenuItemInfoA(
|
|||
&& 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 @@ SetMenuItemInfoW(
|
|||
(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,
|
||||
|
|
|
@ -756,7 +756,7 @@ BOOL FASTCALL
|
|||
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 @@ IntSetMenuItemInfo(PMENU_OBJECT MenuObject, PMENU_ITEM MenuItem, PROSMENUITEMINF
|
|||
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 @@ IntBuildMenuItemList(PMENU_OBJECT MenuObject, PVOID Buffer, ULONG nMax)
|
|||
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))
|
||||
|
|
Loading…
Reference in a new issue