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
bd1fab78
Commit
bd1fab78
authored
Apr 21, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Don't start menu tracking when the owner window is invalid.
parent
354a74e0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
menu.c
dlls/user32/menu.c
+5
-0
menu.c
dlls/user32/tests/menu.c
+14
-0
No files found.
dlls/user32/menu.c
View file @
bd1fab78
...
...
@@ -1848,6 +1848,11 @@ static BOOL MENU_ShowPopup( HWND hwndOwner, HMENU hmenu, UINT id, UINT flags,
}
/* store the owner for DrawItem */
if
(
!
IsWindow
(
hwndOwner
))
{
SetLastError
(
ERROR_INVALID_WINDOW_HANDLE
);
return
FALSE
;
}
menu
->
hwndOwner
=
hwndOwner
;
menu
->
nScrollPos
=
0
;
...
...
dlls/user32/tests/menu.c
View file @
bd1fab78
...
...
@@ -2932,6 +2932,20 @@ static void test_menu_trackpopupmenu(void)
gflag_initmenupopup
?
" WM_INITMENUPOPUP "
:
" "
,
gflag_entermenuloop
?
"WM_INITMENULOOP "
:
""
,
gflag_initmenu
?
"WM_INITMENU"
:
""
);
/* invalid window */
SetLastError
(
0xdeadbeef
);
gflag_initmenupopup
=
gflag_entermenuloop
=
gflag_initmenu
=
0
;
ret
=
MyTrackPopupMenu
(
Ex
,
hmenu
,
TPM_RETURNCMD
,
100
,
100
,
0
,
NULL
);
gle
=
GetLastError
();
ok
(
!
ret
,
"TrackPopupMenu%s should have failed
\n
"
,
Ex
?
"Ex"
:
""
);
ok
(
gle
==
ERROR_INVALID_WINDOW_HANDLE
,
"TrackPopupMenu%s error got %u
\n
"
,
Ex
?
"Ex"
:
""
,
gle
);
ok
(
!
(
gflag_initmenupopup
||
gflag_entermenuloop
||
gflag_initmenu
),
"got unexpected message(s)%s%s%s
\n
"
,
gflag_initmenupopup
?
" WM_INITMENUPOPUP "
:
" "
,
gflag_entermenuloop
?
"WM_INITMENULOOP "
:
""
,
gflag_initmenu
?
"WM_INITMENU"
:
""
);
/* now a somewhat successful call */
SetLastError
(
0xdeadbeef
);
gflag_initmenupopup
=
gflag_entermenuloop
=
gflag_initmenu
=
0
;
...
...
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