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

This commit is contained in:
Alexandre Julliard 2008-12-29 17:24:33 +01:00
parent 45c991937a
commit 0cd3ff6cbe
7 changed files with 21 additions and 17 deletions

View File

@ -357,7 +357,7 @@ static CLASS *CLASS_RegisterClass( LPCWSTR name, HINSTANCE hInstance, BOOL local
req->instance = wine_server_client_ptr( hInstance );
req->extra = classExtra;
req->win_extra = winExtra;
req->client_ptr = classPtr;
req->client_ptr = wine_server_client_ptr( classPtr );
req->atom = classPtr->atomName;
if (!req->atom && name) wine_server_add_data( req, name, strlenW(name) * sizeof(WCHAR) );
ret = !wine_server_call_err( req );
@ -628,7 +628,7 @@ BOOL WINAPI UnregisterClassW( LPCWSTR className, HINSTANCE hInstance )
req->instance = wine_server_client_ptr( hInstance );
if (!(req->atom = get_int_atom_value(className)) && className)
wine_server_add_data( req, className, strlenW(className) * sizeof(WCHAR) );
if (!wine_server_call_err( req )) classPtr = reply->client_ptr;
if (!wine_server_call_err( req )) classPtr = wine_server_get_ptr( reply->client_ptr );
}
SERVER_END_REQ;

View File

@ -117,11 +117,11 @@ static WND *create_window_handle( HWND parent, HWND owner, LPCWSTR name,
wine_server_add_data( req, name, strlenW(name)*sizeof(WCHAR) );
if (!wine_server_call_err( req ))
{
handle = wine_server_ptr_handle( reply->handle );
handle = wine_server_ptr_handle( reply->handle );
full_parent = wine_server_ptr_handle( reply->parent );
full_owner = wine_server_ptr_handle( reply->owner );
extra_bytes = reply->extra;
class = reply->class_ptr;
class = wine_server_get_ptr( reply->class_ptr );
}
}
SERVER_END_REQ;

View File

@ -2789,7 +2789,7 @@ struct create_window_reply
user_handle_t parent;
user_handle_t owner;
int extra;
void* class_ptr;
client_ptr_t class_ptr;
};
@ -3661,7 +3661,7 @@ struct create_class_request
mod_handle_t instance;
int extra;
int win_extra;
void* client_ptr;
client_ptr_t client_ptr;
/* VARARG(name,unicode_str); */
};
struct create_class_reply
@ -3682,7 +3682,7 @@ struct destroy_class_request
struct destroy_class_reply
{
struct reply_header __header;
void* client_ptr;
client_ptr_t client_ptr;
};
@ -5052,6 +5052,6 @@ union generic_reply
struct set_window_layered_info_reply set_window_layered_info_reply;
};
#define SERVER_PROTOCOL_VERSION 359
#define SERVER_PROTOCOL_VERSION 360
#endif /* __WINE_WINE_SERVER_PROTOCOL_H */

View File

@ -49,7 +49,7 @@ struct window_class
mod_handle_t instance; /* module instance */
unsigned int style; /* class style */
int win_extra; /* number of window extra bytes */
void *client_ptr; /* pointer to class in client address space */
client_ptr_t client_ptr; /* pointer to class in client address space */
int nb_extra_bytes; /* number of extra bytes */
char extra_bytes[1]; /* extra bytes storage */
};
@ -141,7 +141,7 @@ atom_t get_class_atom( struct window_class *class )
return class->atom;
}
void *get_class_client_ptr( struct window_class *class )
client_ptr_t get_class_client_ptr( struct window_class *class )
{
return class->client_ptr;
}

View File

@ -2059,7 +2059,7 @@ enum message_type
user_handle_t parent; /* full handle of parent */
user_handle_t owner; /* full handle of owner */
int extra; /* number of extra bytes */
void* class_ptr; /* pointer to class in client address space */
client_ptr_t class_ptr; /* pointer to class in client address space */
@END
@ -2646,7 +2646,7 @@ enum message_type
mod_handle_t instance; /* module instance */
int extra; /* number of extra class bytes */
int win_extra; /* number of window extra bytes */
void* client_ptr; /* pointer to class in client address space */
client_ptr_t client_ptr; /* pointer to class in client address space */
VARARG(name,unicode_str); /* class name */
@REPLY
atom_t atom; /* resulting class atom */
@ -2659,7 +2659,7 @@ enum message_type
mod_handle_t instance; /* module instance */
VARARG(name,unicode_str); /* class name */
@REPLY
void* client_ptr; /* pointer to class in client address space */
client_ptr_t client_ptr; /* pointer to class in client address space */
@END

View File

@ -2623,7 +2623,8 @@ static void dump_create_window_reply( const struct create_window_reply *req )
fprintf( stderr, " parent=%08x,", req->parent );
fprintf( stderr, " owner=%08x,", req->owner );
fprintf( stderr, " extra=%d,", req->extra );
fprintf( stderr, " class_ptr=%p", req->class_ptr );
fprintf( stderr, " class_ptr=" );
dump_uint64( &req->class_ptr );
}
static void dump_destroy_window_request( const struct destroy_window_request *req )
@ -3327,7 +3328,9 @@ static void dump_create_class_request( const struct create_class_request *req )
fprintf( stderr, "," );
fprintf( stderr, " extra=%d,", req->extra );
fprintf( stderr, " win_extra=%d,", req->win_extra );
fprintf( stderr, " client_ptr=%p,", req->client_ptr );
fprintf( stderr, " client_ptr=" );
dump_uint64( &req->client_ptr );
fprintf( stderr, "," );
fprintf( stderr, " name=" );
dump_varargs_unicode_str( cur_size );
}
@ -3349,7 +3352,8 @@ static void dump_destroy_class_request( const struct destroy_class_request *req
static void dump_destroy_class_reply( const struct destroy_class_reply *req )
{
fprintf( stderr, " client_ptr=%p", req->client_ptr );
fprintf( stderr, " client_ptr=" );
dump_uint64( &req->client_ptr );
}
static void dump_set_class_info_request( const struct set_class_info_request *req )

View File

@ -148,7 +148,7 @@ extern void release_class( struct window_class *class );
extern int is_desktop_class( struct window_class *class );
extern int is_hwnd_message_class( struct window_class *class );
extern atom_t get_class_atom( struct window_class *class );
extern void *get_class_client_ptr( struct window_class *class );
extern client_ptr_t get_class_client_ptr( struct window_class *class );
/* windows station functions */