Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
fee6acf3
Commit
fee6acf3
authored
Jun 27, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 27, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Use IsMenu in MENU_mnu2mnuii.
parent
2bd0c872
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
menu.c
dlls/user32/menu.c
+2
-1
menu.c
dlls/user32/tests/menu.c
+11
-0
No files found.
dlls/user32/menu.c
View file @
fee6acf3
...
...
@@ -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
;
}
...
...
dlls/user32/tests/menu.c
View file @
fee6acf3
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment