wine/controls scroll.c

Eric Pouech pouech-eric at wanadoo.fr
Sun Mar 23 03:07:06 CST 2003


Alexandre Julliard wrote:
> ChangeSet ID:	7402
> CVSROOT:	/opt/cvs-commit
> Module name:	wine
> Changes by:	julliard at wine.codeweavers.com	2003/03/07 14:38:20
> 
> Modified files:
> 	controls       : scroll.c 
> 
> Log message:
> 	Andrew Johnston <johnstonam at logica.com>
> 	- GetScrollRange zeros the return parameters for no infoPtr
> 	- GetScrollRange, GetScrollPos and GetScrollInfo send a message to the
> 	window for the SB_CTL case
> 	- Moved code for GetScroll* to into worker functions

> @@ -1736,22 +1804,18 @@
>   * RETURNS STD
>   */
>  BOOL WINAPI GetScrollRange(
> -HWND hwnd, /* [in] Handle of window */
> -INT nBar, /* [in] One of SB_HORZ, SB_VERT, or SB_CTL  */
> -LPINT lpMin, /* [out] Where to store minimum value */
> +HWND hwnd /* [in] Handle of window with scrollbar(s) */,
> +INT nBar /* [in] One of SB_HORZ, SB_VERT, or SB_CTL  */,
> +LPINT lpMin /* [out] Where to store minimum value */,
>  LPINT lpMax /* [out] Where to store maximum value */)
>  {
> -    SCROLLBAR_INFO *infoPtr;
> +    TRACE("hwnd=%p nBar=%d lpMin=%p lpMax=%p\n", hwnd, nBar, lpMin, lpMax);
>  
> -    if (!(infoPtr = SCROLL_GetScrollInfo( hwnd, nBar )))
> -    {
> -        if (lpMin) lpMin = 0;
> -        if (lpMax) lpMax = 0;
> -        return FALSE;
> -    }
> -    if (lpMin) *lpMin = infoPtr->minVal;
> -    if (lpMax) *lpMax = infoPtr->maxVal;
> -    return TRUE;
> +    /* Refer SB_CTL requests to the window */
> +    if (nBar == SB_CTL)
> +        return SendMessageA(hwnd, SBM_GETRANGE, (WPARAM)lpMin, (LPARAM)lpMax);
> +    else
> +        return SCROLL_GetScrollRange(hwnd, nBar, lpMin, lpMax);
>  }


This patch is wrong the hwnd is in fact a 16 bit window
I've an old win16 app which got broken because of this (wParam got 
truncated to a 16 bit value, and of course caused a segfault)

A+

-- 
Eric Pouech




More information about the wine-devel mailing list