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
4f9cc931
Commit
4f9cc931
authored
Apr 10, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Apr 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Introduce a separated type for user APCs.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
320a0258
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
57 additions
and
31 deletions
+57
-31
server.c
dlls/ntdll/server.c
+24
-10
thread.c
dlls/ntdll/thread.c
+5
-5
server_protocol.h
include/wine/server_protocol.h
+7
-1
async.c
server/async.c
+5
-5
protocol.def
server/protocol.def
+6
-0
timer.c
server/timer.c
+4
-4
trace.c
server/trace.c
+6
-6
No files found.
dlls/ntdll/server.c
View file @
4f9cc931
...
...
@@ -381,6 +381,29 @@ int wait_select_reply( void *cookie )
}
static
void
invoke_user_apc
(
const
user_apc_t
*
apc
)
{
switch
(
apc
->
type
)
{
case
APC_USER
:
{
void
(
WINAPI
*
func
)(
ULONG_PTR
,
ULONG_PTR
,
ULONG_PTR
)
=
wine_server_get_ptr
(
apc
->
user
.
func
);
func
(
apc
->
user
.
args
[
0
],
apc
->
user
.
args
[
1
],
apc
->
user
.
args
[
2
]
);
break
;
}
case
APC_TIMER
:
{
void
(
WINAPI
*
func
)(
void
*
,
unsigned
int
,
unsigned
int
)
=
wine_server_get_ptr
(
apc
->
user
.
func
);
func
(
wine_server_get_ptr
(
apc
->
user
.
args
[
1
]
),
(
DWORD
)
apc
->
timer
.
time
,
(
DWORD
)(
apc
->
timer
.
time
>>
32
)
);
break
;
}
default:
server_protocol_error
(
"get_apc_request: bad type %d
\n
"
,
apc
->
type
);
break
;
}
}
/***********************************************************************
* invoke_apc
*
...
...
@@ -400,18 +423,9 @@ void invoke_apc( const apc_call_t *call, apc_result_t *result )
case
APC_NONE
:
break
;
case
APC_USER
:
{
void
(
WINAPI
*
func
)(
ULONG_PTR
,
ULONG_PTR
,
ULONG_PTR
)
=
wine_server_get_ptr
(
call
->
user
.
func
);
func
(
call
->
user
.
args
[
0
],
call
->
user
.
args
[
1
],
call
->
user
.
args
[
2
]
);
break
;
}
case
APC_TIMER
:
{
void
(
WINAPI
*
func
)(
void
*
,
unsigned
int
,
unsigned
int
)
=
wine_server_get_ptr
(
call
->
timer
.
func
);
func
(
wine_server_get_ptr
(
call
->
timer
.
arg
),
(
DWORD
)
call
->
timer
.
time
,
(
DWORD
)(
call
->
timer
.
time
>>
32
)
);
invoke_user_apc
(
&
call
->
user
);
break
;
}
case
APC_ASYNC_IO
:
{
IO_STATUS_BLOCK
*
iosb
=
wine_server_get_ptr
(
call
->
async_io
.
sb
);
...
...
dlls/ntdll/thread.c
View file @
4f9cc931
...
...
@@ -739,11 +739,11 @@ NTSTATUS WINAPI NtQueueApcThread( HANDLE handle, PNTAPCFUNC func, ULONG_PTR arg1
req
->
handle
=
wine_server_obj_handle
(
handle
);
if
(
func
)
{
req
->
call
.
type
=
APC_USER
;
req
->
call
.
user
.
func
=
wine_server_client_ptr
(
func
);
req
->
call
.
user
.
args
[
0
]
=
arg1
;
req
->
call
.
user
.
args
[
1
]
=
arg2
;
req
->
call
.
user
.
args
[
2
]
=
arg3
;
req
->
call
.
type
=
APC_USER
;
req
->
call
.
user
.
user
.
func
=
wine_server_client_ptr
(
func
);
req
->
call
.
user
.
user
.
args
[
0
]
=
arg1
;
req
->
call
.
user
.
user
.
args
[
1
]
=
arg2
;
req
->
call
.
user
.
user
.
args
[
2
]
=
arg3
;
}
else
req
->
call
.
type
=
APC_NONE
;
/* wake up only */
ret
=
wine_server_call
(
req
);
...
...
include/wine/server_protocol.h
View file @
4f9cc931
...
...
@@ -474,6 +474,12 @@ typedef union
abstime_t
time
;
client_ptr_t
arg
;
}
timer
;
}
user_apc_t
;
typedef
union
{
enum
apc_type
type
;
user_apc_t
user
;
struct
{
enum
apc_type
type
;
...
...
@@ -6710,7 +6716,7 @@ union generic_reply
/* ### protocol_version begin ### */
#define SERVER_PROTOCOL_VERSION 59
7
#define SERVER_PROTOCOL_VERSION 59
8
/* ### protocol_version end ### */
...
...
server/async.c
View file @
4f9cc931
...
...
@@ -399,11 +399,11 @@ void async_set_result( struct object *obj, unsigned int status, apc_param_t tota
{
apc_call_t
data
;
memset
(
&
data
,
0
,
sizeof
(
data
)
);
data
.
type
=
APC_USER
;
data
.
user
.
func
=
async
->
data
.
apc
;
data
.
user
.
args
[
0
]
=
async
->
data
.
apc_context
;
data
.
user
.
args
[
1
]
=
async
->
data
.
iosb
;
data
.
user
.
args
[
2
]
=
0
;
data
.
type
=
APC_USER
;
data
.
user
.
user
.
func
=
async
->
data
.
apc
;
data
.
user
.
user
.
args
[
0
]
=
async
->
data
.
apc_context
;
data
.
user
.
user
.
args
[
1
]
=
async
->
data
.
iosb
;
data
.
user
.
user
.
args
[
2
]
=
0
;
thread_queue_apc
(
NULL
,
async
->
thread
,
NULL
,
&
data
);
}
else
if
(
async
->
data
.
apc_context
&&
(
async
->
pending
||
...
...
server/protocol.def
View file @
4f9cc931
...
...
@@ -490,6 +490,12 @@ typedef union
abstime_t time; /* time of expiration */
client_ptr_t arg; /* user argument */
} timer;
} user_apc_t;
typedef union
{
enum apc_type type;
user_apc_t user;
struct
{
enum apc_type type; /* APC_ASYNC_IO */
...
...
server/timer.c
View file @
4f9cc931
...
...
@@ -116,10 +116,10 @@ static void timer_callback( void *private )
memset
(
&
data
,
0
,
sizeof
(
data
)
);
if
(
timer
->
callback
)
{
data
.
type
=
APC_TIMER
;
data
.
timer
.
func
=
timer
->
callback
;
data
.
timer
.
time
=
timer
->
when
;
data
.
timer
.
arg
=
timer
->
arg
;
data
.
type
=
APC_TIMER
;
data
.
user
.
timer
.
func
=
timer
->
callback
;
data
.
user
.
timer
.
time
=
timer
->
when
;
data
.
user
.
timer
.
arg
=
timer
->
arg
;
}
else
data
.
type
=
APC_NONE
;
/* wake up only */
...
...
server/trace.c
View file @
4f9cc931
...
...
@@ -159,15 +159,15 @@ static void dump_apc_call( const char *prefix, const apc_call_t *call )
fprintf
(
stderr
,
"APC_NONE"
);
break
;
case
APC_USER
:
dump_uint64
(
"APC_USER,func="
,
&
call
->
user
.
func
);
dump_uint64
(
",args={"
,
&
call
->
user
.
args
[
0
]
);
dump_uint64
(
","
,
&
call
->
user
.
args
[
1
]
);
dump_uint64
(
","
,
&
call
->
user
.
args
[
2
]
);
dump_uint64
(
"APC_USER,func="
,
&
call
->
user
.
user
.
func
);
dump_uint64
(
",args={"
,
&
call
->
user
.
user
.
args
[
0
]
);
dump_uint64
(
","
,
&
call
->
user
.
user
.
args
[
1
]
);
dump_uint64
(
","
,
&
call
->
user
.
user
.
args
[
2
]
);
fputc
(
'}'
,
stderr
);
break
;
case
APC_TIMER
:
dump_timeout
(
"APC_TIMER,time="
,
&
call
->
timer
.
time
);
dump_uint64
(
",arg="
,
&
call
->
timer
.
arg
);
dump_timeout
(
"APC_TIMER,time="
,
&
call
->
user
.
timer
.
time
);
dump_uint64
(
",arg="
,
&
call
->
user
.
timer
.
arg
);
break
;
case
APC_ASYNC_IO
:
dump_uint64
(
"APC_ASYNC_IO,user="
,
&
call
->
async_io
.
user
);
...
...
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