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

Alexandre Julliard julliard at winehq.org
Tue Dec 30 06:56:55 CST 2008


Module: wine
Branch: master
Commit: 0cd3ff6cbe3979ce207527f79884c49ad53a2905
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=0cd3ff6cbe3979ce207527f79884c49ad53a2905

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Dec 29 17:24:33 2008 +0100

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

---

 dlls/user32/class.c            |    4 ++--
 dlls/user32/win.c              |    4 ++--
 include/wine/server_protocol.h |    8 ++++----
 server/class.c                 |    4 ++--
 server/protocol.def            |    6 +++---
 server/trace.c                 |   10 +++++++---
 server/user.h                  |    2 +-
 7 files changed, 21 insertions(+), 17 deletions(-)

diff --git a/dlls/user32/class.c b/dlls/user32/class.c
index 478ff4f..51e6faf 100644
--- a/dlls/user32/class.c
+++ b/dlls/user32/class.c
@@ -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;
 
diff --git a/dlls/user32/win.c b/dlls/user32/win.c
index de10de6..08649e8 100644
--- a/dlls/user32/win.c
+++ b/dlls/user32/win.c
@@ -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;
diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h
index 4dcd50d..20fc81f 100644
--- a/include/wine/server_protocol.h
+++ b/include/wine/server_protocol.h
@@ -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 */
diff --git a/server/class.c b/server/class.c
index 1833a28..0e402ba 100644
--- a/server/class.c
+++ b/server/class.c
@@ -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;
 }
diff --git a/server/protocol.def b/server/protocol.def
index daa15b7..66c2e01 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -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
 
 
diff --git a/server/trace.c b/server/trace.c
index fb717d0..9530fde 100644
--- a/server/trace.c
+++ b/server/trace.c
@@ -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 )
diff --git a/server/user.h b/server/user.h
index d319410..b4f35a8 100644
--- a/server/user.h
+++ b/server/user.h
@@ -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 */
 




More information about the wine-cvs mailing list