server: Make timer callback function and argument client_ptr_t instead of void pointers.
diff --git a/server/protocol.def b/server/protocol.def
index c0212e2..ca32a41 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -293,10 +293,10 @@
} user;
struct
{
- enum apc_type type; /* APC_TIMER */
- void (__stdcall *func)(void*, unsigned int, unsigned int);
+ enum apc_type type; /* APC_TIMER */
+ client_ptr_t func; /* void (__stdcall *func)(void*, unsigned int, unsigned int); */
timeout_t time; /* absolute time of expiration */
- void *arg; /* user argument */
+ client_ptr_t arg; /* user argument */
} timer;
struct
{
@@ -1669,9 +1669,9 @@
@REQ(set_timer)
obj_handle_t handle; /* handle to the timer */
timeout_t expire; /* next expiration absolute time */
+ client_ptr_t callback; /* callback function */
+ client_ptr_t arg; /* callback argument */
int period; /* timer period in ms */
- void* callback; /* callback function */
- void* arg; /* callback argument */
@REPLY
int signaled; /* was the timer signaled before this call ? */
@END
diff --git a/server/timer.c b/server/timer.c
index 5afe663..b38eae7 100644
--- a/server/timer.c
+++ b/server/timer.c
@@ -46,8 +46,8 @@
timeout_t when; /* next expiration */
struct timeout_user *timeout; /* timeout user */
struct thread *thread; /* thread that set the APC function */
- void *callback; /* callback APC function */
- void *arg; /* callback argument */
+ client_ptr_t callback; /* callback APC function */
+ client_ptr_t arg; /* callback argument */
};
static void timer_dump( struct object *obj, int verbose );
@@ -160,7 +160,7 @@
/* set the timer expiration and period */
static int set_timer( struct timer *timer, timeout_t expire, unsigned int period,
- void *callback, void *arg )
+ client_ptr_t callback, client_ptr_t arg )
{
int signaled = cancel_timer( timer );
if (timer->manual)
diff --git a/server/trace.c b/server/trace.c
index 7e3ccf5..a986d95 100644
--- a/server/trace.c
+++ b/server/trace.c
@@ -125,7 +125,8 @@
case APC_TIMER:
fprintf( stderr, "APC_TIMER,time=" );
dump_timeout( &call->timer.time );
- fprintf( stderr, ",arg=%p", call->timer.arg );
+ fprintf( stderr, ",arg=" );
+ dump_uint64( &call->timer.arg );
break;
case APC_ASYNC_IO:
fprintf( stderr, "APC_ASYNC_IO,func=%p,user=%p,sb=%p,status=%s",
@@ -2166,9 +2167,13 @@
fprintf( stderr, " expire=" );
dump_timeout( &req->expire );
fprintf( stderr, "," );
- fprintf( stderr, " period=%d,", req->period );
- fprintf( stderr, " callback=%p,", req->callback );
- fprintf( stderr, " arg=%p", req->arg );
+ fprintf( stderr, " callback=" );
+ dump_uint64( &req->callback );
+ fprintf( stderr, "," );
+ fprintf( stderr, " arg=" );
+ dump_uint64( &req->arg );
+ fprintf( stderr, "," );
+ fprintf( stderr, " period=%d", req->period );
}
static void dump_set_timer_reply( const struct set_timer_reply *req )