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
July 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
865 discussions
Start a n
N
ew thread
Conor McCarthy : vkd3d-shader/dxil: Validate the module format version.
by Alexandre Julliard
11 Jul '23
11 Jul '23
Module: vkd3d Branch: master Commit: 22157c3da37d5edf068df10c746bec5604ca6ca8 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/22157c3da37d5edf068df10c746be…
Author: Conor McCarthy <cmccarthy(a)codeweavers.com> Date: Thu Jun 29 15:32:44 2023 +1000 vkd3d-shader/dxil: Validate the module format version. --- libs/vkd3d-shader/dxil.c | 56 ++++++++++++++++++++++++++++++++ libs/vkd3d-shader/vkd3d_shader_private.h | 1 + 2 files changed, 57 insertions(+) diff --git a/libs/vkd3d-shader/dxil.c b/libs/vkd3d-shader/dxil.c index 3a8b2fdb..cf0d4bb5 100644 --- a/libs/vkd3d-shader/dxil.c +++ b/libs/vkd3d-shader/dxil.c @@ -70,6 +70,13 @@ enum bitcode_address_space ADDRESS_SPACE_GROUPSHARED, }; +enum bitcode_module_code +{ + MODULE_CODE_VERSION = 1, + MODULE_CODE_GLOBALVAR = 7, + MODULE_CODE_FUNCTION = 8, +}; + enum bitcode_type_code { TYPE_CODE_NUMENTRY = 1, @@ -1201,6 +1208,49 @@ static enum vkd3d_result sm6_parser_symtab_init(struct sm6_parser *sm6) return VKD3D_OK; } +static enum vkd3d_result sm6_parser_globals_init(struct sm6_parser *sm6) +{ + const struct dxil_block *block = &sm6->root_block; + const struct dxil_record *record; + uint64_t version; + size_t i; + + sm6->p.location.line = block->id; + sm6->p.location.column = 0; + + for (i = 0; i < block->record_count; ++i) + { + sm6->p.location.column = i; + record = block->records[i]; + switch (record->code) + { + case MODULE_CODE_FUNCTION: + FIXME("Functions are not implemented yet.\n"); + break; + + case MODULE_CODE_GLOBALVAR: + FIXME("Global variables are not implemented yet.\n"); + break; + + case MODULE_CODE_VERSION: + dxil_record_validate_operand_count(record, 1, 1, sm6); + if ((version = record->operands[0]) != 1) + { + FIXME("Unsupported format version %#"PRIx64".\n", version); + vkd3d_shader_parser_error(&sm6->p, VKD3D_SHADER_ERROR_DXIL_UNSUPPORTED_BITCODE_FORMAT, + "Bitcode format version %#"PRIx64" is unsupported.", version); + return VKD3D_ERROR_INVALID_SHADER; + } + break; + + default: + break; + } + } + + return VKD3D_OK; +} + static void sm6_type_table_cleanup(struct sm6_type *types, size_t count) { size_t i; @@ -1411,6 +1461,12 @@ static enum vkd3d_result sm6_parser_init(struct sm6_parser *sm6, const uint32_t return ret; } + if ((ret = sm6_parser_globals_init(sm6)) < 0) + { + WARN("Failed to load global declarations.\n"); + return ret; + } + dxil_block_destroy(&sm6->root_block); return VKD3D_OK; diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index 3802af1c..e73a8cd1 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -158,6 +158,7 @@ enum vkd3d_shader_error VKD3D_SHADER_ERROR_DXIL_INVALID_OPERAND_COUNT = 8005, VKD3D_SHADER_ERROR_DXIL_INVALID_TYPE_TABLE = 8006, VKD3D_SHADER_ERROR_DXIL_INVALID_VALUE_SYMTAB = 8007, + VKD3D_SHADER_ERROR_DXIL_UNSUPPORTED_BITCODE_FORMAT = 8008, VKD3D_SHADER_WARNING_DXIL_UNKNOWN_MAGIC_NUMBER = 8300, VKD3D_SHADER_WARNING_DXIL_UNKNOWN_SHADER_TYPE = 8301,
1
0
0
0
Conor McCarthy : vkd3d-shader/dxil: Read the value symbol table.
by Alexandre Julliard
11 Jul '23
11 Jul '23
Module: vkd3d Branch: master Commit: eca4b62c7ec1d9ff259c98bb4ee8413f045ced44 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/eca4b62c7ec1d9ff259c98bb4ee84…
Author: Conor McCarthy <cmccarthy(a)codeweavers.com> Date: Mon Jul 10 13:46:45 2023 +1000 vkd3d-shader/dxil: Read the value symbol table. --- libs/vkd3d-shader/dxil.c | 123 +++++++++++++++++++++++++++++-- libs/vkd3d-shader/vkd3d_shader_private.h | 1 + 2 files changed, 119 insertions(+), 5 deletions(-) diff --git a/libs/vkd3d-shader/dxil.c b/libs/vkd3d-shader/dxil.c index 0832670c..3a8b2fdb 100644 --- a/libs/vkd3d-shader/dxil.c +++ b/libs/vkd3d-shader/dxil.c @@ -89,6 +89,12 @@ enum bitcode_type_code TYPE_CODE_FUNCTION = 21, }; +enum bitcode_value_symtab_code +{ + VST_CODE_ENTRY = 1, + VST_CODE_BBENTRY = 2, +}; + struct sm6_pointer_info { const struct sm6_type *type; @@ -149,6 +155,12 @@ struct dxil_record uint64_t operands[]; }; +struct sm6_symbol +{ + unsigned int id; + const char *name; +}; + struct dxil_block { const struct dxil_block *parent; @@ -189,6 +201,9 @@ struct sm6_parser struct sm6_type *types; size_t type_count; + struct sm6_symbol *global_symbols; + size_t global_symbol_count; + struct vkd3d_shader_parser p; }; @@ -818,16 +833,17 @@ static const struct dxil_block *sm6_parser_get_level_one_block(const struct sm6_ return found; } -static char *dxil_record_to_string(const struct dxil_record *record) +static char *dxil_record_to_string(const struct dxil_record *record, unsigned int offset) { unsigned int i; char *str; - if (!(str = vkd3d_calloc(record->operand_count + 1, 1))) + assert(offset <= record->operand_count); + if (!(str = vkd3d_calloc(record->operand_count - offset + 1, 1))) return NULL; - for (i = 0; i < record->operand_count; ++i) - str[i] = record->operands[i]; + for (i = offset; i < record->operand_count; ++i) + str[i - offset] = record->operands[i]; return str; } @@ -1079,7 +1095,7 @@ static enum vkd3d_result sm6_parser_type_table_init(struct sm6_parser *sm6) break; case TYPE_CODE_STRUCT_NAME: - if (!(struct_name = dxil_record_to_string(record))) + if (!(struct_name = dxil_record_to_string(record, 0))) { ERR("Failed to allocate struct name.\n"); return VKD3D_ERROR_OUT_OF_MEMORY; @@ -1111,6 +1127,80 @@ static enum vkd3d_result sm6_parser_type_table_init(struct sm6_parser *sm6) return VKD3D_OK; } +static int global_symbol_compare(const void *a, const void *b) +{ + return vkd3d_u32_compare(((const struct sm6_symbol *)a)->id, ((const struct sm6_symbol *)b)->id); +} + +static enum vkd3d_result sm6_parser_symtab_init(struct sm6_parser *sm6) +{ + const struct dxil_record *record; + const struct dxil_block *block; + struct sm6_symbol *symbol; + size_t i, count; + bool is_unique; + + sm6->p.location.line = 0; + sm6->p.location.column = 0; + + if (!(block = sm6_parser_get_level_one_block(sm6, VALUE_SYMTAB_BLOCK, &is_unique))) + { + /* There should always be at least one symbol: the name of the entry point function. */ + WARN("No value symtab block found.\n"); + return VKD3D_ERROR_INVALID_SHADER; + } + if (!is_unique) + FIXME("Ignoring extra value symtab block(s).\n"); + + sm6->p.location.line = block->id; + + for (i = 0, count = 0; i < block->record_count; ++i) + count += block->records[i]->code == VST_CODE_ENTRY; + + if (!(sm6->global_symbols = vkd3d_calloc(count, sizeof(*sm6->global_symbols)))) + { + ERR("Failed to allocate global symbols.\n"); + return VKD3D_ERROR_OUT_OF_MEMORY; + } + + for (i = 0; i < block->record_count; ++i) + { + sm6->p.location.column = i; + record = block->records[i]; + + if (record->code != VST_CODE_ENTRY) + { + FIXME("Unhandled symtab code %u.\n", record->code); + continue; + } + if (!dxil_record_validate_operand_min_count(record, 1, sm6)) + continue; + + symbol = &sm6->global_symbols[sm6->global_symbol_count]; + symbol->id = record->operands[0]; + if (!(symbol->name = dxil_record_to_string(record, 1))) + { + ERR("Failed to allocate symbol name.\n"); + return VKD3D_ERROR_OUT_OF_MEMORY; + } + ++sm6->global_symbol_count; + } + + sm6->p.location.column = block->record_count; + + qsort(sm6->global_symbols, sm6->global_symbol_count, sizeof(*sm6->global_symbols), global_symbol_compare); + for (i = 1; i < sm6->global_symbol_count; ++i) + { + if (sm6->global_symbols[i].id == sm6->global_symbols[i - 1].id) + { + WARN("Invalid duplicate symbol id %u.\n", sm6->global_symbols[i].id); + return VKD3D_ERROR_INVALID_SHADER; + } + } + + return VKD3D_OK; +} + static void sm6_type_table_cleanup(struct sm6_type *types, size_t count) { size_t i; @@ -1137,6 +1227,15 @@ static void sm6_type_table_cleanup(struct sm6_type *types, size_t count) vkd3d_free(types); } +static void sm6_symtab_cleanup(struct sm6_symbol *symbols, size_t count) +{ + size_t i; + + for (i = 0; i < count; ++i) + vkd3d_free((void *)symbols[i].name); + vkd3d_free(symbols); +} + static void sm6_parser_destroy(struct vkd3d_shader_parser *parser) { struct sm6_parser *sm6 = sm6_parser(parser); @@ -1145,6 +1244,7 @@ static void sm6_parser_destroy(struct vkd3d_shader_parser *parser) dxil_global_abbrevs_cleanup(sm6->abbrevs, sm6->abbrev_count); shader_instruction_array_destroy(&parser->instructions); sm6_type_table_cleanup(sm6->types, sm6->type_count); + sm6_symtab_cleanup(sm6->global_symbols, sm6->global_symbol_count); free_shader_desc(&parser->shader_desc); vkd3d_free(sm6); } @@ -1298,6 +1398,19 @@ static enum vkd3d_result sm6_parser_init(struct sm6_parser *sm6, const uint32_t return ret; } + if ((ret = sm6_parser_symtab_init(sm6)) < 0) + { + if (ret == VKD3D_ERROR_OUT_OF_MEMORY) + vkd3d_shader_error(message_context, &location, VKD3D_SHADER_ERROR_DXIL_OUT_OF_MEMORY, + "Out of memory parsing DXIL value symbol table."); + else if (ret == VKD3D_ERROR_INVALID_SHADER) + vkd3d_shader_error(message_context, &location, VKD3D_SHADER_ERROR_DXIL_INVALID_VALUE_SYMTAB, + "DXIL value symbol table is invalid."); + else + vkd3d_unreachable(); + return ret; + } + dxil_block_destroy(&sm6->root_block); return VKD3D_OK; diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index b2df72d1..3802af1c 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -157,6 +157,7 @@ enum vkd3d_shader_error VKD3D_SHADER_ERROR_DXIL_INVALID_BITCODE = 8004, VKD3D_SHADER_ERROR_DXIL_INVALID_OPERAND_COUNT = 8005, VKD3D_SHADER_ERROR_DXIL_INVALID_TYPE_TABLE = 8006, + VKD3D_SHADER_ERROR_DXIL_INVALID_VALUE_SYMTAB = 8007, VKD3D_SHADER_WARNING_DXIL_UNKNOWN_MAGIC_NUMBER = 8300, VKD3D_SHADER_WARNING_DXIL_UNKNOWN_SHADER_TYPE = 8301,
1
0
0
0
Conor McCarthy : vkd3d-shader/dxil: Read the type table.
by Alexandre Julliard
11 Jul '23
11 Jul '23
Module: vkd3d Branch: master Commit: 571d807dd8588c6574f3f5f974136119c041f43a URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/571d807dd8588c6574f3f5f974136…
Author: Conor McCarthy <cmccarthy(a)codeweavers.com> Date: Fri May 12 15:59:42 2023 +1000 vkd3d-shader/dxil: Read the type table. --- include/private/vkd3d_common.h | 5 + libs/vkd3d-shader/dxil.c | 437 +++++++++++++++++++++++++++++++ libs/vkd3d-shader/vkd3d_shader_private.h | 3 + 3 files changed, 445 insertions(+)
1
0
0
0
Conor McCarthy : vkd3d-shader/dxil: Use size_t where applicable.
by Alexandre Julliard
11 Jul '23
11 Jul '23
Module: vkd3d Branch: master Commit: 41a5d37935831cf3fb605485045d6619abf0dd17 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/41a5d37935831cf3fb605485045d6…
Author: Conor McCarthy <cmccarthy(a)codeweavers.com> Date: Mon Jul 10 13:36:16 2023 +1000 vkd3d-shader/dxil: Use size_t where applicable. --- libs/vkd3d-shader/dxil.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/libs/vkd3d-shader/dxil.c b/libs/vkd3d-shader/dxil.c index 67dcd26a..8fc8dba9 100644 --- a/libs/vkd3d-shader/dxil.c +++ b/libs/vkd3d-shader/dxil.c @@ -628,10 +628,10 @@ static enum vkd3d_result dxil_block_read(struct dxil_block *parent, struct sm6_p return VKD3D_ERROR_INVALID_SHADER; } -static unsigned int sm6_parser_compute_global_abbrev_count_for_block_id(struct sm6_parser *sm6, +static size_t sm6_parser_compute_global_abbrev_count_for_block_id(struct sm6_parser *sm6, unsigned int block_id) { - unsigned int i, count; + size_t i, count; for (i = 0, count = 0; i < sm6->abbrev_count; ++i) count += sm6->abbrevs[i]->block_id == block_id; @@ -641,7 +641,7 @@ static unsigned int sm6_parser_compute_global_abbrev_count_for_block_id(struct s static void dxil_block_destroy(struct dxil_block *block) { - unsigned int i; + size_t i; for (i = 0; i < block->record_count; ++i) vkd3d_free(block->records[i]); @@ -663,7 +663,7 @@ static void dxil_block_destroy(struct dxil_block *block) static enum vkd3d_result dxil_block_init(struct dxil_block *block, const struct dxil_block *parent, struct sm6_parser *sm6) { - unsigned int i, abbrev_count = 0; + size_t i, abbrev_count = 0; enum vkd3d_result ret; block->parent = parent; @@ -705,9 +705,9 @@ static enum vkd3d_result dxil_block_init(struct dxil_block *block, const struct return ret; } -static void dxil_global_abbrevs_cleanup(struct dxil_global_abbrev **abbrevs, unsigned int count) +static void dxil_global_abbrevs_cleanup(struct dxil_global_abbrev **abbrevs, size_t count) { - unsigned int i; + size_t i; for (i = 0; i < count; ++i) vkd3d_free(abbrevs[i]); @@ -735,11 +735,12 @@ static enum vkd3d_result sm6_parser_init(struct sm6_parser *sm6, const uint32_t { const struct vkd3d_shader_location location = {.source_name = source_name}; uint32_t version_token, dxil_version, token_count, magic; - unsigned int count, length, chunk_offset, chunk_size; + unsigned int chunk_offset, chunk_size; enum bitcode_block_abbreviation abbr; struct vkd3d_shader_version version; struct dxil_block *block; enum vkd3d_result ret; + size_t count, length; count = byte_code_size / sizeof(*byte_code); if (count < 6) @@ -757,9 +758,9 @@ static enum vkd3d_result sm6_parser_init(struct sm6_parser *sm6, const uint32_t if (token_count < 6 || count < token_count) { - WARN("Invalid token count %u (word count %u).\n", token_count, count); + WARN("Invalid token count %u (word count %zu).\n", token_count, count); vkd3d_shader_error(message_context, &location, VKD3D_SHADER_ERROR_DXIL_INVALID_CHUNK_SIZE, - "DXIL chunk token count %#x is invalid (word count %u).", token_count, count); + "DXIL chunk token count %#x is invalid (word count %zu).", token_count, count); return VKD3D_ERROR_INVALID_SHADER; } @@ -847,17 +848,17 @@ static enum vkd3d_result sm6_parser_init(struct sm6_parser *sm6, const uint32_t length = sm6->ptr - sm6->start - block->start; if (length != block->length) { - WARN("Invalid block length %u; expected %u.\n", length, block->length); + WARN("Invalid block length %zu; expected %u.\n", length, block->length); vkd3d_shader_parser_warning(&sm6->p, VKD3D_SHADER_WARNING_DXIL_INVALID_BLOCK_LENGTH, - "Root block ends with length %u but indicated length is %u.", length, block->length); + "Root block ends with length %zu but indicated length is %u.", length, block->length); } if (sm6->ptr != sm6->end) { - unsigned int expected_length = sm6->end - sm6->start; + size_t expected_length = sm6->end - sm6->start; length = sm6->ptr - sm6->start; - WARN("Invalid module length %u; expected %u.\n", length, expected_length); + WARN("Invalid module length %zu; expected %zu.\n", length, expected_length); vkd3d_shader_parser_warning(&sm6->p, VKD3D_SHADER_WARNING_DXIL_INVALID_MODULE_LENGTH, - "Module ends with length %u but indicated length is %u.", length, expected_length); + "Module ends with length %zu but indicated length is %zu.", length, expected_length); } dxil_block_destroy(&sm6->root_block);
1
0
0
0
Alexandre Julliard : gitlab: Upgrade the Debian image to bookworm.
by Alexandre Julliard
10 Jul '23
10 Jul '23
Module: wine Branch: master Commit: 5799e89f15b5584f186dcc2fd24b98e0a7bd6c10 URL:
https://gitlab.winehq.org/wine/wine/-/commit/5799e89f15b5584f186dcc2fd24b98…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jul 10 17:18:49 2023 +0200 gitlab: Upgrade the Debian image to bookworm. --- tools/gitlab/build.yml | 4 ++-- tools/gitlab/image.docker | 5 ++--- tools/gitlab/image.yml | 4 ++-- tools/gitlab/test.yml | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/tools/gitlab/build.yml b/tools/gitlab/build.yml index b474f271c8b..441582a99f3 100644 --- a/tools/gitlab/build.yml +++ b/tools/gitlab/build.yml @@ -2,7 +2,7 @@ .wine-build: stage: build - image: $CI_REGISTRY/wine/wine:debian-bullseye + image: $CI_REGISTRY/wine/wine:debian-bookworm interruptible: true variables: GIT_DEPTH: 0 @@ -64,7 +64,7 @@ build-daily-linux: build-winetest: stage: build - image: $CI_REGISTRY/wine/wine:debian-bullseye + image: $CI_REGISTRY/wine/wine:debian-bookworm rules: - if: $CI_PIPELINE_SOURCE == 'trigger' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH needs: diff --git a/tools/gitlab/image.docker b/tools/gitlab/image.docker index cf16ed49c95..c7f9bcd1c08 100644 --- a/tools/gitlab/image.docker +++ b/tools/gitlab/image.docker @@ -23,13 +23,12 @@ RUN export DEBIAN_FRONTEND=noninteractive; \ libgl1-mesa-dev:amd64 libgl1-mesa-dev:i386 \ libgnutls28-dev:amd64 libgnutls28-dev:i386 \ libgphoto2-dev:amd64 libgphoto2-dev:i386 \ - libgstreamer-plugins-base1.0-dev:amd64 libgstreamer-plugins-base1.0-dev:i386 \ + libgstreamer-plugins-base1.0-dev:i386 \ libice-dev:amd64 libice-dev:i386 \ libkrb5-dev:amd64 libkrb5-dev:i386 \ - libldap-dev:amd64 libldap-dev:i386 \ - libopenal-dev:amd64 libopenal-dev:i386 \ libosmesa6-dev:amd64 libosmesa6-dev:i386 \ libpcap-dev:amd64 libpcap-dev:i386 \ + libpcsclite-dev:amd64 \ libpulse-dev:amd64 libpulse-dev:i386 \ libsane-dev:amd64 libsane-dev:i386 \ libsdl2-dev:amd64 libsdl2-dev:i386 \ diff --git a/tools/gitlab/image.yml b/tools/gitlab/image.yml index 7a866553dc2..1e9b3207572 100644 --- a/tools/gitlab/image.yml +++ b/tools/gitlab/image.yml @@ -11,8 +11,8 @@ build-image: name: gcr.io/kaniko-project/executor:debug entrypoint: [""] variables: - IMAGE_SOURCE: "$CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX/debian:bullseye" - IMAGE_LOCAL: "$CI_REGISTRY_IMAGE:debian-bullseye" + IMAGE_SOURCE: "$CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX/debian:bookworm" + IMAGE_LOCAL: "$CI_REGISTRY_IMAGE:debian-bookworm" DOCKER_FILE: "$CI_PROJECT_DIR/tools/gitlab/image.docker" script: - mkdir -p /kaniko/.docker diff --git a/tools/gitlab/test.yml b/tools/gitlab/test.yml index 568addecb5c..1fa0ce402af 100644 --- a/tools/gitlab/test.yml +++ b/tools/gitlab/test.yml @@ -2,7 +2,7 @@ .wine-test: stage: test - image: $CI_REGISTRY/wine/wine:debian-bullseye + image: $CI_REGISTRY/wine/wine:debian-bookworm interruptible: true variables: GIT_STRATEGY: none
1
0
0
0
Alexandre Julliard : wow64: Implement backend notification functions.
by Alexandre Julliard
10 Jul '23
10 Jul '23
Module: wine Branch: master Commit: 1591e01e5d5b29ebb3d3bcb01e6ffc962d65b919 URL:
https://gitlab.winehq.org/wine/wine/-/commit/1591e01e5d5b29ebb3d3bcb01e6ffc…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jul 10 17:03:31 2023 +0200 wow64: Implement backend notification functions. Co-authored-by: Billy Laws <blaws05(a)gmail.com> --- dlls/wow64/process.c | 3 +++ dlls/wow64/syscall.c | 15 ++++++++++++++ dlls/wow64/virtual.c | 49 +++++++++++++++++++++++++++++++++------------- dlls/wow64/wow64_private.h | 10 +++++++++- 4 files changed, 62 insertions(+), 15 deletions(-) diff --git a/dlls/wow64/process.c b/dlls/wow64/process.c index 2182491bbfb..0728f9f0999 100644 --- a/dlls/wow64/process.c +++ b/dlls/wow64/process.c @@ -435,6 +435,9 @@ NTSTATUS WINAPI wow64_NtFlushInstructionCache( UINT *args ) const void *addr = get_ptr( &args ); SIZE_T size = get_ulong( &args ); + if (pBTCpuNotifyFlushInstructionCache2 && RtlIsCurrentProcess( process )) + pBTCpuNotifyFlushInstructionCache2( addr, size ); + return NtFlushInstructionCache( process, addr, size ); } diff --git a/dlls/wow64/syscall.c b/dlls/wow64/syscall.c index 85db80a53df..0f8135859bc 100644 --- a/dlls/wow64/syscall.c +++ b/dlls/wow64/syscall.c @@ -100,6 +100,7 @@ static HMODULE win32u_module; static WOW64INFO *wow64info; /* cpu backend dll functions */ +/* the function prototypes most likely differ from Windows */ static void * (WINAPI *pBTCpuGetBopCode)(void); static NTSTATUS (WINAPI *pBTCpuGetContext)(HANDLE,HANDLE,void *,void *); static BOOLEAN (WINAPI *pBTCpuIsProcessorFeaturePresent)(UINT); @@ -110,6 +111,13 @@ static void (WINAPI *pBTCpuSimulate)(void); static NTSTATUS (WINAPI *pBTCpuResetToConsistentState)( EXCEPTION_POINTERS * ); static void * (WINAPI *p__wine_get_unix_opcode)(void); static void * (WINAPI *pKiRaiseUserExceptionDispatcher)(void); +void (WINAPI *pBTCpuNotifyFlushInstructionCache2)( const void *, SIZE_T ) = NULL; +void (WINAPI *pBTCpuNotifyMapViewOfSection)( void * ) = NULL; +void (WINAPI *pBTCpuNotifyMemoryAlloc)( void *, SIZE_T, ULONG, ULONG ) = NULL; +void (WINAPI *pBTCpuNotifyMemoryDirty)( void *, SIZE_T ) = NULL; +void (WINAPI *pBTCpuNotifyMemoryFree)( void *, SIZE_T ) = NULL; +void (WINAPI *pBTCpuNotifyMemoryProtect)( void *, SIZE_T, ULONG ) = NULL; +void (WINAPI *pBTCpuNotifyUnmapViewOfSection)( void * ) = NULL; void (WINAPI *pBTCpuUpdateProcessorInformation)( SYSTEM_CPU_INFORMATION * ) = NULL; void *dummy = RtlUnwind; @@ -896,6 +904,13 @@ static DWORD WINAPI process_init( RTL_RUN_ONCE *once, void *param, void **contex GET_PTR( BTCpuResetToConsistentState ); GET_PTR( BTCpuSetContext ); GET_PTR( BTCpuSimulate ); + GET_PTR( BTCpuNotifyFlushInstructionCache2 ); + GET_PTR( BTCpuNotifyMapViewOfSection ); + GET_PTR( BTCpuNotifyMemoryAlloc ); + GET_PTR( BTCpuNotifyMemoryDirty ); + GET_PTR( BTCpuNotifyMemoryFree ); + GET_PTR( BTCpuNotifyMemoryProtect ); + GET_PTR( BTCpuNotifyUnmapViewOfSection ); GET_PTR( BTCpuUpdateProcessorInformation ); GET_PTR( __wine_get_unix_opcode ); diff --git a/dlls/wow64/virtual.c b/dlls/wow64/virtual.c index c171fe39cb2..6a63f3793bb 100644 --- a/dlls/wow64/virtual.c +++ b/dlls/wow64/virtual.c @@ -126,6 +126,8 @@ NTSTATUS WINAPI wow64_NtAllocateVirtualMemory( UINT *args ) size_32to64( &size, size32 ), type, protect ); if (!status) { + if (pBTCpuNotifyMemoryAlloc && RtlIsCurrentProcess(process)) + pBTCpuNotifyMemoryAlloc( addr, size, type, protect ); put_addr( addr32, addr ); put_size( size32, size ); } @@ -150,7 +152,8 @@ NTSTATUS WINAPI wow64_NtAllocateVirtualMemoryEx( UINT *args ) SIZE_T size; NTSTATUS status; MEM_EXTENDED_PARAMETER *params64; - BOOL set_limit = (!*addr32 && process == GetCurrentProcess()); + BOOL is_current = RtlIsCurrentProcess( process ); + BOOL set_limit = (!*addr32 && is_current); if ((status = mem_extended_parameters_32to64( ¶ms64, params32, &count, set_limit ))) return status; @@ -158,6 +161,7 @@ NTSTATUS WINAPI wow64_NtAllocateVirtualMemoryEx( UINT *args ) type, protect, params64, count ); if (!status) { + if (pBTCpuNotifyMemoryAlloc && is_current) pBTCpuNotifyMemoryAlloc( addr, size, type, protect ); put_addr( addr32, addr ); put_size( size32, size ); } @@ -212,12 +216,14 @@ NTSTATUS WINAPI wow64_NtFreeVirtualMemory( UINT *args ) ULONG *size32 = get_ptr( &args ); ULONG type = get_ulong( &args ); - void *addr; - SIZE_T size; + void *addr = ULongToPtr( *addr32 ); + SIZE_T size = *size32; NTSTATUS status; - status = NtFreeVirtualMemory( process, addr_32to64( &addr, addr32 ), - size_32to64( &size, size32 ), type ); + if (pBTCpuNotifyMemoryFree && RtlIsCurrentProcess( process )) + pBTCpuNotifyMemoryFree( addr, size ); + + status = NtFreeVirtualMemory( process, &addr, &size, type ); if (!status) { put_addr( addr32, addr ); @@ -353,9 +359,12 @@ NTSTATUS WINAPI wow64_NtMapViewOfSection( UINT *args ) { SECTION_IMAGE_INFORMATION info; - if (!NtQuerySection( handle, SectionImageInformation, &info, sizeof(info), NULL )) + if (RtlIsCurrentProcess( process ) && + !NtQuerySection( handle, SectionImageInformation, &info, sizeof(info), NULL ) && + info.Machine == current_machine) { - if (info.Machine == current_machine) init_image_mapping( addr ); + if (pBTCpuNotifyMapViewOfSection) pBTCpuNotifyMapViewOfSection( addr ); + init_image_mapping( addr ); } put_addr( addr32, addr ); put_size( size32, size ); @@ -382,7 +391,8 @@ NTSTATUS WINAPI wow64_NtMapViewOfSectionEx( UINT *args ) SIZE_T size; NTSTATUS status; MEM_EXTENDED_PARAMETER *params64; - BOOL set_limit = (!*addr32 && process == GetCurrentProcess()); + BOOL is_current = RtlIsCurrentProcess( process ); + BOOL set_limit = (!*addr32 && is_current); if ((status = mem_extended_parameters_32to64( ¶ms64, params32, &count, set_limit ))) return status; @@ -392,9 +402,12 @@ NTSTATUS WINAPI wow64_NtMapViewOfSectionEx( UINT *args ) { SECTION_IMAGE_INFORMATION info; - if (!NtQuerySection( handle, SectionImageInformation, &info, sizeof(info), NULL )) + if (is_current && + !NtQuerySection( handle, SectionImageInformation, &info, sizeof(info), NULL ) && + info.Machine == current_machine) { - if (info.Machine == current_machine) init_image_mapping( addr ); + if (pBTCpuNotifyMapViewOfSection) pBTCpuNotifyMapViewOfSection( addr ); + init_image_mapping( addr ); } put_addr( addr32, addr ); put_size( size32, size ); @@ -413,12 +426,14 @@ NTSTATUS WINAPI wow64_NtProtectVirtualMemory( UINT *args ) ULONG new_prot = get_ulong( &args ); ULONG *old_prot = get_ptr( &args ); - void *addr; - SIZE_T size; + void *addr = ULongToPtr( *addr32 ); + SIZE_T size = *size32; NTSTATUS status; - status = NtProtectVirtualMemory( process, addr_32to64( &addr, addr32 ), - size_32to64( &size, size32 ), new_prot, old_prot ); + if (pBTCpuNotifyMemoryProtect && RtlIsCurrentProcess(process)) + pBTCpuNotifyMemoryProtect( addr, size, new_prot ); + + status = NtProtectVirtualMemory( process, &addr, &size, new_prot, old_prot ); if (!status) { put_addr( addr32, addr ); @@ -686,6 +701,9 @@ NTSTATUS WINAPI wow64_NtUnmapViewOfSection( UINT *args ) HANDLE process = get_handle( &args ); void *addr = get_ptr( &args ); + if (pBTCpuNotifyUnmapViewOfSection && RtlIsCurrentProcess( process )) + pBTCpuNotifyUnmapViewOfSection( addr ); + return NtUnmapViewOfSection( process, addr ); } @@ -699,6 +717,9 @@ NTSTATUS WINAPI wow64_NtUnmapViewOfSectionEx( UINT *args ) void *addr = get_ptr( &args ); ULONG flags = get_ulong( &args ); + if (pBTCpuNotifyUnmapViewOfSection && RtlIsCurrentProcess( process )) + pBTCpuNotifyUnmapViewOfSection( addr ); + return NtUnmapViewOfSectionEx( process, addr, flags ); } diff --git a/dlls/wow64/wow64_private.h b/dlls/wow64/wow64_private.h index a840c1d01c0..73a100cba32 100644 --- a/dlls/wow64/wow64_private.h +++ b/dlls/wow64/wow64_private.h @@ -38,7 +38,15 @@ extern ULONG_PTR args_alignment DECLSPEC_HIDDEN; extern ULONG_PTR highest_user_address DECLSPEC_HIDDEN; extern ULONG_PTR default_zero_bits DECLSPEC_HIDDEN; extern SYSTEM_DLL_INIT_BLOCK *pLdrSystemDllInitBlock DECLSPEC_HIDDEN; -extern void (WINAPI *pBTCpuUpdateProcessorInformation)( SYSTEM_CPU_INFORMATION * ) DECLSPEC_HIDDEN; + +extern void (WINAPI *pBTCpuNotifyFlushInstructionCache2)( const void *, SIZE_T ); +extern void (WINAPI *pBTCpuNotifyMapViewOfSection)( void * ); +extern void (WINAPI *pBTCpuNotifyMemoryAlloc)( void *, SIZE_T, ULONG, ULONG ); +extern void (WINAPI *pBTCpuNotifyMemoryDirty)( void *, SIZE_T ); +extern void (WINAPI *pBTCpuNotifyMemoryFree)( void *, SIZE_T ); +extern void (WINAPI *pBTCpuNotifyMemoryProtect)( void *, SIZE_T, ULONG ); +extern void (WINAPI *pBTCpuNotifyUnmapViewOfSection)( void * ); +extern void (WINAPI *pBTCpuUpdateProcessorInformation)( SYSTEM_CPU_INFORMATION * ); struct object_attr64 {
1
0
0
0
Alexandre Julliard : wintrust: Use nameless unions/structs.
by Alexandre Julliard
10 Jul '23
10 Jul '23
Module: wine Branch: master Commit: 04ffca6e167784d7f2fab6c9eb9dd64476356a6b URL:
https://gitlab.winehq.org/wine/wine/-/commit/04ffca6e167784d7f2fab6c9eb9dd6…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jul 10 17:18:10 2023 +0200 wintrust: Use nameless unions/structs. --- dlls/wintrust/asn.c | 52 ++++++++-------- dlls/wintrust/softpub.c | 135 +++++++++++++++++++++--------------------- dlls/wintrust/wintrust_main.c | 44 +++++++------- 3 files changed, 114 insertions(+), 117 deletions(-)
1
0
0
0
Alexandre Julliard : urlmon: Use nameless unions/structs.
by Alexandre Julliard
10 Jul '23
10 Jul '23
Module: wine Branch: master Commit: dd44930b440136dfedccda3785c98fd2b4badaa1 URL:
https://gitlab.winehq.org/wine/wine/-/commit/dd44930b440136dfedccda3785c98f…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jul 10 17:17:35 2023 +0200 urlmon: Use nameless unions/structs. --- dlls/urlmon/binding.c | 18 ++++++++---------- dlls/urlmon/http.c | 8 +++----- dlls/urlmon/urlmon_main.c | 32 +++++++++++++++----------------- dlls/urlmon/usrmarshal.c | 12 +++++------- 4 files changed, 31 insertions(+), 39 deletions(-) diff --git a/dlls/urlmon/binding.c b/dlls/urlmon/binding.c index fd738f6cf0f..07a00558eec 100644 --- a/dlls/urlmon/binding.c +++ b/dlls/urlmon/binding.c @@ -16,8 +16,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define NONAMELESSUNION - #include "urlmon_main.h" #include "winreg.h" #include "shlwapi.h" @@ -143,7 +141,7 @@ static void dump_BINDINFO(BINDINFO *bi) "}\n", bi->cbSize, debugstr_w(bi->szExtraInfo), - bi->stgmedData.tymed, bi->stgmedData.u.hGlobal, bi->stgmedData.pUnkForRelease, + bi->stgmedData.tymed, bi->stgmedData.hGlobal, bi->stgmedData.pUnkForRelease, bi->grfBindInfoF > BINDINFOF_URLENCODEDEXTRAINFO ? "unknown" : BINDINFOF_str[bi->grfBindInfoF], bi->dwBindVerb > BINDVERB_CUSTOM @@ -522,7 +520,7 @@ static HRESULT WINAPI ProtocolStream_Seek(IStream *iface, LARGE_INTEGER dlibMove LARGE_INTEGER new_pos; DWORD method; - TRACE("(%p)->(%ld %08lx %p)\n", This, dlibMove.u.LowPart, dwOrigin, plibNewPosition); + TRACE("(%p)->(%ld %08lx %p)\n", This, dlibMove.LowPart, dwOrigin, plibNewPosition); if(This->buf->file == INVALID_HANDLE_VALUE) { /* We should probably call protocol handler's Seek. */ @@ -558,7 +556,7 @@ static HRESULT WINAPI ProtocolStream_Seek(IStream *iface, LARGE_INTEGER dlibMove static HRESULT WINAPI ProtocolStream_SetSize(IStream *iface, ULARGE_INTEGER libNewSize) { ProtocolStream *This = impl_from_IStream(iface); - FIXME("(%p)->(%ld)\n", This, libNewSize.u.LowPart); + FIXME("(%p)->(%ld)\n", This, libNewSize.LowPart); return E_NOTIMPL; } @@ -566,7 +564,7 @@ static HRESULT WINAPI ProtocolStream_CopyTo(IStream *iface, IStream *pstm, ULARGE_INTEGER cb, ULARGE_INTEGER *pcbRead, ULARGE_INTEGER *pcbWritten) { ProtocolStream *This = impl_from_IStream(iface); - FIXME("(%p)->(%p %ld %p %p)\n", This, pstm, cb.u.LowPart, pcbRead, pcbWritten); + FIXME("(%p)->(%p %ld %p %p)\n", This, pstm, cb.LowPart, pcbRead, pcbWritten); return E_NOTIMPL; } @@ -592,7 +590,7 @@ static HRESULT WINAPI ProtocolStream_LockRegion(IStream *iface, ULARGE_INTEGER l ULARGE_INTEGER cb, DWORD dwLockType) { ProtocolStream *This = impl_from_IStream(iface); - FIXME("(%p)->(%ld %ld %ld)\n", This, libOffset.u.LowPart, cb.u.LowPart, dwLockType); + FIXME("(%p)->(%ld %ld %ld)\n", This, libOffset.LowPart, cb.LowPart, dwLockType); return E_NOTIMPL; } @@ -600,7 +598,7 @@ static HRESULT WINAPI ProtocolStream_UnlockRegion(IStream *iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) { ProtocolStream *This = impl_from_IStream(iface); - FIXME("(%p)->(%ld %ld %ld)\n", This, libOffset.u.LowPart, cb.u.LowPart, dwLockType); + FIXME("(%p)->(%ld %ld %ld)\n", This, libOffset.LowPart, cb.LowPart, dwLockType); return E_NOTIMPL; } @@ -669,7 +667,7 @@ static HRESULT stgmed_stream_fill_stgmed(stgmed_obj_t *obj, STGMEDIUM *stgmed) ProtocolStream *stream = (ProtocolStream*)obj; stgmed->tymed = TYMED_ISTREAM; - stgmed->u.pstm = &stream->IStream_iface; + stgmed->pstm = &stream->IStream_iface; stgmed->pUnkForRelease = &stream->buf->IUnknown_iface; return S_OK; @@ -735,7 +733,7 @@ static HRESULT stgmed_file_fill_stgmed(stgmed_obj_t *obj, STGMEDIUM *stgmed) read_protocol_data(file_obj->buf); stgmed->tymed = TYMED_FILE; - stgmed->u.lpszFileName = file_obj->buf->cache_file; + stgmed->lpszFileName = file_obj->buf->cache_file; stgmed->pUnkForRelease = &file_obj->buf->IUnknown_iface; return S_OK; diff --git a/dlls/urlmon/http.c b/dlls/urlmon/http.c index d1c104fc8e3..a24006ba08c 100644 --- a/dlls/urlmon/http.c +++ b/dlls/urlmon/http.c @@ -17,8 +17,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define NONAMELESSUNION - #include "urlmon_main.h" #include "wininet.h" @@ -251,7 +249,7 @@ static ULONG send_http_request(HttpProtocol *This) switch(This->base.bind_info.stgmedData.tymed) { case TYMED_HGLOBAL: /* Native does not use GlobalLock/GlobalUnlock, so we won't either */ - send_buffer.lpvBuffer = This->base.bind_info.stgmedData.u.hGlobal; + send_buffer.lpvBuffer = This->base.bind_info.stgmedData.hGlobal; send_buffer.dwBufferLength = send_buffer.dwBufferTotal = This->base.bind_info.cbstgmedData; break; case TYMED_ISTREAM: { @@ -259,7 +257,7 @@ static ULONG send_http_request(HttpProtocol *This) send_buffer.dwBufferTotal = This->base.bind_info.cbstgmedData; if(!This->base.post_stream) { - This->base.post_stream = This->base.bind_info.stgmedData.u.pstm; + This->base.post_stream = This->base.bind_info.stgmedData.pstm; IStream_AddRef(This->base.post_stream); } @@ -791,7 +789,7 @@ static HRESULT WINAPI HttpProtocol_Seek(IInternetProtocolEx *iface, LARGE_INTEGE DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition) { HttpProtocol *This = impl_from_IInternetProtocolEx(iface); - FIXME("(%p)->(%ld %ld %p)\n", This, dlibMove.u.LowPart, dwOrigin, plibNewPosition); + FIXME("(%p)->(%ld %ld %p)\n", This, dlibMove.LowPart, dwOrigin, plibNewPosition); return E_NOTIMPL; } diff --git a/dlls/urlmon/urlmon_main.c b/dlls/urlmon/urlmon_main.c index 00ccc449e15..491313b7cf8 100644 --- a/dlls/urlmon/urlmon_main.c +++ b/dlls/urlmon/urlmon_main.c @@ -20,8 +20,6 @@ #include <stdarg.h> -#define NONAMELESSUNION - #include "urlmon_main.h" #include "winreg.h" @@ -598,32 +596,32 @@ HRESULT WINAPI CopyStgMedium(const STGMEDIUM *src, STGMEDIUM *dst) case TYMED_NULL: break; case TYMED_FILE: - if(src->u.lpszFileName && !src->pUnkForRelease) { - DWORD size = (lstrlenW(src->u.lpszFileName)+1)*sizeof(WCHAR); - dst->u.lpszFileName = CoTaskMemAlloc(size); - if(!dst->u.lpszFileName) + if(src->lpszFileName && !src->pUnkForRelease) { + DWORD size = (lstrlenW(src->lpszFileName)+1)*sizeof(WCHAR); + dst->lpszFileName = CoTaskMemAlloc(size); + if(!dst->lpszFileName) return E_OUTOFMEMORY; - memcpy(dst->u.lpszFileName, src->u.lpszFileName, size); + memcpy(dst->lpszFileName, src->lpszFileName, size); } break; case TYMED_ISTREAM: - if(dst->u.pstm) - IStream_AddRef(dst->u.pstm); + if(dst->pstm) + IStream_AddRef(dst->pstm); break; case TYMED_ISTORAGE: - if(dst->u.pstg) - IStorage_AddRef(dst->u.pstg); + if(dst->pstg) + IStorage_AddRef(dst->pstg); break; case TYMED_HGLOBAL: - if(dst->u.hGlobal) { - SIZE_T size = GlobalSize(src->u.hGlobal); + if(dst->hGlobal) { + SIZE_T size = GlobalSize(src->hGlobal); char *src_ptr, *dst_ptr; - dst->u.hGlobal = GlobalAlloc(GMEM_FIXED, size); - if(!dst->u.hGlobal) + dst->hGlobal = GlobalAlloc(GMEM_FIXED, size); + if(!dst->hGlobal) return E_OUTOFMEMORY; - dst_ptr = GlobalLock(dst->u.hGlobal); - src_ptr = GlobalLock(src->u.hGlobal); + dst_ptr = GlobalLock(dst->hGlobal); + src_ptr = GlobalLock(src->hGlobal); memcpy(dst_ptr, src_ptr, size); GlobalUnlock(src_ptr); GlobalUnlock(dst_ptr); diff --git a/dlls/urlmon/usrmarshal.c b/dlls/urlmon/usrmarshal.c index 950d1a3d67a..57cfaf64ec6 100644 --- a/dlls/urlmon/usrmarshal.c +++ b/dlls/urlmon/usrmarshal.c @@ -16,8 +16,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define NONAMELESSUNION - #include "urlmon_main.h" #include "wine/debug.h" @@ -93,7 +91,7 @@ static HRESULT marshal_stgmed(STGMEDIUM *stgmed, RemSTGMEDIUM **ret) ULONG size = 0; HRESULT hres = S_OK; - if((stgmed->tymed == TYMED_ISTREAM && stgmed->u.pstm) || stgmed->pUnkForRelease) { + if((stgmed->tymed == TYMED_ISTREAM && stgmed->pstm) || stgmed->pUnkForRelease) { hres = CreateStreamOnHGlobal(NULL, TRUE, &stream); if(FAILED(hres)) return hres; @@ -103,8 +101,8 @@ static HRESULT marshal_stgmed(STGMEDIUM *stgmed, RemSTGMEDIUM **ret) case TYMED_NULL: break; case TYMED_ISTREAM: - if(stgmed->u.pstm) - hres = CoMarshalInterface(stream, &IID_IStream, (IUnknown*)stgmed->u.pstm, + if(stgmed->pstm) + hres = CoMarshalInterface(stream, &IID_IStream, (IUnknown*)stgmed->pstm, MSHCTX_LOCAL, NULL, MSHLFLAGS_NORMAL); break; default: @@ -140,7 +138,7 @@ static HRESULT marshal_stgmed(STGMEDIUM *stgmed, RemSTGMEDIUM **ret) rem_stgmed->tymed = stgmed->tymed; rem_stgmed->dwHandleType = 0; - rem_stgmed->pData = stgmed->u.pstm != NULL; + rem_stgmed->pData = stgmed->pstm != NULL; rem_stgmed->pUnkForRelease = stgmed->pUnkForRelease != NULL; rem_stgmed->cbData = size; if(stream) { @@ -181,7 +179,7 @@ static HRESULT unmarshal_stgmed(RemSTGMEDIUM *rem_stgmed, STGMEDIUM *stgmed) break; case TYMED_ISTREAM: if(rem_stgmed->pData) - hres = CoUnmarshalInterface(stream, &IID_IStream, (void**)&stgmed->u.pstm); + hres = CoUnmarshalInterface(stream, &IID_IStream, (void**)&stgmed->pstm); break; default: FIXME("unsupported tymed %lu\n", stgmed->tymed);
1
0
0
0
Alexandre Julliard : riched20: Use nameless unions/structs.
by Alexandre Julliard
10 Jul '23
10 Jul '23
Module: wine Branch: master Commit: 26826d3af8b1969de389f3d6702d7c8b805126e1 URL:
https://gitlab.winehq.org/wine/wine/-/commit/26826d3af8b1969de389f3d6702d7c…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jul 10 17:17:11 2023 +0200 riched20: Use nameless unions/structs. --- dlls/riched20/clipboard.c | 6 ++---- dlls/riched20/editor.c | 12 +++++------- dlls/riched20/richole.c | 13 ++++++------- dlls/riched20/writer.c | 6 ++---- 4 files changed, 15 insertions(+), 22 deletions(-) diff --git a/dlls/riched20/clipboard.c b/dlls/riched20/clipboard.c index c94951b8f6f..a66848a5cf7 100644 --- a/dlls/riched20/clipboard.c +++ b/dlls/riched20/clipboard.c @@ -18,8 +18,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define NONAMELESSUNION - #include "editor.h" WINE_DEFAULT_DEBUG_CHANNEL(richedit); @@ -226,9 +224,9 @@ static HRESULT WINAPI DataObjectImpl_GetData(IDataObject* iface, FORMATETC *pfor return DV_E_TYMED; if(This->unicode && pformatetc->cfFormat == CF_UNICODETEXT) - pmedium->u.hGlobal = This->unicode; + pmedium->hGlobal = This->unicode; else if(This->rtf && pformatetc->cfFormat == cfRTF) - pmedium->u.hGlobal = This->rtf; + pmedium->hGlobal = This->rtf; else return DV_E_FORMATETC; diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index 8ac71379533..5cf43f4e29a 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -224,8 +224,6 @@ * */ -#define NONAMELESSUNION - #include "editor.h" #include "commdlg.h" #include "winreg.h" @@ -1129,13 +1127,13 @@ static HRESULT insert_static_object(ME_TextEditor *editor, HENHMETAFILE hemf, HB if (hemf) { stgm.tymed = TYMED_ENHMF; - stgm.u.hEnhMetaFile = hemf; + stgm.hEnhMetaFile = hemf; fm.cfFormat = CF_ENHMETAFILE; } else if (hbmp) { stgm.tymed = TYMED_GDI; - stgm.u.hBitmap = hbmp; + stgm.hBitmap = hbmp; fm.cfFormat = CF_BITMAP; } else return E_FAIL; @@ -2205,7 +2203,7 @@ static HRESULT paste_rtf(ME_TextEditor *editor, FORMATETC *fmt, STGMEDIUM *med) ME_GlobalDestStruct gds; HRESULT hr; - gds.hData = med->u.hGlobal; + gds.hData = med->hGlobal; gds.nLength = 0; es.dwCookie = (DWORD_PTR)&gds; es.pfnCallback = ME_ReadFromHGLOBALRTF; @@ -2220,7 +2218,7 @@ static HRESULT paste_text(ME_TextEditor *editor, FORMATETC *fmt, STGMEDIUM *med) ME_GlobalDestStruct gds; HRESULT hr; - gds.hData = med->u.hGlobal; + gds.hData = med->hGlobal; gds.nLength = 0; es.dwCookie = (DWORD_PTR)&gds; es.pfnCallback = ME_ReadFromHGLOBALUnicode; @@ -2234,7 +2232,7 @@ static HRESULT paste_emf(ME_TextEditor *editor, FORMATETC *fmt, STGMEDIUM *med) HRESULT hr; SIZEL sz = {0, 0}; - hr = insert_static_object( editor, med->u.hEnhMetaFile, NULL, &sz ); + hr = insert_static_object( editor, med->hEnhMetaFile, NULL, &sz ); if (SUCCEEDED(hr)) { ME_CommitUndo( editor ); diff --git a/dlls/riched20/richole.c b/dlls/riched20/richole.c index 90496742e36..11fde52873e 100644 --- a/dlls/riched20/richole.c +++ b/dlls/riched20/richole.c @@ -21,7 +21,6 @@ #include <stdarg.h> -#define NONAMELESSUNION #define COBJMACROS #include "windef.h" @@ -5762,12 +5761,12 @@ void ME_GetOLEObjectSize(const ME_Context *c, ME_Run *run, SIZE *pSize) switch (stgm.tymed) { case TYMED_GDI: - GetObjectW(stgm.u.hBitmap, sizeof(dibsect), &dibsect); + GetObjectW(stgm.hBitmap, sizeof(dibsect), &dibsect); pSize->cx = dibsect.dsBm.bmWidth; pSize->cy = dibsect.dsBm.bmHeight; break; case TYMED_ENHMF: - GetEnhMetaFileHeader(stgm.u.hEnhMetaFile, sizeof(emh), &emh); + GetEnhMetaFileHeader(stgm.hEnhMetaFile, sizeof(emh), &emh); pSize->cx = emh.rclBounds.right - emh.rclBounds.left; pSize->cy = emh.rclBounds.bottom - emh.rclBounds.top; break; @@ -5854,9 +5853,9 @@ void draw_ole( ME_Context *c, int x, int y, ME_Run *run, BOOL selected ) switch (stgm.tymed) { case TYMED_GDI: - GetObjectW(stgm.u.hBitmap, sizeof(dibsect), &dibsect); + GetObjectW(stgm.hBitmap, sizeof(dibsect), &dibsect); hMemDC = CreateCompatibleDC(c->hDC); - old_bm = SelectObject(hMemDC, stgm.u.hBitmap); + old_bm = SelectObject(hMemDC, stgm.hBitmap); if (has_size) { convert_sizel(c, &run->reobj->obj.sizel, &sz); @@ -5876,7 +5875,7 @@ void draw_ole( ME_Context *c, int x, int y, ME_Run *run, BOOL selected ) DeleteDC(hMemDC); break; case TYMED_ENHMF: - GetEnhMetaFileHeader(stgm.u.hEnhMetaFile, sizeof(emh), &emh); + GetEnhMetaFileHeader(stgm.hEnhMetaFile, sizeof(emh), &emh); if (has_size) { convert_sizel(c, &run->reobj->obj.sizel, &sz); @@ -5894,7 +5893,7 @@ void draw_ole( ME_Context *c, int x, int y, ME_Run *run, BOOL selected ) rc.top = y - sz.cy; rc.right = x + sz.cx; rc.bottom = y; - PlayEnhMetaFile(c->hDC, stgm.u.hEnhMetaFile, &rc); + PlayEnhMetaFile(c->hDC, stgm.hEnhMetaFile, &rc); break; default: FIXME("Unsupported tymed %ld\n", stgm.tymed); diff --git a/dlls/riched20/writer.c b/dlls/riched20/writer.c index def16a4925a..a47a1897973 100644 --- a/dlls/riched20/writer.c +++ b/dlls/riched20/writer.c @@ -18,8 +18,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define NONAMELESSUNION - #include "editor.h" #include "rtf.h" @@ -953,13 +951,13 @@ static BOOL stream_out_graphics( ME_TextEditor *editor, ME_OutStream *stream, if (FAILED(hr)) goto done; if (med.tymed != TYMED_ENHMF) goto done; - size = GetEnhMetaFileBits( med.u.hEnhMetaFile, 0, NULL ); + size = GetEnhMetaFileBits( med.hEnhMetaFile, 0, NULL ); if (size < FIELD_OFFSET(ENHMETAHEADER, cbPixelFormat)) goto done; emf_bits = HeapAlloc( GetProcessHeap(), 0, size ); if (!emf_bits) goto done; - size = GetEnhMetaFileBits( med.u.hEnhMetaFile, size, (BYTE *)emf_bits ); + size = GetEnhMetaFileBits( med.hEnhMetaFile, size, (BYTE *)emf_bits ); if (size < FIELD_OFFSET(ENHMETAHEADER, cbPixelFormat)) goto done; /* size_in_pixels = (frame_size / 100) * szlDevice / szlMillimeters
1
0
0
0
Alexandre Julliard : dplayx: Use nameless unions/structs.
by Alexandre Julliard
10 Jul '23
10 Jul '23
Module: wine Branch: master Commit: a56fcef71512a35ecaf5043360ee3d27d0e596c8 URL:
https://gitlab.winehq.org/wine/wine/-/commit/a56fcef71512a35ecaf5043360ee3d…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jul 10 17:15:41 2023 +0200 dplayx: Use nameless unions/structs. --- dlls/dplayx/dplay.c | 134 ++++++++++++++++++++++---------------------- dlls/dplayx/dplayx_global.c | 98 ++++++++++++++++---------------- dlls/dplayx/dplobby.c | 8 +-- dlls/dplayx/name_server.c | 10 ++-- 4 files changed, 121 insertions(+), 129 deletions(-)
1
0
0
0
← Newer
1
...
55
56
57
58
59
60
61
...
87
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
Results per page:
10
25
50
100
200