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
January 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
472 discussions
Start a n
N
ew thread
Byeongsik Jeon : gdi32: Preserve the GGO_UNHINTED bits until used.
by Alexandre Julliard
21 Jan '21
21 Jan '21
Module: wine Branch: master Commit: f0267395645eb8fc3b8409d7ae3b43e41929469a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f0267395645eb8fc3b8409d7…
Author: Byeongsik Jeon <bsjeon(a)hanmail.net> Date: Mon Jan 11 13:18:42 2021 +0900 gdi32: Preserve the GGO_UNHINTED bits until used. Fix a regression caused by 044315c0b3890676d9fd751d8191b0b7381e0b97. Signed-off-by: Byeongsik Jeon <bsjeon(a)hanmail.net> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdi32/font.c | 3 +-- dlls/gdi32/freetype.c | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index afd41aeec31..74ca4825de4 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -2955,6 +2955,7 @@ static DWORD get_glyph_outline( struct gdi_font *font, UINT glyph, UINT format, /* Windows bitmap font, e.g. Small Fonts, uses ANSI character code as glyph index. "Treasure Adventure Game" depends on this. */ font_funcs->get_glyph_index( font, &index, FALSE ); + format &= ~GGO_GLYPH_INDEX; /* TODO: Window also turns off tategaki for glyphs passed in by index if their unicode code points fall outside of the range that is rotated. */ @@ -2970,8 +2971,6 @@ static DWORD get_glyph_outline( struct gdi_font *font, UINT glyph, UINT format, } } - format &= ~(GGO_GLYPH_INDEX | GGO_UNHINTED); - if (mat && !memcmp( mat, &identity, sizeof(*mat) )) mat = NULL; if (format == GGO_METRICS && !mat && get_gdi_font_glyph_metrics( font, index, &gm, &abc )) diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index fffa3288503..b3fc565afe8 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -3515,6 +3515,8 @@ static DWORD CDECL freetype_get_glyph_outline( struct gdi_font *font, UINT glyph font->matrix.eM11, font->matrix.eM12, font->matrix.eM21, font->matrix.eM22); + format &= ~GGO_UNHINTED; + needsTransform = get_transform_matrices( font, tategaki, lpmat, matrices ); vertical_metrics = (tategaki && FT_HAS_VERTICAL(ft_face));
1
0
0
0
Dmitry Timoshkov : msi: Also set "MsiRunningElevated" installer property.
by Alexandre Julliard
21 Jan '21
21 Jan '21
Module: wine Branch: master Commit: dac655abce0397b3c1accec64039b8cd75beb561 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=dac655abce0397b3c1accec6…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Tue Dec 22 16:36:11 2020 +0300 msi: Also set "MsiRunningElevated" installer property. This property is supposed to be set starting from Windows Installer 4.0 targeting Windows Vista. This patch fixes the installer that checks this property in addition to VersionNT and ALLUSERS. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msi/package.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/msi/package.c b/dlls/msi/package.c index 2483d99e2b5..25e22f040a4 100644 --- a/dlls/msi/package.c +++ b/dlls/msi/package.c @@ -737,6 +737,7 @@ static VOID set_installer_properties(MSIPACKAGE *package) /* in a wine environment the user is always admin and privileged */ msi_set_property( package->db, L"AdminUser", L"1", -1 ); msi_set_property( package->db, L"Privileged", L"1", -1 ); + msi_set_property( package->db, L"MsiRunningElevated", L"1", -1 ); /* set the os things */ OSVersion.dwOSVersionInfoSize = sizeof(OSVersion); @@ -963,6 +964,8 @@ void msi_adjust_privilege_properties( MSIPACKAGE *package ) msi_set_property( package->db, L"ALLUSERS", L"1", -1 ); } msi_set_property( package->db, L"AdminUser", L"1", -1 ); + msi_set_property( package->db, L"Privileged", L"1", -1 ); + msi_set_property( package->db, L"MsiRunningElevated", L"1", -1 ); } MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *db )
1
0
0
0
Alexandre Julliard : include: Add a couple of dll characteristics.
by Alexandre Julliard
21 Jan '21
21 Jan '21
Module: wine Branch: master Commit: e137063394deba721f3a8a8ebd78961f39679ad2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e137063394deba721f3a8a8e…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jan 21 20:39:11 2021 +0100 include: Add a couple of dll characteristics. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/winnt.h | 3 +++ tools/winedump/pe.c | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/winnt.h b/include/winnt.h index fba721f7f02..f5ef0c7bd52 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -3135,13 +3135,16 @@ typedef struct _IMAGE_VXD_HEADER { #define IMAGE_SUBSYSTEM_WINDOWS_BOOT_APPLICATION 16 /* DLL Characteristics */ +#define IMAGE_DLLCHARACTERISTICS_HIGH_ENTROPY_VA 0x0020 #define IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE 0x0040 #define IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY 0x0080 #define IMAGE_DLLCHARACTERISTICS_NX_COMPAT 0x0100 #define IMAGE_DLLCHARACTERISTICS_NO_ISOLATION 0x0200 #define IMAGE_DLLCHARACTERISTICS_NO_SEH 0x0400 #define IMAGE_DLLCHARACTERISTICS_NO_BIND 0x0800 +#define IMAGE_DLLCHARACTERISTICS_APPCONTAINER 0x1000 #define IMAGE_DLLCHARACTERISTICS_WDM_DRIVER 0x2000 +#define IMAGE_DLLCHARACTERISTICS_GUARD_CF 0x4000 #define IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE 0x8000 typedef struct _IMAGE_FILE_HEADER { diff --git a/tools/winedump/pe.c b/tools/winedump/pe.c index fef95c6bb67..19ccd172da2 100644 --- a/tools/winedump/pe.c +++ b/tools/winedump/pe.c @@ -213,15 +213,18 @@ static inline void print_subsys(const char *title, WORD value) static inline void print_dllflags(const char *title, WORD value) { - printf(" %-34s 0x%X\n", title, value); + printf(" %-34s 0x%04X\n", title, value); #define X(f,s) if (value & f) printf(" %s\n", s) + X(IMAGE_DLLCHARACTERISTICS_HIGH_ENTROPY_VA, "HIGH_ENTROPY_VA"); X(IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE, "DYNAMIC_BASE"); X(IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY, "FORCE_INTEGRITY"); X(IMAGE_DLLCHARACTERISTICS_NX_COMPAT, "NX_COMPAT"); X(IMAGE_DLLCHARACTERISTICS_NO_ISOLATION, "NO_ISOLATION"); X(IMAGE_DLLCHARACTERISTICS_NO_SEH, "NO_SEH"); X(IMAGE_DLLCHARACTERISTICS_NO_BIND, "NO_BIND"); + X(IMAGE_DLLCHARACTERISTICS_APPCONTAINER, "APPCONTAINER"); X(IMAGE_DLLCHARACTERISTICS_WDM_DRIVER, "WDM_DRIVER"); + X(IMAGE_DLLCHARACTERISTICS_GUARD_CF, "GUARD_CF"); X(IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE, "TERMINAL_SERVER_AWARE"); #undef X }
1
0
0
0
Alexandre Julliard : ntdll: Support more Dwarf pointer types.
by Alexandre Julliard
21 Jan '21
21 Jan '21
Module: wine Branch: master Commit: e0dbdaac64086b1982760a22b61a9da2794938c9 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e0dbdaac64086b1982760a22…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jan 21 10:46:26 2021 +0100 ntdll: Support more Dwarf pointer types. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/signal_x86_64.c | 92 +++++++++++++++++++++++------------------ 1 file changed, 52 insertions(+), 40 deletions(-) diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c index cccbfc2a3be..12e40853397 100644 --- a/dlls/ntdll/unix/signal_x86_64.c +++ b/dlls/ntdll/unix/signal_x86_64.c @@ -512,10 +512,14 @@ enum dwarf_operation }; #define DW_EH_PE_native 0x00 -#define DW_EH_PE_leb128 0x01 -#define DW_EH_PE_data2 0x02 -#define DW_EH_PE_data4 0x03 -#define DW_EH_PE_data8 0x04 +#define DW_EH_PE_uleb128 0x01 +#define DW_EH_PE_udata2 0x02 +#define DW_EH_PE_udata4 0x03 +#define DW_EH_PE_udata8 0x04 +#define DW_EH_PE_sleb128 0x09 +#define DW_EH_PE_sdata2 0x0a +#define DW_EH_PE_sdata4 0x0b +#define DW_EH_PE_sdata8 0x0c #define DW_EH_PE_signed 0x08 #define DW_EH_PE_abs 0x00 #define DW_EH_PE_pcrel 0x10 @@ -609,13 +613,13 @@ static LONG_PTR dwarf_get_sleb128( const unsigned char **p ) return ret; } -static ULONG_PTR dwarf_get_ptr( const unsigned char **p, unsigned char encoding ) +static ULONG_PTR dwarf_get_ptr( const unsigned char **p, unsigned char encoding, const struct dwarf_eh_bases *bases ) { ULONG_PTR base; if (encoding == DW_EH_PE_omit) return 0; - switch (encoding & 0xf0) + switch (encoding & 0x70) { case DW_EH_PE_abs: base = 0; @@ -623,6 +627,18 @@ static ULONG_PTR dwarf_get_ptr( const unsigned char **p, unsigned char encoding case DW_EH_PE_pcrel: base = (ULONG_PTR)*p; break; + case DW_EH_PE_textrel: + base = (ULONG_PTR)bases->tbase; + break; + case DW_EH_PE_datarel: + base = (ULONG_PTR)bases->dbase; + break; + case DW_EH_PE_funcrel: + base = (ULONG_PTR)bases->func; + break; + case DW_EH_PE_aligned: + base = ((ULONG_PTR)*p + 7) & ~7ul; + break; default: FIXME( "unsupported encoding %02x\n", encoding ); return 0; @@ -630,28 +646,21 @@ static ULONG_PTR dwarf_get_ptr( const unsigned char **p, unsigned char encoding switch (encoding & 0x0f) { - case DW_EH_PE_native: - return base + dwarf_get_u8( p ); - case DW_EH_PE_leb128: - return base + dwarf_get_uleb128( p ); - case DW_EH_PE_data2: - return base + dwarf_get_u2( p ); - case DW_EH_PE_data4: - return base + dwarf_get_u4( p ); - case DW_EH_PE_data8: - return base + dwarf_get_u8( p ); - case DW_EH_PE_signed|DW_EH_PE_leb128: - return base + dwarf_get_sleb128( p ); - case DW_EH_PE_signed|DW_EH_PE_data2: - return base + (signed short)dwarf_get_u2( p ); - case DW_EH_PE_signed|DW_EH_PE_data4: - return base + (signed int)dwarf_get_u4( p ); - case DW_EH_PE_signed|DW_EH_PE_data8: - return base + (LONG64)dwarf_get_u8( p ); + case DW_EH_PE_native: base += dwarf_get_u8( p ); break; + case DW_EH_PE_uleb128: base += dwarf_get_uleb128( p ); break; + case DW_EH_PE_udata2: base += dwarf_get_u2( p ); break; + case DW_EH_PE_udata4: base += dwarf_get_u4( p ); break; + case DW_EH_PE_udata8: base += dwarf_get_u8( p ); break; + case DW_EH_PE_sleb128: base += dwarf_get_sleb128( p ); break; + case DW_EH_PE_sdata2: base += (signed short)dwarf_get_u2( p ); break; + case DW_EH_PE_sdata4: base += (signed int)dwarf_get_u4( p ); break; + case DW_EH_PE_sdata8: base += (LONG64)dwarf_get_u8( p ); break; default: FIXME( "unsupported encoding %02x\n", encoding ); return 0; } + if (encoding & DW_EH_PE_indirect) base = *(ULONG_PTR *)base; + return base; } enum reg_rule @@ -706,7 +715,8 @@ static BOOL valid_reg( ULONG_PTR reg ) } static void execute_cfa_instructions( const unsigned char *ptr, const unsigned char *end, - ULONG_PTR last_ip, struct frame_info *info ) + ULONG_PTR last_ip, struct frame_info *info, + const struct dwarf_eh_bases *bases ) { while (ptr < end && info->ip < last_ip + info->signal_frame) { @@ -749,7 +759,7 @@ static void execute_cfa_instructions( const unsigned char *ptr, const unsigned c break; case DW_CFA_set_loc: { - ULONG_PTR loc = dwarf_get_ptr( &ptr, info->fde_encoding ); + ULONG_PTR loc = dwarf_get_ptr( &ptr, info->fde_encoding, bases ); TRACE( "%lx: DW_CFA_set_loc %lx\n", info->ip, loc ); info->ip = loc; break; @@ -998,7 +1008,8 @@ static void set_context_reg( CONTEXT *context, ULONG_PTR dw_reg, void *val ) } } -static ULONG_PTR eval_expression( const unsigned char *p, CONTEXT *context ) +static ULONG_PTR eval_expression( const unsigned char *p, CONTEXT *context, + const struct dwarf_eh_bases *bases ) { ULONG_PTR reg, tmp, stack[64]; int sp = -1; @@ -1059,7 +1070,7 @@ static ULONG_PTR eval_expression( const unsigned char *p, CONTEXT *context ) case DW_OP_ne: stack[sp-1] = (stack[sp-1] != stack[sp]); sp--; break; case DW_OP_skip: tmp = (short)dwarf_get_u2(&p); p += tmp; break; case DW_OP_bra: tmp = (short)dwarf_get_u2(&p); if (!stack[sp--]) p += tmp; break; - case DW_OP_GNU_encoded_addr: tmp = *p++; stack[++sp] = dwarf_get_ptr( &p, tmp ); break; + case DW_OP_GNU_encoded_addr: tmp = *p++; stack[++sp] = dwarf_get_ptr( &p, tmp, bases ); break; case DW_OP_regx: stack[++sp] = *(ULONG_PTR *)get_context_reg( context, dwarf_get_uleb128(&p) ); break; case DW_OP_bregx: reg = dwarf_get_uleb128(&p); @@ -1083,7 +1094,8 @@ static ULONG_PTR eval_expression( const unsigned char *p, CONTEXT *context ) } /* apply the computed frame info to the actual context */ -static void apply_frame_state( CONTEXT *context, struct frame_state *state ) +static void apply_frame_state( CONTEXT *context, struct frame_state *state, + const struct dwarf_eh_bases *bases ) { unsigned int i; ULONG_PTR cfa, value; @@ -1092,10 +1104,10 @@ static void apply_frame_state( CONTEXT *context, struct frame_state *state ) switch (state->cfa_rule) { case RULE_EXPRESSION: - cfa = *(ULONG_PTR *)eval_expression( (const unsigned char *)state->cfa_offset, context ); + cfa = *(ULONG_PTR *)eval_expression( (const unsigned char *)state->cfa_offset, context, bases ); break; case RULE_VAL_EXPRESSION: - cfa = eval_expression( (const unsigned char *)state->cfa_offset, context ); + cfa = eval_expression( (const unsigned char *)state->cfa_offset, context, bases ); break; default: cfa = *(ULONG_PTR *)get_context_reg( context, state->cfa_reg ) + state->cfa_offset; @@ -1118,11 +1130,11 @@ static void apply_frame_state( CONTEXT *context, struct frame_state *state ) set_context_reg( &new_context, i, get_context_reg( context, state->regs[i] )); break; case RULE_EXPRESSION: - value = eval_expression( (const unsigned char *)state->regs[i], context ); + value = eval_expression( (const unsigned char *)state->regs[i], context, bases ); set_context_reg( &new_context, i, (void *)value ); break; case RULE_VAL_EXPRESSION: - value = eval_expression( (const unsigned char *)state->regs[i], context ); + value = eval_expression( (const unsigned char *)state->regs[i], context, bases ); set_context_reg( &new_context, i, &value ); break; } @@ -1193,7 +1205,7 @@ static NTSTATUS dwarf_virtual_unwind( ULONG64 ip, ULONG64 *frame,CONTEXT *contex case 'P': { unsigned char encoding = *ptr++; - *handler = (void *)dwarf_get_ptr( &ptr, encoding ); + *handler = (void *)dwarf_get_ptr( &ptr, encoding, bases ); continue; } case 'R': @@ -1210,11 +1222,11 @@ static NTSTATUS dwarf_virtual_unwind( ULONG64 ip, ULONG64 *frame,CONTEXT *contex if (end) ptr = end; end = (const unsigned char *)(&cie->length + 1) + cie->length; - execute_cfa_instructions( ptr, end, ip, &info ); + execute_cfa_instructions( ptr, end, ip, &info, bases ); ptr = (const unsigned char *)(fde + 1); - info.ip = dwarf_get_ptr( &ptr, info.fde_encoding ); /* fde code start */ - code_end = info.ip + dwarf_get_ptr( &ptr, info.fde_encoding & 0x0f ); /* fde code length */ + info.ip = dwarf_get_ptr( &ptr, info.fde_encoding, bases ); /* fde code start */ + code_end = info.ip + dwarf_get_ptr( &ptr, info.fde_encoding & 0x0f, bases ); /* fde code length */ if (aug_z_format) /* get length of augmentation data */ { @@ -1223,15 +1235,15 @@ static NTSTATUS dwarf_virtual_unwind( ULONG64 ip, ULONG64 *frame,CONTEXT *contex } else end = NULL; - *handler_data = (void *)dwarf_get_ptr( &ptr, lsda_encoding ); + *handler_data = (void *)dwarf_get_ptr( &ptr, lsda_encoding, bases ); if (end) ptr = end; end = (const unsigned char *)(&fde->length + 1) + fde->length; TRACE( "fde %p len %x personality %p lsda %p code %lx-%lx\n", fde, fde->length, *handler, *handler_data, info.ip, code_end ); - execute_cfa_instructions( ptr, end, ip, &info ); + execute_cfa_instructions( ptr, end, ip, &info, bases ); *frame = context->Rsp; - apply_frame_state( context, &info.state ); + apply_frame_state( context, &info.state, bases ); TRACE( "next function rip=%016lx\n", context->Rip ); TRACE( " rax=%016lx rbx=%016lx rcx=%016lx rdx=%016lx\n",
1
0
0
0
Alexandre Julliard : ntdll: Always inline NtCurrentTeb() on ARM.
by Alexandre Julliard
21 Jan '21
21 Jan '21
Module: wine Branch: master Commit: fc7c3b51ac27b0b4f19c871d0d5e298b5cf535ef URL:
https://source.winehq.org/git/wine.git/?a=commit;h=fc7c3b51ac27b0b4f19c871d…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jan 21 10:37:54 2021 +0100 ntdll: Always inline NtCurrentTeb() on ARM. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/ntdll.spec | 2 +- dlls/ntdll/signal_arm.c | 8 -------- dlls/ntdll/unix/loader.c | 2 ++ dlls/ntdll/unix/signal_arm.c | 41 ++++++++--------------------------------- dlls/ntdll/unixlib.h | 4 +++- include/winnt.h | 2 +- tools/winebuild/import.c | 6 ++---- 7 files changed, 17 insertions(+), 48 deletions(-) diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index f3ec8fd9e39..9f7bfae76d3 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -189,7 +189,7 @@ @ stub NtCreateToken @ stdcall -syscall NtCreateUserProcess(ptr ptr long long ptr ptr long long ptr ptr ptr) # @ stub NtCreateWaitablePort -@ stdcall -arch=win32,arm64 NtCurrentTeb() +@ stdcall -arch=i386,arm64 NtCurrentTeb() @ stdcall -syscall NtDebugActiveProcess(long long) # @ stub NtDebugContinue @ stdcall -syscall NtDelayExecution(long ptr) diff --git a/dlls/ntdll/signal_arm.c b/dlls/ntdll/signal_arm.c index 0461183460d..b1544ba15fe 100644 --- a/dlls/ntdll/signal_arm.c +++ b/dlls/ntdll/signal_arm.c @@ -304,12 +304,4 @@ __ASM_STDCALL_FUNC( DbgBreakPoint, 0, "bkpt #0; bx lr; nop; nop; nop; nop" ); */ __ASM_STDCALL_FUNC( DbgUserBreakPoint, 0, "bkpt #0; bx lr; nop; nop; nop; nop" ); -/********************************************************************** - * NtCurrentTeb (NTDLL.@) - */ -TEB * WINAPI NtCurrentTeb(void) -{ - return unix_funcs->NtCurrentTeb(); -} - #endif /* __arm__ */ diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 31cfb43d11f..43c769f2d2a 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -1508,7 +1508,9 @@ static double CDECL ntdll_tan( double d ) { return tan( d ); } */ static struct unix_funcs unix_funcs = { +#ifdef __aarch64__ NtCurrentTeb, +#endif DbgUiIssueRemoteBreakin, RtlGetSystemTimePrecise, RtlWaitOnAddress, diff --git a/dlls/ntdll/unix/signal_arm.c b/dlls/ntdll/unix/signal_arm.c index 231f23e354a..385e4807990 100644 --- a/dlls/ntdll/unix/signal_arm.c +++ b/dlls/ntdll/unix/signal_arm.c @@ -68,8 +68,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(seh); -static pthread_key_t teb_key; - /*********************************************************************** * signal context platform-specific definitions @@ -584,23 +582,21 @@ static void setup_exception( ucontext_t *sigcontext, EXCEPTION_RECORD *rec ) * call_user_apc_dispatcher */ __ASM_GLOBAL_FUNC( call_user_apc_dispatcher, - "mov r4, r0\n\t" /* context_ptr */ "mov r5, r1\n\t" /* ctx */ "mov r6, r2\n\t" /* arg1 */ "mov r7, r3\n\t" /* arg2 */ "ldr r8, [sp]\n\t" /* func */ "ldr r9, [sp, #4]\n\t" /* dispatcher */ - "bl " __ASM_NAME("NtCurrentTeb") "\n\t" - "add r10, r0, #0x1d8\n\t" /* arm_thread_data()->syscall_frame */ - "movs r0, r4\n\t" + "mrc p15, 0, r10, c13, c0, 2\n\t" /* NtCurrentTeb() */ + "cmp r0, #0\n\t" /* context_ptr */ "beq 1f\n\t" "ldr r0, [r0, #0x38]\n\t" /* context_ptr->Sp */ "sub r0, r0, #0x1c8\n\t" /* sizeof(CONTEXT) + offsetof(frame,r4) */ "mov ip, #0\n\t" - "str ip, [r10]\n\t" + "str ip, [r10, #0x1d8]\n\t" /* arm_thread_data()->syscall_frame */ "mov sp, r0\n\t" "b 2f\n" - "1:\tldr r0, [r10]\n\t" + "1:\tldr r0, [r10, #0x1d8]\n\t" "sub r0, #0x1a0\n\t" "mov sp, r0\n\t" "mov r0, #3\n\t" @@ -613,7 +609,7 @@ __ASM_GLOBAL_FUNC( call_user_apc_dispatcher, "str r0, [sp, #4]\n\t" /* context.R0 = STATUS_USER_APC */ "mov r0, sp\n\t" "mov ip, #0\n\t" - "str ip, [r10]\n\t" + "str ip, [r10, #0x1d8]\n\t" "2:\tmov r1, r5\n\t" /* ctx */ "mov r2, r6\n\t" /* arg1 */ "mov r3, r7\n\t" /* arg2 */ @@ -634,17 +630,10 @@ __ASM_GLOBAL_FUNC( call_raise_user_exception_dispatcher, * call_user_exception_dispatcher */ __ASM_GLOBAL_FUNC( call_user_exception_dispatcher, - "mov r4, r0\n\t" - "mov r5, r1\n\t" - "mov r6, r2\n\t" - "bl " __ASM_NAME("NtCurrentTeb") "\n\t" - "add r7, r0, #0x1d8\n\t" /* arm_thread_data()->syscall_frame */ - "mov r0, r4\n\t" - "mov r1, r5\n\t" - "mov r2, r6\n\t" - "ldr r3, [r7]\n\t" + "mrc p15, 0, r7, c13, c0, 2\n\t" /* NtCurrentTeb() */ + "ldr r3, [r7, #0x1d8]\n\t" /* arm_thread_data()->syscall_frame */ "mov ip, #0\n\t" - "str ip, [r7]\n\t" + "str ip, [r7, #0x1d8]\n\t" "add r3, r3, #8\n\t" "ldm r3, {r5-r11}\n\t" "ldr r4, [r3, #32]\n\t" @@ -911,7 +900,6 @@ NTSTATUS WINAPI NtSetLdtEntries( ULONG sel1, LDT_ENTRY entry1, ULONG sel2, LDT_E */ void signal_init_threading(void) { - pthread_key_create( &teb_key, NULL ); } @@ -937,11 +925,7 @@ void signal_free_thread( TEB *teb ) */ void signal_init_thread( TEB *teb ) { -#if defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_8A__) - /* Win32/ARM applications expect the TEB pointer to be in the TPIDRURW register. */ __asm__ __volatile__( "mcr p15, 0, %0, c13, c0, 2" : : "r" (teb) ); -#endif - pthread_setspecific( teb_key, teb ); } @@ -1057,13 +1041,4 @@ void signal_exit_thread( int status, void (*func)(int) ) call_thread_exit_func( status, func, NtCurrentTeb() ); } - -/********************************************************************** - * NtCurrentTeb (NTDLL.@) - */ -TEB * WINAPI NtCurrentTeb(void) -{ - return pthread_getspecific( teb_key ); -} - #endif /* __arm__ */ diff --git a/dlls/ntdll/unixlib.h b/dlls/ntdll/unixlib.h index 7ed3148e4c4..0847c7e07ca 100644 --- a/dlls/ntdll/unixlib.h +++ b/dlls/ntdll/unixlib.h @@ -27,12 +27,14 @@ struct _DISPATCHER_CONTEXT; /* increment this when you change the function table */ -#define NTDLL_UNIXLIB_VERSION 106 +#define NTDLL_UNIXLIB_VERSION 107 struct unix_funcs { /* Nt* functions */ +#ifdef __aarch64__ TEB * (WINAPI *NtCurrentTeb)(void); +#endif /* other Win32 API functions */ NTSTATUS (WINAPI *DbgUiIssueRemoteBreakin)( HANDLE process ); diff --git a/include/winnt.h b/include/winnt.h index 83f03b62ade..fba721f7f02 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -2801,7 +2801,7 @@ static FORCEINLINE struct _TEB * WINAPI NtCurrentTeb(void) { return (struct _TEB *)__readgsqword(FIELD_OFFSET(NT_TIB, Self)); } -#elif defined(__arm__) && defined(__MINGW32__) +#elif defined(__arm__) && defined(__GNUC__) static FORCEINLINE struct _TEB * WINAPI NtCurrentTeb(void) { struct _TEB *teb; diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c index f0730aa2fe7..2ff63c2265d 100644 --- a/tools/winebuild/import.c +++ b/tools/winebuild/import.c @@ -1577,10 +1577,8 @@ void output_syscalls( DLLSPEC *spec ) output( "\tcmp r4, r5\n" ); output( "\tbcs 5f\n" ); output( "\tsub sp, sp, #8\n" ); - output( "\tpush {r0-r3}\n" ); - output( "\tbl %s\n", asm_name("NtCurrentTeb") ); - output( "\tadd r7, r0, #0x1d8\n" ); /* arm_thread_data()->syscall_frame */ - output( "\tpop {r0-r3}\n" ); + output( "\tmrc p15, 0, r7, c13, c0, 2\n" ); /* NtCurrentTeb() */ + output( "\tadd r7, #0x1d8\n" ); /* arm_thread_data()->syscall_frame */ output( "\tmrs ip, CPSR\n" ); output( "\tstr ip, [sp, #4]\n" ); output( "\tstr sp, [r7]\n" ); /* syscall frame */
1
0
0
0
Daniel Lehman : ntdll: Check event type on creation.
by Alexandre Julliard
21 Jan '21
21 Jan '21
Module: wine Branch: master Commit: 6a971e8429a81e4fcec8ac13b28bbf75b7a06bdb URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6a971e8429a81e4fcec8ac13…
Author: Daniel Lehman <dlehman25(a)gmail.com> Date: Wed Jan 20 22:04:52 2021 -0800 ntdll: Check event type on creation. Signed-off-by: Daniel Lehman <dlehman25(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/tests/om.c | 50 +++++++++++++++++++++++++++++++++++--------------- dlls/ntdll/unix/sync.c | 1 + 2 files changed, 36 insertions(+), 15 deletions(-) diff --git a/dlls/ntdll/tests/om.c b/dlls/ntdll/tests/om.c index ff0b9c939e4..5744b88fc84 100644 --- a/dlls/ntdll/tests/om.c +++ b/dlls/ntdll/tests/om.c @@ -26,7 +26,7 @@ #include "stdlib.h" static VOID (WINAPI *pRtlInitUnicodeString)( PUNICODE_STRING, LPCWSTR ); -static NTSTATUS (WINAPI *pNtCreateEvent) ( PHANDLE, ACCESS_MASK, const POBJECT_ATTRIBUTES, BOOLEAN, BOOLEAN); +static NTSTATUS (WINAPI *pNtCreateEvent) ( PHANDLE, ACCESS_MASK, const POBJECT_ATTRIBUTES, EVENT_TYPE, BOOLEAN); static NTSTATUS (WINAPI *pNtOpenEvent) ( PHANDLE, ACCESS_MASK, const POBJECT_ATTRIBUTES); static NTSTATUS (WINAPI *pNtPulseEvent) ( HANDLE, PLONG ); static NTSTATUS (WINAPI *pNtQueryEvent) ( HANDLE, EVENT_INFORMATION_CLASS, PVOID, ULONG, PULONG ); @@ -92,12 +92,12 @@ static void test_case_sensitive (void) status = pNtCreateMutant(&Mutant, GENERIC_ALL, &attr, FALSE); ok(status == STATUS_SUCCESS, "Failed to create Mutant(%08x)\n", status); - status = pNtCreateEvent(&Event, GENERIC_ALL, &attr, FALSE, FALSE); + status = pNtCreateEvent(&Event, GENERIC_ALL, &attr, NotificationEvent, FALSE); ok(status == STATUS_OBJECT_NAME_COLLISION || status == STATUS_OBJECT_TYPE_MISMATCH /* Vista+ */, "got %#x\n", status); pRtlInitUnicodeString(&str, L"\\BaseNamedObjects\\Test"); InitializeObjectAttributes(&attr, &str, 0, 0, NULL); - status = pNtCreateEvent(&Event, GENERIC_ALL, &attr, FALSE, FALSE); + status = pNtCreateEvent(&Event, GENERIC_ALL, &attr, NotificationEvent, FALSE); ok(status == STATUS_SUCCESS, "Failed to create Event(%08x)\n", status); pRtlInitUnicodeString(&str, L"\\BaseNamedObjects\\TEst"); @@ -113,7 +113,7 @@ static void test_case_sensitive (void) status = pNtCreateMutant(&Mutant, GENERIC_ALL, &attr, FALSE); ok(status == STATUS_OBJECT_NAME_COLLISION || status == STATUS_OBJECT_TYPE_MISMATCH /* Vista+ */, "got %#x\n", status); - status = pNtCreateEvent(&h, GENERIC_ALL, &attr, FALSE, FALSE); + status = pNtCreateEvent(&h, GENERIC_ALL, &attr, NotificationEvent, FALSE); ok(status == STATUS_OBJECT_NAME_COLLISION, "NtCreateEvent should have failed with STATUS_OBJECT_NAME_COLLISION got(%08x)\n", status); @@ -292,7 +292,7 @@ static void test_name_collisions(void) h = CreateEventA(NULL, FALSE, FALSE, "om.c-test"); ok(h != 0, "CreateEventA failed got ret=%p (%d)\n", h, GetLastError()); - status = pNtCreateEvent(&h1, GENERIC_ALL, &attr, FALSE, FALSE); + status = pNtCreateEvent(&h1, GENERIC_ALL, &attr, NotificationEvent, FALSE); ok(status == STATUS_OBJECT_NAME_EXISTS && h1 != NULL, "NtCreateEvent should have succeeded with STATUS_OBJECT_NAME_EXISTS got(%08x)\n", status); h2 = CreateEventA(NULL, FALSE, FALSE, "om.c-test"); @@ -370,7 +370,7 @@ static void test_all_kernel_objects( UINT line, OBJECT_ATTRIBUTES *attr, ok( status2 == open_expect, "%u: NtOpenSemaphore failed %x\n", line, status2 ); if (!status) pNtClose( ret ); if (!status2) pNtClose( ret2 ); - status = pNtCreateEvent( &ret, GENERIC_ALL, attr, 1, 0 ); + status = pNtCreateEvent( &ret, GENERIC_ALL, attr, SynchronizationEvent, 0 ); ok( status == create_expect, "%u: NtCreateEvent failed %x\n", line, status ); status2 = pNtOpenEvent( &ret2, GENERIC_ALL, attr ); ok( status2 == open_expect, "%u: NtOpenEvent failed %x\n", line, status2 ); @@ -462,7 +462,7 @@ static void test_name_limits(void) ok( status == STATUS_OBJECT_TYPE_MISMATCH || status == STATUS_INVALID_HANDLE /* < 7 */, "%u: NtOpenSemaphore failed %x\n", str.Length, status ); pNtClose( ret ); - status = pNtCreateEvent( &ret, GENERIC_ALL, &attr2, 1, 0 ); + status = pNtCreateEvent( &ret, GENERIC_ALL, &attr2, SynchronizationEvent, 0 ); ok( status == STATUS_SUCCESS, "%u: NtCreateEvent failed %x\n", str.Length, status ); attr3.RootDirectory = ret; status = pNtOpenEvent( &ret2, GENERIC_ALL, &attr ); @@ -581,7 +581,7 @@ static void test_name_limits(void) pNtClose( ret ); status = pNtOpenSemaphore( &ret, GENERIC_ALL, NULL ); ok( status == STATUS_INVALID_PARAMETER, "NULL: NtOpenSemaphore failed %x\n", status ); - status = pNtCreateEvent( &ret, GENERIC_ALL, NULL, 1, 0 ); + status = pNtCreateEvent( &ret, GENERIC_ALL, NULL, SynchronizationEvent, 0 ); ok( status == STATUS_SUCCESS, "NULL: NtCreateEvent failed %x\n", status ); pNtClose( ret ); status = pNtOpenEvent( &ret, GENERIC_ALL, NULL ); @@ -934,7 +934,7 @@ static void test_directory(void) RtlInitUnicodeString( &str, L"om.c-event" ); InitializeObjectAttributes( &attr, &str, 0, dir1, NULL ); - status = pNtCreateEvent( &h, GENERIC_ALL, &attr, 1, 0 ); + status = pNtCreateEvent( &h, GENERIC_ALL, &attr, SynchronizationEvent, 0 ); ok( status == STATUS_SUCCESS, "NtCreateEvent failed %x\n", status ); status = pNtOpenEvent( &h2, GENERIC_ALL, &attr ); ok( status == STATUS_SUCCESS, "NtOpenEvent failed %x\n", status ); @@ -1570,7 +1570,7 @@ static void test_type_mismatch(void) attr.SecurityDescriptor = NULL; attr.SecurityQualityOfService = NULL; - res = pNtCreateEvent( &h, 0, &attr, 0, 0 ); + res = pNtCreateEvent( &h, 0, &attr, NotificationEvent, 0 ); ok(!res, "can't create event: %x\n", res); res = pNtReleaseSemaphore( h, 30, NULL ); @@ -1592,16 +1592,29 @@ static void test_event(void) pRtlInitUnicodeString( &str, L"\\BaseNamedObjects\\testEvent" ); InitializeObjectAttributes(&attr, &str, 0, 0, NULL); - status = pNtCreateEvent(&Event, GENERIC_ALL, &attr, 1, 0); + status = pNtCreateEvent(&Event, GENERIC_ALL, &attr, 2, 0); + ok( status == STATUS_INVALID_PARAMETER, "NtCreateEvent failed %08x\n", status ); + + status = pNtCreateEvent(&Event, GENERIC_ALL, &attr, NotificationEvent, 0); + ok( status == STATUS_SUCCESS, "NtCreateEvent failed %08x\n", status ); + memset(&info, 0xcc, sizeof(info)); + status = pNtQueryEvent(Event, EventBasicInformation, &info, sizeof(info), NULL); + ok( status == STATUS_SUCCESS, "NtQueryEvent failed %08x\n", status ); + ok( info.EventType == NotificationEvent && info.EventState == 0, + "NtQueryEvent failed, expected 0 0, got %d %d\n", info.EventType, info.EventState ); + pNtClose(Event); + + status = pNtCreateEvent(&Event, GENERIC_ALL, &attr, SynchronizationEvent, 0); ok( status == STATUS_SUCCESS, "NtCreateEvent failed %08x\n", status ); status = pNtPulseEvent(Event, &prev_state); ok( status == STATUS_SUCCESS, "NtPulseEvent failed %08x\n", status ); ok( !prev_state, "prev_state = %x\n", prev_state ); + memset(&info, 0xcc, sizeof(info)); status = pNtQueryEvent(Event, EventBasicInformation, &info, sizeof(info), NULL); ok( status == STATUS_SUCCESS, "NtQueryEvent failed %08x\n", status ); - ok( info.EventType == 1 && info.EventState == 0, + ok( info.EventType == SynchronizationEvent && info.EventState == 0, "NtQueryEvent failed, expected 1 0, got %d %d\n", info.EventType, info.EventState ); status = pNtOpenEvent(&Event2, GENERIC_ALL, &attr); @@ -1610,15 +1623,22 @@ static void test_event(void) pNtClose(Event); Event = Event2; + memset(&info, 0xcc, sizeof(info)); status = pNtQueryEvent(Event, EventBasicInformation, &info, sizeof(info), NULL); ok( status == STATUS_SUCCESS, "NtQueryEvent failed %08x\n", status ); - ok( info.EventType == 1 && info.EventState == 0, + ok( info.EventType == SynchronizationEvent && info.EventState == 0, "NtQueryEvent failed, expected 1 0, got %d %d\n", info.EventType, info.EventState ); status = pNtSetEvent( Event, &prev_state ); ok( status == STATUS_SUCCESS, "NtSetEvent failed: %08x\n", status ); ok( !prev_state, "prev_state = %x\n", prev_state ); + memset(&info, 0xcc, sizeof(info)); + status = pNtQueryEvent(Event, EventBasicInformation, &info, sizeof(info), NULL); + ok( status == STATUS_SUCCESS, "NtQueryEvent failed %08x\n", status ); + ok( info.EventType == SynchronizationEvent && info.EventState == 1, + "NtQueryEvent failed, expected 1 1, got %d %d\n", info.EventType, info.EventState ); + status = pNtSetEvent( Event, &prev_state ); ok( status == STATUS_SUCCESS, "NtSetEvent failed: %08x\n", status ); ok( prev_state == 1, "prev_state = %x\n", prev_state ); @@ -1824,13 +1844,13 @@ static void test_keyed_events(void) status = pNtPulseEvent( handle, NULL ); ok( status == STATUS_OBJECT_TYPE_MISMATCH, "NtPulseEvent %x\n", status ); - status = pNtCreateEvent( &event, GENERIC_ALL, &attr, FALSE, FALSE ); + status = pNtCreateEvent( &event, GENERIC_ALL, &attr, NotificationEvent, FALSE ); ok( status == STATUS_OBJECT_NAME_COLLISION || status == STATUS_OBJECT_TYPE_MISMATCH /* 7+ */, "CreateEvent %x\n", status ); NtClose( handle ); - status = pNtCreateEvent( &event, GENERIC_ALL, &attr, FALSE, FALSE ); + status = pNtCreateEvent( &event, GENERIC_ALL, &attr, NotificationEvent, FALSE ); ok( status == 0, "CreateEvent %x\n", status ); status = pNtWaitForKeyedEvent( event, (void *)8, 0, &timeout ); ok( status == STATUS_OBJECT_TYPE_MISMATCH, "NtWaitForKeyedEvent %x\n", status ); diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index dcc8c5447ef..3a3080463d7 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -427,6 +427,7 @@ NTSTATUS WINAPI NtCreateEvent( HANDLE *handle, ACCESS_MASK access, const OBJECT_ data_size_t len; struct object_attributes *objattr; + if (type != NotificationEvent && type != SynchronizationEvent) return STATUS_INVALID_PARAMETER; if ((ret = alloc_object_attributes( attr, &objattr, &len ))) return ret; SERVER_START_REQ( create_event )
1
0
0
0
Zebediah Figura : ntoskrnl: Use YieldProcessor().
by Alexandre Julliard
21 Jan '21
21 Jan '21
Module: wine Branch: master Commit: c0ce83371b1c45d22d584afc7407cfcf9d4063aa URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c0ce83371b1c45d22d584afc…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Wed Jan 20 22:35:49 2021 -0600 ntoskrnl: Use YieldProcessor(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntoskrnl.exe/sync.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/dlls/ntoskrnl.exe/sync.c b/dlls/ntoskrnl.exe/sync.c index 671398594e8..2aa60a0f2a0 100644 --- a/dlls/ntoskrnl.exe/sync.c +++ b/dlls/ntoskrnl.exe/sync.c @@ -540,15 +540,6 @@ void WINAPI KeInitializeSpinLock( KSPIN_LOCK *lock ) *lock = 0; } -static inline void small_pause(void) -{ -#ifdef __x86_64__ - __asm__ __volatile__( "rep;nop" : : : "memory" ); -#else - __asm__ __volatile__( "" : : : "memory" ); -#endif -} - /*********************************************************************** * KeAcquireSpinLockAtDpcLevel (NTOSKRNL.EXE.@) */ @@ -556,7 +547,7 @@ void WINAPI KeAcquireSpinLockAtDpcLevel( KSPIN_LOCK *lock ) { TRACE("lock %p.\n", lock); while (InterlockedCompareExchangePointer( (void **)lock, (void *)1, (void *)0 )) - small_pause(); + YieldProcessor(); } /*********************************************************************** @@ -592,7 +583,7 @@ void FASTCALL KeAcquireInStackQueuedSpinLockAtDpcLevel( KSPIN_LOCK *lock, KLOCK_ while (!((ULONG_PTR)InterlockedCompareExchangePointer( (void **)&queue->LockQueue.Lock, 0, 0 ) & QUEUED_SPINLOCK_OWNED)) { - small_pause(); + YieldProcessor(); } } } @@ -619,7 +610,7 @@ void FASTCALL KeReleaseInStackQueuedSpinLockFromDpcLevel( KLOCK_QUEUE_HANDLE *qu /* Otherwise, someone just queued themselves, but hasn't yet set * themselves as successor. Spin waiting for them to do so. */ while (!(next = queue->LockQueue.Next)) - small_pause(); + YieldProcessor(); } InterlockedExchangePointer( (void **)&next->Lock, (KSPIN_LOCK *)((ULONG_PTR)lock | QUEUED_SPINLOCK_OWNED) );
1
0
0
0
Zebediah Figura : wined3d: Use YieldProcessor().
by Alexandre Julliard
21 Jan '21
21 Jan '21
Module: wine Branch: master Commit: 6bdf641142c631ce22784da16cf8ff0bda4f3a70 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6bdf641142c631ce22784da1…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Wed Jan 20 22:35:48 2021 -0600 wined3d: Use YieldProcessor(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/cs.c | 4 ++-- dlls/wined3d/wined3d_private.h | 9 +-------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index 0b9c5f70043..56df760145a 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -646,7 +646,7 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw * ahead of the worker thread. */ while (pending >= swapchain->max_frame_latency) { - wined3d_pause(); + YieldProcessor(); pending = InterlockedCompareExchange(&cs->pending_presents, 0, 0); } } @@ -2822,7 +2822,7 @@ static void wined3d_cs_mt_finish(struct wined3d_cs *cs, enum wined3d_cs_queue_id return wined3d_cs_st_finish(cs, queue_id); while (cs->queue[queue_id].head != *(volatile LONG *)&cs->queue[queue_id].tail) - wined3d_pause(); + YieldProcessor(); } static const struct wined3d_cs_ops wined3d_cs_mt_ops = diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 37fe3a314cb..e010deb1264 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -424,13 +424,6 @@ static inline unsigned int wined3d_popcount(unsigned int x) #endif } -static inline void wined3d_pause(void) -{ -#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) - __asm__ __volatile__( "rep;nop" : : : "memory" ); -#endif -} - #define ORM_BACKBUFFER 0 #define ORM_FBO 1 @@ -4817,7 +4810,7 @@ static inline void wined3d_resource_wait_idle(struct wined3d_resource *resource) return; while (InterlockedCompareExchange(&resource->access_count, 0, 0)) - wined3d_pause(); + YieldProcessor(); } /* TODO: Add tests and support for FLOAT16_4 POSITIONT, D3DCOLOR position, other
1
0
0
0
Zebediah Figura : include: Add YieldProcessor().
by Alexandre Julliard
21 Jan '21
21 Jan '21
Module: wine Branch: master Commit: 86fc30c10540dc5ed225e547032ca1dd2d21433f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=86fc30c10540dc5ed225e547…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Wed Jan 20 22:35:47 2021 -0600 include: Add YieldProcessor(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/winnt.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/winnt.h b/include/winnt.h index d8abb8bde70..83f03b62ade 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -7154,6 +7154,19 @@ static FORCEINLINE void MemoryBarrier(void) #endif /* __GNUC__ */ +static FORCEINLINE void YieldProcessor(void) +{ +#ifdef __GNUC__ +#if defined(__i386__) || defined(__x86_64__) + __asm__ __volatile__( "rep; nop" : : : "memory" ); +#elif defined(__arm__) || defined(__aarch64__) + __asm__ __volatile__( "dmb ishst\n\tyield" : : : "memory" ); +#else + __asm__ __volatile__( "" : : : "memory" ); +#endif +#endif +} + #ifdef __cplusplus } #endif
1
0
0
0
Zebediah Figura : include: Add InterlockedIncrement16() and InterlockedDecrement16().
by Alexandre Julliard
21 Jan '21
21 Jan '21
Module: wine Branch: master Commit: a3c295d4cf295860fd45c3ef828174da4e969874 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a3c295d4cf295860fd45c3ef…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Wed Jan 20 22:35:46 2021 -0600 include: Add InterlockedIncrement16() and InterlockedDecrement16(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/winnt.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/include/winnt.h b/include/winnt.h index b03f7bb3646..d8abb8bde70 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -6905,7 +6905,9 @@ static inline BOOLEAN BitScanReverse(DWORD *index, DWORD mask) #pragma intrinsic(_InterlockedExchange) #pragma intrinsic(_InterlockedExchangeAdd) #pragma intrinsic(_InterlockedIncrement) +#pragma intrinsic(_InterlockedIncrement16) #pragma intrinsic(_InterlockedDecrement) +#pragma intrinsic(_InterlockedDecrement16) #pragma intrinsic(_InterlockedOr) long _InterlockedAnd(long volatile *,long); @@ -6915,9 +6917,11 @@ long long _InterlockedCompareExchange64(long long volatile*,long long,long long) unsigned char _InterlockedCompareExchange128(volatile __int64 *, __int64, __int64, __int64 *); #endif long _InterlockedDecrement(long volatile*); +short _InterlockedDecrement16(short volatile*); long _InterlockedExchange(long volatile*,long); long _InterlockedExchangeAdd(long volatile*,long); long _InterlockedIncrement(long volatile*); +short _InterlockedIncrement16(short volatile*); long _InterlockedOr(long volatile *,long); static FORCEINLINE LONG WINAPI InterlockedAnd( LONG volatile *dest, LONG val ) @@ -6957,11 +6961,21 @@ static FORCEINLINE LONG WINAPI InterlockedIncrement( LONG volatile *dest ) return _InterlockedIncrement( (long volatile *)dest ); } +static FORCEINLINE short WINAPI InterlockedIncrement16( short volatile *dest ) +{ + return _InterlockedIncrement16( (long volatile *)dest ); +} + static FORCEINLINE LONG WINAPI InterlockedDecrement( LONG volatile *dest ) { return _InterlockedDecrement( (long volatile *)dest ); } +static FORCEINLINE short WINAPI InterlockedDecrement16( short volatile *dest ) +{ + return _InterlockedDecrement16( (long volatile *)dest ); +} + static FORCEINLINE LONG WINAPI InterlockedOr( LONG volatile *dest, LONG val ) { return _InterlockedOr( (long volatile *)dest, val ); @@ -7098,11 +7112,21 @@ static FORCEINLINE LONG WINAPI InterlockedIncrement( LONG volatile *dest ) return __sync_add_and_fetch( dest, 1 ); } +static FORCEINLINE short WINAPI InterlockedIncrement16( short volatile *dest ) +{ + return __sync_add_and_fetch( dest, 1 ); +} + static FORCEINLINE LONG WINAPI InterlockedDecrement( LONG volatile *dest ) { return __sync_add_and_fetch( dest, -1 ); } +static FORCEINLINE short WINAPI InterlockedDecrement16( short volatile *dest ) +{ + return __sync_add_and_fetch( dest, -1 ); +} + static FORCEINLINE void * WINAPI InterlockedExchangePointer( void *volatile *dest, void *val ) { void *ret;
1
0
0
0
← Newer
1
...
20
21
22
23
24
25
26
...
48
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
Results per page:
10
25
50
100
200