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
5e65b652
Commit
5e65b652
authored
Apr 09, 2016
by
Rodrigo Rivas Costa
Committed by
Alexandre Julliard
Apr 11, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Make DeferWindowPos() fail on invalid window handles.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
137030bf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
1 deletion
+40
-1
win.c
dlls/user32/tests/win.c
+35
-0
winpos.c
dlls/user32/winpos.c
+5
-1
No files found.
dlls/user32/tests/win.c
View file @
5e65b652
...
...
@@ -8821,6 +8821,40 @@ static void test_winproc_limit(void)
ok
(
i
==
1
,
"winproc should be called once (%d)
\n
"
,
i
);
}
static
void
test_deferwindowpos
(
void
)
{
HDWP
hdwp
,
hdwp2
;
BOOL
ret
;
hdwp
=
BeginDeferWindowPos
(
0
);
ok
(
hdwp
!=
NULL
,
"got %p
\n
"
,
hdwp
);
ret
=
EndDeferWindowPos
(
NULL
);
ok
(
!
ret
,
"got %d
\n
"
,
ret
);
hdwp2
=
DeferWindowPos
(
NULL
,
NULL
,
NULL
,
0
,
0
,
10
,
10
,
0
);
todo_wine
ok
(
hdwp2
==
NULL
&&
((
GetLastError
()
==
ERROR_INVALID_DWP_HANDLE
)
||
broken
(
GetLastError
()
==
ERROR_INVALID_WINDOW_HANDLE
)
/* before win8 */
),
"got %p, error %d
\n
"
,
hdwp2
,
GetLastError
());
hdwp2
=
DeferWindowPos
((
HDWP
)
0xdead
,
GetDesktopWindow
(),
NULL
,
0
,
0
,
10
,
10
,
0
);
todo_wine
ok
(
hdwp2
==
NULL
&&
((
GetLastError
()
==
ERROR_INVALID_DWP_HANDLE
)
||
broken
(
GetLastError
()
==
ERROR_INVALID_WINDOW_HANDLE
)
/* before win8 */
),
"got %p, error %d
\n
"
,
hdwp2
,
GetLastError
());
hdwp2
=
DeferWindowPos
(
hdwp
,
NULL
,
NULL
,
0
,
0
,
10
,
10
,
0
);
ok
(
hdwp2
==
NULL
&&
GetLastError
()
==
ERROR_INVALID_WINDOW_HANDLE
,
"got %p, error %d
\n
"
,
hdwp2
,
GetLastError
());
hdwp2
=
DeferWindowPos
(
hdwp
,
GetDesktopWindow
(),
NULL
,
0
,
0
,
10
,
10
,
0
);
ok
(
hdwp2
==
NULL
&&
GetLastError
()
==
ERROR_INVALID_WINDOW_HANDLE
,
"got %p, error %d
\n
"
,
hdwp2
,
GetLastError
());
hdwp2
=
DeferWindowPos
(
hdwp
,
(
HWND
)
0xdead
,
NULL
,
0
,
0
,
10
,
10
,
0
);
ok
(
hdwp2
==
NULL
&&
GetLastError
()
==
ERROR_INVALID_WINDOW_HANDLE
,
"got %p, error %d
\n
"
,
hdwp2
,
GetLastError
());
ret
=
EndDeferWindowPos
(
hdwp
);
ok
(
ret
,
"got %d
\n
"
,
ret
);
}
START_TEST
(
win
)
{
char
**
argv
;
...
...
@@ -8963,6 +8997,7 @@ START_TEST(win)
test_GetMessagePos
();
test_activateapp
(
hwndMain
);
test_winproc_handles
(
argv
[
0
]);
test_deferwindowpos
();
/* add the tests above this line */
if
(
hhook
)
UnhookWindowsHookEx
(
hhook
);
...
...
dlls/user32/winpos.c
View file @
5e65b652
...
...
@@ -2348,7 +2348,11 @@ HDWP WINAPI DeferWindowPos( HDWP hdwp, HWND hwnd, HWND hwndAfter,
hdwp
,
hwnd
,
hwndAfter
,
x
,
y
,
cx
,
cy
,
flags
);
hwnd
=
WIN_GetFullHandle
(
hwnd
);
if
(
is_desktop_window
(
hwnd
))
return
0
;
if
(
is_desktop_window
(
hwnd
)
||
!
IsWindow
(
hwnd
))
{
SetLastError
(
ERROR_INVALID_WINDOW_HANDLE
);
return
0
;
}
if
(
!
(
pDWP
=
get_user_handle_ptr
(
hdwp
,
USER_DWP
)))
return
0
;
if
(
pDWP
==
OBJ_OTHER_PROCESS
)
...
...
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