[NTUSER] Report fresh scrollbar state in co_IntGetScrollBarInfo (#9137)

`co_IntGetScrollBarInfo()` computed the `rgstate` bits into the output buffer
and then immediately overwrote them with the cached copy, so callers always
got stale state.

Fix this by copying the cached info before computing `rgstate`.

This also exposed an inverted `WS_DISABLED` test (per wine, disabled `SB_CTL`
should report `UNAVAILABLE`, not enabled ones), which is now fixed as well.
This commit is contained in:
Ahmed Arif
2026-06-29 21:10:41 +02:00
committed by GitHub
parent 0572d36024
commit b82e2884fc
+3 -3
View File
@@ -701,6 +701,8 @@ co_IntGetScrollBarInfo(PWND Window, LONG idObject, PSCROLLBARINFO psbi)
IntGetScrollBarRect(Window, Bar, &(sbi->rcScrollBar));
IntCalculateThumb(Window, Bar, sbi, pSBData);
RtlCopyMemory(psbi, sbi, sizeof(*psbi));
// Scrollbar state
psbi->rgstate[0] = 0;
if ((Bar == SB_HORZ && !(Window->style & WS_HSCROLL))
@@ -713,11 +715,9 @@ co_IntGetScrollBarInfo(PWND Window, LONG idObject, PSCROLLBARINFO psbi)
else
psbi->rgstate[0] |= STATE_SYSTEM_OFFSCREEN;
}
if (Bar == SB_CTL && !(Window->style & WS_DISABLED))
if (Bar == SB_CTL && (Window->style & WS_DISABLED))
psbi->rgstate[0] |= STATE_SYSTEM_UNAVAILABLE;
RtlCopyMemory(psbi, sbi, sizeof(SCROLLBARINFO));
return TRUE;
}