server: Make the device opaque data a client_ptr_t instead of a void pointer.

This commit is contained in:
Alexandre Julliard 2008-12-29 17:28:40 +01:00
parent 0cd3ff6cbe
commit 923310aa54
5 changed files with 14 additions and 10 deletions

View File

@ -225,7 +225,7 @@ NTSTATUS CDECL wine_ntoskrnl_main_loop( HANDLE stop_event )
{
code = reply->code;
ioctl = reply->next;
device = reply->user_ptr;
device = wine_server_get_ptr( reply->user_ptr );
in_size = reply->in_size;
out_size = reply->out_size;
}
@ -491,7 +491,7 @@ NTSTATUS WINAPI IoCreateDevice( DRIVER_OBJECT *driver, ULONG ext_size,
req->attributes = 0;
req->rootdir = 0;
req->manager = wine_server_obj_handle( manager );
req->user_ptr = device;
req->user_ptr = wine_server_client_ptr( device );
if (name) wine_server_add_data( req, name->Buffer, name->Length );
if (!(status = wine_server_call( req ))) handle = wine_server_ptr_handle( reply->handle );
}

View File

@ -4118,7 +4118,7 @@ struct create_device_request
unsigned int attributes;
obj_handle_t rootdir;
obj_handle_t manager;
void* user_ptr;
client_ptr_t user_ptr;
/* VARARG(name,unicode_str); */
};
struct create_device_reply
@ -4154,7 +4154,7 @@ struct get_next_device_request_reply
struct reply_header __header;
obj_handle_t next;
ioctl_code_t code;
void* user_ptr;
client_ptr_t user_ptr;
data_size_t in_size;
data_size_t out_size;
/* VARARG(next_data,bytes); */
@ -5052,6 +5052,6 @@ union generic_reply
struct set_window_layered_info_reply set_window_layered_info_reply;
};
#define SERVER_PROTOCOL_VERSION 360
#define SERVER_PROTOCOL_VERSION 361
#endif /* __WINE_WINE_SERVER_PROTOCOL_H */

View File

@ -112,7 +112,7 @@ struct device
struct object obj; /* object header */
struct device_manager *manager; /* manager for this device (or NULL if deleted) */
struct fd *fd; /* file descriptor for ioctl */
void *user_ptr; /* opaque ptr for client side */
client_ptr_t user_ptr; /* opaque ptr for client side */
struct list entry; /* entry in device manager list */
struct list requests; /* list of pending ioctl requests */
};

View File

@ -2961,7 +2961,7 @@ enum message_type
unsigned int attributes; /* object attributes */
obj_handle_t rootdir; /* root directory */
obj_handle_t manager; /* device manager */
void* user_ptr; /* opaque ptr for use by client */
client_ptr_t user_ptr; /* opaque ptr for use by client */
VARARG(name,unicode_str); /* object name */
@REPLY
obj_handle_t handle; /* handle to the device */
@ -2983,7 +2983,7 @@ enum message_type
@REPLY
obj_handle_t next; /* handle to the next ioctl */
ioctl_code_t code; /* ioctl code */
void* user_ptr; /* opaque ptr for the device */
client_ptr_t user_ptr; /* opaque ptr for the device */
data_size_t in_size; /* total needed input size */
data_size_t out_size; /* needed output size */
VARARG(next_data,bytes); /* input data of the next ioctl */

View File

@ -3729,7 +3729,9 @@ static void dump_create_device_request( const struct create_device_request *req
fprintf( stderr, " attributes=%08x,", req->attributes );
fprintf( stderr, " rootdir=%04x,", req->rootdir );
fprintf( stderr, " manager=%04x,", req->manager );
fprintf( stderr, " user_ptr=%p,", req->user_ptr );
fprintf( stderr, " user_ptr=" );
dump_uint64( &req->user_ptr );
fprintf( stderr, "," );
fprintf( stderr, " name=" );
dump_varargs_unicode_str( cur_size );
}
@ -3759,7 +3761,9 @@ static void dump_get_next_device_request_reply( const struct get_next_device_req
fprintf( stderr, " code=" );
dump_ioctl_code( &req->code );
fprintf( stderr, "," );
fprintf( stderr, " user_ptr=%p,", req->user_ptr );
fprintf( stderr, " user_ptr=" );
dump_uint64( &req->user_ptr );
fprintf( stderr, "," );
fprintf( stderr, " in_size=%u,", req->in_size );
fprintf( stderr, " out_size=%u,", req->out_size );
fprintf( stderr, " next_data=" );