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
September 2021
----- 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
2 participants
1030 discussions
Start a n
N
ew thread
Eric Pouech : dbghelp/dwarf: Add support for FORM_loc_offset and FORM_sec_offset.
by Alexandre Julliard
14 Sep '21
14 Sep '21
Module: wine Branch: master Commit: 6bd22a2f5071da5c32ecb87d3d4e0f8dfe7bcb63 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6bd22a2f5071da5c32ecb87d…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Sat Sep 11 10:59:05 2021 +0200 dbghelp/dwarf: Add support for FORM_loc_offset and FORM_sec_offset. Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dbghelp/dwarf.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c index a29bd53f929..a9a72ee6566 100644 --- a/dlls/dbghelp/dwarf.c +++ b/dlls/dbghelp/dwarf.c @@ -489,7 +489,6 @@ static void dwarf2_swallow_attribute(dwarf2_traverse_context_t* ctx, case DW_FORM_ref2: step = 2; break; case DW_FORM_data4: case DW_FORM_ref4: step = 4; break; - case DW_FORM_strp: step = head->offset_size; break; case DW_FORM_data8: case DW_FORM_ref8: step = 8; break; case DW_FORM_sdata: @@ -500,6 +499,8 @@ static void dwarf2_swallow_attribute(dwarf2_traverse_context_t* ctx, case DW_FORM_block1: step = dwarf2_parse_byte(ctx); break; case DW_FORM_block2: step = dwarf2_parse_u2(ctx); break; case DW_FORM_block4: step = dwarf2_parse_u4(ctx); break; + case DW_FORM_sec_offset: + case DW_FORM_strp: step = head->offset_size; break; default: FIXME("Unhandled attribute form %lx\n", abbrev_attr->form); return; @@ -625,6 +626,11 @@ static void dwarf2_fill_attr(const dwarf2_parse_context_t* ctx, TRACE("block<%p,%u>\n", attr->u.block.ptr, attr->u.block.size); break; + case DW_FORM_sec_offset: + attr->u.lluvalue = dwarf2_get_addr(data, ctx->head.offset_size); + TRACE("sec_offset<%s>\n", wine_dbgstr_longlong(attr->u.lluvalue)); + break; + default: FIXME("Unhandled attribute form %lx\n", abbrev_attr->form); break; @@ -935,11 +941,16 @@ static BOOL dwarf2_compute_location_attr(dwarf2_parse_context_t* ctx, loc->reg = 0; loc->offset = xloc.u.uvalue; return TRUE; - case DW_FORM_data4: case DW_FORM_data8: + case DW_FORM_data4: loc->kind = loc_dwarf2_location_list; loc->reg = Wine_DW_no_register; loc->offset = xloc.u.uvalue; return TRUE; + case DW_FORM_data8: case DW_FORM_sec_offset: + loc->kind = loc_dwarf2_location_list; + loc->reg = Wine_DW_no_register; + loc->offset = xloc.u.lluvalue; + return TRUE; case DW_FORM_block: case DW_FORM_block1: case DW_FORM_block2: @@ -1662,6 +1673,7 @@ static void dwarf2_parse_variable(dwarf2_subprogram_t* subpgm, break; case DW_FORM_data8: + case DW_FORM_sec_offset: v.n1.n2.vt = VT_UI8; v.n1.n2.n3.llVal = value.u.lluvalue; break;
1
0
0
0
Eric Pouech : dbghelp/dwarf: Correctly handle attributes according to 32bit or 64bit format.
by Alexandre Julliard
14 Sep '21
14 Sep '21
Module: wine Branch: master Commit: 8241fe3877ce58e88e48043be08ae27fbd6e1b04 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8241fe3877ce58e88e48043b…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Sat Sep 11 10:58:59 2021 +0200 dbghelp/dwarf: Correctly handle attributes according to 32bit or 64bit format. Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dbghelp/dwarf.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c index 331739899d8..a29bd53f929 100644 --- a/dlls/dbghelp/dwarf.c +++ b/dlls/dbghelp/dwarf.c @@ -480,7 +480,7 @@ static void dwarf2_swallow_attribute(dwarf2_traverse_context_t* ctx, switch (abbrev_attr->form) { case DW_FORM_flag_present: step = 0; break; - case DW_FORM_ref_addr: + case DW_FORM_ref_addr: step = (head->version >= 3) ? head->offset_size : head->word_size; break; case DW_FORM_addr: step = head->word_size; break; case DW_FORM_flag: case DW_FORM_data1: @@ -488,8 +488,8 @@ static void dwarf2_swallow_attribute(dwarf2_traverse_context_t* ctx, case DW_FORM_data2: case DW_FORM_ref2: step = 2; break; case DW_FORM_data4: - case DW_FORM_ref4: - case DW_FORM_strp: step = 4; break; + case DW_FORM_ref4: step = 4; break; + case DW_FORM_strp: step = head->offset_size; break; case DW_FORM_data8: case DW_FORM_ref8: step = 8; break; case DW_FORM_sdata: @@ -516,6 +516,13 @@ static void dwarf2_fill_attr(const dwarf2_parse_context_t* ctx, switch (attr->form) { case DW_FORM_ref_addr: + if (ctx->head.version >= 3) + attr->u.uvalue = dwarf2_get_addr(data, ctx->head.offset_size); + else + attr->u.uvalue = dwarf2_get_addr(data, ctx->head.word_size); + TRACE("addr<0x%lx>\n", attr->u.uvalue); + break; + case DW_FORM_addr: attr->u.uvalue = dwarf2_get_addr(data, ctx->head.word_size); TRACE("addr<0x%lx>\n", attr->u.uvalue); @@ -590,13 +597,11 @@ static void dwarf2_fill_attr(const dwarf2_parse_context_t* ctx, break; case DW_FORM_strp: - { - ULONG_PTR offset = dwarf2_get_u4(data); - attr->u.string = (const char*)ctx->sections[section_string].address + offset; - } - TRACE("strp<%s>\n", debugstr_a(attr->u.string)); - break; - + attr->u.string = (const char*)ctx->sections[section_string].address + + dwarf2_get_addr(data, ctx->head.offset_size); + TRACE("strp<%s>\n", debugstr_a(attr->u.string)); + break; + case DW_FORM_block: attr->u.block.size = dwarf2_get_leb128_as_unsigned(data, &attr->u.block.ptr); TRACE("block<%p,%u>\n", attr->u.block.ptr, attr->u.block.size);
1
0
0
0
Eric Pouech : dbghelp/dwarf: Properly parse 32 vs bit 64bit entities.
by Alexandre Julliard
14 Sep '21
14 Sep '21
Module: wine Branch: master Commit: d78c09aa37d55316e3d2eff8ab2bda4a0cd733de URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d78c09aa37d55316e3d2eff8…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Sat Sep 11 10:58:53 2021 +0200 dbghelp/dwarf: Properly parse 32 vs bit 64bit entities. Store the offset_size in dwarf2_cuhead_t. Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dbghelp/dwarf.c | 64 ++++++++++++++++++++++++++++++++++++++-------------- dlls/dbghelp/dwarf.h | 1 + 2 files changed, 48 insertions(+), 17 deletions(-) diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c index 476061a62a5..331739899d8 100644 --- a/dlls/dbghelp/dwarf.c +++ b/dlls/dbghelp/dwarf.c @@ -170,6 +170,7 @@ typedef struct dwarf2_cuhead_s { unsigned char word_size; /* size of a word on target machine */ unsigned char version; + unsigned char offset_size; /* size of offset inside DWARF */ } dwarf2_cuhead_t; typedef struct dwarf2_parse_context_s @@ -362,6 +363,25 @@ static inline ULONG_PTR dwarf2_parse_addr_head(dwarf2_traverse_context_t* ctx, c return dwarf2_parse_addr(ctx, head->word_size); } +static ULONG_PTR dwarf2_parse_offset(dwarf2_traverse_context_t* ctx, unsigned char offset_size) +{ + ULONG_PTR ret = dwarf2_get_addr(ctx->data, offset_size); + ctx->data += offset_size; + return ret; +} + +static ULONG_PTR dwarf2_parse_3264(dwarf2_traverse_context_t* ctx, unsigned char* ofsz) +{ + ULONG_PTR ret = dwarf2_parse_u4(ctx); + if (ret == 0xffffffff) + { + ret = dwarf2_parse_u8(ctx); + *ofsz = 8; + } + else *ofsz = 4; + return ret; +} + static const char* dwarf2_debug_traverse_ctx(const dwarf2_traverse_context_t* ctx) { return wine_dbg_sprintf("ctx(%p)", ctx->data); @@ -2159,6 +2179,7 @@ static BOOL dwarf2_parse_line_numbers(const dwarf2_section_t* sections, unsigned insn_size, default_stmt; unsigned line_range, opcode_base; int line_base; + unsigned char offset_size; const unsigned char* opcode_len; struct vector dirs; struct vector files; @@ -2174,18 +2195,23 @@ static BOOL dwarf2_parse_line_numbers(const dwarf2_section_t* sections, return FALSE; } traverse.data = sections[section_line].address + offset; - traverse.end_data = traverse.data + 4; + traverse.end_data = sections[section_line].address + sections[section_line].size; - length = dwarf2_parse_u4(&traverse); - traverse.end_data = sections[section_line].address + offset + length; + length = dwarf2_parse_3264(&traverse, &offset_size); + if (offset_size != ctx->head.offset_size) + { + WARN("Mismatch in 32/64 bit format\n"); + return FALSE; + } + traverse.end_data = traverse.data + length; - if (offset + 4 + length > sections[section_line].size) + if (traverse.end_data > sections[section_line].address + sections[section_line].size) { WARN("out of bounds header\n"); return FALSE; } dwarf2_parse_u2(&traverse); /* version */ - dwarf2_parse_u4(&traverse); /* header_len */ + dwarf2_parse_offset(&traverse, offset_size); /* header_len */ insn_size = dwarf2_parse_byte(&traverse); default_stmt = dwarf2_parse_byte(&traverse); line_base = (signed char)dwarf2_parse_byte(&traverse); @@ -2375,12 +2401,13 @@ static BOOL dwarf2_parse_compilation_unit(const dwarf2_section_t* sections, /* FIXME this is a temporary configuration while adding support for dwarf3&4 bits */ static LONG max_supported_dwarf_version = 0; - cu_length = dwarf2_parse_u4(mod_ctx); + cu_length = dwarf2_parse_3264(mod_ctx, &ctx.head.offset_size); + cu_ctx.data = mod_ctx->data; cu_ctx.end_data = mod_ctx->data + cu_length; mod_ctx->data += cu_length; ctx.head.version = dwarf2_parse_u2(&cu_ctx); - cu_abbrev_offset = dwarf2_parse_u4(&cu_ctx); + cu_abbrev_offset = dwarf2_parse_offset(&cu_ctx, ctx.head.offset_size); ctx.head.word_size = dwarf2_parse_byte(&cu_ctx); TRACE("Compilation Unit Header found at 0x%x:\n", @@ -2389,6 +2416,7 @@ static BOOL dwarf2_parse_compilation_unit(const dwarf2_section_t* sections, TRACE("- version: %u\n", ctx.head.version); TRACE("- abbrev_offset: %lu\n", cu_abbrev_offset); TRACE("- word_size: %u\n", ctx.head.word_size); + TRACE("- offset_size: %u\n", ctx.head.offset_size); if (max_supported_dwarf_version == 0) { @@ -2727,13 +2755,13 @@ static BOOL dwarf2_get_cie(ULONG_PTR addr, struct module* module, DWORD_PTR delt const unsigned char* ptr_blk; const unsigned char* cie_ptr; const unsigned char* last_cie_ptr = (const unsigned char*)~0; - unsigned len, id; + ULONG_PTR len, id; ULONG_PTR start, range; - unsigned cie_id; + ULONG_PTR cie_id; const BYTE* start_data = fde_ctx->data; unsigned char word_size = module->format_info[DFI_DWARF]->u.dwarf2_info->word_size; + unsigned char offset_size; - cie_id = in_eh_frame ? 0 : DW_CIE_ID; /* skip 0-padding at beginning of section (alignment) */ while (fde_ctx->data + 2 * 4 < fde_ctx->end_data) { @@ -2745,14 +2773,15 @@ static BOOL dwarf2_get_cie(ULONG_PTR addr, struct module* module, DWORD_PTR delt } for (; fde_ctx->data + 2 * 4 < fde_ctx->end_data; fde_ctx->data = ptr_blk) { + const unsigned char* st = fde_ctx->data; /* find the FDE for address addr (skip CIE) */ - len = dwarf2_parse_u4(fde_ctx); - if (len == 0xffffffff) FIXME("Unsupported yet 64-bit CIEs\n"); + len = dwarf2_parse_3264(fde_ctx, &offset_size); + cie_id = in_eh_frame ? 0 : (offset_size == 4 ? DW_CIE_ID : (ULONG_PTR)DW64_CIE_ID); ptr_blk = fde_ctx->data + len; - id = dwarf2_parse_u4(fde_ctx); + id = dwarf2_parse_offset(fde_ctx, offset_size); if (id == cie_id) { - last_cie_ptr = fde_ctx->data - 8; + last_cie_ptr = st; /* we need some bits out of the CIE in order to parse all contents */ if (!parse_cie_details(fde_ctx, info, word_size)) return FALSE; cie_ctx->data = fde_ctx->data; @@ -2764,9 +2793,10 @@ static BOOL dwarf2_get_cie(ULONG_PTR addr, struct module* module, DWORD_PTR delt { last_cie_ptr = cie_ptr; cie_ctx->data = cie_ptr; - cie_ctx->end_data = cie_ptr + 4; - cie_ctx->end_data = cie_ptr + 4 + dwarf2_parse_u4(cie_ctx); - if (dwarf2_parse_u4(cie_ctx) != cie_id) + cie_ctx->end_data = cie_ptr + (offset_size == 4 ? 4 : 4 + 8); + cie_ctx->end_data += dwarf2_parse_3264(cie_ctx, &offset_size); + + if (dwarf2_parse_offset(cie_ctx, in_eh_frame ? word_size : offset_size) != cie_id) { FIXME("wrong CIE pointer at %x from FDE %x\n", (unsigned)(cie_ptr - start_data), diff --git a/dlls/dbghelp/dwarf.h b/dlls/dbghelp/dwarf.h index d4355d72e80..603c302d136 100644 --- a/dlls/dbghelp/dwarf.h +++ b/dlls/dbghelp/dwarf.h @@ -504,6 +504,7 @@ enum dwarf_calling_convention #define DW_LNE_hi_user 0xff #define DW_CIE_ID ~(0x0U) +#define DW64_CIE_ID ~((ULONG64)0x0) enum dwarf_call_frame_info {
1
0
0
0
Eric Pouech : dbghelp/dwarf: Don't recompute location when said location is complex.
by Alexandre Julliard
14 Sep '21
14 Sep '21
Module: wine Branch: master Commit: 92b3f1bf2ad363578587408d40b7eccff82b182d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=92b3f1bf2ad363578587408d…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Sat Sep 11 10:58:47 2021 +0200 dbghelp/dwarf: Don't recompute location when said location is complex. This was generating a global symbol instead of a local symbol. Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dbghelp/dwarf.c | 1 - 1 file changed, 1 deletion(-) diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c index 13f1c0e7d9c..476061a62a5 100644 --- a/dlls/dbghelp/dwarf.c +++ b/dlls/dbghelp/dwarf.c @@ -947,7 +947,6 @@ static BOOL dwarf2_compute_location_attr(dwarf2_parse_context_t* ctx, *ptr = xloc.u.block.size; memcpy(ptr + 1, xloc.u.block.ptr, xloc.u.block.size); loc->offset = (ULONG_PTR)ptr; - compute_location(ctx->module, &ctx->head, &lctx, loc, NULL, frame); } } return TRUE;
1
0
0
0
Nikolay Sivov : oleaut32: Do not use static variable for disp params.
by Alexandre Julliard
14 Sep '21
14 Sep '21
Module: wine Branch: master Commit: 2651677d4923f3a918f54777839cd3b79f0081d0 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2651677d4923f3a918f54777…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Sep 14 20:12:13 2021 +0300 oleaut32: Do not use static variable for disp params. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/oleaut32/variant.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/oleaut32/variant.c b/dlls/oleaut32/variant.c index bd1ff17c707..010b1143172 100644 --- a/dlls/oleaut32/variant.c +++ b/dlls/oleaut32/variant.c @@ -506,13 +506,13 @@ static inline HRESULT VARIANT_CoerceArray(VARIANTARG* pd, VARIANTARG* ps, VARTYP static HRESULT VARIANT_FetchDispatchValue(LPVARIANT pvDispatch, LPVARIANT pValue) { + DISPPARAMS params = { 0 }; HRESULT hres; - static DISPPARAMS emptyParams = { NULL, NULL, 0, 0 }; if ((V_VT(pvDispatch) & VT_TYPEMASK) == VT_DISPATCH) { if (NULL == V_DISPATCH(pvDispatch)) return DISP_E_TYPEMISMATCH; hres = IDispatch_Invoke(V_DISPATCH(pvDispatch), DISPID_VALUE, &IID_NULL, - LOCALE_USER_DEFAULT, DISPATCH_PROPERTYGET, &emptyParams, pValue, + LOCALE_USER_DEFAULT, DISPATCH_PROPERTYGET, ¶ms, pValue, NULL, NULL); } else { hres = DISP_E_TYPEMISMATCH;
1
0
0
0
Nikolay Sivov : oleaut32: Fix uninitialized variable access in VarXor() for earlier failure paths (Coverity).
by Alexandre Julliard
14 Sep '21
14 Sep '21
Module: wine Branch: master Commit: e4451427d874f84e2d8c6ce37ef0645f4d21aa16 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e4451427d874f84e2d8c6ce3…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Sep 14 20:12:12 2021 +0300 oleaut32: Fix uninitialized variable access in VarXor() for earlier failure paths (Coverity). Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/oleaut32/variant.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dlls/oleaut32/variant.c b/dlls/oleaut32/variant.c index 2c60f920f5e..bd1ff17c707 100644 --- a/dlls/oleaut32/variant.c +++ b/dlls/oleaut32/variant.c @@ -4635,6 +4635,7 @@ HRESULT WINAPI VarXor(LPVARIANT pVarLeft, LPVARIANT pVarRight, LPVARIANT pVarOut return S_OK; } + V_VT(&varLeft) = V_VT(&varRight) = VT_EMPTY; VariantInit(&tempLeft); VariantInit(&tempRight); @@ -4653,8 +4654,6 @@ HRESULT WINAPI VarXor(LPVARIANT pVarLeft, LPVARIANT pVarRight, LPVARIANT pVarOut } /* Copy our inputs so we don't disturb anything */ - V_VT(&varLeft) = V_VT(&varRight) = VT_EMPTY; - hRet = VariantCopy(&varLeft, pVarLeft); if (FAILED(hRet)) goto VarXor_Exit;
1
0
0
0
Gabriel Ivăncescu : ntdll: Implement JobObjectBasicProcessIdList for NtQueryInformationJobObject.
by Alexandre Julliard
14 Sep '21
14 Sep '21
Module: wine Branch: master Commit: 2fe70331d9df49708ec78f12ebff8406f0536881 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2fe70331d9df49708ec78f12…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Tue Sep 14 16:07:38 2021 +0300 ntdll: Implement JobObjectBasicProcessIdList for NtQueryInformationJobObject. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/tests/process.c | 9 --------- dlls/ntdll/unix/sync.c | 35 ++++++++++++++++++++++++++++++++--- include/wine/server_protocol.h | 3 ++- server/process.c | 25 +++++++++++++++++++++++++ server/protocol.def | 1 + server/trace.c | 1 + 6 files changed, 61 insertions(+), 13 deletions(-) diff --git a/dlls/kernel32/tests/process.c b/dlls/kernel32/tests/process.c index b1b76a88878..87873d4a90d 100644 --- a/dlls/kernel32/tests/process.c +++ b/dlls/kernel32/tests/process.c @@ -2700,15 +2700,11 @@ static void test_QueryInformationJobObject(void) pid_list->NumberOfProcessIdsInList = 42; ret = QueryInformationJobObject(job, JobObjectBasicProcessIdList, pid_list, FIELD_OFFSET(JOBOBJECT_BASIC_PROCESS_ID_LIST, ProcessIdList[1]), &ret_len); - todo_wine ok(!ret, "QueryInformationJobObject expected failure\n"); - todo_wine expect_eq_d(ERROR_MORE_DATA, GetLastError()); if (ret) { - todo_wine expect_eq_d(42, pid_list->NumberOfAssignedProcesses); - todo_wine expect_eq_d(42, pid_list->NumberOfProcessIdsInList); } @@ -2723,17 +2719,12 @@ static void test_QueryInformationJobObject(void) { ULONG_PTR *list = pid_list->ProcessIdList; - todo_wine ok(ret_len == FIELD_OFFSET(JOBOBJECT_BASIC_PROCESS_ID_LIST, ProcessIdList[2]), "QueryInformationJobObject returned ret_len=%u\n", ret_len); - todo_wine expect_eq_d(2, pid_list->NumberOfAssignedProcesses); - todo_wine expect_eq_d(2, pid_list->NumberOfProcessIdsInList); - todo_wine expect_eq_d(pi[0].dwProcessId, list[0]); - todo_wine expect_eq_d(pi[1].dwProcessId, list[1]); } } diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index a13e53a437b..5a5d49bf4bd 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -791,11 +791,40 @@ NTSTATUS WINAPI NtQueryInformationJobObject( HANDLE handle, JOBOBJECTINFOCLASS c case JobObjectBasicProcessIdList: { JOBOBJECT_BASIC_PROCESS_ID_LIST *process = info; + DWORD count, i; if (len < sizeof(*process)) return STATUS_INFO_LENGTH_MISMATCH; - memset( process, 0, sizeof(*process) ); - if (ret_len) *ret_len = sizeof(*process); - return STATUS_SUCCESS; + + count = len - offsetof( JOBOBJECT_BASIC_PROCESS_ID_LIST, ProcessIdList ); + count /= sizeof(process->ProcessIdList[0]); + + SERVER_START_REQ( get_job_info ) + { + req->handle = wine_server_user_handle(handle); + wine_server_set_reply(req, process->ProcessIdList, count * sizeof(process_id_t)); + if (!(ret = wine_server_call(req))) + { + process->NumberOfAssignedProcesses = reply->active_processes; + process->NumberOfProcessIdsInList = min(count, reply->active_processes); + } + } + SERVER_END_REQ; + + if (ret != STATUS_SUCCESS) return ret; + + if (sizeof(process_id_t) < sizeof(process->ProcessIdList[0])) + { + /* start from the end to not overwrite */ + for (i = process->NumberOfProcessIdsInList; i--;) + { + ULONG_PTR id = ((process_id_t *)process->ProcessIdList)[i]; + process->ProcessIdList[i] = id; + } + } + + if (ret_len) + *ret_len = offsetof( JOBOBJECT_BASIC_PROCESS_ID_LIST, ProcessIdList[process->NumberOfProcessIdsInList] ); + return count < process->NumberOfAssignedProcesses ? STATUS_MORE_ENTRIES : STATUS_SUCCESS; } case JobObjectExtendedLimitInformation: { diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index e5437576193..e9c12cac070 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -5357,6 +5357,7 @@ struct get_job_info_reply struct reply_header __header; int total_processes; int active_processes; + /* VARARG(pids,uints); */ }; @@ -6256,7 +6257,7 @@ union generic_reply /* ### protocol_version begin ### */ -#define SERVER_PROTOCOL_VERSION 730 +#define SERVER_PROTOCOL_VERSION 731 /* ### protocol_version end ### */ diff --git a/server/process.c b/server/process.c index 0870de5bb26..8109fbe8de4 100644 --- a/server/process.c +++ b/server/process.c @@ -286,6 +286,24 @@ static int process_in_job( struct job *job, struct process *process ) return process->job == job; } +static process_id_t *get_job_pids( struct job *job, process_id_t *pids, process_id_t *end ) +{ + struct process *process; + struct job *j; + + LIST_FOR_EACH_ENTRY( j, &job->child_job_list, struct job, parent_job_entry ) + pids = get_job_pids( j, pids, end ); + + LIST_FOR_EACH_ENTRY( process, &job->process_list, struct process, job_entry ) + { + if (pids == end) break; + if (process->end_time) continue; /* skip processes that ended */ + *pids++ = process->id; + } + + return pids; +} + static void add_job_process( struct job *job, struct process *process ) { struct job *j, *common_parent; @@ -1745,11 +1763,18 @@ DECL_HANDLER(process_in_job) DECL_HANDLER(get_job_info) { struct job *job = get_job_obj( current->process, req->handle, JOB_OBJECT_QUERY ); + process_id_t *pids; + data_size_t len; if (!job) return; reply->total_processes = job->total_processes; reply->active_processes = job->num_processes; + + len = min( get_reply_max_size(), reply->active_processes * sizeof(*pids) ); + if (len && ((pids = set_reply_data_size( len )))) + get_job_pids( job, pids, pids + len / sizeof(*pids) ); + release_object( job ); } diff --git a/server/protocol.def b/server/protocol.def index cc1887dae2d..a5030fcf813 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -3696,6 +3696,7 @@ struct handle_info @REPLY int total_processes; /* total count of processes */ int active_processes; /* count of running processes */ + VARARG(pids,uints); /* list of active pids */ @END diff --git a/server/trace.c b/server/trace.c index cfa6eefc36c..6e380fc4be5 100644 --- a/server/trace.c +++ b/server/trace.c @@ -4525,6 +4525,7 @@ static void dump_get_job_info_reply( const struct get_job_info_reply *req ) { fprintf( stderr, " total_processes=%d", req->total_processes ); fprintf( stderr, ", active_processes=%d", req->active_processes ); + dump_varargs_uints( ", pids=", cur_size ); } static void dump_terminate_job_request( const struct terminate_job_request *req )
1
0
0
0
Robert Wilhelm : vbscript: Support date and time literals.
by Alexandre Julliard
14 Sep '21
14 Sep '21
Module: wine Branch: master Commit: bf5f7a7b7bef24f8a0d9c3fa30342e31c9c9c8ca URL:
https://source.winehq.org/git/wine.git/?a=commit;h=bf5f7a7b7bef24f8a0d9c3fa…
Author: Robert Wilhelm <robert.wilhelm(a)gmx.net> Date: Tue Sep 14 13:18:41 2021 +0200 vbscript: Support date and time literals. Date literals, which are enclosed in number signs in vbscript, will be lexed, pushed throught parser and compiler and finally converted to VT_Date Variant in interpreter. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=51503
Signed-off-by: Robert Wilhelm <robert.wilhelm(a)gmx.net> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/vbscript/compile.c | 22 ++++++++++++++++++++++ dlls/vbscript/interp.c | 13 +++++++++++++ dlls/vbscript/lex.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ dlls/vbscript/parse.h | 7 +++++++ dlls/vbscript/parser.y | 16 ++++++++++++++++ dlls/vbscript/tests/lang.vbs | 1 + dlls/vbscript/vbscript.h | 5 ++++- 7 files changed, 107 insertions(+), 1 deletion(-) diff --git a/dlls/vbscript/compile.c b/dlls/vbscript/compile.c index 0d1960d8ca1..821d85310b6 100644 --- a/dlls/vbscript/compile.c +++ b/dlls/vbscript/compile.c @@ -92,6 +92,7 @@ static void dump_instr_arg(instr_arg_type_t type, instr_arg_t *arg) case ARG_ADDR: TRACE_(vbscript_disas)("\t%u", arg->uint); break; + case ARG_DATE: case ARG_DOUBLE: TRACE_(vbscript_disas)("\t%lf", *arg->dbl); break; @@ -238,6 +239,24 @@ static HRESULT push_instr_double(compile_ctx_t *ctx, vbsop_t op, double arg) return S_OK; } +static HRESULT push_instr_date(compile_ctx_t *ctx, vbsop_t op, DATE arg) +{ + unsigned instr; + DATE *d; + + d = compiler_alloc(ctx->code, sizeof(DATE)); + if(!d) + return E_OUTOFMEMORY; + + instr = push_instr(ctx, op); + if(!instr) + return E_OUTOFMEMORY; + + *d = arg; + instr_ptr(ctx, instr)->arg1.date = d; + return S_OK; +} + static BSTR alloc_bstr_arg(compile_ctx_t *ctx, const WCHAR *str) { if(!ctx->code->bstr_pool_size) { @@ -530,6 +549,8 @@ static HRESULT compile_expression(compile_ctx_t *ctx, expression_t *expr) return compile_call_expression(ctx, (call_expression_t*)expr, TRUE); case EXPR_CONCAT: return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_concat); + case EXPR_DATE: + return push_instr_date(ctx, OP_date, ((date_expression_t*)expr)->value); case EXPR_DIV: return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_div); case EXPR_DOT: @@ -1962,6 +1983,7 @@ HRESULT compile_script(script_ctx_t *script, const WCHAR *src, const WCHAR *item item->ref++; } + ctx.parser.lcid = script->lcid; hres = parse_script(&ctx.parser, code->source, delimiter, flags); if(FAILED(hres)) { if(ctx.parser.error_loc != -1) diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c index 11d95e57758..f648f073bc8 100644 --- a/dlls/vbscript/interp.c +++ b/dlls/vbscript/interp.c @@ -1637,6 +1637,19 @@ static HRESULT interp_string(exec_ctx_t *ctx) return stack_push(ctx, &v); } +static HRESULT interp_date(exec_ctx_t *ctx) +{ + const DATE *d = ctx->instr->arg1.date; + VARIANT v; + + TRACE("%lf\n",*d); + + V_VT(&v) = VT_DATE; + V_DATE(&v) = *d; + + return stack_push(ctx, &v); +} + static HRESULT interp_int(exec_ctx_t *ctx) { const LONG arg = ctx->instr->arg1.lng; diff --git a/dlls/vbscript/lex.c b/dlls/vbscript/lex.c index 357cad7158c..09b073fb773 100644 --- a/dlls/vbscript/lex.c +++ b/dlls/vbscript/lex.c @@ -204,6 +204,48 @@ static int parse_string_literal(parser_ctx_t *ctx, const WCHAR **ret) return tString; } +static int parse_date_literal(parser_ctx_t *ctx, DATE *ret) +{ + const WCHAR *ptr = ++ctx->ptr; + WCHAR *rptr; + int len = 0; + HRESULT res; + + while(ctx->ptr < ctx->end) { + if(*ctx->ptr == '\n' || *ctx->ptr == '\r') { + FIXME("newline inside date literal\n"); + return 0; + } + + if(*ctx->ptr == '#') + break; + ctx->ptr++; + } + + if(ctx->ptr == ctx->end) { + FIXME("unterminated date literal\n"); + return 0; + } + + len += ctx->ptr-ptr; + + rptr = heap_alloc((len+1)*sizeof(WCHAR)); + if(!rptr) + return 0; + + memcpy( rptr, ptr, len * sizeof(WCHAR)); + rptr[len] = 0; + res = VarDateFromStr(rptr, ctx->lcid, 0, ret); + heap_free(rptr); + if (!SUCCEEDED(res)) { + FIXME("Invalid date literal\n"); + return 0; + } + + ctx->ptr++; + return tDate; +} + static int parse_numeric_literal(parser_ctx_t *ctx, void **ret) { BOOL use_int = TRUE; @@ -429,6 +471,8 @@ static int parse_next_token(void *lval, unsigned *loc, parser_ctx_t *ctx) return tEXPRLBRACKET; case '"': return parse_string_literal(ctx, lval); + case '#': + return parse_date_literal(ctx, lval); case '&': if(*++ctx->ptr == 'h' || *ctx->ptr == 'H') return parse_hex_literal(ctx, lval); diff --git a/dlls/vbscript/parse.h b/dlls/vbscript/parse.h index 2888ea3b546..32cfcfe75c5 100644 --- a/dlls/vbscript/parse.h +++ b/dlls/vbscript/parse.h @@ -23,6 +23,7 @@ typedef enum { EXPR_BRACKETS, EXPR_CALL, EXPR_CONCAT, + EXPR_DATE, EXPR_DIV, EXPR_DOT, EXPR_DOUBLE, @@ -70,6 +71,11 @@ typedef struct { LONG value; } int_expression_t; +typedef struct { + expression_t expr; + DATE value; +} date_expression_t; + typedef struct { expression_t expr; double value; @@ -287,6 +293,7 @@ typedef struct { BOOL is_html; HRESULT hres; int error_loc; + LCID lcid; int last_token; unsigned last_nl; diff --git a/dlls/vbscript/parser.y b/dlls/vbscript/parser.y index 37b14f05e14..796e9d5ee5e 100644 --- a/dlls/vbscript/parser.y +++ b/dlls/vbscript/parser.y @@ -34,6 +34,7 @@ static void source_add_class(parser_ctx_t*,class_decl_t*); static void *new_expression(parser_ctx_t*,expression_type_t,size_t); static expression_t *new_bool_expression(parser_ctx_t*,VARIANT_BOOL); +static expression_t *new_date_expression(parser_ctx_t*,DATE); static expression_t *new_string_expression(parser_ctx_t*,const WCHAR*); static expression_t *new_long_expression(parser_ctx_t*,expression_type_t,LONG); static expression_t *new_double_expression(parser_ctx_t*,double); @@ -107,6 +108,7 @@ static statement_t *link_statements(statement_t*,statement_t*); LONG integer; BOOL boolean; double dbl; + DATE date; } %token tEXPRESSION tNL tEMPTYBRACKETS tEXPRLBRACKET @@ -129,6 +131,7 @@ static statement_t *link_statements(statement_t*,statement_t*); %token <string> tDEFAULT tERROR tEXPLICIT tPROPERTY tSTEP %token <integer> tInt %token <dbl> tDouble +%token <date> tDate %type <statement> Statement SimpleStatement StatementNl StatementsNl StatementsNl_opt BodyStatements IfStatement Else_opt %type <statement> GlobalDimDeclaration @@ -416,6 +419,7 @@ LiteralExpression : tTRUE { $$ = new_bool_expression(ctx, VARIANT_TRUE); CHECK_ERROR; } | tFALSE { $$ = new_bool_expression(ctx, VARIANT_FALSE); CHECK_ERROR; } | tString { $$ = new_string_expression(ctx, $1); CHECK_ERROR; } + | tDate { $$ = new_date_expression(ctx, $1); CHECK_ERROR; } | NumericLiteralExpression { $$ = $1; } | tEMPTY { $$ = new_expression(ctx, EXPR_EMPTY, 0); CHECK_ERROR; } | tNULL { $$ = new_expression(ctx, EXPR_NULL, 0); CHECK_ERROR; } @@ -594,6 +598,18 @@ static expression_t *new_string_expression(parser_ctx_t *ctx, const WCHAR *value return &expr->expr; } +static expression_t *new_date_expression(parser_ctx_t *ctx, DATE value) +{ + date_expression_t *expr; + + expr = new_expression(ctx, EXPR_DATE, sizeof(*expr)); + if(!expr) + return NULL; + + expr->value = value; + return &expr->expr; +} + static expression_t *new_long_expression(parser_ctx_t *ctx, expression_type_t type, LONG value) { int_expression_t *expr; diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs index a716cdbc65f..d7865301784 100644 --- a/dlls/vbscript/tests/lang.vbs +++ b/dlls/vbscript/tests/lang.vbs @@ -107,6 +107,7 @@ Call ok(getVT(&hffFFffFF&) = "VT_I2", "getVT(&hffFFffFF&) is not VT_I2") Call ok(getVT(&hffFFffFE&) = "VT_I2", "getVT(&hffFFffFE &) is not VT_I2") Call ok(getVT(&hffF&) = "VT_I2", "getVT(&hffFF&) is not VT_I2") Call ok(getVT(&hffFF&) = "VT_I4", "getVT(&hffFF&) is not VT_I4") +Call ok(getVT(# 1/1/2011 #) = "VT_DATE", "getVT(# 1/1/2011 #) is not VT_DATE") Call ok(getVT(1e2) = "VT_R8", "getVT(1e2) is not VT_R8") Call ok(getVT(1e0) = "VT_R8", "getVT(1e0) is not VT_R8") Call ok(getVT(0.1e2) = "VT_R8", "getVT(0.1e2) is not VT_R8") diff --git a/dlls/vbscript/vbscript.h b/dlls/vbscript/vbscript.h index afcce5eb9b8..9ef2cae81e5 100644 --- a/dlls/vbscript/vbscript.h +++ b/dlls/vbscript/vbscript.h @@ -212,7 +212,8 @@ typedef enum { ARG_INT, ARG_UINT, ARG_ADDR, - ARG_DOUBLE + ARG_DOUBLE, + ARG_DATE } instr_arg_type_t; #define OP_LIST \ @@ -225,6 +226,7 @@ typedef enum { X(case, 0, ARG_ADDR, 0) \ X(concat, 1, 0, 0) \ X(const, 1, ARG_BSTR, 0) \ + X(date, 1, ARG_DATE, 0) \ X(deref, 1, 0, 0) \ X(dim, 1, ARG_BSTR, ARG_UINT) \ X(div, 1, 0, 0) \ @@ -293,6 +295,7 @@ typedef union { unsigned uint; LONG lng; double *dbl; + DATE *date; } instr_arg_t; typedef struct {
1
0
0
0
Eduard Permyakov : winex11.drv: Add 'EDID' registry key to every monitor device.
by Alexandre Julliard
14 Sep '21
14 Sep '21
Module: wine Branch: master Commit: dedda40e5d7b5a3bcf67eea95145810da283d7d9 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=dedda40e5d7b5a3bcf67eea9…
Author: Eduard Permyakov <epermyakov(a)codeweavers.com> Date: Tue Sep 14 21:48:25 2021 +0800 winex11.drv: Add 'EDID' registry key to every monitor device. Extended display identification data (EDID) is a set of data that is provided by a display to describe its capabilities to a graphics adapter. EDID data allows a computer to detect the type of monitor that is connected to it. EDID data includes the manufacturer name, the product type, the timings that are supported by the display, the display size, as well as other display characteristics. EDID is defined by a standard published by the Video Electronics Standards Association (VESA). In Windows, every display device has an associated 'EDID' registry key containing this data. Applications can read and parse it to get the display capabilities. In Linux, we can get each monitor's EDID using the RANDR X extension. This patch fixes, for example, monitor detection in the UE-based game 'Industries of Titan'. Signed-off-by: Eduard Permyakov <epermyakov(a)codeweavers.com> Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winex11.drv/desktop.c | 4 +++- dlls/winex11.drv/display.c | 15 ++++++++++++--- dlls/winex11.drv/x11drv.h | 6 +++++- dlls/winex11.drv/x11drv_main.c | 1 + dlls/winex11.drv/xinerama.c | 4 +++- dlls/winex11.drv/xrandr.c | 38 +++++++++++++++++++++++++++++++++++++- 6 files changed, 61 insertions(+), 7 deletions(-) diff --git a/dlls/winex11.drv/desktop.c b/dlls/winex11.drv/desktop.c index b517e44e150..71b3a0a5a27 100644 --- a/dlls/winex11.drv/desktop.c +++ b/dlls/winex11.drv/desktop.c @@ -265,6 +265,8 @@ static BOOL X11DRV_desktop_get_monitors( ULONG_PTR adapter_id, struct x11drv_mon SetRect( &monitor->rc_work, 0, 0, desktop_width, desktop_height ); query_desktop_work_area( &monitor->rc_work ); monitor->state_flags = DISPLAY_DEVICE_ATTACHED; + monitor->edid_len = 0; + monitor->edid = NULL; if (desktop_width && desktop_height) monitor->state_flags |= DISPLAY_DEVICE_ACTIVE; @@ -273,7 +275,7 @@ static BOOL X11DRV_desktop_get_monitors( ULONG_PTR adapter_id, struct x11drv_mon return TRUE; } -static void X11DRV_desktop_free_monitors( struct x11drv_monitor *monitors ) +static void X11DRV_desktop_free_monitors( struct x11drv_monitor *monitors, int count ) { heap_free( monitors ); } diff --git a/dlls/winex11.drv/display.c b/dlls/winex11.drv/display.c index b3ff213ae89..ca81f169f9f 100644 --- a/dlls/winex11.drv/display.c +++ b/dlls/winex11.drv/display.c @@ -109,6 +109,8 @@ static const WCHAR monitor_hardware_idW[] = { 'M','O','N','I','T','O','R','\\', 'D','e','f','a','u','l','t','_','M','o','n','i','t','o','r',0,0}; static const WCHAR driver_date_fmtW[] = {'%','u','-','%','u','-','%','u',0}; +static const WCHAR edidW[] = {'E','D','I','D',0}; +static const WCHAR bad_edidW[] = {'B','A','D','_','E','D','I','D',0}; static struct x11drv_display_device_handler host_handler; struct x11drv_display_device_handler desktop_handler; @@ -257,7 +259,7 @@ RECT get_host_primary_monitor_rect(void) if (gpus) host_handler.free_gpus(gpus); if (adapters) host_handler.free_adapters(adapters); - if (monitors) host_handler.free_monitors(monitors); + if (monitors) host_handler.free_monitors(monitors, monitor_count); return rect; } @@ -611,6 +613,13 @@ static BOOL X11DRV_InitMonitor(HDEVINFO devinfo, const struct x11drv_monitor *mo DEVPROP_TYPE_UINT32, (const BYTE *)&output_id, sizeof(output_id), 0)) goto done; + hkey = SetupDiCreateDevRegKeyW(devinfo, &device_data, DICS_FLAG_GLOBAL, 0, DIREG_DEV, NULL, NULL); + if (monitor->edid) + RegSetValueExW(hkey, edidW, 0, REG_BINARY, monitor->edid, monitor->edid_len); + else + RegSetValueExW(hkey, bad_edidW, 0, REG_BINARY, NULL, 0); + RegCloseKey(hkey); + /* Create driver key */ hkey = SetupDiCreateDevRegKeyW(devinfo, &device_data, DICS_FLAG_GLOBAL, 0, DIREG_DRV, NULL, NULL); RegCloseKey(hkey); @@ -768,7 +777,7 @@ void X11DRV_DisplayDevices_Init(BOOL force) goto done; } - handler->free_monitors(monitors); + handler->free_monitors(monitors, monitor_count); monitors = NULL; video_index++; } @@ -788,5 +797,5 @@ done: if (adapters) handler->free_adapters(adapters); if (monitors) - handler->free_monitors(monitors); + handler->free_monitors(monitors, monitor_count); } diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index afa06561aaa..5ed2fcf73fb 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -413,6 +413,7 @@ enum x11drv_atoms FIRST_XATOM = XA_LAST_PREDEFINED + 1, XATOM_CLIPBOARD = FIRST_XATOM, XATOM_COMPOUND_TEXT, + XATOM_EDID, XATOM_INCR, XATOM_MANAGER, XATOM_MULTIPLE, @@ -751,6 +752,9 @@ struct x11drv_monitor RECT rc_work; /* StateFlags in DISPLAY_DEVICE struct */ DWORD state_flags; + /* Extended Device Identification Data */ + unsigned long edid_len; + unsigned char *edid; }; /* Required functions for display device registry initialization */ @@ -786,7 +790,7 @@ struct x11drv_display_device_handler void (*free_adapters)(struct x11drv_adapter *adapters); /* free_monitors will be called to free a monitor list from get_monitors */ - void (*free_monitors)(struct x11drv_monitor *monitors); + void (*free_monitors)(struct x11drv_monitor *monitors, int count); /* register_event_handlers will be called to register event handlers. * This function pointer is optional and can be NULL when driver doesn't support it */ diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c index 2fac560556b..e8b273d055e 100644 --- a/dlls/winex11.drv/x11drv_main.c +++ b/dlls/winex11.drv/x11drv_main.c @@ -138,6 +138,7 @@ static const char * const atom_names[NB_XATOMS - FIRST_XATOM] = { "CLIPBOARD", "COMPOUND_TEXT", + "EDID", "INCR", "MANAGER", "MULTIPLE", diff --git a/dlls/winex11.drv/xinerama.c b/dlls/winex11.drv/xinerama.c index c9863482534..0e1e07669c2 100644 --- a/dlls/winex11.drv/xinerama.c +++ b/dlls/winex11.drv/xinerama.c @@ -244,6 +244,8 @@ static BOOL xinerama_get_monitors( ULONG_PTR adapter_id, struct x11drv_monitor * monitor[index].rc_work = monitors[i].rcWork; /* Xinerama only reports monitors already attached */ monitor[index].state_flags = DISPLAY_DEVICE_ATTACHED; + monitor[index].edid_len = 0; + monitor[index].edid = NULL; if (!IsRectEmpty( &monitors[i].rcMonitor )) monitor[index].state_flags |= DISPLAY_DEVICE_ACTIVE; @@ -256,7 +258,7 @@ static BOOL xinerama_get_monitors( ULONG_PTR adapter_id, struct x11drv_monitor * return TRUE; } -static void xinerama_free_monitors( struct x11drv_monitor *monitors ) +static void xinerama_free_monitors( struct x11drv_monitor *monitors, int count ) { heap_free( monitors ); } diff --git a/dlls/winex11.drv/xrandr.c b/dlls/winex11.drv/xrandr.c index e7adcec0f2e..8faece9023a 100644 --- a/dlls/winex11.drv/xrandr.c +++ b/dlls/winex11.drv/xrandr.c @@ -68,6 +68,7 @@ MAKE_FUNCPTR(XRRFreeOutputInfo) MAKE_FUNCPTR(XRRFreeScreenResources) MAKE_FUNCPTR(XRRGetCrtcInfo) MAKE_FUNCPTR(XRRGetOutputInfo) +MAKE_FUNCPTR(XRRGetOutputProperty) MAKE_FUNCPTR(XRRGetScreenResources) MAKE_FUNCPTR(XRRGetScreenResourcesCurrent) MAKE_FUNCPTR(XRRGetScreenSizeRange) @@ -112,6 +113,7 @@ static int load_xrandr(void) LOAD_FUNCPTR(XRRFreeScreenResources); LOAD_FUNCPTR(XRRGetCrtcInfo); LOAD_FUNCPTR(XRRGetOutputInfo); + LOAD_FUNCPTR(XRRGetOutputProperty); LOAD_FUNCPTR(XRRGetScreenResources); LOAD_FUNCPTR(XRRGetScreenResourcesCurrent); LOAD_FUNCPTR(XRRGetScreenSizeRange); @@ -466,6 +468,24 @@ static void get_screen_size( XRRScreenResources *resources, unsigned int *width, } } +static void get_edid( RROutput output, unsigned char **prop, unsigned long *len ) +{ + int result, actual_format; + unsigned long bytes_after; + Atom actual_type; + + result = pXRRGetOutputProperty( gdi_display, output, x11drv_atom(EDID), 0, 128, FALSE, FALSE, + AnyPropertyType, &actual_type, &actual_format, len, + &bytes_after, prop ); + + if (result != Success) + { + WARN("Could not retrieve EDID property for output %#lx.\n", output); + *prop = NULL; + *len = 0; + } +} + static void set_screen_size( int width, int height ) { int screen = default_visual.screen; @@ -1036,6 +1056,7 @@ static BOOL xrandr14_get_monitors( ULONG_PTR adapter_id, struct x11drv_monitor * { lstrcpyW( monitors[monitor_count].name, generic_nonpnp_monitorW ); monitors[monitor_count].state_flags = DISPLAY_DEVICE_ATTACHED; + get_edid( adapter_id, &monitors[monitor_count].edid, &monitors[monitor_count].edid_len ); monitor_count = 1; } /* Active monitors, need to find other monitors with the same coordinates as mirrored */ @@ -1091,6 +1112,9 @@ static BOOL xrandr14_get_monitors( ULONG_PTR adapter_id, struct x11drv_monitor * if (is_crtc_primary( primary_rect, crtc_info )) primary_index = monitor_count; + + get_edid( screen_resources->outputs[i], &monitors[monitor_count].edid, + &monitors[monitor_count].edid_len ); monitor_count++; } @@ -1131,14 +1155,26 @@ done: pXRRFreeOutputInfo( enum_output_info ); if (!ret) { + for (i = 0; i < monitor_count; i++) + { + if (monitors[i].edid) + XFree( monitors[i].edid ); + } heap_free( monitors ); ERR("Failed to get monitors\n"); } return ret; } -static void xrandr14_free_monitors( struct x11drv_monitor *monitors ) +static void xrandr14_free_monitors( struct x11drv_monitor *monitors, int count ) { + int i; + + for (i = 0; i < count; i++) + { + if (monitors[i].edid) + XFree( monitors[i].edid ); + } heap_free( monitors ); }
1
0
0
0
Zhiyi Zhang : avicap32: Use the correct return type for get_device_desc().
by Alexandre Julliard
14 Sep '21
14 Sep '21
Module: wine Branch: master Commit: ea15a5445fcb8922524ca8c8502a08e7d3572f3d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ea15a5445fcb8922524ca8c8…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Tue Sep 14 21:10:46 2021 +0800 avicap32: Use the correct return type for get_device_desc(). get_device_desc() should return a NTSTATUS instead of a BOOL. Fix a regression that video capture devices cannot be opened because of the changes in abb1757. Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/avicap32/v4l.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/avicap32/v4l.c b/dlls/avicap32/v4l.c index ab2694ae041..0b004e17e58 100644 --- a/dlls/avicap32/v4l.c +++ b/dlls/avicap32/v4l.c @@ -119,14 +119,14 @@ static NTSTATUS get_device_desc(void *args) v4l_umbstowcs(version, ret, params->version, ARRAY_SIZE(params->version)); } close(fd); - return is_capture_device; + return is_capture_device ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL; } /* errno 515 is used by some webcam drivers for unknown IOCTL commands. */ ERR("Failed to get capabilities for %s: %s\n", device, strerror(errno)); close(fd); - return FALSE; + return STATUS_UNSUCCESSFUL; } const unixlib_entry_t __wine_unix_call_funcs[] =
1
0
0
0
← Newer
1
...
61
62
63
64
65
66
67
...
103
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
Results per page:
10
25
50
100
200