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
4be3d4c1
Commit
4be3d4c1
authored
Mar 06, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Return real parent and owner in the create_window request.
Remove computing of parent and owner handles on the client side.
parent
f874d20f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
20 deletions
+30
-20
win.c
dlls/user/win.c
+19
-19
server_protocol.h
include/wine/server_protocol.h
+3
-1
protocol.def
server/protocol.def
+2
-0
trace.c
server/trace.c
+2
-0
window.c
server/window.c
+4
-0
No files found.
dlls/user/win.c
View file @
4be3d4c1
...
...
@@ -59,6 +59,7 @@ static WND *create_window_handle( HWND parent, HWND owner, ATOM atom,
{
WORD
index
;
WND
*
win
;
HWND
full_parent
=
0
,
full_owner
=
0
;
struct
tagCLASS
*
class
=
NULL
;
user_handle_t
handle
=
0
;
int
extra_bytes
=
0
;
...
...
@@ -76,6 +77,8 @@ static WND *create_window_handle( HWND parent, HWND owner, ATOM atom,
if
(
!
wine_server_call_err
(
req
))
{
handle
=
reply
->
handle
;
full_parent
=
reply
->
parent
;
full_owner
=
reply
->
owner
;
extra_bytes
=
reply
->
extra
;
class
=
reply
->
class_ptr
;
}
...
...
@@ -106,6 +109,8 @@ static WND *create_window_handle( HWND parent, HWND owner, ATOM atom,
assert
(
index
<
NB_USER_HANDLES
);
user_handles
[
index
]
=
win
;
win
->
hwndSelf
=
handle
;
win
->
parent
=
full_parent
;
win
->
owner
=
full_owner
;
win
->
dwMagic
=
WND_MAGIC
;
win
->
cbWndExtra
=
extra_bytes
;
memset
(
win
->
wExtra
,
0
,
extra_bytes
);
...
...
@@ -915,7 +920,7 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, ATOM classAtom,
/* Find the parent window */
parent
=
GetDesktopWindow
()
;
parent
=
cs
->
hwndParent
;
owner
=
0
;
if
(
cs
->
hwndParent
==
HWND_MESSAGE
)
...
...
@@ -924,24 +929,24 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, ATOM classAtom,
* message window (style: WS_POPUP|WS_DISABLED)
*/
FIXME
(
"Parent is HWND_MESSAGE
\n
"
);
parent
=
GetDesktopWindow
();
}
else
if
(
cs
->
hwndParent
)
{
/* Make sure parent is valid */
if
(
!
IsWindow
(
cs
->
hwndParent
))
if
((
cs
->
style
&
(
WS_CHILD
|
WS_POPUP
))
!=
WS_CHILD
)
{
WARN
(
"Bad parent %p
\n
"
,
cs
->
hwndParent
);
return
0
;
}
if
((
cs
->
style
&
(
WS_CHILD
|
WS_POPUP
))
==
WS_CHILD
)
parent
=
WIN_GetFullHandle
(
cs
->
hwndParent
);
else
owner
=
GetAncestor
(
cs
->
hwndParent
,
GA_ROOT
);
parent
=
GetDesktopWindow
();
owner
=
cs
->
hwndParent
;
}
}
else
if
((
cs
->
style
&
(
WS_CHILD
|
WS_POPUP
))
==
WS_CHILD
)
else
{
WARN
(
"No parent for child window
\n
"
);
return
0
;
/* WS_CHILD needs a parent, but WS_POPUP doesn't */
if
((
cs
->
style
&
(
WS_CHILD
|
WS_POPUP
))
==
WS_CHILD
)
{
WARN
(
"No parent for child window
\n
"
);
return
0
;
/* WS_CHILD needs a parent, but WS_POPUP doesn't */
}
parent
=
GetDesktopWindow
();
}
WIN_FixCoordinates
(
cs
,
&
sw
);
/* fix default coordinates */
...
...
@@ -956,17 +961,12 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, ATOM classAtom,
/* Create the window structure */
if
(
!
(
wndPtr
=
create_window_handle
(
parent
,
owner
,
classAtom
,
cs
->
hInstance
,
type
)))
{
TRACE
(
"out of memory
\n
"
);
return
0
;
}
return
0
;
hwnd
=
wndPtr
->
hwndSelf
;
/* Fill the window structure */
wndPtr
->
tid
=
GetCurrentThreadId
();
wndPtr
->
owner
=
owner
;
wndPtr
->
parent
=
parent
;
wndPtr
->
hInstance
=
cs
->
hInstance
;
wndPtr
->
text
=
NULL
;
wndPtr
->
dwStyle
=
cs
->
style
&
~
WS_VISIBLE
;
...
...
include/wine/server_protocol.h
View file @
4be3d4c1
...
...
@@ -2520,6 +2520,8 @@ struct create_window_reply
{
struct
reply_header
__header
;
user_handle_t
handle
;
user_handle_t
parent
;
user_handle_t
owner
;
int
extra
;
void
*
class_ptr
;
};
...
...
@@ -4358,6 +4360,6 @@ union generic_reply
struct
query_symlink_reply
query_symlink_reply
;
};
#define SERVER_PROTOCOL_VERSION 2
29
#define SERVER_PROTOCOL_VERSION 2
30
#endif
/* __WINE_WINE_SERVER_PROTOCOL_H */
server/protocol.def
View file @
4be3d4c1
...
...
@@ -1789,6 +1789,8 @@ enum message_type
void* instance; /* module instance */
@REPLY
user_handle_t handle; /* created window */
user_handle_t parent; /* full handle of parent */
user_handle_t owner; /* full handle of owner */
int extra; /* number of extra bytes */
void* class_ptr; /* pointer to class in client address space */
@END
...
...
server/trace.c
View file @
4be3d4c1
...
...
@@ -2267,6 +2267,8 @@ static void dump_create_window_request( const struct create_window_request *req
static
void
dump_create_window_reply
(
const
struct
create_window_reply
*
req
)
{
fprintf
(
stderr
,
" handle=%p,"
,
req
->
handle
);
fprintf
(
stderr
,
" parent=%p,"
,
req
->
parent
);
fprintf
(
stderr
,
" owner=%p,"
,
req
->
owner
);
fprintf
(
stderr
,
" extra=%d,"
,
req
->
extra
);
fprintf
(
stderr
,
" class_ptr=%p"
,
req
->
class_ptr
);
}
...
...
server/window.c
View file @
4be3d4c1
...
...
@@ -1372,10 +1372,14 @@ DECL_HANDLER(create_window)
set_error
(
STATUS_ACCESS_DENIED
);
return
;
}
else
/* owner must be a top-level window */
while
(
!
is_desktop_window
(
owner
->
parent
))
owner
=
owner
->
parent
;
}
if
(
!
(
win
=
create_window
(
parent
,
owner
,
req
->
atom
,
req
->
instance
)))
return
;
reply
->
handle
=
win
->
handle
;
reply
->
parent
=
win
->
parent
?
win
->
parent
->
handle
:
0
;
reply
->
owner
=
win
->
owner
;
reply
->
extra
=
win
->
nb_extra_bytes
;
reply
->
class_ptr
=
get_class_client_ptr
(
win
->
class
);
}
...
...
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