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
dfe6ae58
Commit
dfe6ae58
authored
Aug 04, 2010
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Aug 04, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Protect from setting as a window owner one of its successors.
parent
884b7665
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletion
+21
-1
win.c
dlls/user32/tests/win.c
+9
-0
window.c
server/window.c
+12
-1
No files found.
dlls/user32/tests/win.c
View file @
dfe6ae58
...
...
@@ -380,6 +380,15 @@ static void test_parent_owner(void)
check_parents
(
test
,
desktop
,
0
,
desktop
,
0
,
test
,
desktop
);
/* window is now child of desktop so GWLP_HWNDPARENT changes owner from now on */
if
(
!
is_win9x
)
{
ret
=
(
HWND
)
SetWindowLongPtrA
(
test
,
GWLP_HWNDPARENT
,
(
LONG_PTR
)
test
);
ok
(
ret
==
0
,
"GWL_HWNDPARENT return value %p expected 0
\n
"
,
ret
);
check_parents
(
test
,
desktop
,
0
,
desktop
,
0
,
test
,
desktop
);
}
else
win_skip
(
"Test creates circular window tree under Win9x/WinMe
\n
"
);
ret
=
(
HWND
)
SetWindowLongPtrA
(
test
,
GWLP_HWNDPARENT
,
(
LONG_PTR
)
child
);
ok
(
ret
==
0
,
"GWL_HWNDPARENT return value %p expected 0
\n
"
,
ret
);
check_parents
(
test
,
desktop
,
child
,
desktop
,
child
,
test
,
desktop
);
...
...
server/window.c
View file @
dfe6ae58
...
...
@@ -1834,7 +1834,7 @@ DECL_HANDLER(get_desktop_window)
DECL_HANDLER
(
set_window_owner
)
{
struct
window
*
win
=
get_window
(
req
->
handle
);
struct
window
*
owner
=
NULL
;
struct
window
*
owner
=
NULL
,
*
ptr
;
if
(
!
win
)
return
;
if
(
req
->
owner
&&
!
(
owner
=
get_window
(
req
->
owner
)))
return
;
...
...
@@ -1843,6 +1843,17 @@ DECL_HANDLER(set_window_owner)
set_error
(
STATUS_ACCESS_DENIED
);
return
;
}
/* make sure owner is not a successor of window */
for
(
ptr
=
owner
;
ptr
;
ptr
=
ptr
->
owner
?
get_window
(
ptr
->
owner
)
:
NULL
)
{
if
(
ptr
==
win
)
{
set_error
(
STATUS_INVALID_PARAMETER
);
return
;
}
}
reply
->
prev_owner
=
win
->
owner
;
reply
->
full_owner
=
win
->
owner
=
owner
?
owner
->
handle
:
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