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 2024
----- 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
711 discussions
Start a n
N
ew thread
Rémi Bernon : user32/tests: Tests clicking through window with SetWindowRgn.
by Alexandre Julliard
26 Jan '24
26 Jan '24
Module: wine Branch: master Commit: 52a4d9e32162586fa3e8226f9407392c1e7012a4 URL:
https://gitlab.winehq.org/wine/wine/-/commit/52a4d9e32162586fa3e8226f940739…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Jan 26 10:01:24 2024 +0100 user32/tests: Tests clicking through window with SetWindowRgn. --- dlls/user32/tests/input.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index 736172cb504..02200fb37aa 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -3622,6 +3622,8 @@ static void test_SendInput_mouse_messages(void) DWORD thread_id; HANDLE thread; HHOOK hook, hook_setpos, hook_getpos; + HRGN hregion; + RECT region; POINT pt; params.start_event = CreateEventA( NULL, FALSE, FALSE, NULL ); @@ -3921,6 +3923,8 @@ static void test_SendInput_mouse_messages(void) ok_ne( 0, old_other_proc, LONG_PTR, "%#Ix" ); wait_messages( 100, FALSE ); + ok_ret( ERROR, GetWindowRgnBox( other, ®ion ) ); + SetWindowLongW( other, GWL_EXSTYLE, GetWindowLongW( other, GWL_EXSTYLE ) | WS_EX_LAYERED ); ret = SetLayeredWindowAttributes( other, test->color, test->alpha, test->flags ); @@ -3974,6 +3978,35 @@ static void test_SendInput_mouse_messages(void) } + /* click on top-level window with SetWindowRgn called */ + + other = CreateWindowW( L"static", NULL, WS_VISIBLE | WS_POPUP, 0, 0, 100, 100, NULL, NULL, NULL, NULL ); + ok_ne( NULL, hwnd, HWND, "%p" ); + wait_messages( 100, FALSE ); + current_sequence_len = 0; + + old_other_proc = SetWindowLongPtrW( other, GWLP_WNDPROC, (LONG_PTR)append_message_wndproc ); + ok_ne( 0, old_other_proc, LONG_PTR, "%#Ix" ); + + hregion = CreateRectRgn( 0, 0, 10, 10 ); + ok_ne( NULL, hregion, HRGN, "%p" ); + ok_ret( 1, SetWindowRgn( other, hregion, TRUE ) ); + DeleteObject( hregion ); + ok_ret( SIMPLEREGION, GetWindowRgnBox( other, ®ion ) ); + + mouse_event( MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0 ); + wait_messages( 5, FALSE ); + button_down_hwnd[1].message.hwnd = hwnd; + ok_seq( button_down_hwnd ); + mouse_event( MOUSEEVENTF_LEFTUP, 0, 0, 0, 0 ); + wait_messages( 5, FALSE ); + button_up_hwnd[1].message.hwnd = hwnd; + ok_seq( button_up_hwnd ); + + ok_ret( 1, DestroyWindow( other ) ); + wait_messages( 0, FALSE ); + + /* warm up test case by moving cursor and window a bit first */ ok_ret( 1, SetCursorPos( 60, 50 ) ); ok_ret( 1, SetWindowPos( hwnd, NULL, 10, 0, 0, 0, SWP_NOSIZE ) );
1
0
0
0
Rémi Bernon : user32/tests: Test clicking through attribute-layered windows.
by Alexandre Julliard
26 Jan '24
26 Jan '24
Module: wine Branch: master Commit: 71201815bcbf90967f6d6dfc86c995ebb8d3a4ab URL:
https://gitlab.winehq.org/wine/wine/-/commit/71201815bcbf90967f6d6dfc86c995…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Jan 26 10:36:14 2024 +0100 user32/tests: Test clicking through attribute-layered windows. --- dlls/user32/tests/input.c | 114 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 113 insertions(+), 1 deletion(-) diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index 9eafde917af..736172cb504 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -52,6 +52,7 @@ #include "winbase.h" #include "wingdi.h" #include "winuser.h" +#include "wingdi.h" #include "winnls.h" #include "winreg.h" #include "ddk/hidsdi.h" @@ -3462,6 +3463,28 @@ static LRESULT CALLBACK mouse_move_wndproc(HWND hwnd, UINT msg, WPARAM wparam, L return DefWindowProcW(hwnd, msg, wparam, lparam); } +static LRESULT CALLBACK mouse_layered_wndproc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) +{ + append_message( hwnd, msg, wparam, lparam ); + + if (msg == WM_PAINT) + { + HBRUSH brush = CreateSolidBrush( RGB(50, 100, 255) ); + PAINTSTRUCT paint; + RECT client_rect; + + HDC hdc = BeginPaint( hwnd, &paint ); + GetClientRect( hwnd, &client_rect ); + FillRect( hdc, &client_rect, brush ); + EndPaint( hwnd, &paint ); + + DeleteObject( brush ); + return 0; + } + + return DefWindowProcW( hwnd, msg, wparam, lparam ); +} + struct send_input_mouse_test { BOOL set_cursor_pos; @@ -3541,6 +3564,7 @@ static void test_SendInput_mouse_messages(void) { MS_HOOK(WM_LBUTTONDOWN, 50, 50), WIN_MSG(WM_LBUTTONDOWN, (HWND)-1/*hwnd*/, 0x1, MAKELONG(50, 50), .todo = TRUE), + {0/* placeholder for Wine spurious messages */}, {0}, }; struct user_call button_up_hwnd[] = @@ -3553,6 +3577,7 @@ static void test_SendInput_mouse_messages(void) { MS_HOOK(WM_LBUTTONUP, 50, 50), WIN_MSG(WM_LBUTTONUP, (HWND)-1/*hwnd*/, 0, MAKELONG(50, 50), .todo = TRUE), + {0/* placeholder for Wine spurious messages */}, {0}, }; struct user_call button_down_no_message[] = @@ -3571,10 +3596,28 @@ static void test_SendInput_mouse_messages(void) #undef MS_HOOK static const POINT expect_60x50 = {60, 50}, expect_50x50 = {50, 50}; + static const struct layered_test + { + UINT color; + UINT alpha; + UINT flags; + BOOL expect_click; + } + layered_tests[] = + { + {.flags = LWA_ALPHA, .expect_click = FALSE}, + {.alpha = 1, .flags = LWA_ALPHA, .expect_click = TRUE}, + {.color = RGB(0, 255, 0), .flags = LWA_COLORKEY, .expect_click = TRUE}, + {.color = RGB(50, 100, 255), .flags = LWA_COLORKEY, .expect_click = TRUE}, + {.color = RGB(0, 255, 0), .flags = LWA_COLORKEY | LWA_ALPHA, .expect_click = FALSE}, + {.color = RGB(0, 255, 0), .alpha = 1, .flags = LWA_COLORKEY | LWA_ALPHA, .expect_click = TRUE}, + {.color = RGB(50, 100, 255), .alpha = 1, .flags = LWA_COLORKEY | LWA_ALPHA, .expect_click = TRUE}, + }; + struct create_transparent_window_params params = {0}; ULONG_PTR old_proc, old_other_proc; RECT clip_rect = {55, 55, 55, 55}; - UINT dblclk_time; + UINT dblclk_time, i; HWND hwnd, other; DWORD thread_id; HANDLE thread; @@ -3862,6 +3905,75 @@ static void test_SendInput_mouse_messages(void) SetCapture( 0 ); + + /* click through layered window with alpha channel / color key */ + + for (i = 0; i < ARRAY_SIZE(layered_tests); i++) + { + const struct layered_test *test = layered_tests + i; + BOOL ret; + + winetest_push_context( "layered %u", i ); + + other = CreateWindowW( L"static", NULL, WS_VISIBLE | WS_POPUP, 0, 0, 100, 100, NULL, NULL, NULL, NULL ); + ok_ne( NULL, other, HWND, "%p" ); + old_other_proc = SetWindowLongPtrW( other, GWLP_WNDPROC, (LONG_PTR)mouse_layered_wndproc ); + ok_ne( 0, old_other_proc, LONG_PTR, "%#Ix" ); + wait_messages( 100, FALSE ); + + + SetWindowLongW( other, GWL_EXSTYLE, GetWindowLongW( other, GWL_EXSTYLE ) | WS_EX_LAYERED ); + ret = SetLayeredWindowAttributes( other, test->color, test->alpha, test->flags ); + if (broken(!ret)) /* broken on Win7 probably because of the separate desktop */ + { + win_skip("Skipping broken SetLayeredWindowAttributes tests\n"); + DestroyWindow( other ); + break; + } + + ok_ret( 1, RedrawWindow( other, NULL, NULL, RDW_ERASE | RDW_INVALIDATE | RDW_FRAME | RDW_ALLCHILDREN ) ); + wait_messages( 5, FALSE ); + current_sequence_len = 0; + + mouse_event( MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0 ); + wait_messages( 5, FALSE ); + button_down_hwnd_todo[1].message.hwnd = test->expect_click ? other : hwnd; + button_down_hwnd_todo[1].todo = !test->expect_click; + button_down_hwnd_todo[2].todo = !test->alpha && (test->flags & LWA_ALPHA); + ok_seq( button_down_hwnd_todo ); + mouse_event( MOUSEEVENTF_LEFTUP, 0, 0, 0, 0 ); + wait_messages( 5, FALSE ); + button_up_hwnd_todo[1].message.hwnd = test->expect_click ? other : hwnd; + button_up_hwnd_todo[1].todo = !test->expect_click; + button_up_hwnd_todo[2].todo = !test->alpha && (test->flags & LWA_ALPHA); + ok_seq( button_up_hwnd_todo ); + + + /* removing the attribute isn't enough to get mouse input again? */ + + SetWindowLongW( other, GWL_EXSTYLE, GetWindowLongW( other, GWL_EXSTYLE ) & ~WS_EX_LAYERED ); + ok_ret( 1, RedrawWindow( other, NULL, NULL, RDW_ERASE | RDW_INVALIDATE | RDW_FRAME | RDW_ALLCHILDREN ) ); + wait_messages( 5, FALSE ); + + mouse_event( MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0 ); + wait_messages( 5, FALSE ); + button_down_hwnd_todo[1].message.hwnd = test->expect_click ? other : hwnd; + button_down_hwnd_todo[1].todo = !test->expect_click; + button_down_hwnd_todo[2].todo = !test->alpha && (test->flags & LWA_ALPHA); + ok_seq( button_down_hwnd_todo ); + mouse_event( MOUSEEVENTF_LEFTUP, 0, 0, 0, 0 ); + wait_messages( 5, FALSE ); + button_up_hwnd_todo[1].message.hwnd = test->expect_click ? other : hwnd; + button_up_hwnd_todo[1].todo = !test->expect_click; + button_up_hwnd_todo[2].todo = !test->alpha && (test->flags & LWA_ALPHA); + ok_seq( button_up_hwnd_todo ); + + ok_ret( 1, DestroyWindow( other ) ); + + winetest_pop_context(); + } + + /* warm up test case by moving cursor and window a bit first */ ok_ret( 1, SetCursorPos( 60, 50 ) ); ok_ret( 1, SetWindowPos( hwnd, NULL, 10, 0, 0, 0, SWP_NOSIZE ) );
1
0
0
0
Rémi Bernon : user32/tests: Filter the ll-hook messages with accept_message.
by Alexandre Julliard
26 Jan '24
26 Jan '24
Module: wine Branch: master Commit: c5e16d2090ac552b47c5ecb83d8ffe447fd90b8e URL:
https://gitlab.winehq.org/wine/wine/-/commit/c5e16d2090ac552b47c5ecb83d8ffe…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Jan 26 10:19:51 2024 +0100 user32/tests: Filter the ll-hook messages with accept_message. Wine sends spurious mouse move messages in some cases, let's ignore them as it makes tests unreliable otherwise. --- dlls/user32/tests/input.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index b7dc5aac3b1..9eafde917af 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -302,6 +302,9 @@ static void ok_seq_( const char *file, int line, const struct user_call *expecte current_sequence_len = 0; } +static BOOL append_message_hwnd; +static BOOL (*p_accept_message)( UINT msg ); + static void append_ll_hook_kbd( UINT msg, const KBDLLHOOKSTRUCT *info ) { struct user_call call = @@ -312,9 +315,12 @@ static void append_ll_hook_kbd( UINT msg, const KBDLLHOOKSTRUCT *info ) .flags = info->flags, .extra = info->dwExtraInfo } }; - ULONG index = InterlockedIncrement( ¤t_sequence_len ) - 1; - ok( index < ARRAY_SIZE(current_sequence), "got %lu calls\n", index ); - current_sequence[index] = call; + if (!p_accept_message || p_accept_message( msg )) + { + ULONG index = InterlockedIncrement( ¤t_sequence_len ) - 1; + ok( index < ARRAY_SIZE(current_sequence), "got %lu calls\n", index ); + current_sequence[index] = call; + } } static void append_ll_hook_ms( UINT msg, const MSLLHOOKSTRUCT *info ) @@ -327,13 +333,14 @@ static void append_ll_hook_ms( UINT msg, const MSLLHOOKSTRUCT *info ) .time = info->time, .extra = info->dwExtraInfo } }; - ULONG index = InterlockedIncrement( ¤t_sequence_len ) - 1; - ok( index < ARRAY_SIZE(current_sequence), "got %lu calls\n", index ); - current_sequence[index] = call; + if (!p_accept_message || p_accept_message( msg )) + { + ULONG index = InterlockedIncrement( ¤t_sequence_len ) - 1; + ok( index < ARRAY_SIZE(current_sequence), "got %lu calls\n", index ); + current_sequence[index] = call; + } } -static BOOL append_message_hwnd; -static BOOL (*p_accept_message)( UINT msg ); static void append_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) { if (!p_accept_message || p_accept_message( msg )) @@ -3536,13 +3543,6 @@ static void test_SendInput_mouse_messages(void) WIN_MSG(WM_LBUTTONDOWN, (HWND)-1/*hwnd*/, 0x1, MAKELONG(50, 50), .todo = TRUE), {0}, }; - struct user_call button_down_hwnd_todo_attached[] = - { - MS_HOOK(WM_LBUTTONDOWN, 50, 50), - WIN_MSG(WM_LBUTTONDOWN, (HWND)-1/*hwnd*/, 0x1, MAKELONG(50, 50), .todo = TRUE), - {.todo = TRUE /* spurious message on Wine */}, - {0}, - }; struct user_call button_up_hwnd[] = { MS_HOOK(WM_LBUTTONUP, 50, 50), @@ -3793,8 +3793,8 @@ static void test_SendInput_mouse_messages(void) mouse_event( MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0 ); wait_messages( 5, FALSE ); - button_down_hwnd_todo_attached[1].message.hwnd = hwnd; - ok_seq( button_down_hwnd_todo_attached ); + button_down_hwnd[1].message.hwnd = hwnd; + ok_seq( button_down_hwnd ); mouse_event( MOUSEEVENTF_LEFTUP, 0, 0, 0, 0 ); wait_messages( 5, FALSE ); button_up_hwnd[1].message.hwnd = hwnd;
1
0
0
0
Nikolay Sivov : d3d10/effect: Use bitfields for numeric type descriptions.
by Alexandre Julliard
26 Jan '24
26 Jan '24
Module: wine Branch: master Commit: 3724385c86eeedd6de8fa91d6179b64ba0fd9597 URL:
https://gitlab.winehq.org/wine/wine/-/commit/3724385c86eeedd6de8fa91d6179b6…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Jan 25 22:20:11 2024 +0100 d3d10/effect: Use bitfields for numeric type descriptions. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- dlls/d3d10/effect.c | 49 ++++++++++++++++++++++++------------------------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 6e2b67bb700..534eadb2659 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -34,20 +34,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d10); #define TAG_CLI4 MAKE_TAG('C', 'L', 'I', '4') #define TAG_CTAB MAKE_TAG('C', 'T', 'A', 'B') -#define D3D10_FX10_TYPE_COLUMN_SHIFT 11 -#define D3D10_FX10_TYPE_COLUMN_MASK (0x7 << D3D10_FX10_TYPE_COLUMN_SHIFT) - -#define D3D10_FX10_TYPE_ROW_SHIFT 8 -#define D3D10_FX10_TYPE_ROW_MASK (0x7 << D3D10_FX10_TYPE_ROW_SHIFT) - -#define D3D10_FX10_TYPE_BASETYPE_SHIFT 3 -#define D3D10_FX10_TYPE_BASETYPE_MASK (0x1f << D3D10_FX10_TYPE_BASETYPE_SHIFT) - -#define D3D10_FX10_TYPE_CLASS_SHIFT 0 -#define D3D10_FX10_TYPE_CLASS_MASK (0x7 << D3D10_FX10_TYPE_CLASS_SHIFT) - -#define D3D10_FX10_TYPE_MATRIX_COLUMN_MAJOR_MASK 0x4000 - static inline struct d3d10_effect *impl_from_ID3D10EffectPool(ID3D10EffectPool *iface) { return CONTAINING_RECORD(iface, struct d3d10_effect, ID3D10EffectPool_iface); @@ -1897,9 +1883,25 @@ static D3D10_SHADER_VARIABLE_TYPE d3d10_variable_type(uint32_t t, BOOL is_object } } +struct numeric_type +{ + uint32_t type_class : 3; + uint32_t base_type : 5; + uint32_t rows : 3; + uint32_t columns : 3; + uint32_t column_major : 1; + uint32_t unknown : 17; +}; + static HRESULT parse_fx10_type(const char *data, size_t data_size, uint32_t offset, struct d3d10_effect_type *t) { uint32_t typeinfo, type_flags, type_kind; + union + { + struct numeric_type type; + uint32_t data; + } numeric; + const char *ptr; unsigned int i; @@ -1940,28 +1942,25 @@ static HRESULT parse_fx10_type(const char *data, size_t data_size, uint32_t offs case 1: TRACE("Type is numeric.\n"); - if (!require_space(ptr - data, 1, sizeof(typeinfo), data_size)) + if (!require_space(ptr - data, 1, sizeof(numeric), data_size)) { WARN("Invalid offset %#x (data size %#Ix).\n", offset, data_size); return E_FAIL; } - typeinfo = read_u32(&ptr); + numeric.data = read_u32(&ptr); t->member_count = 0; - t->column_count = (typeinfo & D3D10_FX10_TYPE_COLUMN_MASK) >> D3D10_FX10_TYPE_COLUMN_SHIFT; - t->row_count = (typeinfo & D3D10_FX10_TYPE_ROW_MASK) >> D3D10_FX10_TYPE_ROW_SHIFT; - t->basetype = d3d10_variable_type((typeinfo & D3D10_FX10_TYPE_BASETYPE_MASK) - >> D3D10_FX10_TYPE_BASETYPE_SHIFT, FALSE, &type_flags); - t->type_class = d3d10_variable_class((typeinfo & D3D10_FX10_TYPE_CLASS_MASK) - >> D3D10_FX10_TYPE_CLASS_SHIFT, typeinfo & D3D10_FX10_TYPE_MATRIX_COLUMN_MAJOR_MASK); + t->column_count = numeric.type.columns; + t->row_count = numeric.type.rows; + t->basetype = d3d10_variable_type(numeric.type.base_type, FALSE, &type_flags); + t->type_class = d3d10_variable_class(numeric.type.type_class, numeric.type.column_major); - TRACE("Type description: %#x.\n", typeinfo); + TRACE("Type description: %#x.\n", numeric.data); TRACE("\tcolumns: %u.\n", t->column_count); TRACE("\trows: %u.\n", t->row_count); TRACE("\tbasetype: %s.\n", debug_d3d10_shader_variable_type(t->basetype)); TRACE("\tclass: %s.\n", debug_d3d10_shader_variable_class(t->type_class)); - TRACE("\tunknown bits: %#x.\n", typeinfo & ~(D3D10_FX10_TYPE_COLUMN_MASK | D3D10_FX10_TYPE_ROW_MASK - | D3D10_FX10_TYPE_BASETYPE_MASK | D3D10_FX10_TYPE_CLASS_MASK | D3D10_FX10_TYPE_MATRIX_COLUMN_MAJOR_MASK)); + TRACE("\tunknown bits: %#x.\n", numeric.type.unknown); break; case 2:
1
0
0
0
Martin Storsjö : wineps.drv: Avoid invalid unaligned accesses.
by Alexandre Julliard
26 Jan '24
26 Jan '24
Module: wine Branch: master Commit: 11128e236fbd75dbecd37de1a1a9e93af3c0ad50 URL:
https://gitlab.winehq.org/wine/wine/-/commit/11128e236fbd75dbecd37de1a1a9e9…
Author: Martin Storsjö <martin(a)martin.st> Date: Wed Jan 24 00:04:16 2024 +0200 wineps.drv: Avoid invalid unaligned accesses. While armv7 generally tolerates unaligned loads/stores in most cases, the compiler is free to use the ldrd/strd instructions, for loading/storing two consecutive 32 bit registers, and this requires the destination to be aligned to a 4 byte boundary. When packing a number of variable length structures, make sure that each actual struct gets aligned at the right address boundary. This fixes crashes in DllMain of wineps.drv, when built for armv7, since 351e58dc2d0aafe19294cbeaed9cd30ae965d591. Signed-off-by: Martin Storsjö <martin(a)martin.st> --- dlls/wineps.drv/init.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/dlls/wineps.drv/init.c b/dlls/wineps.drv/init.c index 8537ba287d1..10e8e77e52d 100644 --- a/dlls/wineps.drv/init.c +++ b/dlls/wineps.drv/init.c @@ -133,6 +133,10 @@ static BOOL import_ntf_from_reg(void) return ret; } +#define DWORD_ALIGN(x) (((x) + 3) & ~3) +#define ntf_strsize(str) DWORD_ALIGN(strlen(str) + 1) +#define ntf_wcssize(str) DWORD_ALIGN((wcslen(str) + 1) * sizeof(WCHAR)) + static BOOL convert_afm_to_ntf(void) { int i, count, size, off, metrics_size; @@ -176,8 +180,8 @@ static BOOL convert_afm_to_ntf(void) list = (void *)(data + header->glyph_set_off + sizeof(*list) * count); list->name_off = off + sizeof(*glyph_set); - list->size = sizeof(*glyph_set) + strlen(glyph_set_name) + 1 + sizeof(*cp) + - sizeof(short) * afmle->afm->NumofMetrics; + list->size = sizeof(*glyph_set) + ntf_strsize(glyph_set_name) + sizeof(*cp) + + DWORD_ALIGN(sizeof(short) * afmle->afm->NumofMetrics); list->off = off; size += list->size; new_data = realloc(data, size); @@ -196,7 +200,7 @@ static BOOL convert_afm_to_ntf(void) glyph_set->name_off = sizeof(*glyph_set); glyph_set->glyph_count = afmle->afm->NumofMetrics; glyph_set->cp_count = 1; - glyph_set->cp_off = glyph_set->name_off + strlen(glyph_set_name) + 1; + glyph_set->cp_off = glyph_set->name_off + ntf_strsize(glyph_set_name); glyph_set->glyph_set_off = glyph_set->cp_off + sizeof(*cp); strcpy(data + off + glyph_set->name_off, glyph_set_name); cp = (void *)(data + off + glyph_set->cp_off); @@ -205,12 +209,11 @@ static BOOL convert_afm_to_ntf(void) *(WCHAR*)(data + off + glyph_set->glyph_set_off + i * sizeof(short)) = afmle->afm->Metrics[i].UV; off = size; - metrics_size = sizeof(IFIMETRICS) + - (wcslen(afmle->afm->FamilyName) + 1) * sizeof(WCHAR); + metrics_size = sizeof(IFIMETRICS) + ntf_wcssize(afmle->afm->FamilyName); list = (void *)(data + header->font_mtx_off + sizeof(*list) * count); list->name_off = off + sizeof(*font_mtx); - list->size = sizeof(*font_mtx) + strlen(afmle->afm->FontName) + 1 + - strlen(glyph_set_name) + 1 + metrics_size + + list->size = sizeof(*font_mtx) + ntf_strsize(afmle->afm->FontName) + + ntf_strsize(glyph_set_name) + metrics_size + (afmle->afm->IsFixedPitch ? 0 : sizeof(*width_range) * afmle->afm->NumofMetrics); list->off = off; size += list->size; @@ -227,9 +230,9 @@ static BOOL convert_afm_to_ntf(void) font_mtx = (void *)(data + off); font_mtx->size = size - off; font_mtx->name_off = sizeof(*font_mtx); - font_mtx->glyph_set_name_off = font_mtx->name_off + strlen(afmle->afm->FontName) + 1; + font_mtx->glyph_set_name_off = font_mtx->name_off + ntf_strsize(afmle->afm->FontName); font_mtx->glyph_count = afmle->afm->NumofMetrics; - font_mtx->metrics_off = font_mtx->glyph_set_name_off + strlen(glyph_set_name) + 1; + font_mtx->metrics_off = font_mtx->glyph_set_name_off + ntf_strsize(glyph_set_name); font_mtx->width_count = afmle->afm->IsFixedPitch ? 0 : afmle->afm->NumofMetrics; font_mtx->width_off = font_mtx->metrics_off + metrics_size; font_mtx->def_width = afmle->afm->Metrics[0].WX;
1
0
0
0
Alexandre Julliard : ntdll/tests: Port the exception unwinding tests to ARM.
by Alexandre Julliard
26 Jan '24
26 Jan '24
Module: wine Branch: master Commit: adf5f5fd304402743d1741bb96d316c8ba46a1bb URL:
https://gitlab.winehq.org/wine/wine/-/commit/adf5f5fd304402743d1741bb96d316…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Jan 26 16:21:38 2024 +0100 ntdll/tests: Port the exception unwinding tests to ARM. --- dlls/ntdll/tests/exception.c | 189 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 189 insertions(+) diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c index aca6383c83c..b6d22092a11 100644 --- a/dlls/ntdll/tests/exception.c +++ b/dlls/ntdll/tests/exception.c @@ -7772,6 +7772,193 @@ static void test_KiUserCallbackDispatcher(void) VirtualProtect( code_ptr, sizeof(saved_code), old_protect, &old_protect ); } +struct unwind_info +{ + DWORD function_length : 18; + DWORD version : 2; + DWORD x : 1; + DWORD e : 1; + DWORD f : 1; + DWORD epilog : 5; + DWORD codes : 4; +}; + +static void run_exception_test(void *handler, const void* context, + const void *code, unsigned int code_size, + unsigned int func2_offset, DWORD access, DWORD handler_flags) +{ + DWORD buf[11]; + RUNTIME_FUNCTION runtime_func[2]; + struct unwind_info unwind; + void (*func)(void) = (void *)((char *)code_mem + 1); /* thumb */ + DWORD oldaccess, oldaccess2; + + runtime_func[0].BeginAddress = 0; + runtime_func[0].UnwindData = 0x1000; + runtime_func[1].BeginAddress = func2_offset; + runtime_func[1].UnwindData = 0x1010; + + unwind.function_length = func2_offset / 2; + unwind.version = 0; + unwind.x = 1; + unwind.e = 1; + unwind.f = 0; + unwind.epilog = 1; + unwind.codes = 1; + buf[0] = *(DWORD *)&unwind; + buf[1] = 0xfbfbffd4; /* push {r4, lr}; end; nop; nop */ + buf[2] = 0x1021; + *(const void **)&buf[3] = context; + unwind.function_length = (code_size - func2_offset) / 2; + buf[4] = *(DWORD *)&unwind; + buf[5] = 0xfbfbffd4; /* push {r4, lr}; end; nop; nop */ + buf[6] = 0x1021; + *(const void **)&buf[7] = context; + buf[8] = 0xc004f8df; /* ldr ip, 1f */ + buf[9] = 0xbf004760; /* bx ip; nop */ + *(const void **)&buf[10] = handler; + + memcpy((unsigned char *)code_mem + 0x1000, buf, sizeof(buf)); + memcpy(code_mem, code, code_size); + if (access) VirtualProtect(code_mem, code_size, access, &oldaccess); + FlushInstructionCache( GetCurrentProcess(), code_mem, 0x2000 ); + + RtlAddFunctionTable(runtime_func, ARRAY_SIZE(runtime_func), (ULONG_PTR)code_mem); + func(); + pRtlDeleteFunctionTable(runtime_func); + + if (access) VirtualProtect(code_mem, code_size, oldaccess, &oldaccess2); +} + +static BOOL got_nested_exception, got_prev_frame_exception; +static void *nested_exception_initial_frame; + +static DWORD nested_exception_handler(EXCEPTION_RECORD *rec, EXCEPTION_REGISTRATION_RECORD *frame, + CONTEXT *context, EXCEPTION_REGISTRATION_RECORD **dispatcher) +{ + trace("nested_exception_handler pc %p, sp %p, code %#lx, flags %#lx, ExceptionAddress %p.\n", + (void *)context->Pc, (void *)context->Sp, rec->ExceptionCode, rec->ExceptionFlags, rec->ExceptionAddress); + + if (rec->ExceptionCode == 0x80000003 && !(rec->ExceptionFlags & EH_NESTED_CALL)) + { + ok(rec->NumberParameters == 1, "Got unexpected rec->NumberParameters %lu.\n", rec->NumberParameters); + ok((char *)context->Sp == (char *)frame - 8, "Got unexpected frame %p / %p.\n", frame, (void *)context->Sp); + ok((char *)context->Lr == (char *)code_mem + 0x07, "Got unexpected lr %p.\n", (void *)context->Lr); + ok((char *)context->Pc == (char *)code_mem + 0x0b, "Got unexpected pc %p.\n", (void *)context->Pc); + + nested_exception_initial_frame = frame; + RaiseException(0xdeadbeef, 0, 0, 0); + context->Pc += 2; + return ExceptionContinueExecution; + } + + if (rec->ExceptionCode == 0xdeadbeef && + (rec->ExceptionFlags == EH_NESTED_CALL || + rec->ExceptionFlags == (EH_NESTED_CALL | EXCEPTION_SOFTWARE_ORIGINATE))) + { + ok(!rec->NumberParameters, "Got unexpected rec->NumberParameters %lu.\n", rec->NumberParameters); + got_nested_exception = TRUE; + ok(frame == nested_exception_initial_frame, "Got unexpected frame %p / %p.\n", + frame, nested_exception_initial_frame); + return ExceptionContinueSearch; + } + + ok(rec->ExceptionCode == 0xdeadbeef && (!rec->ExceptionFlags || rec->ExceptionFlags == EXCEPTION_SOFTWARE_ORIGINATE), + "Got unexpected exception code %#lx, flags %#lx.\n", rec->ExceptionCode, rec->ExceptionFlags); + ok(!rec->NumberParameters, "Got unexpected rec->NumberParameters %lu.\n", rec->NumberParameters); + ok((char *)frame == (char *)nested_exception_initial_frame + 8, "Got unexpected frame %p / %p.\n", + frame, nested_exception_initial_frame); + got_prev_frame_exception = TRUE; + return ExceptionContinueExecution; +} + +static const WORD nested_except_code[] = +{ + 0xb510, /* 00: push {r4, lr} */ + 0xf000, 0xf801, /* 02: bl 1f */ + 0xbd10, /* 06: pop {r4, pc} */ + 0xb510, /* 08: 1: push {r4, lr} */ + 0xdefe, /* 0a: trap */ + 0xbf00, /* 0c: nop */ + 0xbd10, /* 0e: pop {r4, pc} */ +}; + +static void test_nested_exception(void) +{ + got_nested_exception = got_prev_frame_exception = FALSE; + run_exception_test(nested_exception_handler, NULL, nested_except_code, sizeof(nested_except_code), + 4 * sizeof(WORD), PAGE_EXECUTE_READ, UNW_FLAG_EHANDLER); + ok(got_nested_exception, "Did not get nested exception.\n"); + ok(got_prev_frame_exception, "Did not get nested exception in the previous frame.\n"); +} + +static unsigned int collided_unwind_exception_count; + +static DWORD collided_exception_handler(EXCEPTION_RECORD *rec, EXCEPTION_REGISTRATION_RECORD *frame, + CONTEXT *context, EXCEPTION_REGISTRATION_RECORD **dispatcher) +{ + CONTEXT ctx; + + trace("collided_exception_handler pc %p, sp %p, code %#lx, flags %#lx, ExceptionAddress %p, frame %p.\n", + (void *)context->Pc, (void *)context->Sp, rec->ExceptionCode, rec->ExceptionFlags, rec->ExceptionAddress, frame); + + switch(collided_unwind_exception_count++) + { + case 0: + /* Initial exception from nested_except_code. */ + ok(rec->ExceptionCode == STATUS_BREAKPOINT, "got %#lx.\n", rec->ExceptionCode); + nested_exception_initial_frame = frame; + /* Start unwind. */ + pRtlUnwindEx((char *)frame + 8, (char *)code_mem + 0x07, NULL, NULL, &ctx, NULL); + ok(0, "shouldn't be reached\n"); + break; + case 1: + ok(rec->ExceptionCode == STATUS_UNWIND, "got %#lx.\n", rec->ExceptionCode); + ok(rec->ExceptionFlags == EH_UNWINDING, "got %#lx.\n", rec->ExceptionFlags); + ok((char *)context->Pc == (char *)code_mem + 0x0b, "got %p.\n", (void *)context->Pc); + /* generate exception in unwind handler. */ + RaiseException(0xdeadbeef, 0, 0, 0); + ok(0, "shouldn't be reached\n"); + break; + case 2: + /* Inner call frame, continue search. */ + ok(rec->ExceptionCode == 0xdeadbeef, "got %#lx.\n", rec->ExceptionCode); + ok(!rec->ExceptionFlags || rec->ExceptionFlags == EXCEPTION_SOFTWARE_ORIGINATE, "got %#lx.\n", rec->ExceptionFlags); + ok(frame == nested_exception_initial_frame, "got %p, expected %p.\n", frame, nested_exception_initial_frame); + break; + case 3: + /* Top level call frame, handle exception by unwinding. */ + ok(rec->ExceptionCode == 0xdeadbeef, "got %#lx.\n", rec->ExceptionCode); + ok(!rec->ExceptionFlags || rec->ExceptionFlags == EXCEPTION_SOFTWARE_ORIGINATE, "got %#lx.\n", rec->ExceptionFlags); + ok((char *)frame == (char *)nested_exception_initial_frame + 8, "got %p, expected %p.\n", frame, nested_exception_initial_frame); + pRtlUnwindEx((char *)nested_exception_initial_frame + 8, (char *)code_mem + 0x07, NULL, NULL, &ctx, NULL); + ok(0, "shouldn't be reached\n"); + break; + case 4: + /* Collided unwind. */ + ok(rec->ExceptionCode == STATUS_UNWIND, "got %#lx.\n", rec->ExceptionCode); + ok(rec->ExceptionFlags == (EH_UNWINDING | EH_COLLIDED_UNWIND), "got %#lx.\n", rec->ExceptionFlags); + ok(frame == nested_exception_initial_frame, "got %p, expected %p.\n", frame, nested_exception_initial_frame); + break; + case 5: + /* EH_COLLIDED_UNWIND cleared for the following frames. */ + ok(rec->ExceptionCode == STATUS_UNWIND, "got %#lx.\n", rec->ExceptionCode); + ok(rec->ExceptionFlags == (EH_UNWINDING | EH_TARGET_UNWIND), "got %#lx.\n", rec->ExceptionFlags); + ok((char *)frame == (char *)nested_exception_initial_frame + 8, "got %p, expected %p.\n", frame, nested_exception_initial_frame); + break; + } + return ExceptionContinueSearch; +} + +static void test_collided_unwind(void) +{ + got_nested_exception = got_prev_frame_exception = FALSE; + collided_unwind_exception_count = 0; + run_exception_test(collided_exception_handler, NULL, nested_except_code, sizeof(nested_except_code), + 4 * sizeof(WORD), PAGE_EXECUTE_READ, UNW_FLAG_EHANDLER | UNW_FLAG_UHANDLER); + ok(collided_unwind_exception_count == 6, "got %u.\n", collided_unwind_exception_count); +} + #elif defined(__aarch64__) #define UNW_FLAG_NHANDLER 0 @@ -12864,6 +13051,8 @@ START_TEST(exception) #elif defined(__arm__) test_virtual_unwind(); + test_nested_exception(); + test_collided_unwind(); #endif
1
0
0
0
Alexandre Julliard : ntdll/tests: Port the exception unwinding tests to ARM64.
by Alexandre Julliard
26 Jan '24
26 Jan '24
Module: wine Branch: master Commit: 32f5efcdb20d4342fc4023bbc28d67d727830a72 URL:
https://gitlab.winehq.org/wine/wine/-/commit/32f5efcdb20d4342fc4023bbc28d67…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Jan 26 15:06:07 2024 +0100 ntdll/tests: Port the exception unwinding tests to ARM64. --- dlls/ntdll/tests/exception.c | 239 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 221 insertions(+), 18 deletions(-)
1
0
0
0
Alexandre Julliard : ntdll: Clear CONTEXT_UNWOUND_TO_CALL in signal frames.
by Alexandre Julliard
26 Jan '24
26 Jan '24
Module: wine Branch: master Commit: 35c1cc6c81f566b6bbc3f3159583d86dd732b7e4 URL:
https://gitlab.winehq.org/wine/wine/-/commit/35c1cc6c81f566b6bbc3f3159583d8…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Jan 26 15:05:33 2024 +0100 ntdll: Clear CONTEXT_UNWOUND_TO_CALL in signal frames. --- dlls/ntdll/signal_arm.c | 11 +++++------ dlls/ntdll/signal_arm64.c | 11 +++++------ dlls/ntdll/unix/signal_arm.c | 5 ++++- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/dlls/ntdll/signal_arm.c b/dlls/ntdll/signal_arm.c index db8955387ae..f9db361efca 100644 --- a/dlls/ntdll/signal_arm.c +++ b/dlls/ntdll/signal_arm.c @@ -148,10 +148,6 @@ static NTSTATUS virtual_unwind( ULONG type, DISPATCHER_CONTEXT *dispatch, CONTEX dispatch->ScopeIndex = 0; dispatch->EstablisherFrame = 0; dispatch->ControlPc = context->Pc; - /* - * TODO: CONTEXT_UNWOUND_TO_CALL should be cleared if unwound past a - * signal frame. - */ dispatch->ControlPcIsUnwound = (context->ContextFlags & CONTEXT_UNWOUND_TO_CALL) != 0; pc = context->Pc - (dispatch->ControlPcIsUnwound ? 2 : 0); @@ -773,6 +769,7 @@ static void ms_opcode( BYTE opcode, CONTEXT *context, case 1: /* MSFT_OP_MACHINE_FRAME */ context->Pc = ((DWORD *)context->Sp)[1]; context->Sp = ((DWORD *)context->Sp)[0]; + context->ContextFlags &= ~CONTEXT_UNWOUND_TO_CALL; break; case 2: /* MSFT_OP_CONTEXT */ { @@ -1171,10 +1168,12 @@ PVOID WINAPI RtlVirtualUnwind( ULONG type, ULONG_PTR base, ULONG_PTR pc, else handler = unwind_full_data( base, pc, func, context, handler_data, ctx_ptr ); - TRACE( "ret: lr=%lx sp=%lx handler=%p\n", context->Lr, context->Sp, handler ); + TRACE( "ret: pc=%lx lr=%lx sp=%lx handler=%p\n", context->Pc, context->Lr, context->Sp, handler ); if (!context->Pc) + { context->Pc = context->Lr; - context->ContextFlags |= CONTEXT_UNWOUND_TO_CALL; + context->ContextFlags |= CONTEXT_UNWOUND_TO_CALL; + } *frame_ret = context->Sp; return handler; } diff --git a/dlls/ntdll/signal_arm64.c b/dlls/ntdll/signal_arm64.c index 841a4b05d96..19f7121e1e1 100644 --- a/dlls/ntdll/signal_arm64.c +++ b/dlls/ntdll/signal_arm64.c @@ -179,10 +179,6 @@ static NTSTATUS virtual_unwind( ULONG type, DISPATCHER_CONTEXT *dispatch, CONTEX dispatch->ScopeIndex = 0; dispatch->EstablisherFrame = 0; dispatch->ControlPc = context->Pc; - /* - * TODO: CONTEXT_UNWOUND_TO_CALL should be cleared if unwound past a - * signal frame. - */ dispatch->ControlPcIsUnwound = (context->ContextFlags & CONTEXT_UNWOUND_TO_CALL) != 0; pc = context->Pc - (dispatch->ControlPcIsUnwound ? 4 : 0); @@ -786,6 +782,7 @@ static void process_unwind_codes( BYTE *ptr, BYTE *end, CONTEXT *context, { context->Pc = ((DWORD64 *)context->Sp)[1]; context->Sp = ((DWORD64 *)context->Sp)[0]; + context->ContextFlags &= ~CONTEXT_UNWOUND_TO_CALL; } else if (*ptr == 0xea) /* MSFT_OP_CONTEXT */ { @@ -1068,10 +1065,12 @@ PVOID WINAPI RtlVirtualUnwind( ULONG type, ULONG_PTR base, ULONG_PTR pc, else handler = unwind_full_data( base, pc, func, context, handler_data, ctx_ptr ); - TRACE( "ret: lr=%I64x sp=%I64x handler=%p\n", context->Lr, context->Sp, handler ); + TRACE( "ret: pc=%I64x lr=%I64x sp=%I64x handler=%p\n", context->Pc, context->Lr, context->Sp, handler ); if (!context->Pc) + { context->Pc = context->Lr; - context->ContextFlags |= CONTEXT_UNWOUND_TO_CALL; + context->ContextFlags |= CONTEXT_UNWOUND_TO_CALL; + } *frame_ret = context->Sp; return handler; } diff --git a/dlls/ntdll/unix/signal_arm.c b/dlls/ntdll/unix/signal_arm.c index 68c8f0c0486..148108646bb 100644 --- a/dlls/ntdll/unix/signal_arm.c +++ b/dlls/ntdll/unix/signal_arm.c @@ -549,9 +549,12 @@ static NTSTATUS ehabi_virtual_unwind( UINT ip, DWORD *frame, CONTEXT *context, *handler = NULL; /* personality */ *handler_data = NULL; /* lsda */ - context->ContextFlags |= CONTEXT_UNWOUND_TO_CALL; if (!set_pc) + { context->Pc = context->Lr; + context->ContextFlags |= CONTEXT_UNWOUND_TO_CALL; + } + else context->ContextFlags &= ~CONTEXT_UNWOUND_TO_CALL; TRACE( "next function pc=%08lx\n", context->Pc ); TRACE(" r0=%08lx r1=%08lx r2=%08lx r3=%08lx\n",
1
0
0
0
Aida Jonikienė : localspl: Fix a maybe-uninitialized warning in fill_builtin_form_info().
by Alexandre Julliard
26 Jan '24
26 Jan '24
Module: wine Branch: master Commit: 81e9ae96f1eb9ae6f7b9a4ebecbf8d0268d867a0 URL:
https://gitlab.winehq.org/wine/wine/-/commit/81e9ae96f1eb9ae6f7b9a4ebecbf8d…
Author: Aida Jonikienė <aidas957(a)gmail.com> Date: Thu Nov 30 15:17:54 2023 +0200 localspl: Fix a maybe-uninitialized warning in fill_builtin_form_info(). --- dlls/localspl/provider.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/localspl/provider.c b/dlls/localspl/provider.c index b1f1e245693..e318736e09a 100644 --- a/dlls/localspl/provider.c +++ b/dlls/localspl/provider.c @@ -3072,7 +3072,7 @@ static void fill_builtin_form_info( BYTE **base, WCHAR **strings, const struct b DWORD size, DWORD *used ) { FORM_INFO_2W *info = *(FORM_INFO_2W**)base; - DWORD name_len = wcslen( form->name ) + 1, res_len = 0, keyword_len, total_size; + DWORD name_len = wcslen( form->name ) + 1, res_len = 0, keyword_len = 0, total_size; static const WCHAR dll_name[] = L"localspl.dll"; const WCHAR *resource;
1
0
0
0
Paul Gofman : winhttp: Always return result at once if available in WinHttpReadData().
by Alexandre Julliard
26 Jan '24
26 Jan '24
Module: wine Branch: master Commit: bd2a2c25f54e33b5ffae1f28f5ead4b020f55456 URL:
https://gitlab.winehq.org/wine/wine/-/commit/bd2a2c25f54e33b5ffae1f28f5ead4…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Jan 23 16:56:09 2024 -0600 winhttp: Always return result at once if available in WinHttpReadData(). --- dlls/winhttp/request.c | 42 ++++++++++++++++++++++++++++++++++++--- dlls/winhttp/tests/notification.c | 10 +++++++++- 2 files changed, 48 insertions(+), 4 deletions(-) diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c index 59431e3a9f2..29b30fc2583 100644 --- a/dlls/winhttp/request.c +++ b/dlls/winhttp/request.c @@ -3213,7 +3213,7 @@ BOOL WINAPI WinHttpReadData( HINTERNET hrequest, void *buffer, DWORD to_read, DW DWORD ret; struct request *request; BOOL async; - BOOL wont_block; + BOOL wont_block = FALSE; TRACE( "%p, %p, %lu, %p\n", hrequest, buffer, to_read, read ); @@ -3229,7 +3229,44 @@ BOOL WINAPI WinHttpReadData( HINTERNET hrequest, void *buffer, DWORD to_read, DW return FALSE; } - if ((async = request->connect->hdr.flags & WINHTTP_FLAG_ASYNC) && !skip_async_queue( request, &wont_block )) + if (!(async = request->connect->hdr.flags & WINHTTP_FLAG_ASYNC) || skip_async_queue( request, &wont_block )) + { + ret = read_data( request, buffer, to_read, read, async ); + } + else if (wont_block) + { + /* Data available but recursion limit reached, only queue callback. */ + struct send_callback *s; + + if (!(s = malloc( sizeof(*s) ))) + { + release_object( &request->hdr ); + SetLastError( ERROR_OUTOFMEMORY ); + return FALSE; + } + + if (!(ret = read_data( request, buffer, to_read, &s->count, FALSE ))) + { + if (read) *read = s->count; + s->status = WINHTTP_CALLBACK_STATUS_READ_COMPLETE; + s->info = buffer; + s->buflen = s->count; + } + else + { + s->result.dwResult = API_READ_DATA; + s->result.dwError = ret; + s->status = WINHTTP_CALLBACK_STATUS_REQUEST_ERROR; + s->info = &s->result; + s->buflen = sizeof(s->result); + } + + if ((ret = queue_task( &request->queue, task_send_callback, &s->task_hdr, &request->hdr ))) + free( s ); + else + ret = ERROR_IO_PENDING; + } + else { struct read_data *r; @@ -3248,7 +3285,6 @@ BOOL WINAPI WinHttpReadData( HINTERNET hrequest, void *buffer, DWORD to_read, DW else ret = ERROR_IO_PENDING; } - else ret = read_data( request, buffer, to_read, read, async ); release_object( &request->hdr ); SetLastError( ret ); diff --git a/dlls/winhttp/tests/notification.c b/dlls/winhttp/tests/notification.c index 98df1571464..3e67c439bb5 100644 --- a/dlls/winhttp/tests/notification.c +++ b/dlls/winhttp/tests/notification.c @@ -1904,6 +1904,9 @@ static void CALLBACK test_recursion_callback( HINTERNET handle, DWORD_PTR contex break; case WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE: + { + DWORD len; + if (!context->read_from_callback) { SetEvent( context->wait ); @@ -1920,13 +1923,18 @@ static void CALLBACK test_recursion_callback( HINTERNET handle, DWORD_PTR contex "got %lu, thread %#lx\n", context->recursion_count, GetCurrentThreadId() ); context->max_recursion_query = max( context->max_recursion_query, context->recursion_count ); InterlockedIncrement( &context->recursion_count ); - ret = WinHttpReadData( context->request, &b, 1, NULL ); + b = 0xff; + len = 0xdeadbeef; + ret = WinHttpReadData( context->request, &b, 1, &len ); err = GetLastError(); ok( ret, "failed to read data, GetLastError() %lu\n", err ); ok( err == ERROR_SUCCESS || err == ERROR_IO_PENDING, "got %lu\n", err ); + ok( b != 0xff, "got %#x.\n", b ); + ok( len == 1, "got %lu.\n", len ); if (err == ERROR_SUCCESS) context->have_sync_callback = TRUE; InterlockedDecrement( &context->recursion_count ); break; + } case WINHTTP_CALLBACK_STATUS_READ_COMPLETE: {
1
0
0
0
← Newer
1
...
11
12
13
14
15
16
17
...
72
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
Results per page:
10
25
50
100
200