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
3cbccd44
Commit
3cbccd44
authored
Feb 08, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 09, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Don't allow creating children of orphaned windows.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
862d0eef
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
3 deletions
+40
-3
win.c
dlls/user32/tests/win.c
+31
-2
window.c
server/window.c
+9
-1
No files found.
dlls/user32/tests/win.c
View file @
3cbccd44
...
...
@@ -765,7 +765,7 @@ static LRESULT CALLBACK test_thread_exit_wnd_proc( HWND hwnd, UINT msg, WPARAM w
static
void
test_thread_exit_destroy
(
void
)
{
struct
test_thread_exit_parent_params
params
;
HWND
adopter
,
child1
,
child2
,
child3
;
HWND
adopter
,
child1
,
child2
,
child3
,
child
;
WNDPROC
old_wndproc
,
wndproc
;
WCHAR
buffer
[
MAX_PATH
];
HANDLE
thread
;
...
...
@@ -889,6 +889,14 @@ static void test_thread_exit_destroy(void)
tmp
=
GetPropW
(
child2
,
L"myprop"
);
ok
(
HandleToULong
(
tmp
)
==
0xdeadbeef
,
"GetPropW returned %p
\n
"
,
tmp
);
child
=
CreateWindowExA
(
0
,
"ToolWindowClass"
,
"Tool window 1"
,
WS_CHILD
,
0
,
0
,
100
,
100
,
child1
,
0
,
0
,
NULL
);
ok
(
!
child
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"CreateWindowExA returned %p %u
\n
"
,
child
,
GetLastError
()
);
ret
=
MoveWindow
(
child1
,
5
,
5
,
10
,
10
,
FALSE
);
ok
(
ret
,
"MoveWindow failed: %u
\n
"
,
GetLastError
()
);
/* destroying child1 ourselves succeeds */
ret
=
DestroyWindow
(
child1
);
ok
(
ret
,
"DestroyWindow returned %u
\n
"
,
ret
);
...
...
@@ -12789,7 +12797,8 @@ static void test_DragDetect(void)
static
LRESULT
WINAPI
ncdestroy_test_proc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wp
,
LPARAM
lp
)
{
unsigned
int
ret
;
HWND
parent
;
HWND
parent
,
child
;
RECT
rect
,
exp
;
switch
(
msg
)
{
...
...
@@ -12805,6 +12814,25 @@ static LRESULT WINAPI ncdestroy_test_proc( HWND hwnd, UINT msg, WPARAM wp, LPARA
parent
=
SetParent
(
hwnd
,
hwndMain
);
ok
(
parent
==
0
,
"SetParent returned %p
\n
"
,
parent
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"got error %u
\n
"
,
GetLastError
()
);
ret
=
GetWindowRect
(
hwnd
,
&
rect
);
ok
(
ret
,
"GetWindowRect failed: %u
\n
"
,
GetLastError
()
);
SetRect
(
&
exp
,
10
,
20
,
110
,
220
);
ok
(
EqualRect
(
&
rect
,
&
exp
),
"unexpected rect %s, expected %s
\n
"
,
wine_dbgstr_rect
(
&
rect
),
wine_dbgstr_rect
(
&
exp
));
ret
=
MoveWindow
(
hwnd
,
11
,
12
,
20
,
30
,
FALSE
);
ok
(
ret
,
"MoveWindow failed: %u
\n
"
,
GetLastError
()
);
ret
=
GetWindowRect
(
hwnd
,
&
rect
);
ok
(
ret
,
"GetWindowRect failed: %u
\n
"
,
GetLastError
()
);
SetRect
(
&
exp
,
11
,
12
,
31
,
42
);
ok
(
EqualRect
(
&
rect
,
&
exp
),
"unexpected rect %s, expected %s
\n
"
,
wine_dbgstr_rect
(
&
rect
),
wine_dbgstr_rect
(
&
exp
));
child
=
CreateWindowExA
(
0
,
"ToolWindowClass"
,
"Tool window 1"
,
WS_CHILD
,
0
,
0
,
100
,
100
,
hwnd
,
0
,
0
,
NULL
);
ok
(
!
child
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"CreateWindowExA returned %p %u
\n
"
,
child
,
GetLastError
()
);
break
;
}
...
...
@@ -12816,6 +12844,7 @@ static void test_ncdestroy(void)
HWND
hwnd
;
hwnd
=
create_tool_window
(
WS_POPUP
,
0
);
SetWindowLongPtrW
(
hwnd
,
GWLP_WNDPROC
,
(
LONG_PTR
)
ncdestroy_test_proc
);
MoveWindow
(
hwnd
,
10
,
20
,
100
,
200
,
FALSE
);
DestroyWindow
(
hwnd
);
}
...
...
server/window.c
View file @
3cbccd44
...
...
@@ -2025,7 +2025,15 @@ DECL_HANDLER(create_window)
atom_t
atom
;
reply
->
handle
=
0
;
if
(
req
->
parent
&&
!
(
parent
=
get_window
(
req
->
parent
)))
return
;
if
(
req
->
parent
)
{
if
(
!
(
parent
=
get_window
(
req
->
parent
)))
return
;
if
(
is_orphan_window
(
parent
))
{
set_error
(
STATUS_INVALID_PARAMETER
);
return
;
}
}
if
(
req
->
owner
)
{
...
...
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