From: Sven Baars <sbaars@codeweavers.com> Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57516 --- dlls/comctl32/tests/updown.c | 23 +++++++++++++++++++---- dlls/comctl32/updown.c | 14 +++++++++++--- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/dlls/comctl32/tests/updown.c b/dlls/comctl32/tests/updown.c index d863e2692e0..db7847df170 100644 --- a/dlls/comctl32/tests/updown.c +++ b/dlls/comctl32/tests/updown.c @@ -461,7 +461,7 @@ static void test_updown_pos(void) r = SendMessageA(updown, UDM_GETPOS32, 0, 0); if (r) { - UDACCEL accel; + UDACCEL accel[3]; flush_sequences(sequences, NUM_MSG_SEQUENCES); @@ -476,11 +476,26 @@ static void test_updown_pos(void) expect(1, LOWORD(r)); expect(40, HIWORD(r)); - accel.nSec = 0; - accel.nInc = 5; - r = SendMessageA(updown, UDM_SETACCEL, 1, (LPARAM)&accel); + memset(accel, 1234, 6 * sizeof(UINT)); + r = SendMessageA(updown, UDM_GETACCEL, 3, (LPARAM)accel); + expect(3, r); + expect(0, accel[0].nSec); + expect(1, accel[0].nInc); + expect(2, accel[1].nSec); + expect(5, accel[1].nInc); + expect(5, accel[2].nSec); + expect(20, accel[2].nInc); + + accel[0].nSec = 0; + accel[0].nInc = 5; + r = SendMessageA(updown, UDM_SETACCEL, 1, (LPARAM)accel); expect(TRUE, r); + r = SendMessageA(updown, UDM_GETACCEL, 3, (LPARAM)accel); + expect(1, r); + expect(0, accel[0].nSec); + expect(5, accel[0].nInc); + r = SendMessageA(updown, UDM_GETPOS, 0, 0); expect(40, LOWORD(r)); expect(1, HIWORD(r)); diff --git a/dlls/comctl32/updown.c b/dlls/comctl32/updown.c index afa96c87ec4..b136db153a0 100644 --- a/dlls/comctl32/updown.c +++ b/dlls/comctl32/updown.c @@ -999,9 +999,6 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L infoPtr->Self = hwnd; infoPtr->Notify = pcs->hwndParent; infoPtr->dwStyle = pcs->style; - infoPtr->AccelCount = 0; - infoPtr->AccelVect = 0; - infoPtr->AccelIndex = -1; infoPtr->CurVal = 0; infoPtr->MinVal = 100; infoPtr->MaxVal = 0; @@ -1009,6 +1006,17 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L infoPtr->Buddy = 0; /* No buddy window yet */ infoPtr->Flags = (infoPtr->dwStyle & UDS_SETBUDDYINT) ? FLAG_BUDDYINT : 0; + infoPtr->AccelCount = 3; + infoPtr->AccelIndex = -1; + infoPtr->AccelVect = Alloc(infoPtr->AccelCount * sizeof(UDACCEL)); + + infoPtr->AccelVect[0].nSec = 0; + infoPtr->AccelVect[0].nInc = 1; + infoPtr->AccelVect[1].nSec = 2; + infoPtr->AccelVect[1].nInc = 5; + infoPtr->AccelVect[2].nSec = 5; + infoPtr->AccelVect[2].nInc = 20; + SetWindowLongW (hwnd, GWL_STYLE, infoPtr->dwStyle & ~WS_BORDER); if (!(infoPtr->dwStyle & UDS_HORZ)) SetWindowPos (hwnd, NULL, 0, 0, DEFAULT_WIDTH, pcs->cy, -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9795