Commit fee6acf3 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

user32: Use IsMenu in MENU_mnu2mnuii.

parent 2bd0c872
......@@ -489,7 +489,8 @@ static void MENU_mnu2mnuii( UINT flags, UINT_PTR id, LPCWSTR str,
pmii->fMask |= MIIM_DATA;
pmii->dwItemData = (ULONG_PTR) str;
}
if( flags & MF_POPUP && MENU_GetMenu((HMENU)id)) {
if ((flags & MF_POPUP) && IsMenu( UlongToHandle( id )))
{
pmii->fMask |= MIIM_SUBMENU;
pmii->hSubMenu = (HMENU)id;
}
......
......@@ -3013,6 +3013,7 @@ static void test_InsertMenu(void)
{ MF_HELP, 1, MAKEINTRESOURCEA(1) }
};
HMENU hmenu;
BOOL ret;
#define create_menu(a) create_menu_from_data((a), ARRAY_SIZE(a))
#define create_menuitem(a) create_menuitem_from_data((a), ARRAY_SIZE(a))
......@@ -3054,6 +3055,16 @@ static void test_InsertMenu(void)
#undef create_menu
#undef create_menuitem
#undef compare_menu
hmenu = CreateMenu();
SetLastError(0xdeadbeef);
ret = InsertMenuW(hmenu, -1, MF_BYPOSITION | MF_POPUP, 0xdeadbeef, L"test");
ok(ret && GetLastError() == ERROR_INVALID_MENU_HANDLE,
"InsertMenuW returned %x %lu\n", ret, GetLastError());
ok(GetMenuItemCount(hmenu) == 1, "GetMenuItemCount() = %d\n", GetMenuItemCount(hmenu));
DestroyMenu(hmenu);
}
static void test_menu_getmenuinfo(void)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment