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
367577c0
Commit
367577c0
authored
Feb 26, 2014
by
Piotr Caban
Committed by
Alexandre Julliard
Feb 27, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Check WS_CHILD style in IsChild function.
parent
c60e81b7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
5 deletions
+26
-5
win.c
dlls/user32/tests/win.c
+13
-0
win.c
dlls/user32/win.c
+13
-5
No files found.
dlls/user32/tests/win.c
View file @
367577c0
...
...
@@ -3675,6 +3675,19 @@ static void test_SetParent(void)
ok
(
SetParent
(
sibling
,
parent
)
!=
0
,
"SetParent should not fail
\n
"
);
ok
(
GetMenu
(
sibling
)
==
hMenu
,
"SetParent should not remove menu
\n
"
);
ok
(
SetParent
(
parent
,
desktop
)
!=
0
,
"SetParent should not fail
\n
"
);
ok
(
SetParent
(
child4
,
child3
)
!=
0
,
"SetParent should not fail
\n
"
);
ok
(
SetParent
(
child3
,
child2
)
!=
0
,
"SetParent should not fail
\n
"
);
ok
(
SetParent
(
child2
,
child1
)
!=
0
,
"SetParent should not fail
\n
"
);
ok
(
!
IsChild
(
child3
,
child4
),
"wrong parent/child %p/%p
\n
"
,
child3
,
child4
);
SetWindowLongW
(
child4
,
GWL_STYLE
,
WS_CHILD
);
ok
(
IsChild
(
child3
,
child4
),
"wrong parent/child %p/%p
\n
"
,
child3
,
child4
);
ok
(
IsChild
(
child2
,
child4
),
"wrong parent/child %p/%p
\n
"
,
child2
,
child4
);
ok
(
!
IsChild
(
child1
,
child4
),
"wrong parent/child %p/%p
\n
"
,
child1
,
child4
);
SetWindowLongW
(
child2
,
GWL_STYLE
,
WS_CHILD
);
ok
(
IsChild
(
child1
,
child4
),
"wrong parent/child %p/%p
\n
"
,
child1
,
child4
);
ok
(
IsChild
(
parent
,
child4
),
"wrong parent/child %p/%p
\n
"
,
parent
,
child4
);
ok
(
DestroyWindow
(
parent
),
"DestroyWindow() failed
\n
"
);
ok
(
!
IsWindow
(
parent
),
"parent still exists
\n
"
);
...
...
dlls/user32/win.c
View file @
367577c0
...
...
@@ -3043,14 +3043,22 @@ HWND WINAPI SetParent( HWND hwnd, HWND parent )
*/
BOOL
WINAPI
IsChild
(
HWND
parent
,
HWND
child
)
{
HWND
*
list
=
list_window_parents
(
child
)
;
HWND
*
list
;
int
i
;
BOOL
ret
;
BOOL
ret
=
FALSE
;
if
(
!
list
)
return
FALSE
;
if
(
!
(
GetWindowLongW
(
child
,
GWL_STYLE
)
&
WS_CHILD
))
return
FALSE
;
if
(
!
(
list
=
list_window_parents
(
child
)))
return
FALSE
;
parent
=
WIN_GetFullHandle
(
parent
);
for
(
i
=
0
;
list
[
i
];
i
++
)
if
(
list
[
i
]
==
parent
)
break
;
ret
=
list
[
i
]
&&
list
[
i
+
1
];
for
(
i
=
0
;
list
[
i
];
i
++
)
{
if
(
list
[
i
]
==
parent
)
{
ret
=
list
[
i
]
&&
list
[
i
+
1
];
break
;
}
if
(
!
(
GetWindowLongW
(
list
[
i
],
GWL_STYLE
)
&
WS_CHILD
))
break
;
}
HeapFree
(
GetProcessHeap
(),
0
,
list
);
return
ret
;
}
...
...
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