From f139b06651ff259198b3ae765edc81483bf12e8f Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Thu, 10 Feb 2022 15:02:08 +0100 Subject: [PATCH] server: Store all 64 bits of window id. Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- dlls/user32/win.c | 2 +- include/wine/server_protocol.h | 11 +++++------ server/protocol.def | 7 +++---- server/request.h | 7 +++---- server/trace.c | 7 +++---- server/window.c | 4 ++-- 6 files changed, 17 insertions(+), 21 deletions(-) diff --git a/dlls/user32/win.c b/dlls/user32/win.c index 82975cadd23..70c3521ab1d 100644 --- a/dlls/user32/win.c +++ b/dlls/user32/win.c @@ -2715,7 +2715,7 @@ LONG_PTR WIN_SetWindowLong( HWND hwnd, INT offset, UINT size, LONG_PTR newval, B break; case GWLP_ID: req->flags = SET_WIN_ID; - req->id = newval; + req->extra_value = newval; break; case GWLP_HINSTANCE: req->flags = SET_WIN_INSTANCE; diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index 050b682d489..97ab4e25834 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -3112,12 +3112,12 @@ struct set_window_info_request user_handle_t handle; unsigned int style; unsigned int ex_style; - unsigned int id; + data_size_t extra_size; mod_handle_t instance; lparam_t user_data; - int extra_offset; - data_size_t extra_size; lparam_t extra_value; + int extra_offset; + char __pad_60[4]; }; struct set_window_info_reply { @@ -3127,8 +3127,7 @@ struct set_window_info_reply mod_handle_t old_instance; lparam_t old_user_data; lparam_t old_extra_value; - unsigned int old_id; - char __pad_44[4]; + lparam_t old_id; }; #define SET_WIN_STYLE 0x01 #define SET_WIN_EXSTYLE 0x02 @@ -6263,7 +6262,7 @@ union generic_reply /* ### protocol_version begin ### */ -#define SERVER_PROTOCOL_VERSION 742 +#define SERVER_PROTOCOL_VERSION 743 /* ### protocol_version end ### */ diff --git a/server/protocol.def b/server/protocol.def index 02e73047f9b..21b17c11551 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -2303,19 +2303,18 @@ enum message_type user_handle_t handle; /* handle to the window */ unsigned int style; /* window style */ unsigned int ex_style; /* window extended style */ - unsigned int id; /* window id */ + data_size_t extra_size; /* size to set in extra bytes */ mod_handle_t instance; /* creator instance */ lparam_t user_data; /* user-specific data */ + lparam_t extra_value; /* value to set in extra bytes or window id */ int extra_offset; /* offset to set in extra bytes */ - data_size_t extra_size; /* size to set in extra bytes */ - lparam_t extra_value; /* value to set in extra bytes */ @REPLY unsigned int old_style; /* old window style */ unsigned int old_ex_style; /* old window extended style */ mod_handle_t old_instance; /* old creator instance */ lparam_t old_user_data; /* old user-specific data */ lparam_t old_extra_value; /* old value in extra bytes */ - unsigned int old_id; /* old window id */ + lparam_t old_id; /* old window id */ @END #define SET_WIN_STYLE 0x01 #define SET_WIN_EXSTYLE 0x02 diff --git a/server/request.h b/server/request.h index 98b3300de2c..f2d0e827d94 100644 --- a/server/request.h +++ b/server/request.h @@ -1479,12 +1479,11 @@ C_ASSERT( FIELD_OFFSET(struct set_window_info_request, is_unicode) == 14 ); C_ASSERT( FIELD_OFFSET(struct set_window_info_request, handle) == 16 ); C_ASSERT( FIELD_OFFSET(struct set_window_info_request, style) == 20 ); C_ASSERT( FIELD_OFFSET(struct set_window_info_request, ex_style) == 24 ); -C_ASSERT( FIELD_OFFSET(struct set_window_info_request, id) == 28 ); +C_ASSERT( FIELD_OFFSET(struct set_window_info_request, extra_size) == 28 ); C_ASSERT( FIELD_OFFSET(struct set_window_info_request, instance) == 32 ); C_ASSERT( FIELD_OFFSET(struct set_window_info_request, user_data) == 40 ); -C_ASSERT( FIELD_OFFSET(struct set_window_info_request, extra_offset) == 48 ); -C_ASSERT( FIELD_OFFSET(struct set_window_info_request, extra_size) == 52 ); -C_ASSERT( FIELD_OFFSET(struct set_window_info_request, extra_value) == 56 ); +C_ASSERT( FIELD_OFFSET(struct set_window_info_request, extra_value) == 48 ); +C_ASSERT( FIELD_OFFSET(struct set_window_info_request, extra_offset) == 56 ); C_ASSERT( sizeof(struct set_window_info_request) == 64 ); C_ASSERT( FIELD_OFFSET(struct set_window_info_reply, old_style) == 8 ); C_ASSERT( FIELD_OFFSET(struct set_window_info_reply, old_ex_style) == 12 ); diff --git a/server/trace.c b/server/trace.c index 429b39a5cdd..32606d540f7 100644 --- a/server/trace.c +++ b/server/trace.c @@ -2907,12 +2907,11 @@ static void dump_set_window_info_request( const struct set_window_info_request * fprintf( stderr, ", handle=%08x", req->handle ); fprintf( stderr, ", style=%08x", req->style ); fprintf( stderr, ", ex_style=%08x", req->ex_style ); - fprintf( stderr, ", id=%08x", req->id ); + fprintf( stderr, ", extra_size=%u", req->extra_size ); dump_uint64( ", instance=", &req->instance ); dump_uint64( ", user_data=", &req->user_data ); - fprintf( stderr, ", extra_offset=%d", req->extra_offset ); - fprintf( stderr, ", extra_size=%u", req->extra_size ); dump_uint64( ", extra_value=", &req->extra_value ); + fprintf( stderr, ", extra_offset=%d", req->extra_offset ); } static void dump_set_window_info_reply( const struct set_window_info_reply *req ) @@ -2922,7 +2921,7 @@ static void dump_set_window_info_reply( const struct set_window_info_reply *req dump_uint64( ", old_instance=", &req->old_instance ); dump_uint64( ", old_user_data=", &req->old_user_data ); dump_uint64( ", old_extra_value=", &req->old_extra_value ); - fprintf( stderr, ", old_id=%08x", req->old_id ); + dump_uint64( ", old_id=", &req->old_id ); } static void dump_set_parent_request( const struct set_parent_request *req ) diff --git a/server/window.c b/server/window.c index 6b889df9149..7675cd1103d 100644 --- a/server/window.c +++ b/server/window.c @@ -74,7 +74,7 @@ struct window struct region *update_region; /* update region (relative to window rect) */ unsigned int style; /* window style */ unsigned int ex_style; /* window extended style */ - unsigned int id; /* window id */ + lparam_t id; /* window id */ mod_handle_t instance; /* creator instance */ unsigned int is_unicode : 1; /* ANSI or unicode */ unsigned int is_linked : 1; /* is it linked into the parent z-order list? */ @@ -2245,7 +2245,7 @@ DECL_HANDLER(set_window_info) else win->ex_style = (req->ex_style & ~WS_EX_TOPMOST) | (win->ex_style & WS_EX_TOPMOST); if (!(win->ex_style & WS_EX_LAYERED)) win->is_layered = 0; } - if (req->flags & SET_WIN_ID) win->id = req->id; + if (req->flags & SET_WIN_ID) win->id = req->extra_value; if (req->flags & SET_WIN_INSTANCE) win->instance = req->instance; if (req->flags & SET_WIN_UNICODE) win->is_unicode = req->is_unicode; if (req->flags & SET_WIN_USERDATA) win->user_data = req->user_data;