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
97903d26
Commit
97903d26
authored
Nov 26, 2003
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for inter-process GetWindowLong on the window extra
bytes.
parent
d78dfc8e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
56 additions
and
8 deletions
+56
-8
server_protocol.h
include/wine/server_protocol.h
+7
-1
protocol.def
server/protocol.def
+6
-0
trace.c
server/trace.c
+7
-3
window.c
server/window.c
+36
-4
win.c
windows/win.c
+0
-0
No files found.
include/wine/server_protocol.h
View file @
97903d26
...
...
@@ -2525,6 +2525,7 @@ struct create_window_request
user_handle_t
parent
;
user_handle_t
owner
;
atom_t
atom
;
int
extra
;
};
struct
create_window_reply
{
...
...
@@ -2603,6 +2604,8 @@ struct set_window_info_request
unsigned
int
id
;
void
*
instance
;
void
*
user_data
;
int
extra_offset
;
unsigned
int
extra_value
;
};
struct
set_window_info_reply
{
...
...
@@ -2612,12 +2615,15 @@ struct set_window_info_reply
unsigned
int
old_id
;
void
*
old_instance
;
void
*
old_user_data
;
unsigned
int
old_extra_value
;
};
#define SET_WIN_STYLE 0x01
#define SET_WIN_EXSTYLE 0x02
#define SET_WIN_ID 0x04
#define SET_WIN_INSTANCE 0x08
#define SET_WIN_USERDATA 0x10
#define SET_WIN_EXTRAWORD 0x20
#define SET_WIN_EXTRALONG 0x40
...
...
@@ -3667,6 +3673,6 @@ union generic_reply
struct
set_global_windows_reply
set_global_windows_reply
;
};
#define SERVER_PROTOCOL_VERSION 12
6
#define SERVER_PROTOCOL_VERSION 12
7
#endif
/* __WINE_WINE_SERVER_PROTOCOL_H */
server/protocol.def
View file @
97903d26
...
...
@@ -1780,6 +1780,7 @@ enum message_type
user_handle_t parent; /* parent window */
user_handle_t owner; /* owner window */
atom_t atom; /* class atom */
int extra; /* number of extra bytes */
@REPLY
user_handle_t handle; /* created window */
@END
...
...
@@ -1832,18 +1833,23 @@ enum message_type
unsigned int id; /* window id */
void* instance; /* creator instance */
void* user_data; /* user-specific data */
int extra_offset; /* offset to set in extra bytes */
unsigned int extra_value; /* value to set in extra bytes */
@REPLY
unsigned int old_style; /* old window style */
unsigned int old_ex_style; /* old window extended style */
unsigned int old_id; /* old window id */
void* old_instance; /* old creator instance */
void* old_user_data; /* old user-specific data */
unsigned int old_extra_value; /* old value in extra bytes */
@END
#define SET_WIN_STYLE 0x01
#define SET_WIN_EXSTYLE 0x02
#define SET_WIN_ID 0x04
#define SET_WIN_INSTANCE 0x08
#define SET_WIN_USERDATA 0x10
#define SET_WIN_EXTRAWORD 0x20
#define SET_WIN_EXTRALONG 0x40
/* Get a list of the window parents, up to the root of the tree */
...
...
server/trace.c
View file @
97903d26
...
...
@@ -2095,7 +2095,8 @@ static void dump_create_window_request( const struct create_window_request *req
{
fprintf
(
stderr
,
" parent=%p,"
,
req
->
parent
);
fprintf
(
stderr
,
" owner=%p,"
,
req
->
owner
);
fprintf
(
stderr
,
" atom=%04x"
,
req
->
atom
);
fprintf
(
stderr
,
" atom=%04x,"
,
req
->
atom
);
fprintf
(
stderr
,
" extra=%d"
,
req
->
extra
);
}
static
void
dump_create_window_reply
(
const
struct
create_window_reply
*
req
)
...
...
@@ -2154,7 +2155,9 @@ static void dump_set_window_info_request( const struct set_window_info_request *
fprintf
(
stderr
,
" ex_style=%08x,"
,
req
->
ex_style
);
fprintf
(
stderr
,
" id=%08x,"
,
req
->
id
);
fprintf
(
stderr
,
" instance=%p,"
,
req
->
instance
);
fprintf
(
stderr
,
" user_data=%p"
,
req
->
user_data
);
fprintf
(
stderr
,
" user_data=%p,"
,
req
->
user_data
);
fprintf
(
stderr
,
" extra_offset=%d,"
,
req
->
extra_offset
);
fprintf
(
stderr
,
" extra_value=%08x"
,
req
->
extra_value
);
}
static
void
dump_set_window_info_reply
(
const
struct
set_window_info_reply
*
req
)
...
...
@@ -2163,7 +2166,8 @@ static void dump_set_window_info_reply( const struct set_window_info_reply *req
fprintf
(
stderr
,
" old_ex_style=%08x,"
,
req
->
old_ex_style
);
fprintf
(
stderr
,
" old_id=%08x,"
,
req
->
old_id
);
fprintf
(
stderr
,
" old_instance=%p,"
,
req
->
old_instance
);
fprintf
(
stderr
,
" old_user_data=%p"
,
req
->
old_user_data
);
fprintf
(
stderr
,
" old_user_data=%p,"
,
req
->
old_user_data
);
fprintf
(
stderr
,
" old_extra_value=%08x"
,
req
->
old_extra_value
);
}
static
void
dump_get_window_parents_request
(
const
struct
get_window_parents_request
*
req
)
...
...
server/window.c
View file @
97903d26
...
...
@@ -77,6 +77,8 @@ struct window
int
prop_inuse
;
/* number of in-use window properties */
int
prop_alloc
;
/* number of allocated window properties */
struct
property
*
properties
;
/* window properties array */
int
nb_extra_bytes
;
/* number of extra bytes */
char
extra_bytes
[
1
];
/* extra bytes storage */
};
static
struct
window
*
top_window
;
/* top-level (desktop) window */
...
...
@@ -264,9 +266,10 @@ static void destroy_window( struct window *win )
}
/* create a new window structure (note: the window is not linked in the window tree) */
static
struct
window
*
create_window
(
struct
window
*
parent
,
struct
window
*
owner
,
atom_t
atom
)
static
struct
window
*
create_window
(
struct
window
*
parent
,
struct
window
*
owner
,
atom_t
atom
,
int
extra_bytes
)
{
struct
window
*
win
=
mem_alloc
(
sizeof
(
*
win
)
);
struct
window
*
win
=
mem_alloc
(
sizeof
(
*
win
)
+
extra_bytes
-
1
);
if
(
!
win
)
return
NULL
;
if
(
!
(
win
->
handle
=
alloc_user_handle
(
win
,
USER_WINDOW
)))
...
...
@@ -292,6 +295,8 @@ static struct window *create_window( struct window *parent, struct window *owner
win
->
prop_inuse
=
0
;
win
->
prop_alloc
=
0
;
win
->
properties
=
NULL
;
win
->
nb_extra_bytes
=
extra_bytes
;
memset
(
win
->
extra_bytes
,
0
,
extra_bytes
);
if
(
parent
)
/* put it on parent unlinked list */
{
...
...
@@ -448,11 +453,16 @@ user_handle_t find_window_to_repaint( user_handle_t parent, struct thread *threa
DECL_HANDLER
(
create_window
)
{
reply
->
handle
=
0
;
if
(
req
->
extra
<
0
||
req
->
extra
>
4096
)
/* don't allow stupid values here */
{
set_error
(
STATUS_INVALID_PARAMETER
);
return
;
}
if
(
!
req
->
parent
)
/* return desktop window */
{
if
(
!
top_window
)
{
if
(
!
(
top_window
=
create_window
(
NULL
,
NULL
,
req
->
atom
)))
return
;
if
(
!
(
top_window
=
create_window
(
NULL
,
NULL
,
req
->
atom
,
req
->
extra
)))
return
;
top_window
->
thread
=
NULL
;
/* no thread owns the desktop */
top_window
->
style
=
WS_POPUP
|
WS_VISIBLE
|
WS_CLIPSIBLINGS
|
WS_CLIPCHILDREN
;
}
...
...
@@ -471,7 +481,7 @@ DECL_HANDLER(create_window)
set_error
(
STATUS_ACCESS_DENIED
);
return
;
}
if
(
!
(
win
=
create_window
(
parent
,
owner
,
req
->
atom
)))
return
;
if
(
!
(
win
=
create_window
(
parent
,
owner
,
req
->
atom
,
req
->
extra
)))
return
;
reply
->
handle
=
win
->
handle
;
}
}
...
...
@@ -576,6 +586,22 @@ DECL_HANDLER(set_window_info)
set_error
(
STATUS_ACCESS_DENIED
);
return
;
}
if
(
req
->
extra_offset
<
-
1
||
req
->
extra_offset
>=
win
->
nb_extra_bytes
)
{
set_error
(
STATUS_INVALID_PARAMETER
);
return
;
}
if
(
req
->
extra_offset
!=
-
1
)
{
memcpy
(
&
reply
->
old_extra_value
,
win
->
extra_bytes
+
req
->
extra_offset
,
min
(
sizeof
(
reply
->
old_extra_value
),
(
size_t
)(
win
->
nb_extra_bytes
-
req
->
extra_offset
)
));
}
else
if
(
req
->
flags
&
(
SET_WIN_EXTRAWORD
|
SET_WIN_EXTRALONG
))
{
set_error
(
STATUS_INVALID_PARAMETER
);
return
;
}
reply
->
old_style
=
win
->
style
;
reply
->
old_ex_style
=
win
->
ex_style
;
reply
->
old_id
=
win
->
id
;
...
...
@@ -586,6 +612,12 @@ DECL_HANDLER(set_window_info)
if
(
req
->
flags
&
SET_WIN_ID
)
win
->
id
=
req
->
id
;
if
(
req
->
flags
&
SET_WIN_INSTANCE
)
win
->
instance
=
req
->
instance
;
if
(
req
->
flags
&
SET_WIN_USERDATA
)
win
->
user_data
=
req
->
user_data
;
if
(
req
->
flags
&
(
SET_WIN_EXTRAWORD
|
SET_WIN_EXTRALONG
))
{
const
int
len
=
(
req
->
flags
&
SET_WIN_EXTRALONG
)
?
sizeof
(
int
)
:
sizeof
(
short
);
memcpy
(
win
->
extra_bytes
+
req
->
extra_offset
,
&
req
->
extra_value
,
min
(
len
,
win
->
nb_extra_bytes
-
req
->
extra_offset
));
}
}
...
...
windows/win.c
View file @
97903d26
This diff is collapsed.
Click to expand it.
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