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
d09e973f
Commit
d09e973f
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 SetFocus.
parent
94ffc49e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
focus.c
dlls/user32/focus.c
+5
-0
msg.c
dlls/user32/tests/msg.c
+1
-2
No files found.
dlls/user32/focus.c
View file @
d09e973f
...
...
@@ -259,6 +259,11 @@ HWND WINAPI SetFocus( HWND hwnd )
{
/* Check if we can set the focus to this window */
hwnd
=
WIN_GetFullHandle
(
hwnd
);
if
(
!
IsWindow
(
hwnd
))
{
SetLastError
(
ERROR_INVALID_WINDOW_HANDLE
);
return
0
;
}
if
(
hwnd
==
previous
)
return
previous
;
/* nothing to do */
for
(;;)
{
...
...
dlls/user32/tests/msg.c
View file @
d09e973f
...
...
@@ -13573,10 +13573,9 @@ static void test_SetFocus(void)
SetLastError
(
0xdeadbeef
);
old_focus
=
SetFocus
((
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
,
"SetFocus on an invalid window"
,
TRU
E
);
ok_sequence
(
WmEmptySeq
,
"SetFocus on an invalid window"
,
FALS
E
);
ok
(
old_focus
==
0
,
"expected old focus 0, got %p
\n
"
,
old_focus
);
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