LPRECT parameters for Main_DirectDrawSurface_Lock

Christian Costa titan.costa at wanadoo.fr
Fri Feb 18 04:58:55 CST 2005


Andreas Eckstein wrote:

> Good morning, wine devs!
>
> When playing Icewind Dale II (using wine-20050111), the game sometimes 
> crashed with these messages:
>
>    trace:ddraw:Main_DirectDrawSurface_Lock     lprect: 0x0-0x0
>    err:ddraw:Main_DirectDrawSurface_Lock  Invalid values in LPRECT !!!
>
> or, on another occasion:
>
>    trace:ddraw:Main_DirectDrawSurface_Lock     lprect: 0x0-2x0
>    err:ddraw:Main_DirectDrawSurface_Lock  Invalid values in LPRECT !!!
>
> As you notice, the game tries to lock a surface with width and/or 
> height equal to zero. Frankly I have no idea what the expected 
> behavior is in this case, however playing the critical passages on 
> Windows worked without crash. A quick patch to let 
> Main_DirectDrawSurface_Lock not choke on zero-width or -height LPRECTs 
> solved the problem with wine. Since I don't plan to dig into wine 
> hacking any time soon, could someone merge it into cvs for me (if the 
> new behavior of the function is acceptable, that is)? Thanks in advance!
>
> Andreas Eckstein
>
> ---
>
> The patch:
>
> --- dlls/ddraw/dsurface/main.c    2005-01-09 18:35:44.000000000 +0100
> +++ dlls/ddraw/dsurface/main.c    2005-02-14 21:03:36.511738080 +0100
> @@ -1111,8 +1111,8 @@
>         (prect->left < 0) ||
>         (prect->bottom < 0) ||
>         (prect->right < 0) ||
> -        (prect->left >= prect->right) ||
> -        (prect->top >= prect->bottom) ||
> +        (prect->left > prect->right) ||
> +        (prect->top > prect->bottom) ||
>         (prect->left >= This->surface_desc.dwWidth) ||
>         (prect->right > This->surface_desc.dwWidth) ||
>         (prect->top >= This->surface_desc.dwHeight) ||
>
>
>
>
This patch won't be applied.
The things to do is to write a test case and run it under Windows.
Once the exact behaviour is determined, a proper fix can be written.
Also note that the data in LPRECT may has been corrupted at some point. 
The problem is thus elsewhere.

Bye,
Christian






More information about the wine-devel mailing list