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
November 2023
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
989 discussions
Start a n
N
ew thread
Rémi Bernon : winebus.sys: Fix incorrect hid_device_set index check.
by Alexandre Julliard
15 Nov '23
15 Nov '23
Module: wine Branch: master Commit: bbdec47b966ed94fc72e13e91c943c6b1a34682e URL:
https://gitlab.winehq.org/wine/wine/-/commit/bbdec47b966ed94fc72e13e91c943c…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Wed Nov 15 16:01:43 2023 +0100 winebus.sys: Fix incorrect hid_device_set index check. Instead of checking it in set_report_from_joystick_event. --- dlls/winebus.sys/bus_sdl.c | 6 ++---- dlls/winebus.sys/hid.c | 6 +++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/dlls/winebus.sys/bus_sdl.c b/dlls/winebus.sys/bus_sdl.c index 9b0e7226fa5..ed9d3aed4bd 100644 --- a/dlls/winebus.sys/bus_sdl.c +++ b/dlls/winebus.sys/bus_sdl.c @@ -841,8 +841,7 @@ static BOOL set_report_from_joystick_event(struct sdl_device *impl, SDL_Event *e { SDL_JoyAxisEvent *ie = &event->jaxis; - if (ie->axis >= ARRAY_SIZE(absolute_axis_usages)) break; - hid_device_set_abs_axis(iface, ie->axis, ie->value); + if (!hid_device_set_abs_axis(iface, ie->axis, ie->value)) break; bus_event_queue_input_report(&event_queue, iface, state->report_buf, state->report_len); break; } @@ -850,8 +849,7 @@ static BOOL set_report_from_joystick_event(struct sdl_device *impl, SDL_Event *e { SDL_JoyBallEvent *ie = &event->jball; - if (ie->ball >= ARRAY_SIZE(relative_axis_usages) / 2) break; - hid_device_set_rel_axis(iface, 2 * ie->ball, ie->xrel); + if (!hid_device_set_rel_axis(iface, 2 * ie->ball, ie->xrel)) break; hid_device_set_rel_axis(iface, 2 * ie->ball + 1, ie->yrel); bus_event_queue_input_report(&event_queue, iface, state->report_buf, state->report_len); break; diff --git a/dlls/winebus.sys/hid.c b/dlls/winebus.sys/hid.c index c5543e081ae..6d2b484ccca 100644 --- a/dlls/winebus.sys/hid.c +++ b/dlls/winebus.sys/hid.c @@ -1376,7 +1376,7 @@ BOOL hid_device_set_abs_axis(struct unix_device *iface, ULONG index, LONG value) { struct hid_device_state *state = &iface->hid_device_state; ULONG offset = state->abs_axis_start + index * 4; - if (index > state->abs_axis_count) return FALSE; + if (index >= state->abs_axis_count) return FALSE; *(ULONG *)(state->report_buf + offset) = LE_ULONG(value); return TRUE; } @@ -1385,7 +1385,7 @@ BOOL hid_device_set_rel_axis(struct unix_device *iface, ULONG index, LONG value) { struct hid_device_state *state = &iface->hid_device_state; ULONG offset = state->rel_axis_start + index * 4; - if (index > state->rel_axis_count) return FALSE; + if (index >= state->rel_axis_count) return FALSE; *(ULONG *)(state->report_buf + offset) = LE_ULONG(value); return TRUE; } @@ -1395,7 +1395,7 @@ BOOL hid_device_set_button(struct unix_device *iface, ULONG index, BOOL is_set) struct hid_device_state *state = &iface->hid_device_state; ULONG offset = state->button_start + (index / 8); BYTE mask = (1 << (index % 8)); - if (index > state->button_count) return FALSE; + if (index >= state->button_count) return FALSE; if (is_set) state->report_buf[offset] |= mask; else state->report_buf[offset] &= ~mask; return TRUE;
1
0
0
0
Michael Stefaniuc : sane.ds: Use ARRAY_SIZE instead of open coding it.
by Alexandre Julliard
15 Nov '23
15 Nov '23
Module: wine Branch: master Commit: f79d4343a9d4d4146b3377b021256e32955769f5 URL:
https://gitlab.winehq.org/wine/wine/-/commit/f79d4343a9d4d4146b3377b021256e…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Wed Nov 8 19:34:26 2023 +0100 sane.ds: Use ARRAY_SIZE instead of open coding it. --- dlls/sane.ds/capability.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/sane.ds/capability.c b/dlls/sane.ds/capability.c index 349126f6b95..560b670ae4d 100644 --- a/dlls/sane.ds/capability.c +++ b/dlls/sane.ds/capability.c @@ -186,7 +186,7 @@ static TW_UINT16 TWAIN_GetSupportedCaps(pTW_CAPABILITY pCapability) ICAP_XFERMECH, ICAP_PIXELTYPE, ICAP_UNITS, ICAP_BITDEPTH, ICAP_COMPRESSION, ICAP_PIXELFLAVOR, ICAP_XRESOLUTION, ICAP_YRESOLUTION, ICAP_PHYSICALHEIGHT, ICAP_PHYSICALWIDTH, ICAP_SUPPORTEDSIZES }; - return msg_get_array(pCapability, TWTY_UINT16, supported_caps, sizeof(supported_caps) / sizeof(supported_caps[0])); + return msg_get_array(pCapability, TWTY_UINT16, supported_caps, ARRAY_SIZE(supported_caps)); }
1
0
0
0
Michael Stefaniuc : gdiplus: Remove redundant NULL check before free().
by Alexandre Julliard
15 Nov '23
15 Nov '23
Module: wine Branch: master Commit: 1a8ef0c4db497d62cf2654fab62de9edbe661917 URL:
https://gitlab.winehq.org/wine/wine/-/commit/1a8ef0c4db497d62cf2654fab62de9…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Wed Nov 8 19:29:01 2023 +0100 gdiplus: Remove redundant NULL check before free(). --- dlls/gdiplus/image.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index 1fe259f6096..d680cff9940 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -3780,9 +3780,7 @@ static void png_metadata_reader(GpBitmap *bitmap, IWICBitmapDecoder *decoder, UI IWICMetadataReader_Release(reader); } - - if (seen_text) - heap_free(seen_text); + heap_free(seen_text); png_add_unit_properties(frame, bitmap);
1
0
0
0
Dmitry Timoshkov : user32: Return DEFAULT_CHARSET from SPI_GETICONTITLELOGFONT and SPI_GETNONCLIENTMETRICS.
by Alexandre Julliard
15 Nov '23
15 Nov '23
Module: wine Branch: master Commit: cb80a250218f75673c50df85ffc7f16ec7c8e2c5 URL:
https://gitlab.winehq.org/wine/wine/-/commit/cb80a250218f75673c50df85ffc7f1…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Thu Aug 18 13:00:45 2022 +0300 user32: Return DEFAULT_CHARSET from SPI_GETICONTITLELOGFONT and SPI_GETNONCLIENTMETRICS. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> --- dlls/user32/tests/sysparams.c | 3 +-- dlls/win32u/sysparams.c | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dlls/user32/tests/sysparams.c b/dlls/user32/tests/sysparams.c index a6bdf73dd34..e6a296f5d3a 100644 --- a/dlls/user32/tests/sysparams.c +++ b/dlls/user32/tests/sysparams.c @@ -4151,14 +4151,13 @@ static void test_LOGFONT_charset(void) ret = SystemParametersInfoA(SPI_GETICONTITLELOGFONT, sizeof(lf), &lf, FALSE); ok(ret, "SystemParametersInfoW error %lu\n", GetLastError()); - todo_wine ok(lf.lfCharSet == DEFAULT_CHARSET, "got %d\n", lf.lfCharSet); ncm.cbSize = FIELD_OFFSET(NONCLIENTMETRICSA, iPaddedBorderWidth); ret = SystemParametersInfoA(SPI_GETNONCLIENTMETRICS, 0, &ncm, 0); ok(ret, "SystemParametersInfoW error %lu\n", GetLastError()); - todo_wine ok(ncm.lfCaptionFont.lfCharSet == DEFAULT_CHARSET, "got %d\n", ncm.lfCaptionFont.lfCharSet); + ok(ncm.lfSmCaptionFont.lfCharSet == DEFAULT_CHARSET, "got %d\n", ncm.lfSmCaptionFont.lfCharSet); } START_TEST(sysparams) diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index b134c5af680..9d23c533049 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -4247,12 +4247,14 @@ static BOOL get_font_entry( union sysparam_all_entry *entry, UINT int_param, voi switch (load_entry( &entry->hdr, &font, sizeof(font) )) { case sizeof(font): + font.lfCharSet = DEFAULT_CHARSET; if (font.lfHeight > 0) /* positive height value means points ( inch/72 ) */ font.lfHeight = -muldiv( font.lfHeight, USER_DEFAULT_SCREEN_DPI, 72 ); entry->font.val = font; break; case sizeof(LOGFONT16): /* win9x-winME format */ logfont16to32( (LOGFONT16 *)&font, &entry->font.val ); + entry->font.val.lfCharSet = DEFAULT_CHARSET; if (entry->font.val.lfHeight > 0) entry->font.val.lfHeight = -muldiv( entry->font.val.lfHeight, USER_DEFAULT_SCREEN_DPI, 72 ); break; @@ -4263,6 +4265,7 @@ static BOOL get_font_entry( union sysparam_all_entry *entry, UINT int_param, voi /* fall through */ case 0: /* use the default GUI font */ NtGdiExtGetObjectW( GetStockObject( DEFAULT_GUI_FONT ), sizeof(font), &font ); + font.lfCharSet = DEFAULT_CHARSET; font.lfHeight = map_from_system_dpi( font.lfHeight ); font.lfWeight = entry->font.weight; entry->font.val = font; @@ -4302,6 +4305,7 @@ static BOOL set_font_entry( union sysparam_all_entry *entry, UINT int_param, voi static BOOL init_font_entry( union sysparam_all_entry *entry ) { NtGdiExtGetObjectW( GetStockObject( DEFAULT_GUI_FONT ), sizeof(entry->font.val), &entry->font.val ); + entry->font.val.lfCharSet = DEFAULT_CHARSET; entry->font.val.lfHeight = map_from_system_dpi( entry->font.val.lfHeight ); entry->font.val.lfWeight = entry->font.weight; get_real_fontname( &entry->font.val, entry->font.fullname );
1
0
0
0
Dmitry Timoshkov : user32/tests: Add some tests for font charset returned by SPI_GETICONTITLELOGFONT and SPI_GETNONCLIENTMETRICS.
by Alexandre Julliard
15 Nov '23
15 Nov '23
Module: wine Branch: master Commit: f4fd21e3fe53f66e9fc4fb2d8e1c584dc10ce760 URL:
https://gitlab.winehq.org/wine/wine/-/commit/f4fd21e3fe53f66e9fc4fb2d8e1c58…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Wed Aug 17 19:10:44 2022 +0300 user32/tests: Add some tests for font charset returned by SPI_GETICONTITLELOGFONT and SPI_GETNONCLIENTMETRICS. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> --- dlls/user32/tests/sysparams.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/dlls/user32/tests/sysparams.c b/dlls/user32/tests/sysparams.c index 12cbf630319..a6bdf73dd34 100644 --- a/dlls/user32/tests/sysparams.c +++ b/dlls/user32/tests/sysparams.c @@ -4136,6 +4136,31 @@ static void test_GetAutoRotationState(void) ok(ret, "Expected GetAutoRotationState to succeed, error %ld\n", GetLastError()); } +static void test_LOGFONT_charset(void) +{ + CHARSETINFO csi; + LOGFONTA lf; + NONCLIENTMETRICSA ncm; + BOOL ret; + + ret = TranslateCharsetInfo(ULongToPtr(GetACP()), &csi, TCI_SRCCODEPAGE); + ok(ret, "TranslateCharsetInfo(%d) error %lu\n", GetACP(), GetLastError()); + + GetObjectA(GetStockObject(DEFAULT_GUI_FONT), sizeof(lf), &lf); + ok(lf.lfCharSet == csi.ciCharset, "got %d, expected %d\n", lf.lfCharSet, csi.ciCharset); + + ret = SystemParametersInfoA(SPI_GETICONTITLELOGFONT, sizeof(lf), &lf, FALSE); + ok(ret, "SystemParametersInfoW error %lu\n", GetLastError()); + todo_wine + ok(lf.lfCharSet == DEFAULT_CHARSET, "got %d\n", lf.lfCharSet); + + ncm.cbSize = FIELD_OFFSET(NONCLIENTMETRICSA, iPaddedBorderWidth); + ret = SystemParametersInfoA(SPI_GETNONCLIENTMETRICS, 0, &ncm, 0); + ok(ret, "SystemParametersInfoW error %lu\n", GetLastError()); + todo_wine + ok(ncm.lfCaptionFont.lfCharSet == DEFAULT_CHARSET, "got %d\n", ncm.lfCaptionFont.lfCharSet); +} + START_TEST(sysparams) { int argc; @@ -4183,6 +4208,8 @@ START_TEST(sysparams) strict=(argc >= 3 && strcmp(argv[2],"strict")==0); trace("strict=%d\n",strict); + test_LOGFONT_charset(); + trace("testing GetSystemMetrics with your current desktop settings\n"); test_GetSystemMetrics( ); test_metrics_for_dpi( 192 );
1
0
0
0
Paweł Ulita : user32: Add stubs for GetWindowDpiHostingBehavior and SetThreadDpiHostingBehavior.
by Alexandre Julliard
15 Nov '23
15 Nov '23
Module: wine Branch: master Commit: 09edd1391979bf41fe6c99f34488823cef0280a6 URL:
https://gitlab.winehq.org/wine/wine/-/commit/09edd1391979bf41fe6c99f3448882…
Author: Paweł Ulita <pawelulita(a)fastmail.com> Date: Sun Nov 12 15:21:27 2023 +0100 user32: Add stubs for GetWindowDpiHostingBehavior and SetThreadDpiHostingBehavior. This prevents Native Instruments Kontakt 7 from crashing on start-up. --- dlls/user32/sysparams.c | 9 +++++++++ dlls/user32/user32.spec | 2 ++ dlls/user32/win.c | 10 ++++++++++ include/windef.h | 6 ++++++ include/winuser.h | 2 ++ 5 files changed, 29 insertions(+) diff --git a/dlls/user32/sysparams.c b/dlls/user32/sysparams.c index 5ededfee62a..bc78c1fef88 100644 --- a/dlls/user32/sysparams.c +++ b/dlls/user32/sysparams.c @@ -746,6 +746,15 @@ DPI_AWARENESS_CONTEXT WINAPI SetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT return ULongToHandle( prev ); } +/********************************************************************** + * SetThreadDpiHostingBehavior (USER32.@) + */ +DPI_HOSTING_BEHAVIOR WINAPI SetThreadDpiHostingBehavior( DPI_HOSTING_BEHAVIOR value ) +{ + FIXME("(%d): stub\n", value); + return DPI_HOSTING_BEHAVIOR_DEFAULT; +} + /*********************************************************************** * MonitorFromRect (USER32.@) */ diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index 96e6e1a7d6b..9f9f03041b4 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -410,6 +410,7 @@ @ stdcall GetWindowDC(long) NtUserGetWindowDC @ stdcall GetWindowDisplayAffinity(long ptr) @ stdcall GetWindowDpiAwarenessContext(long) +@ stdcall GetWindowDpiHostingBehavior(long) @ stdcall GetWindowInfo(long ptr) @ stdcall GetWindowLongA(long long) @ stdcall -arch=win64 GetWindowLongPtrA(long long) @@ -719,6 +720,7 @@ @ stdcall SetTaskmanWindow (long) @ stdcall SetThreadDesktop(long) NtUserSetThreadDesktop @ stdcall SetThreadDpiAwarenessContext(ptr) +@ stdcall SetThreadDpiHostingBehavior(ptr) @ stdcall SetTimer(long long long ptr) @ stdcall SetUserObjectInformationA(long long ptr long) @ stdcall SetUserObjectInformationW(long long ptr long) NtUserSetObjectInformation diff --git a/dlls/user32/win.c b/dlls/user32/win.c index 6459ddf9f28..b8c04047333 100644 --- a/dlls/user32/win.c +++ b/dlls/user32/win.c @@ -616,6 +616,16 @@ DPI_AWARENESS_CONTEXT WINAPI GetWindowDpiAwarenessContext( HWND hwnd ) } +/*********************************************************************** + * GetWindowDpiHostingBehavior (USER32.@) + */ +DPI_HOSTING_BEHAVIOR WINAPI GetWindowDpiHostingBehavior( HWND hwnd ) +{ + FIXME("(%p): stub\n", hwnd); + return DPI_HOSTING_BEHAVIOR_DEFAULT; +} + + static LONG_PTR get_window_long_ptr( HWND hwnd, int offset, LONG_PTR ret, BOOL ansi ) { if (offset == DWLP_DLGPROC && NtUserGetDialogInfo( hwnd )) diff --git a/include/windef.h b/include/windef.h index b22e15c4dbf..78e4f56052c 100644 --- a/include/windef.h +++ b/include/windef.h @@ -439,4 +439,10 @@ typedef enum DPI_AWARENESS } #endif +typedef enum { + DPI_HOSTING_BEHAVIOR_INVALID = -1, + DPI_HOSTING_BEHAVIOR_DEFAULT = 0, + DPI_HOSTING_BEHAVIOR_MIXED = 1 +} DPI_HOSTING_BEHAVIOR; + #endif /* _WINDEF_ */ diff --git a/include/winuser.h b/include/winuser.h index 73e7919aaea..ee0f05e1cb8 100644 --- a/include/winuser.h +++ b/include/winuser.h @@ -4296,6 +4296,7 @@ WINUSERAPI DWORD WINAPI GetWindowContextHelpId(HWND); WINUSERAPI HDC WINAPI GetWindowDC(HWND); WINUSERAPI BOOL WINAPI GetWindowDisplayAffinity(HWND,DWORD*); WINUSERAPI DPI_AWARENESS_CONTEXT WINAPI GetWindowDpiAwarenessContext(HWND); +WINUSERAPI DPI_HOSTING_BEHAVIOR WINAPI GetWindowDpiHostingBehavior(HWND); WINUSERAPI BOOL WINAPI GetWindowFeedbackSetting(HWND,FEEDBACK_TYPE,DWORD,UINT32*,void*); WINUSERAPI BOOL WINAPI GetWindowInfo(HWND, PWINDOWINFO); WINUSERAPI LONG WINAPI GetWindowLongA(HWND,INT); @@ -4608,6 +4609,7 @@ WINUSERAPI BOOL WINAPI SetSystemMenu(HWND,HMENU); WINUSERAPI UINT_PTR WINAPI SetSystemTimer(HWND,UINT_PTR,UINT,void*); WINUSERAPI BOOL WINAPI SetThreadDesktop(HDESK); WINUSERAPI DPI_AWARENESS_CONTEXT WINAPI SetThreadDpiAwarenessContext(DPI_AWARENESS_CONTEXT); +WINUSERAPI DPI_HOSTING_BEHAVIOR WINAPI SetThreadDpiHostingBehavior(DPI_HOSTING_BEHAVIOR); WINUSERAPI UINT_PTR WINAPI SetTimer(HWND,UINT_PTR,UINT,TIMERPROC); WINUSERAPI BOOL WINAPI SetUserObjectInformationA(HANDLE,INT,LPVOID,DWORD); WINUSERAPI BOOL WINAPI SetUserObjectInformationW(HANDLE,INT,LPVOID,DWORD);
1
0
0
0
Hans Leidekker : wldp: Improve the WldpGetLockdownPolicy() stub.
by Alexandre Julliard
15 Nov '23
15 Nov '23
Module: wine Branch: master Commit: c090bdbe0ae300177afb2fda2a6c3f735fd127f3 URL:
https://gitlab.winehq.org/wine/wine/-/commit/c090bdbe0ae300177afb2fda2a6c3f…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Nov 15 12:22:27 2023 +0100 wldp: Improve the WldpGetLockdownPolicy() stub. --- configure | 1 + configure.ac | 1 + dlls/wldp/tests/Makefile.in | 4 +++ dlls/wldp/tests/wldp.c | 82 +++++++++++++++++++++++++++++++++++++++++++++ dlls/wldp/wldp.c | 5 +-- include/wldp.h | 9 +++++ 6 files changed, 100 insertions(+), 2 deletions(-) diff --git a/configure b/configure index e14a35b5266..2ffbfd8520c 100755 --- a/configure +++ b/configure @@ -22205,6 +22205,7 @@ wine_fn_config_makefile dlls/wlanui enable_wlanui wine_fn_config_makefile dlls/wldap32 enable_wldap32 wine_fn_config_makefile dlls/wldap32/tests enable_tests wine_fn_config_makefile dlls/wldp enable_wldp +wine_fn_config_makefile dlls/wldp/tests enable_tests wine_fn_config_makefile dlls/wmasf enable_wmasf wine_fn_config_makefile dlls/wmi enable_wmi wine_fn_config_makefile dlls/wmiutils enable_wmiutils diff --git a/configure.ac b/configure.ac index 154e0ee06aa..aba623ee6e7 100644 --- a/configure.ac +++ b/configure.ac @@ -3247,6 +3247,7 @@ WINE_CONFIG_MAKEFILE(dlls/wlanui) WINE_CONFIG_MAKEFILE(dlls/wldap32) WINE_CONFIG_MAKEFILE(dlls/wldap32/tests) WINE_CONFIG_MAKEFILE(dlls/wldp) +WINE_CONFIG_MAKEFILE(dlls/wldp/tests) WINE_CONFIG_MAKEFILE(dlls/wmasf) WINE_CONFIG_MAKEFILE(dlls/wmi) WINE_CONFIG_MAKEFILE(dlls/wmiutils) diff --git a/dlls/wldp/tests/Makefile.in b/dlls/wldp/tests/Makefile.in new file mode 100644 index 00000000000..3271c17dad2 --- /dev/null +++ b/dlls/wldp/tests/Makefile.in @@ -0,0 +1,4 @@ +TESTDLL = wldp.dll + +SOURCES = \ + wldp.c diff --git a/dlls/wldp/tests/wldp.c b/dlls/wldp/tests/wldp.c new file mode 100644 index 00000000000..4a41f1e9407 --- /dev/null +++ b/dlls/wldp/tests/wldp.c @@ -0,0 +1,82 @@ +/* + * Copyright 2023 Hans Leidekker for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <stdarg.h> + +#include "windef.h" +#include "winbase.h" +#include "wldp.h" + +#include "wine/test.h" + +static HRESULT (WINAPI *pWldpGetLockdownPolicy)(WLDP_HOST_INFORMATION *, DWORD *, DWORD); +static HRESULT (WINAPI *pWldpQueryWindowsLockdownMode)(WLDP_WINDOWS_LOCKDOWN_MODE *); + +static void test_WldpGetLockdownPolicy(void) +{ + WLDP_HOST_INFORMATION info; + DWORD state; + HRESULT hr; + + if (!pWldpGetLockdownPolicy) + { + win_skip( "WldpGetLockdownPolicy not available\n" ); + return; + } + + state = 0xdeadbeef; + hr = pWldpGetLockdownPolicy( NULL, &state, 0 ); + ok( hr == 0x10000000, "got %#lx\n", hr ); + ok( state == WLDP_LOCKDOWN_DEFINED_FLAG, "got %#lx\n", state ); + + memset( &info, 0, sizeof(info) ); + info.dwRevision = 1; + info.dwHostId = WLDP_HOST_ID_GLOBAL; + state = 0xdeadbeef; + hr = pWldpGetLockdownPolicy( &info, &state, 0 ); + ok( hr == S_OK, "got %#lx\n", hr ); + ok( state == WLDP_LOCKDOWN_DEFINED_FLAG, "got %#lx\n", state ); +} + +static void test_WldpQueryWindowsLockdownMode(void) +{ + WLDP_WINDOWS_LOCKDOWN_MODE mode; + HRESULT hr; + + if (!pWldpQueryWindowsLockdownMode) + { + win_skip( "WldpQueryWindowsLockdownMode not available\n" ); + return; + } + + mode = 0xdeadbeef; + hr = pWldpQueryWindowsLockdownMode( &mode ); + ok( hr == S_OK, "got %#lx\n", hr ); + ok( mode == WLDP_WINDOWS_LOCKDOWN_MODE_UNLOCKED, "got %u\n", mode ); +} + +START_TEST(wldp) +{ + HMODULE hwldp = LoadLibraryW( L"wldp" ); + + pWldpGetLockdownPolicy = (void *)GetProcAddress( hwldp, "WldpGetLockdownPolicy" ); + pWldpQueryWindowsLockdownMode = (void *)GetProcAddress( hwldp, "WldpQueryWindowsLockdownMode" ); + + test_WldpGetLockdownPolicy(); + test_WldpQueryWindowsLockdownMode(); +} diff --git a/dlls/wldp/wldp.c b/dlls/wldp/wldp.c index 0c2fd0c4b70..25c85c68304 100644 --- a/dlls/wldp/wldp.c +++ b/dlls/wldp/wldp.c @@ -44,9 +44,10 @@ HRESULT WINAPI WldpIsDynamicCodePolicyEnabled(BOOL *is_enabled) */ HRESULT WINAPI WldpGetLockdownPolicy(WLDP_HOST_INFORMATION *info, DWORD *state, DWORD flags) { - FIXME("%p %p %lu\n", info, state, flags); + FIXME("%p %p %lx\n", info, state, flags); - *state = 0; + *state = WLDP_LOCKDOWN_DEFINED_FLAG; + if (!info) return HRESULT_FROM_NT(0); return S_OK; } diff --git a/include/wldp.h b/include/wldp.h index 93f246fffa4..262e917b5bc 100644 --- a/include/wldp.h +++ b/include/wldp.h @@ -19,6 +19,14 @@ #ifndef WLDP_H #define WLDP_H +#define WLDP_LOCKDOWN_UNDEFINED 0x00000000 +#define WLDP_LOCKDOWN_DEFINED_FLAG 0x80000000 +#define WLDP_LOCKDOWN_CONFIG_CI_FLAG 0x00000001 +#define WLDP_LOCKDOWN_CONFIG_CI_AUDIT_FLAG 0x00000002 +#define WLDP_LOCKDOWN_UMCIENFORCE_FLAG 0x00000004 +#define WLDP_LOCKDOWN_AUDIT_FLAG 0x00000008 +#define WLDP_LOCKDOWN_EXCLUSION_FLAG 0x00000010 + typedef enum WLDP_HOST_ID { WLDP_HOST_ID_UNKNOWN, @@ -50,5 +58,6 @@ typedef struct WLDP_HOST_INFORMATION HRESULT WINAPI WldpGetLockdownPolicy(WLDP_HOST_INFORMATION*,DWORD*,DWORD); HRESULT WINAPI WldpIsDynamicCodePolicyEnabled(BOOL*); +HRESULT WINAPI WldpQueryWindowsLockdownMode(WLDP_WINDOWS_LOCKDOWN_MODE*); #endif
1
0
0
0
Alexandre Julliard : ntdll: Remove DECLSPEC_HIDDEN usage.
by Alexandre Julliard
15 Nov '23
15 Nov '23
Module: wine Branch: master Commit: 59485f00c917061c097c1805d7fa7f61c380c749 URL:
https://gitlab.winehq.org/wine/wine/-/commit/59485f00c917061c097c1805d7fa7f…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Nov 15 15:06:15 2023 +0100 ntdll: Remove DECLSPEC_HIDDEN usage. --- dlls/ntdll/ntdll_misc.h | 66 ++++---- dlls/ntdll/relay.c | 36 ++--- dlls/ntdll/resource.c | 4 +- dlls/ntdll/signal_i386.c | 8 +- dlls/ntdll/signal_x86_64.c | 2 +- dlls/ntdll/unix/signal_arm.c | 6 +- dlls/ntdll/unix/signal_arm64.c | 8 +- dlls/ntdll/unix/signal_i386.c | 14 +- dlls/ntdll/unix/signal_x86_64.c | 14 +- dlls/ntdll/unix/system.c | 4 +- dlls/ntdll/unix/unix_private.h | 344 ++++++++++++++++++++-------------------- dlls/ntdll/unixlib.h | 2 +- 12 files changed, 254 insertions(+), 254 deletions(-)
1
0
0
0
Alexandre Julliard : ntdll: Redirect PE function pointers through the ARM64EC redirection map.
by Alexandre Julliard
15 Nov '23
15 Nov '23
Module: wine Branch: master Commit: 406016536703f084b950b62f0dae714c1c11bb53 URL:
https://gitlab.winehq.org/wine/wine/-/commit/406016536703f084b950b62f0dae71…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Nov 15 15:00:29 2023 +0100 ntdll: Redirect PE function pointers through the ARM64EC redirection map. --- dlls/ntdll/unix/loader.c | 50 ++++++++++++++++++++++++++++++++++++++++++ dlls/ntdll/unix/unix_private.h | 8 ++++++- 2 files changed, 57 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index b7a18f94950..5b6098df3bc 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -1819,6 +1819,55 @@ static void load_ntdll_wow64_functions( HMODULE module ) } +/*********************************************************************** + * redirect_arm64ec_ptr + * + * Redirect a function pointer through the arm64ec redirection table. + */ +static void *redirect_arm64ec_ptr( void *module, void *ptr, + const IMAGE_ARM64EC_REDIRECTION_ENTRY *map, ULONG map_count ) +{ + int min = 0, max = map_count - 1; + ULONG_PTR rva = (char *)ptr - (char *)module; + + while (min <= max) + { + int pos = (min + max) / 2; + if (map[pos].Source == rva) return get_rva( module, map[pos].Destination ); + if (map[pos].Source < rva) min = pos + 1; + else max = pos - 1; + } + return ptr; +} + + +/*********************************************************************** + * redirect_ntdll_functions + * + * Redirect ntdll functions on arm64ec. + */ +static void redirect_ntdll_functions( HMODULE module ) +{ + const IMAGE_LOAD_CONFIG_DIRECTORY *loadcfg; + const IMAGE_ARM64EC_METADATA *metadata; + const IMAGE_ARM64EC_REDIRECTION_ENTRY *map; + + if (!(loadcfg = get_module_data_dir( module, IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG, NULL ))) return; + if (!(metadata = (void *)loadcfg->CHPEMetadataPointer)) return; + if (!(map = get_rva( module, metadata->RedirectionMetadata ))) return; +#define REDIRECT(name) \ + p##name = redirect_arm64ec_ptr( module, p##name, map, metadata->RedirectionMetadataCount ) + REDIRECT( DbgUiRemoteBreakin ); + REDIRECT( KiRaiseUserExceptionDispatcher ); + REDIRECT( KiUserExceptionDispatcher ); + REDIRECT( KiUserApcDispatcher ); + REDIRECT( KiUserCallbackDispatcher ); + REDIRECT( LdrInitializeThunk ); + REDIRECT( RtlUserThreadStart ); +#undef REDIRECT +} + + /*********************************************************************** * load_ntdll */ @@ -1851,6 +1900,7 @@ static void load_ntdll(void) if (status) fatal_error( "failed to load %s error %x\n", name, status ); free( name ); load_ntdll_functions( module ); + if (is_arm64ec()) redirect_ntdll_functions( module ); } diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index d9d830a7462..f15efa45d14 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -64,6 +64,7 @@ static inline TEB64 *NtCurrentTeb64(void) { return (TEB64 *)NtCurrentTeb()->GdiB extern WOW_PEB *wow_peb DECLSPEC_HIDDEN; extern ULONG_PTR user_space_wow_limit DECLSPEC_HIDDEN; +extern SECTION_IMAGE_INFORMATION main_image_info DECLSPEC_HIDDEN; static inline WOW_TEB *get_wow_teb( TEB *teb ) { @@ -81,6 +82,12 @@ static inline BOOL is_old_wow64(void) return !is_win64 && wow_peb; } +static inline BOOL is_arm64ec(void) +{ + return (current_machine == IMAGE_FILE_MACHINE_ARM64 && + main_image_info.Machine == IMAGE_FILE_MACHINE_AMD64); +} + /* thread private data, stored in NtCurrentTeb()->GdiTebBatch */ struct ntdll_thread_data { @@ -152,7 +159,6 @@ extern USHORT *uctable DECLSPEC_HIDDEN; extern USHORT *lctable DECLSPEC_HIDDEN; extern SIZE_T startup_info_size DECLSPEC_HIDDEN; extern BOOL is_prefix_bootstrap DECLSPEC_HIDDEN; -extern SECTION_IMAGE_INFORMATION main_image_info DECLSPEC_HIDDEN; extern int main_argc DECLSPEC_HIDDEN; extern char **main_argv DECLSPEC_HIDDEN; extern char **main_envp DECLSPEC_HIDDEN;
1
0
0
0
Alexandre Julliard : ntdll: Implement __os_arm64x_get/set_x64_information().
by Alexandre Julliard
15 Nov '23
15 Nov '23
Module: wine Branch: master Commit: 56409f2c79dec68a869c0b6b45a8bb85438aebb5 URL:
https://gitlab.winehq.org/wine/wine/-/commit/56409f2c79dec68a869c0b6b45a8bb…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Nov 15 14:19:20 2023 +0100 ntdll: Implement __os_arm64x_get/set_x64_information(). --- dlls/ntdll/signal_arm64ec.c | 92 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) diff --git a/dlls/ntdll/signal_arm64ec.c b/dlls/ntdll/signal_arm64ec.c index f17cbdaf063..a71e3214aeb 100644 --- a/dlls/ntdll/signal_arm64ec.c +++ b/dlls/ntdll/signal_arm64ec.c @@ -36,6 +36,96 @@ WINE_DEFAULT_DEBUG_CHANNEL(unwind); WINE_DECLARE_DEBUG_CHANNEL(relay); +static UINT64 mxcsr_to_fpcsr( UINT mxcsr ) +{ + UINT fpcr = 0, fpsr = 0; + + if (mxcsr & 0x0001) fpsr |= 0x0001; /* invalid operation */ + if (mxcsr & 0x0002) fpsr |= 0x0080; /* denormal */ + if (mxcsr & 0x0004) fpsr |= 0x0002; /* zero-divide */ + if (mxcsr & 0x0008) fpsr |= 0x0004; /* overflow */ + if (mxcsr & 0x0010) fpsr |= 0x0008; /* underflow */ + if (mxcsr & 0x0020) fpsr |= 0x0010; /* precision */ + + if (mxcsr & 0x0040) fpcr |= 0x0001; /* denormals are zero */ + if (mxcsr & 0x0080) fpcr |= 0x0100; /* invalid operation mask */ + if (mxcsr & 0x0100) fpcr |= 0x8000; /* denormal mask */ + if (mxcsr & 0x0200) fpcr |= 0x0200; /* zero-divide mask */ + if (mxcsr & 0x0400) fpcr |= 0x0400; /* overflow mask */ + if (mxcsr & 0x0800) fpcr |= 0x0800; /* underflow mask */ + if (mxcsr & 0x1000) fpcr |= 0x1000; /* precision mask */ + if (mxcsr & 0x2000) fpcr |= 0x800000; /* round down */ + if (mxcsr & 0x4000) fpcr |= 0x400000; /* round up */ + if (mxcsr & 0x8000) fpcr |= 0x1000000; /* flush to zero */ + return fpcr | ((UINT64)fpsr << 32); +} + +static UINT fpcsr_to_mxcsr( UINT fpcr, UINT fpsr ) +{ + UINT ret = 0; + + if (fpsr & 0x0001) ret |= 0x0001; /* invalid operation */ + if (fpsr & 0x0002) ret |= 0x0004; /* zero-divide */ + if (fpsr & 0x0004) ret |= 0x0008; /* overflow */ + if (fpsr & 0x0008) ret |= 0x0010; /* underflow */ + if (fpsr & 0x0010) ret |= 0x0020; /* precision */ + if (fpsr & 0x0080) ret |= 0x0002; /* denormal */ + + if (fpcr & 0x0000001) ret |= 0x0040; /* denormals are zero */ + if (fpcr & 0x0000100) ret |= 0x0080; /* invalid operation mask */ + if (fpcr & 0x0000200) ret |= 0x0200; /* zero-divide mask */ + if (fpcr & 0x0000400) ret |= 0x0400; /* overflow mask */ + if (fpcr & 0x0000800) ret |= 0x0800; /* underflow mask */ + if (fpcr & 0x0001000) ret |= 0x1000; /* precision mask */ + if (fpcr & 0x0008000) ret |= 0x0100; /* denormal mask */ + if (fpcr & 0x0400000) ret |= 0x4000; /* round up */ + if (fpcr & 0x0800000) ret |= 0x2000; /* round down */ + if (fpcr & 0x1000000) ret |= 0x8000; /* flush to zero */ + return ret; +} + + +/*********************************************************************** + * LdrpGetX64Information + */ +static NTSTATUS WINAPI LdrpGetX64Information( ULONG type, void *output, void *extra_info ) +{ + switch (type) + { + case 0: + { + UINT64 fpcr, fpsr; + + __asm__ __volatile__( "mrs %0, fpcr; mrs %1, fpsr" : "=r" (fpcr), "=r" (fpsr) ); + *(UINT *)output = fpcsr_to_mxcsr( fpcr, fpsr ); + return STATUS_SUCCESS; + } + default: + FIXME( "not implemented type %u\n", type ); + return STATUS_INVALID_PARAMETER; + } +} + +/*********************************************************************** + * LdrpSetX64Information + */ +static NTSTATUS WINAPI LdrpSetX64Information( ULONG type, ULONG_PTR input, void *extra_info ) +{ + switch (type) + { + case 0: + { + UINT64 fpcsr = mxcsr_to_fpcsr( input ); + __asm__ __volatile__( "msr fpcr, %0; msr fpsr, %1" :: "r" (fpcsr), "r" (fpcsr >> 32) ); + return STATUS_SUCCESS; + } + default: + FIXME( "not implemented type %u\n", type ); + return STATUS_INVALID_PARAMETER; + } +} + + /******************************************************************* * KiUserExceptionDispatcher (NTDLL.@) */ @@ -313,6 +403,8 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unk2, ULONG_PTR unk3 __os_arm64x_check_call = arm64x_check_call; __os_arm64x_check_icall = arm64x_check_call; __os_arm64x_check_icall_cfg = arm64x_check_call; + __os_arm64x_get_x64_information = LdrpGetX64Information; + __os_arm64x_set_x64_information = LdrpSetX64Information; } loader_init( context, (void **)&context->Rcx );
1
0
0
0
← Newer
1
...
44
45
46
47
48
49
50
...
99
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
Results per page:
10
25
50
100
200