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
06a6b189
Commit
06a6b189
authored
Jan 18, 2014
by
Bruno Jesus
Committed by
Alexandre Julliard
Jan 27, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Cope with null LPMENUITEMINFO in SetMenuItemInfo.
parent
2ff6bd27
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
menu.c
dlls/user32/menu.c
+2
-2
menu.c
dlls/user32/tests/menu.c
+13
-0
No files found.
dlls/user32/menu.c
View file @
06a6b189
...
...
@@ -4795,8 +4795,8 @@ static BOOL MENU_NormalizeMenuItemInfoStruct( const MENUITEMINFOW *pmii_in,
MENUITEMINFOW
*
pmii_out
)
{
/* do we recognize the size? */
if
(
pmii_in
->
cbSize
!=
sizeof
(
MENUITEMINFOW
)
&&
pmii_in
->
cbSize
!=
sizeof
(
MENUITEMINFOW
)
-
sizeof
(
pmii_in
->
hbmpItem
))
{
if
(
!
pmii_in
||
(
pmii_in
->
cbSize
!=
sizeof
(
MENUITEMINFOW
)
&&
pmii_in
->
cbSize
!=
sizeof
(
MENUITEMINFOW
)
-
sizeof
(
pmii_in
->
hbmpItem
))
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
...
...
dlls/user32/tests/menu.c
View file @
06a6b189
...
...
@@ -948,6 +948,19 @@ static void test_menu_add_string( void )
ok
(
!
lstrcmpW
(
strbackW
,
expectedString
),
"Menu text from Unicode version incorrect
\n
"
);
}
/* Just try some invalid parameter tests */
SetLastError
(
0xdeadbeef
);
rc
=
SetMenuItemInfoA
(
hmenu
,
0
,
TRUE
,
NULL
);
ret
=
GetLastError
();
ok
(
!
rc
,
"SetMenuItemInfoA succeeded unexpectedly
\n
"
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"Expected 87, got %d
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
rc
=
SetMenuItemInfoA
(
hmenu
,
0
,
FALSE
,
NULL
);
ret
=
GetLastError
();
ok
(
!
rc
,
"SetMenuItemInfoA succeeded unexpectedly
\n
"
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"Expected 87, got %d
\n
"
,
ret
);
/* Just change ftype to string and see what text is stored */
memset
(
&
info
,
0x00
,
sizeof
(
info
));
info
.
cbSize
=
sizeof
(
MENUITEMINFOA
);
...
...
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