winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
August 2023
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
667 discussions
Start a n
N
ew thread
Zebediah Figura : vkd3d-shader/preproc: Parse hash marks as two separate tokens when not in stringification contexts.
by Alexandre Julliard
02 Aug '23
02 Aug '23
Module: vkd3d Branch: master Commit: 9b98489155fb479d6b4c891db9a345086e830f3d URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/9b98489155fb479d6b4c891db9a34…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Sat Jul 29 18:08:29 2023 -0500 vkd3d-shader/preproc: Parse hash marks as two separate tokens when not in stringification contexts. --- libs/vkd3d-shader/preproc.l | 37 ++++++++++++++++++++++--------------- tests/preproc-macro.shader_test | 4 ++++ 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/libs/vkd3d-shader/preproc.l b/libs/vkd3d-shader/preproc.l index 8e35e355..20bf5cb5 100644 --- a/libs/vkd3d-shader/preproc.l +++ b/libs/vkd3d-shader/preproc.l @@ -29,6 +29,13 @@ #define YY_DECL static int preproc_lexer_lex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, yyscan_t yyscanner) +static struct preproc_macro *preproc_get_top_macro(struct preproc_ctx *ctx) +{ + if (!ctx->expansion_count) + return NULL; + return ctx->expansion_stack[ctx->expansion_count - 1].macro; +} + static void update_location(struct preproc_ctx *ctx); #define YY_USER_ACTION update_location(yyget_extra(yyscanner)); @@ -124,7 +131,20 @@ INT_SUFFIX [uUlL]{0,2} const char *p; if (!ctx->last_was_newline) - return T_HASHSTRING; + { + struct preproc_macro *macro; + + /* Stringification is only done for function-like macro bodies. + * Anywhere else, we need to parse it as two separate tokens. + * We could use a state for this, but yyless() is easier and cheap. + */ + + if ((macro = preproc_get_top_macro(ctx)) && macro->arg_count) + return T_HASHSTRING; + + yyless(1); + return T_TEXT; + } for (p = yytext + 1; strchr(" \t", *p); ++p) ; @@ -218,13 +238,6 @@ static bool preproc_is_writing(struct preproc_ctx *ctx) return file->if_stack[file->if_count - 1].current_true; } -static struct preproc_macro *preproc_get_top_macro(struct preproc_ctx *ctx) -{ - if (!ctx->expansion_count) - return NULL; - return ctx->expansion_stack[ctx->expansion_count - 1].macro; -} - /* Concatenation is not done for object-like macros, but is done for both * function-like macro bodies and their arguments. */ static bool should_concat(struct preproc_ctx *ctx) @@ -440,9 +453,6 @@ int yylex(YYSTYPE *lval, YYLTYPE *lloc, yyscan_t scanner) switch (func_state->state) { case STATE_NONE: - { - struct preproc_macro *macro; - if (token == T_CONCAT && should_concat(ctx)) { while (ctx->buffer.content_size @@ -451,9 +461,7 @@ int yylex(YYSTYPE *lval, YYLTYPE *lloc, yyscan_t scanner) break; } - /* Stringification, however, is only done for function-like - * macro bodies. */ - if (token == T_HASHSTRING && (macro = preproc_get_top_macro(ctx)) && macro->arg_count) + if (token == T_HASHSTRING) { const struct preproc_text *expansion; const char *p = text + 1; @@ -585,7 +593,6 @@ int yylex(YYSTYPE *lval, YYLTYPE *lloc, yyscan_t scanner) else vkd3d_string_buffer_printf(&ctx->buffer, "%s ", text); break; - } case STATE_IDENTIFIER: if (token == '(') diff --git a/tests/preproc-macro.shader_test b/tests/preproc-macro.shader_test index 0fe73f7c..b2f2530e 100644 --- a/tests/preproc-macro.shader_test +++ b/tests/preproc-macro.shader_test @@ -301,3 +301,7 @@ fail [preproc] #define __LINE__ pass __LINE__ + +[preproc] +#define KEY pass +apple # KEY
1
0
0
0
Zebediah Figura : vkd3d-shader/tpf: Check buffer->status in add_section().
by Alexandre Julliard
02 Aug '23
02 Aug '23
Module: vkd3d Branch: master Commit: 9a80ff28e40d0788efafff9cf54a248b44cd08fe URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/9a80ff28e40d0788efafff9cf54a2…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Wed Jul 26 18:43:02 2023 -0500 vkd3d-shader/tpf: Check buffer->status in add_section(). --- libs/vkd3d-shader/tpf.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/libs/vkd3d-shader/tpf.c b/libs/vkd3d-shader/tpf.c index f3ca223c..351943e2 100644 --- a/libs/vkd3d-shader/tpf.c +++ b/libs/vkd3d-shader/tpf.c @@ -2627,7 +2627,8 @@ bool hlsl_sm4_usage_from_semantic(struct hlsl_ctx *ctx, const struct hlsl_semant return true; } -static void add_section(struct dxbc_writer *dxbc, uint32_t tag, struct vkd3d_bytecode_buffer *buffer) +static void add_section(struct hlsl_ctx *ctx, struct dxbc_writer *dxbc, + uint32_t tag, struct vkd3d_bytecode_buffer *buffer) { /* Native D3DDisassemble() expects at least the sizes of the ISGN and OSGN * sections to be aligned. Without this, the sections themselves will be @@ -2635,6 +2636,9 @@ static void add_section(struct dxbc_writer *dxbc, uint32_t tag, struct vkd3d_byt size_t size = bytecode_align(buffer); dxbc_writer_add_section(dxbc, tag, buffer->data, size); + + if (buffer->status < 0) + ctx->result = buffer->status; } static void write_sm4_signature(struct hlsl_ctx *ctx, struct dxbc_writer *dxbc, bool output) @@ -2742,7 +2746,7 @@ static void write_sm4_signature(struct hlsl_ctx *ctx, struct dxbc_writer *dxbc, set_u32(&buffer, count_position, i); - add_section(dxbc, output ? TAG_OSGN : TAG_ISGN, &buffer); + add_section(ctx, dxbc, output ? TAG_OSGN : TAG_ISGN, &buffer); } static D3D_SHADER_VARIABLE_CLASS sm4_class(const struct hlsl_type *type) @@ -3357,7 +3361,7 @@ static void write_sm4_rdef(struct hlsl_ctx *ctx, struct dxbc_writer *dxbc) creator_offset = put_string(&buffer, vkd3d_shader_get_version(NULL, NULL)); set_u32(&buffer, creator_position, creator_offset); - add_section(dxbc, TAG_RDEF, &buffer); + add_section(ctx, dxbc, TAG_RDEF, &buffer); sm4_free_extern_resources(extern_resources, extern_resources_count); } @@ -5377,7 +5381,7 @@ static void write_sm4_shdr(struct hlsl_ctx *ctx, set_u32(&buffer, token_count_position, bytecode_get_size(&buffer) / sizeof(uint32_t)); - add_section(dxbc, TAG_SHDR, &buffer); + add_section(ctx, dxbc, TAG_SHDR, &buffer); sm4_free_extern_resources(extern_resources, extern_resources_count); }
1
0
0
0
Zebediah Figura : vkd3d-shader/d3dbc: Return ctx->result from hlsl_sm1_write().
by Alexandre Julliard
02 Aug '23
02 Aug '23
Module: vkd3d Branch: master Commit: 71afb78126488008f64716ae1df41910a8c5a2ef URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/71afb78126488008f64716ae1df41…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Wed Jul 26 18:42:42 2023 -0500 vkd3d-shader/d3dbc: Return ctx->result from hlsl_sm1_write(). --- libs/vkd3d-shader/d3dbc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libs/vkd3d-shader/d3dbc.c b/libs/vkd3d-shader/d3dbc.c index 91910850..fe739339 100644 --- a/libs/vkd3d-shader/d3dbc.c +++ b/libs/vkd3d-shader/d3dbc.c @@ -2442,7 +2442,6 @@ static void write_sm1_instructions(struct hlsl_ctx *ctx, struct vkd3d_bytecode_b int hlsl_sm1_write(struct hlsl_ctx *ctx, struct hlsl_ir_function_decl *entry_func, struct vkd3d_shader_code *out) { struct vkd3d_bytecode_buffer buffer = {0}; - int ret; put_u32(&buffer, sm1_version(ctx->profile->type, ctx->profile->major_version, ctx->profile->minor_version)); @@ -2455,7 +2454,10 @@ int hlsl_sm1_write(struct hlsl_ctx *ctx, struct hlsl_ir_function_decl *entry_fun put_u32(&buffer, D3DSIO_END); - if (!(ret = buffer.status)) + if (buffer.status) + ctx->result = buffer.status; + + if (!ctx->result) { out->code = buffer.data; out->size = buffer.size; @@ -2464,5 +2466,5 @@ int hlsl_sm1_write(struct hlsl_ctx *ctx, struct hlsl_ir_function_decl *entry_fun { vkd3d_free(buffer.data); } - return ret; + return ctx->result; }
1
0
0
0
Zebediah Figura : vkd3d-shader/d3dbc: Free vkd3d_bytecode_buffer data on failure.
by Alexandre Julliard
02 Aug '23
02 Aug '23
Module: vkd3d Branch: master Commit: 6e370777b484237f94800ec95c7b241755697b33 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/6e370777b484237f94800ec95c7b2…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Thu Jul 27 00:42:46 2023 -0500 vkd3d-shader/d3dbc: Free vkd3d_bytecode_buffer data on failure. --- libs/vkd3d-shader/d3dbc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libs/vkd3d-shader/d3dbc.c b/libs/vkd3d-shader/d3dbc.c index 34dc4bab..91910850 100644 --- a/libs/vkd3d-shader/d3dbc.c +++ b/libs/vkd3d-shader/d3dbc.c @@ -2460,5 +2460,9 @@ int hlsl_sm1_write(struct hlsl_ctx *ctx, struct hlsl_ir_function_decl *entry_fun out->code = buffer.data; out->size = buffer.size; } + else + { + vkd3d_free(buffer.data); + } return ret; }
1
0
0
0
Zebediah Figura : vkd3d-shader/d3dbc: Skip generic sampler declarations.
by Alexandre Julliard
02 Aug '23
02 Aug '23
Module: vkd3d Branch: master Commit: 1bd873fb2b887d6b4a21d0f009374ddf7cff8303 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/1bd873fb2b887d6b4a21d0f009374…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Wed Jul 26 18:41:26 2023 -0500 vkd3d-shader/d3dbc: Skip generic sampler declarations. Instead of asserting. --- libs/vkd3d-shader/d3dbc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libs/vkd3d-shader/d3dbc.c b/libs/vkd3d-shader/d3dbc.c index 9a147e3d..34dc4bab 100644 --- a/libs/vkd3d-shader/d3dbc.c +++ b/libs/vkd3d-shader/d3dbc.c @@ -2034,7 +2034,12 @@ static void write_sm1_sampler_dcls(struct hlsl_ctx *ctx, struct vkd3d_bytecode_b if (var->objects_usage[HLSL_REGSET_SAMPLERS][i].used) { sampler_dim = var->objects_usage[HLSL_REGSET_SAMPLERS][i].sampler_dim; - assert(sampler_dim != HLSL_SAMPLER_DIM_GENERIC); + if (sampler_dim == HLSL_SAMPLER_DIM_GENERIC) + { + /* These can appear in sm4-style combined sample instructions. */ + hlsl_fixme(ctx, &var->loc, "Generic samplers need to be lowered."); + continue; + } reg_id = var->regs[HLSL_REGSET_SAMPLERS].id + i; write_sm1_sampler_dcl(ctx, buffer, reg_id, sampler_dim);
1
0
0
0
Jacek Caban : win32u: Remove no longer needed NtUserSendDriverMessage.
by Alexandre Julliard
02 Aug '23
02 Aug '23
Module: wine Branch: master Commit: 61b80f67044d1bd720740b6e017a91bd9a026f61 URL:
https://gitlab.winehq.org/wine/wine/-/commit/61b80f67044d1bd720740b6e017a91…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Aug 1 17:24:19 2023 +0200 win32u: Remove no longer needed NtUserSendDriverMessage. All messages are packed now anyway. --- dlls/win32u/message.c | 4 ---- dlls/winemac.drv/macdrv.h | 2 +- dlls/winex11.drv/x11drv.h | 2 +- include/ntuser.h | 9 ++++----- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index b83ab32976b..71c1017a3f0 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -4286,10 +4286,6 @@ LRESULT WINAPI NtUserMessageCall( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpa else RtlSetLastWin32Error( ERROR_MESSAGE_SYNC_ONLY ); return FALSE; - case NtUserSendDriverMessage: - /* used by driver to send packed messages */ - return send_message( hwnd, msg, wparam, lparam ); - case NtUserSpyEnter: spy_enter_message( ansi, hwnd, msg, wparam, lparam ); return 0; diff --git a/dlls/winemac.drv/macdrv.h b/dlls/winemac.drv/macdrv.h index 35ee6425b86..bcb048707ca 100644 --- a/dlls/winemac.drv/macdrv.h +++ b/dlls/winemac.drv/macdrv.h @@ -290,7 +290,7 @@ extern NTSTATUS macdrv_client_func(enum macdrv_client_funcs func, const void *pa static inline LRESULT send_message(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { - return NtUserMessageCall(hwnd, msg, wparam, lparam, NULL, NtUserSendDriverMessage, FALSE); + return NtUserMessageCall(hwnd, msg, wparam, lparam, NULL, NtUserSendMessage, FALSE); } static inline LRESULT send_message_timeout(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 3c41ce60854..9ee6498a02e 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -862,7 +862,7 @@ static inline UINT get_palette_entries( HPALETTE palette, UINT start, UINT count static inline LRESULT send_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) { - return NtUserMessageCall( hwnd, msg, wparam, lparam, NULL, NtUserSendDriverMessage, FALSE ); + return NtUserMessageCall( hwnd, msg, wparam, lparam, NULL, NtUserSendMessage, FALSE ); } static inline LRESULT send_message_timeout( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, diff --git a/include/ntuser.h b/include/ntuser.h index 2d6c41f0e62..b873512dbd1 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -301,11 +301,10 @@ enum /* Wine-specific exports */ NtUserClipboardWindowProc = 0x0300, NtUserGetDispatchParams = 0x3001, - NtUserSendDriverMessage = 0x3002, - NtUserSpyGetMsgName = 0x3003, - NtUserSpyEnter = 0x0304, - NtUserSpyExit = 0x0305, - NtUserImeDriverCall = 0x0306, + NtUserSpyGetMsgName = 0x3002, + NtUserSpyEnter = 0x0303, + NtUserSpyExit = 0x0304, + NtUserImeDriverCall = 0x0305, }; /* NtUserThunkedMenuItemInfo codes */
1
0
0
0
Jacek Caban : win32u: Remove no longer needed needs_unpack from win_proc_params.
by Alexandre Julliard
02 Aug '23
02 Aug '23
Module: wine Branch: master Commit: f693d66086bc117a032d2c96529f3a339aeb6461 URL:
https://gitlab.winehq.org/wine/wine/-/commit/f693d66086bc117a032d2c96529f3a…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Jul 19 13:59:25 2023 +0200 win32u: Remove no longer needed needs_unpack from win_proc_params. --- dlls/user32/winproc.c | 32 ++++++++++++++------------------ dlls/win32u/message.c | 16 +++++++++------- dlls/wow64win/user.c | 16 ++++++++++------ include/ntuser.h | 1 - 4 files changed, 33 insertions(+), 32 deletions(-) diff --git a/dlls/user32/winproc.c b/dlls/user32/winproc.c index d0ebbb5ea8d..5ab85eb81cd 100644 --- a/dlls/user32/winproc.c +++ b/dlls/user32/winproc.c @@ -805,31 +805,27 @@ void unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lparam, BOOL WINAPI User32CallWindowProc( struct win_proc_params *params, ULONG size ) { + size_t packed_size = 0; + void *buffer = NULL; LRESULT result; - if (params->needs_unpack) + if (size > sizeof(*params)) { - void *buffer; + const size_t offset = (sizeof(*params) + 15) & ~15; + packed_size = size - offset; + buffer = (char *)params + offset; - size -= sizeof(*params); - buffer = params + 1; - - if (size) - unpack_message( params->hwnd, params->msg, ¶ms->wparam, - ¶ms->lparam, buffer, size, params->ansi ); + unpack_message( params->hwnd, params->msg, ¶ms->wparam, ¶ms->lparam, + buffer, packed_size, params->ansi ); + } - result = dispatch_win_proc_params( params ); + result = dispatch_win_proc_params( params ); - if (size) - { - LRESULT *result_ptr = (LRESULT *)buffer - 1; - *result_ptr = result; - return NtCallbackReturn( result_ptr, sizeof(*result_ptr) + size, TRUE ); - } - } - else + if (packed_size) { - result = dispatch_win_proc_params( params ); + LRESULT *result_ptr = (LRESULT *)buffer - 1; + *result_ptr = result; + return NtCallbackReturn( result_ptr, sizeof(*result_ptr) + packed_size, TRUE ); } return NtCallbackReturn( &result, sizeof(result), TRUE ); } diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index 588cd4e7cc8..b83ab32976b 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -377,7 +377,6 @@ static BOOL init_win_proc_params( struct win_proc_params *params, HWND hwnd, UIN params->wparam = wparam; params->lparam = lparam; params->ansi = params->ansi_dst = ansi; - params->needs_unpack = FALSE; params->mapping = WMCHAR_MAP_CALLWINDOWPROC; params->dpi_awareness = get_window_dpi_awareness_context( params->hwnd ); get_winproc_params( params, TRUE ); @@ -409,7 +408,6 @@ static BOOL init_window_call_params( struct win_proc_params *params, HWND hwnd, params->wparam = wParam; params->lparam = lParam; params->ansi = ansi; - params->needs_unpack = FALSE; params->mapping = mapping; params->dpi_awareness = get_window_dpi_awareness_context( params->hwnd ); get_winproc_params( params, !is_dialog ); @@ -2155,10 +2153,10 @@ static LRESULT call_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpar { struct win_proc_params p, *params = &p; BOOL ansi = ansi_dst && type == MSG_ASCII; + size_t packed_size = 0, offset = sizeof(*params); LRESULT result = 0; CWPSTRUCT cwp; CWPRETSTRUCT cwpret; - size_t packed_size = 0; void *ret_ptr; size_t ret_len = 0; @@ -2177,7 +2175,12 @@ static LRESULT call_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpar call_message_hooks( WH_CALLWNDPROC, HC_ACTION, same_thread, (LPARAM)&cwp, sizeof(cwp), packed_size, ansi ); - if (packed_size && !(params = malloc( sizeof(*params) + packed_size ))) return 0; + if (packed_size) + { + offset = (offset + 15) & ~15; + if (!(params = malloc( offset + packed_size ))) return 0; + } + if (!init_window_call_params( params, hwnd, msg, wparam, lparam, ansi_dst, mapping )) { if (params != &p) free( params ); @@ -2185,11 +2188,10 @@ static LRESULT call_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpar } if (type == MSG_OTHER_PROCESS) params->ansi = FALSE; - params->needs_unpack = packed_size != 0; if (packed_size) - pack_user_message( params + 1, packed_size, msg, wparam, lparam, ansi ); + pack_user_message( (char *)params + offset, packed_size, msg, wparam, lparam, ansi ); - result = dispatch_win_proc_params( params, sizeof(*params) + packed_size, &ret_ptr, &ret_len ); + result = dispatch_win_proc_params( params, offset + packed_size, &ret_ptr, &ret_len ); if (params != &p) free( params ); copy_user_result( ret_ptr, min( ret_len, packed_size ), result, msg, wparam, lparam, ansi ); diff --git a/dlls/wow64win/user.c b/dlls/wow64win/user.c index e593da7ba53..b15f0a263cf 100644 --- a/dlls/wow64win/user.c +++ b/dlls/wow64win/user.c @@ -353,7 +353,6 @@ struct win_proc_params32 ULONG lparam; BOOL ansi; BOOL ansi_dst; - BOOL needs_unpack; enum wm_char_mapping mapping; ULONG dpi_awareness; ULONG procA; @@ -471,7 +470,6 @@ static void win_proc_params_64to32( const struct win_proc_params *src, struct wi params.lparam = src->lparam; params.ansi = src->ansi; params.ansi_dst = src->ansi_dst; - params.needs_unpack = src->needs_unpack; params.mapping = src->mapping; params.dpi_awareness = HandleToUlong( src->dpi_awareness ); params.procA = PtrToUlong( src->procA ); @@ -932,7 +930,7 @@ static NTSTATUS WINAPI wow64_NtUserCallWinProc( void *arg, ULONG size ) { struct win_proc_params *params = arg; struct win_proc_params32 *params32 = arg; - size_t lparam_size = 0; + size_t lparam_size = 0, offset32 = sizeof(*params32); LRESULT result = 0; void *ret_ptr; ULONG ret_len; @@ -940,11 +938,17 @@ static NTSTATUS WINAPI wow64_NtUserCallWinProc( void *arg, ULONG size ) win_proc_params_64to32( params, params32 ); if (size > sizeof(*params)) - lparam_size = packed_message_64to32( params32->msg, params32->wparam, params + 1, params32 + 1, - size - sizeof(*params) ); + { + const size_t offset64 = (sizeof(*params) + 15) & ~15; + offset32 = (offset32 + 15) & ~15; + lparam_size = packed_message_64to32( params32->msg, params32->wparam, + (char *)params + offset64, + (char *)params32 + offset32, + size - offset64 ); + } status = Wow64KiUserCallbackDispatcher( NtUserCallWinProc, params32, - sizeof(*params32) + lparam_size, + offset32 + lparam_size, &ret_ptr, &ret_len ); if (ret_len >= sizeof(LONG)) diff --git a/include/ntuser.h b/include/ntuser.h index 110aa3a3c54..2d6c41f0e62 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -149,7 +149,6 @@ struct win_proc_params LPARAM lparam; BOOL ansi; BOOL ansi_dst; - BOOL needs_unpack; enum wm_char_mapping mapping; DPI_AWARENESS_CONTEXT dpi_awareness; WNDPROC procA;
1
0
0
0
Jacek Caban : win32u: Remove no longer needed process_packed_message.
by Alexandre Julliard
02 Aug '23
02 Aug '23
Module: wine Branch: master Commit: 813e04e6554bec6799c8eb2d38a5896d479f0401 URL:
https://gitlab.winehq.org/wine/wine/-/commit/813e04e6554bec6799c8eb2d38a589…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Jul 19 01:09:37 2023 +0200 win32u: Remove no longer needed process_packed_message. --- dlls/win32u/message.c | 62 +++++++++++---------------------------------------- 1 file changed, 13 insertions(+), 49 deletions(-) diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index 6e5b686c32e..588cd4e7cc8 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -2150,11 +2150,11 @@ BOOL WINAPI NtUserGetGUIThreadInfo( DWORD id, GUITHREADINFO *info ) * Call a window procedure and the corresponding hooks. */ static LRESULT call_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, - BOOL unicode, BOOL same_thread, enum wm_char_mapping mapping, - BOOL needs_unpack, void *buffer, size_t size ) + enum message_type type, BOOL same_thread, + enum wm_char_mapping mapping, BOOL ansi_dst ) { struct win_proc_params p, *params = &p; - BOOL ansi = !unicode && !needs_unpack; + BOOL ansi = ansi_dst && type == MSG_ASCII; LRESULT result = 0; CWPSTRUCT cwp; CWPRETSTRUCT cwpret; @@ -2165,11 +2165,9 @@ static LRESULT call_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpar if (msg & 0x80000000) return handle_internal_message( hwnd, msg, wparam, lparam ); - if (!needs_unpack) size = 0; if (!is_current_thread_window( hwnd )) return 0; - packed_size = user_message_size( hwnd, msg, wparam, lparam, needs_unpack, ansi ); - if (packed_size) size = packed_size; + packed_size = user_message_size( hwnd, msg, wparam, lparam, type == MSG_OTHER_PROCESS, ansi ); /* first the WH_CALLWNDPROC hook */ cwp.lParam = lparam; @@ -2179,21 +2177,19 @@ static LRESULT call_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpar call_message_hooks( WH_CALLWNDPROC, HC_ACTION, same_thread, (LPARAM)&cwp, sizeof(cwp), packed_size, ansi ); - if (size && !(params = malloc( sizeof(*params) + size ))) return 0; - if (!init_window_call_params( params, hwnd, msg, wparam, lparam, !unicode, mapping )) + if (packed_size && !(params = malloc( sizeof(*params) + packed_size ))) return 0; + if (!init_window_call_params( params, hwnd, msg, wparam, lparam, ansi_dst, mapping )) { if (params != &p) free( params ); return 0; } - if (needs_unpack) params->ansi = FALSE; - params->needs_unpack = needs_unpack || packed_size; + if (type == MSG_OTHER_PROCESS) params->ansi = FALSE; + params->needs_unpack = packed_size != 0; if (packed_size) pack_user_message( params + 1, packed_size, msg, wparam, lparam, ansi ); - else if (size) - memcpy( params + 1, buffer, size ); - result = dispatch_win_proc_params( params, sizeof(*params) + size, &ret_ptr, &ret_len ); + result = dispatch_win_proc_params( params, sizeof(*params) + packed_size, &ret_ptr, &ret_len ); if (params != &p) free( params ); copy_user_result( ret_ptr, min( ret_len, packed_size ), result, msg, wparam, lparam, ansi ); @@ -2637,7 +2633,6 @@ static int peek_message( MSG *msg, HWND hwnd, UINT first, UINT last, UINT flags, NTSTATUS res; size_t size = 0; const message_data_t *msg_data = buffer; - BOOL needs_unpack = FALSE; thread_info->client_info.msg_source = prev_source; @@ -2703,7 +2698,6 @@ static int peek_message( MSG *msg, HWND hwnd, UINT first, UINT last, UINT flags, if (!unpack_message( info.msg.hwnd, info.msg.message, &info.msg.wParam, &info.msg.lParam, &buffer, size )) continue; - needs_unpack = TRUE; break; case MSG_CALLBACK: info.flags = ISMEX_CALLBACK; @@ -2786,7 +2780,6 @@ static int peek_message( MSG *msg, HWND hwnd, UINT first, UINT last, UINT flags, reply_message( &info, 0, &info.msg ); continue; } - needs_unpack = TRUE; break; case MSG_HARDWARE: if (size >= sizeof(msg_data->hardware)) @@ -2867,8 +2860,8 @@ static int peek_message( MSG *msg, HWND hwnd, UINT first, UINT last, UINT flags, thread_info->client_info.msg_source = msg_source_unavailable; thread_info->client_info.receive_flags = info.flags; result = call_window_proc( info.msg.hwnd, info.msg.message, info.msg.wParam, - info.msg.lParam, (info.type != MSG_ASCII), FALSE, - WMCHAR_MAP_RECVMESSAGE, needs_unpack, buffer, size ); + info.msg.lParam, info.type, FALSE, WMCHAR_MAP_RECVMESSAGE, + info.type == MSG_ASCII ); if (thread_info->receive_info == &info) reply_winproc_result( result, info.msg.hwnd, info.msg.message, info.msg.wParam, info.msg.lParam ); @@ -3643,31 +3636,6 @@ static BOOL broadcast_message( struct send_message_info *info, DWORD_PTR *res_pt return TRUE; } -static BOOL process_packed_message( struct send_message_info *info, LRESULT *res_ptr, BOOL ansi ) -{ - struct packed_message data; - size_t buffer_size = 0, i; - void *buffer = NULL; - char *ptr; - - pack_message( info->hwnd, info->msg, info->wparam, info->lparam, &data ); - if (data.count == -1) return FALSE; - - for (i = 0; i < data.count; i++) buffer_size += data.size[i]; - if (!(buffer = malloc( buffer_size ))) return FALSE; - for (ptr = buffer, i = 0; i < data.count; i++) - { - memcpy( ptr, data.data[i], data.size[i] ); - ptr += data.size[i]; - } - - *res_ptr = call_window_proc( info->hwnd, info->msg, info->wparam, info->lparam, - !ansi, TRUE, info->wm_char, TRUE, buffer, buffer_size ); - - free( buffer ); - return TRUE; -} - static inline void *get_buffer( void *static_buffer, size_t size, size_t need ) { if (size >= need) return static_buffer; @@ -3974,18 +3942,14 @@ static BOOL process_message( struct send_message_info *info, DWORD_PTR *res_ptr, else ret = send_inter_thread_message( info, &result ); } - else if (info->type != MSG_OTHER_PROCESS) + else { result = call_window_proc( info->hwnd, info->msg, info->wparam, info->lparam, - !ansi, TRUE, info->wm_char, FALSE, NULL, 0 ); + info->type, TRUE, info->wm_char, ansi ); if (info->type == MSG_CALLBACK) call_sendmsg_callback( info->callback, info->hwnd, info->msg, info->data, result ); ret = TRUE; } - else - { - ret = process_packed_message( info, &result, ansi ); - } spy_exit_message( SPY_RESULT_OK, info->hwnd, info->msg, result, info->wparam, info->lparam ); thread_info->msg_source = prev_source;
1
0
0
0
Jacek Caban : win32u: Move more of unpack_message implementation from user32.
by Alexandre Julliard
02 Aug '23
02 Aug '23
Module: wine Branch: master Commit: b9740fcf4b57204ebc4ea1c52a01a16e3948af6f URL:
https://gitlab.winehq.org/wine/wine/-/commit/b9740fcf4b57204ebc4ea1c52a01a1…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Jul 19 00:49:42 2023 +0200 win32u: Move more of unpack_message implementation from user32. --- dlls/user32/user_private.h | 2 +- dlls/user32/winproc.c | 127 +++++---------------------------------------- dlls/win32u/message.c | 43 +++++++++++++++ 3 files changed, 56 insertions(+), 116 deletions(-) diff --git a/dlls/user32/user_private.h b/dlls/user32/user_private.h index 1a467712f0e..9330174a778 100644 --- a/dlls/user32/user_private.h +++ b/dlls/user32/user_private.h @@ -51,7 +51,7 @@ extern BOOL unpack_dde_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM const void *buffer, size_t size ) DECLSPEC_HIDDEN; extern void free_cached_data( UINT format, HANDLE handle ) DECLSPEC_HIDDEN; extern HANDLE render_synthesized_format( UINT format, UINT from ) DECLSPEC_HIDDEN; -extern BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lparam, +extern void unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lparam, void *buffer, size_t size, BOOL ansi ); extern void CLIPBOARD_ReleaseOwner( HWND hwnd ) DECLSPEC_HIDDEN; diff --git a/dlls/user32/winproc.c b/dlls/user32/winproc.c index 7d53269dc80..d0ebbb5ea8d 100644 --- a/dlls/user32/winproc.c +++ b/dlls/user32/winproc.c @@ -176,8 +176,7 @@ LRESULT WINPROC_CallProcAtoW( winproc_callback_t callback, HWND hwnd, UINT msg, { LRESULT ret = 0; - TRACE_(msg)("(hwnd=%p,msg=%s,wp=%08Ix,lp=%08Ix)\n", - hwnd, SPY_GetMsgName(msg, hwnd), wParam, lParam); + TRACE( "(hwnd=%p,msg=%s,wp=%08Ix,lp=%08Ix)\n", hwnd, SPY_GetMsgName(msg, hwnd), wParam, lParam ); switch(msg) { @@ -415,8 +414,8 @@ LRESULT WINPROC_CallProcAtoW( winproc_callback_t callback, HWND hwnd, UINT msg, case WM_PAINTCLIPBOARD: case WM_SIZECLIPBOARD: - FIXME_(msg)( "message %s (0x%x) needs translation, please report\n", - SPY_GetMsgName(msg, hwnd), msg ); + FIXME( "message %s (0x%x) needs translation, please report\n", + SPY_GetMsgName(msg, hwnd), msg ); break; default: @@ -437,8 +436,7 @@ static LRESULT WINPROC_CallProcWtoA( winproc_callback_t callback, HWND hwnd, UIN { LRESULT ret = 0; - TRACE_(msg)("(hwnd=%p,msg=%s,wp=%08Ix,lp=%08Ix)\n", - hwnd, SPY_GetMsgName(msg, hwnd), wParam, lParam); + TRACE( "(hwnd=%p,msg=%s,wp=%08Ix,lp=%08Ix)\n", hwnd, SPY_GetMsgName(msg, hwnd), wParam, lParam ); switch(msg) { @@ -683,8 +681,8 @@ static LRESULT WINPROC_CallProcWtoA( winproc_callback_t callback, HWND hwnd, UIN case WM_PAINTCLIPBOARD: case WM_SIZECLIPBOARD: - FIXME_(msg)( "message %s (%04x) needs translation, please report\n", - SPY_GetMsgName(msg, hwnd), msg ); + FIXME( "message %s (%04x) needs translation, please report\n", + SPY_GetMsgName(msg, hwnd), msg ); break; default: @@ -738,13 +736,11 @@ static size_t string_size( const void *str, BOOL ansi ) /*********************************************************************** * unpack_message * - * Unpack a message received from another process. + * Unpack a message received from win32u. */ -BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lparam, +void unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lparam, void *buffer, size_t size, BOOL ansi ) { - size_t minsize = 0; - switch(message) { case WM_NCCREATE: @@ -784,7 +780,7 @@ BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lparam, DWORD *ptr = buffer; *wparam = (WPARAM)ptr++; *lparam = (LPARAM)ptr; - return TRUE; + return; } case WM_MDICREATE: { @@ -802,108 +798,9 @@ BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lparam, } break; } - case WM_GETTEXT: - case WM_ASKCBFORMATNAME: - case WM_WININICHANGE: - case WM_SETTEXT: - case WM_DEVMODECHANGE: - case CB_DIR: - case LB_DIR: - case LB_ADDFILE: - case EM_REPLACESEL: - case WM_GETMINMAXINFO: - case WM_DRAWITEM: - case WM_MEASUREITEM: - case WM_DELETEITEM: - case WM_COMPAREITEM: - case WM_WINDOWPOSCHANGING: - case WM_WINDOWPOSCHANGED: - case WM_HELP: - case WM_STYLECHANGING: - case WM_STYLECHANGED: - case WM_GETDLGCODE: - case SBM_SETSCROLLINFO: - case SBM_GETSCROLLINFO: - case SBM_GETSCROLLBARINFO: - case EM_GETRECT: - case LB_GETITEMRECT: - case CB_GETDROPPEDCONTROLRECT: - case EM_SETRECT: - case EM_SETRECTNP: - case EM_GETLINE: - case EM_SETTABSTOPS: - case LB_SETTABSTOPS: - case CB_ADDSTRING: - case CB_INSERTSTRING: - case CB_FINDSTRING: - case CB_FINDSTRINGEXACT: - case CB_SELECTSTRING: - case LB_ADDSTRING: - case LB_INSERTSTRING: - case LB_FINDSTRING: - case LB_FINDSTRINGEXACT: - case LB_SELECTSTRING: - case CB_GETLBTEXT: - case LB_GETTEXT: - case LB_GETSELITEMS: - case WM_NEXTMENU: - case WM_SIZING: - case WM_MOVING: - case CB_GETCOMBOBOXINFO: - case WM_MDIGETACTIVE: - case WM_DEVICECHANGE: - break; - case WM_NOTIFY: - /* WM_NOTIFY cannot be sent across processes (MSDN) */ - return FALSE; - case WM_NCPAINT: - if (*wparam <= 1) return TRUE; - FIXME( "WM_NCPAINT hdc unpacking not supported\n" ); - return FALSE; - case WM_PAINT: - if (!*wparam) return TRUE; - /* fall through */ - - /* these contain an HFONT */ - case WM_SETFONT: - case WM_GETFONT: - /* these contain an HDC */ - case WM_ERASEBKGND: - case WM_ICONERASEBKGND: - case WM_CTLCOLORMSGBOX: - case WM_CTLCOLOREDIT: - case WM_CTLCOLORLISTBOX: - case WM_CTLCOLORBTN: - case WM_CTLCOLORDLG: - case WM_CTLCOLORSCROLLBAR: - case WM_CTLCOLORSTATIC: - case WM_PRINT: - case WM_PRINTCLIENT: - /* these contain an HGLOBAL */ - case WM_PAINTCLIPBOARD: - case WM_SIZECLIPBOARD: - /* these contain HICON */ - case WM_GETICON: - case WM_SETICON: - case WM_QUERYDRAGICON: - case WM_QUERYPARKICON: - /* these contain pointers */ - case WM_DROPOBJECT: - case WM_QUERYDROPOBJECT: - case WM_DRAGLOOP: - case WM_DRAGSELECT: - case WM_DRAGMOVE: - FIXME( "msg %x (%s) not supported yet\n", message, SPY_GetMsgName(message, hwnd) ); - return FALSE; - - default: - return TRUE; /* message doesn't need any unpacking */ } - /* default exit for most messages: check minsize and store buffer in lparam */ - if (size < minsize) return FALSE; *lparam = (LPARAM)buffer; - return TRUE; } BOOL WINAPI User32CallWindowProc( struct win_proc_params *params, ULONG size ) @@ -917,9 +814,9 @@ BOOL WINAPI User32CallWindowProc( struct win_proc_params *params, ULONG size ) size -= sizeof(*params); buffer = params + 1; - if (!unpack_message( params->hwnd, params->msg, ¶ms->wparam, - ¶ms->lparam, buffer, size, params->ansi )) - return 0; + if (size) + unpack_message( params->hwnd, params->msg, ¶ms->wparam, + ¶ms->lparam, buffer, size, params->ansi ); result = dispatch_win_proc_params( params ); diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index 56a05ba7eac..6e5b686c32e 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -880,6 +880,49 @@ static BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lpa if (!(*wparam & 0x8000)) return TRUE; minsize = sizeof(DEV_BROADCAST_HDR); break; + case WM_NOTIFY: + /* WM_NOTIFY cannot be sent across processes (MSDN) */ + return FALSE; + case WM_NCPAINT: + if (*wparam <= 1) return TRUE; + FIXME( "WM_NCPAINT hdc unpacking not supported\n" ); + return FALSE; + case WM_PAINT: + if (!*wparam) return TRUE; + /* fall through */ + + /* these contain an HFONT */ + case WM_SETFONT: + case WM_GETFONT: + /* these contain an HDC */ + case WM_ERASEBKGND: + case WM_ICONERASEBKGND: + case WM_CTLCOLORMSGBOX: + case WM_CTLCOLOREDIT: + case WM_CTLCOLORLISTBOX: + case WM_CTLCOLORBTN: + case WM_CTLCOLORDLG: + case WM_CTLCOLORSCROLLBAR: + case WM_CTLCOLORSTATIC: + case WM_PRINT: + case WM_PRINTCLIENT: + /* these contain an HGLOBAL */ + case WM_PAINTCLIPBOARD: + case WM_SIZECLIPBOARD: + /* these contain HICON */ + case WM_GETICON: + case WM_SETICON: + case WM_QUERYDRAGICON: + case WM_QUERYPARKICON: + /* these contain pointers */ + case WM_DROPOBJECT: + case WM_QUERYDROPOBJECT: + case WM_DRAGLOOP: + case WM_DRAGSELECT: + case WM_DRAGMOVE: + FIXME( "msg %x (%s) not supported yet\n", message, debugstr_msg_name( message, hwnd )); + return FALSE; + default: return TRUE; /* message doesn't need any unpacking */ }
1
0
0
0
Jacek Caban : win32u: Use user message packing for WM_DEVICECHANGE.
by Alexandre Julliard
02 Aug '23
02 Aug '23
Module: wine Branch: master Commit: 140f9e82f96fc825ac72a217339104fb8e81dc83 URL:
https://gitlab.winehq.org/wine/wine/-/commit/140f9e82f96fc825ac72a217339104…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Jul 19 00:35:31 2023 +0200 win32u: Use user message packing for WM_DEVICECHANGE. --- dlls/user32/winproc.c | 3 --- dlls/win32u/message.c | 11 +++++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/dlls/user32/winproc.c b/dlls/user32/winproc.c index b1193773ed2..7d53269dc80 100644 --- a/dlls/user32/winproc.c +++ b/dlls/user32/winproc.c @@ -851,10 +851,7 @@ BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lparam, case WM_MOVING: case CB_GETCOMBOBOXINFO: case WM_MDIGETACTIVE: - break; case WM_DEVICECHANGE: - if (!(*wparam & 0x8000)) return TRUE; - minsize = sizeof(DEV_BROADCAST_HDR); break; case WM_NOTIFY: /* WM_NOTIFY cannot be sent across processes (MSDN) */ diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index 28a2b7d39cc..56a05ba7eac 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -876,6 +876,10 @@ static BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lpa if (!*lparam) return TRUE; if (!get_buffer_space( buffer, sizeof(BOOL), size )) return FALSE; break; + case WM_DEVICECHANGE: + if (!(*wparam & 0x8000)) return TRUE; + minsize = sizeof(DEV_BROADCAST_HDR); + break; default: return TRUE; /* message doesn't need any unpacking */ } @@ -1704,6 +1708,13 @@ size_t user_message_size( HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam, case WM_MDIGETACTIVE: if (lparam) size = sizeof(BOOL); break; + case WM_DEVICECHANGE: + if ((wparam & 0x8000) && lparam) + { + const DEV_BROADCAST_HDR *header = lparam_ptr; + size = header->dbch_size; + } + break; } return size;
1
0
0
0
← Newer
1
...
57
58
59
60
61
62
63
...
67
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
Results per page:
10
25
50
100
200