diff --git a/dlls/user32/menu.c b/dlls/user32/menu.c index c07a8cbc4489746feed507909a0e2c202479e321..bf4be62bd3503342d3e8b094b93a554560cc7100 100644 --- a/dlls/user32/menu.c +++ b/dlls/user32/menu.c @@ -4566,7 +4566,7 @@ static BOOL GetMenuItemInfo_common ( HMENU hmenu, UINT item, BOOL bypos, SetLastError( ERROR_MENU_ITEM_NOT_FOUND); return FALSE; } - + if( lpmii->fMask & MIIM_TYPE) { if( lpmii->fMask & ( MIIM_STRING | MIIM_FTYPE | MIIM_BITMAP)) { WARN("invalid combination of fMask bits used\n"); @@ -4575,7 +4575,8 @@ static BOOL GetMenuItemInfo_common ( HMENU hmenu, UINT item, BOOL bypos, return FALSE; } lpmii->fType = menu->fType & MENUITEMINFO_TYPE_MASK; - if( menu->hbmpItem) lpmii->fType |= MFT_BITMAP; + if (menu->hbmpItem && !IS_MAGIC_BITMAP(menu->hbmpItem)) + lpmii->fType |= MFT_BITMAP; lpmii->hbmpItem = menu->hbmpItem; /* not on Win9x/ME */ if( lpmii->fType & MFT_BITMAP) { lpmii->dwTypeData = (LPWSTR) menu->hbmpItem; diff --git a/dlls/user32/tests/menu.c b/dlls/user32/tests/menu.c index 9855d38439f0471444055719df3365d65a8b7f0a..7599431ab60c909c15101d40a250f340f84c856b 100644 --- a/dlls/user32/tests/menu.c +++ b/dlls/user32/tests/menu.c @@ -856,13 +856,11 @@ static void test_menu_bmp_and_string(void) mii.dwItemData = 0x81818181; got = GetMenuItemInfoA(hsysmenu, SC_RESTORE, FALSE, &mii); ok(got, "GetMenuItemInfo failed\n"); -todo_wine ok(mii.fType == MF_STRING, "expected MF_STRING, got %#x\n", mii.fType); ok(mii.fState == MF_ENABLED, "expected MF_ENABLED, got %#x\n", mii.fState); ok(mii.wID == SC_RESTORE, "expected SC_RESTORE, got %#x\n", mii.wID); ok(mii.hSubMenu == 0, "expected 0, got %p\n", mii.hSubMenu); ok(mii.dwItemData == 0, "expected 0, got %#lx\n", mii.dwItemData); -todo_wine ok(mii.dwTypeData == (LPSTR)bmfill, "expected %p, got %p\n", bmfill, mii.dwTypeData); ok(mii.cch != 0, "cch should not be 0\n"); ok(mii.hbmpItem == HBMMENU_POPUP_RESTORE, "expected HBMMENU_POPUP_RESTORE, got %p\n", mii.hbmpItem); @@ -872,13 +870,11 @@ todo_wine mii.hbmpItem = (HBITMAP)0x81818181; got = GetMenuItemInfoA(hsysmenu, SC_CLOSE, FALSE, &mii); ok(got, "GetMenuItemInfo failed\n"); -todo_wine ok(mii.fType == MF_STRING, "expected MF_STRING, got %#x\n", mii.fType); ok(mii.fState == MF_ENABLED, "expected MF_ENABLED, got %#x\n", mii.fState); ok(mii.wID == SC_RESTORE, "expected SC_RESTORE, got %#x\n", mii.wID); ok(mii.hSubMenu == 0, "expected 0, got %p\n", mii.hSubMenu); ok(mii.dwItemData == 0, "expected 0, got %#lx\n", mii.dwItemData); -todo_wine ok(mii.dwTypeData == (LPSTR)bmfill, "expected %p, got %p\n", bmfill, mii.dwTypeData); ok(mii.cch != 0, "cch should not be 0\n"); ok(mii.hbmpItem == HBMMENU_POPUP_CLOSE, "expected HBMMENU_POPUP_CLOSE, got %p\n", mii.hbmpItem); @@ -3917,13 +3913,11 @@ if (0) /* FIXME: uncomment once Wine is fixed */ mii.dwItemData = 0x81818181; ret = GetMenuItemInfoA(hmenu, 0, TRUE, &mii); ok(ret, "GetMenuItemInfo failed\n"); -todo_wine ok(mii.fType == MF_STRING, "expected MF_STRING, got %#x\n", mii.fType); ok(mii.fState == 0x81818181, "expected 0x81818181, got %#x\n", mii.fState); ok(mii.wID == 0x81818181, "expected 0x81818181, got %#x\n", mii.wID); ok(mii.hSubMenu == 0, "expected 0, got %p\n", mii.hSubMenu); ok(mii.dwItemData == 0x81818181, "expected 0x81818181, got %#lx\n", mii.dwItemData); -todo_wine ok(mii.dwTypeData == buf, "expected %p, got %p\n", buf, mii.dwTypeData); ok(mii.cch == 6, "expected 6, got %u\n", mii.cch); ok(!strcmp(buf, string), "expected %s, got %s\n", string, buf); @@ -3938,16 +3932,13 @@ todo_wine mii.dwItemData = 0x81818181; ret = GetMenuItemInfoA(hmenu, 0, TRUE, &mii); ok(ret, "GetMenuItemInfo failed\n"); -todo_wine ok(mii.fType == MF_STRING, "expected MF_STRING, got %#x\n", mii.fType); ok(mii.fState == MF_ENABLED, "expected MF_ENABLED, got %#x\n", mii.fState); ok(mii.wID == 0, "expected 0, got %#x\n", mii.wID); ok(mii.hSubMenu == 0, "expected 0, got %p\n", mii.hSubMenu); ok(mii.dwItemData == 0, "expected 0, got %#lx\n", mii.dwItemData); -todo_wine ok(mii.dwTypeData == buf, "expected %p, got %p\n", buf, mii.dwTypeData); ok(mii.cch == 6, "expected 6, got %u\n", mii.cch); -todo_wine ok(!strcmp(buf, string), "expected %s, got %s\n", string, buf); ok(mii.hbmpItem == HBMMENU_POPUP_RESTORE, "expected HBMMENU_POPUP_RESTORE, got %p\n", mii.hbmpItem); @@ -4071,16 +4062,13 @@ todo_wine mii.dwItemData = 0x81818181; ret = GetMenuItemInfoA(hmenu, 0, TRUE, &mii); ok(ret, "GetMenuItemInfo failed\n"); -todo_wine ok(mii.fType == MF_STRING, "expected MF_STRING, got %#x\n", mii.fType); ok(mii.fState == 0x81818181, "expected 0x81818181, got %#x\n", mii.fState); ok(mii.wID == 0x81818181, "expected 0x81818181, got %#x\n", mii.wID); ok(mii.hSubMenu == 0, "expected 0, got %p\n", mii.hSubMenu); ok(mii.dwItemData == 0x81818181, "expected 0x81818181, got %#lx\n", mii.dwItemData); -todo_wine ok(mii.dwTypeData == buf, "expected %p, got %p\n", buf, mii.dwTypeData); ok(mii.cch == 6, "expected 6, got %u\n", mii.cch); -todo_wine ok(!strcmp(buf, string), "expected %s, got %s\n", string, buf); ok(mii.hbmpItem == HBMMENU_POPUP_RESTORE, "expected HBMMENU_POPUP_RESTORE, got %p\n", mii.hbmpItem);