Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
c5c10198
Commit
c5c10198
authored
Jun 08, 2018
by
Zebediah Figura
Committed by
Vitaly Lipatov
Jul 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Add a request to get the eventfd file descriptor associated with a waitable handle.
parent
790031ac
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
83 additions
and
1 deletion
+83
-1
server_protocol.h
include/wine/server_protocol.h
+17
-1
esync.c
server/esync.c
+37
-0
protocol.def
server/protocol.def
+8
-0
request.h
server/request.h
+7
-0
trace.c
server/trace.c
+14
-0
No files found.
include/wine/server_protocol.h
View file @
c5c10198
...
...
@@ -5508,6 +5508,19 @@ struct create_esync_reply
};
struct
get_esync_fd_request
{
struct
request_header
__header
;
obj_handle_t
handle
;
};
struct
get_esync_fd_reply
{
struct
reply_header
__header
;
int
type
;
unsigned
int
shm_idx
;
};
enum
request
{
REQ_new_process
,
...
...
@@ -5788,6 +5801,7 @@ enum request
REQ_resume_process
,
REQ_get_next_thread
,
REQ_create_esync
,
REQ_get_esync_fd
,
REQ_NB_REQUESTS
};
...
...
@@ -6073,6 +6087,7 @@ union generic_request
struct
resume_process_request
resume_process_request
;
struct
get_next_thread_request
get_next_thread_request
;
struct
create_esync_request
create_esync_request
;
struct
get_esync_fd_request
get_esync_fd_request
;
};
union
generic_reply
{
...
...
@@ -6356,11 +6371,12 @@ union generic_reply
struct
resume_process_reply
resume_process_reply
;
struct
get_next_thread_reply
get_next_thread_reply
;
struct
create_esync_reply
create_esync_reply
;
struct
get_esync_fd_reply
get_esync_fd_reply
;
};
/* ### protocol_version begin ### */
#define SERVER_PROTOCOL_VERSION 75
8
#define SERVER_PROTOCOL_VERSION 75
9
/* ### protocol_version end ### */
...
...
server/esync.c
View file @
c5c10198
...
...
@@ -333,3 +333,40 @@ DECL_HANDLER(create_esync)
if
(
root
)
release_object
(
root
);
}
/* Retrieve a file descriptor for an esync object which will be signaled by the
* server. The client should only read from (i.e. wait on) this object. */
DECL_HANDLER
(
get_esync_fd
)
{
struct
object
*
obj
;
enum
esync_type
type
;
int
fd
;
if
(
!
(
obj
=
get_handle_obj
(
current
->
process
,
req
->
handle
,
SYNCHRONIZE
,
NULL
)))
return
;
if
(
obj
->
ops
->
get_esync_fd
)
{
fd
=
obj
->
ops
->
get_esync_fd
(
obj
,
&
type
);
reply
->
type
=
type
;
if
(
obj
->
ops
==
&
esync_ops
)
{
struct
esync
*
esync
=
(
struct
esync
*
)
obj
;
reply
->
shm_idx
=
esync
->
shm_idx
;
}
else
reply
->
shm_idx
=
0
;
send_client_fd
(
current
->
process
,
fd
,
req
->
handle
);
}
else
{
if
(
debug_level
)
{
fprintf
(
stderr
,
"%04x: esync: can't wait on object: "
,
current
->
id
);
obj
->
ops
->
dump
(
obj
,
0
);
}
set_error
(
STATUS_NOT_IMPLEMENTED
);
}
release_object
(
obj
);
}
server/protocol.def
View file @
c5c10198
...
...
@@ -3789,3 +3789,11 @@ enum esync_type
int type; /* actual type (may be different for events) */
unsigned int shm_idx;
@END
/* Retrieve the esync fd for an object. */
@REQ(get_esync_fd)
obj_handle_t handle; /* handle to the object */
@REPLY
int type;
unsigned int shm_idx;
@END
server/request.h
View file @
c5c10198
...
...
@@ -397,6 +397,7 @@ DECL_HANDLER(suspend_process);
DECL_HANDLER
(
resume_process
);
DECL_HANDLER
(
get_next_thread
);
DECL_HANDLER
(
create_esync
);
DECL_HANDLER
(
get_esync_fd
);
#ifdef WANT_REQUEST_HANDLERS
...
...
@@ -681,6 +682,7 @@ static const req_handler req_handlers[REQ_NB_REQUESTS] =
(
req_handler
)
req_resume_process
,
(
req_handler
)
req_get_next_thread
,
(
req_handler
)
req_create_esync
,
(
req_handler
)
req_get_esync_fd
,
};
C_ASSERT
(
sizeof
(
abstime_t
)
==
8
);
...
...
@@ -2279,6 +2281,11 @@ C_ASSERT( FIELD_OFFSET(struct create_esync_reply, handle) == 8 );
C_ASSERT
(
FIELD_OFFSET
(
struct
create_esync_reply
,
type
)
==
12
);
C_ASSERT
(
FIELD_OFFSET
(
struct
create_esync_reply
,
shm_idx
)
==
16
);
C_ASSERT
(
sizeof
(
struct
create_esync_reply
)
==
24
);
C_ASSERT
(
FIELD_OFFSET
(
struct
get_esync_fd_request
,
handle
)
==
12
);
C_ASSERT
(
sizeof
(
struct
get_esync_fd_request
)
==
16
);
C_ASSERT
(
FIELD_OFFSET
(
struct
get_esync_fd_reply
,
type
)
==
8
);
C_ASSERT
(
FIELD_OFFSET
(
struct
get_esync_fd_reply
,
shm_idx
)
==
12
);
C_ASSERT
(
sizeof
(
struct
get_esync_fd_reply
)
==
16
);
#endif
/* WANT_REQUEST_HANDLERS */
...
...
server/trace.c
View file @
c5c10198
...
...
@@ -4516,6 +4516,17 @@ static void dump_create_esync_reply( const struct create_esync_reply *req )
fprintf
(
stderr
,
", shm_idx=%08x"
,
req
->
shm_idx
);
}
static
void
dump_get_esync_fd_request
(
const
struct
get_esync_fd_request
*
req
)
{
fprintf
(
stderr
,
" handle=%04x"
,
req
->
handle
);
}
static
void
dump_get_esync_fd_reply
(
const
struct
get_esync_fd_reply
*
req
)
{
fprintf
(
stderr
,
" type=%d"
,
req
->
type
);
fprintf
(
stderr
,
", shm_idx=%08x"
,
req
->
shm_idx
);
}
static
const
dump_func
req_dumpers
[
REQ_NB_REQUESTS
]
=
{
(
dump_func
)
dump_new_process_request
,
(
dump_func
)
dump_get_new_process_info_request
,
...
...
@@ -4795,6 +4806,7 @@ static const dump_func req_dumpers[REQ_NB_REQUESTS] = {
(
dump_func
)
dump_resume_process_request
,
(
dump_func
)
dump_get_next_thread_request
,
(
dump_func
)
dump_create_esync_request
,
(
dump_func
)
dump_get_esync_fd_request
,
};
static
const
dump_func
reply_dumpers
[
REQ_NB_REQUESTS
]
=
{
...
...
@@ -5076,6 +5088,7 @@ static const dump_func reply_dumpers[REQ_NB_REQUESTS] = {
NULL
,
(
dump_func
)
dump_get_next_thread_reply
,
(
dump_func
)
dump_create_esync_reply
,
(
dump_func
)
dump_get_esync_fd_reply
,
};
static
const
char
*
const
req_names
[
REQ_NB_REQUESTS
]
=
{
...
...
@@ -5357,6 +5370,7 @@ static const char * const req_names[REQ_NB_REQUESTS] = {
"resume_process"
,
"get_next_thread"
,
"create_esync"
,
"get_esync_fd"
,
};
static
const
struct
...
...
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