Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
98e2bf4e
Commit
98e2bf4e
authored
Jan 05, 2012
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Jan 05, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Add an invalid window check to SetActiveWindow.
parent
d09e973f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
focus.c
dlls/user32/focus.c
+9
-3
msg.c
dlls/user32/tests/msg.c
+1
-2
No files found.
dlls/user32/focus.c
View file @
98e2bf4e
...
...
@@ -232,12 +232,18 @@ HWND WINAPI SetActiveWindow( HWND hwnd )
if
(
hwnd
)
{
LONG
style
=
GetWindowLongW
(
hwnd
,
GWL_STYLE
)
;
LONG
style
;
hwnd
=
WIN_GetFullHandle
(
hwnd
);
if
(
!
IsWindow
(
hwnd
))
{
SetLastError
(
ERROR_INVALID_WINDOW_HANDLE
);
return
0
;
}
style
=
GetWindowLongW
(
hwnd
,
GWL_STYLE
);
if
((
style
&
(
WS_POPUP
|
WS_CHILD
))
==
WS_CHILD
)
return
GetActiveWindow
();
/* Windows doesn't seem to return an error here */
hwnd
=
WIN_GetFullHandle
(
hwnd
);
}
if
(
!
set_active_window
(
hwnd
,
&
prev
,
FALSE
,
TRUE
))
return
0
;
...
...
dlls/user32/tests/msg.c
View file @
98e2bf4e
...
...
@@ -13602,10 +13602,9 @@ static void test_SetFocus(void)
SetLastError
(
0xdeadbeef
);
old_active
=
SetActiveWindow
((
HWND
)
0xdeadbeef
);
todo_wine
ok
(
GetLastError
()
==
ERROR_INVALID_WINDOW_HANDLE
,
"expected ERROR_INVALID_WINDOW_HANDLE, got %d
\n
"
,
GetLastError
());
while
(
PeekMessage
(
&
msg
,
NULL
,
0
,
0
,
PM_REMOVE
))
DispatchMessage
(
&
msg
);
ok_sequence
(
WmEmptySeq
,
"SetActiveWindow on an invalid window"
,
TRU
E
);
ok_sequence
(
WmEmptySeq
,
"SetActiveWindow on an invalid window"
,
FALS
E
);
ok
(
old_active
==
0
,
"expected old focus 0, got %p
\n
"
,
old_active
);
ok
(
GetActiveWindow
()
==
parent
,
"expected active %p, got %p
\n
"
,
parent
,
GetActiveWindow
());
ok
(
GetFocus
()
==
parent
,
"expected focus %p, got %p
\n
"
,
parent
,
GetFocus
());
...
...
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