gdi32: return non-zero v-refresh value for display devices.

Huw Davies huw at codeweavers.com
Wed Jul 19 03:31:01 CDT 2017


On Wed, Jul 19, 2017 at 12:11:28AM +0900, Akihiro Sagawa wrote:
> 
> To avoid division by zero (Bug 43369).
> 
> Signed-off-by: Akihiro Sagawa <sagawa.aki at gmail.com>
> ---
>  dlls/gdi32/driver.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

> diff --git a/dlls/gdi32/driver.c b/dlls/gdi32/driver.c
> index fe7812c..6a3975a 100644
> --- a/dlls/gdi32/driver.c
> +++ b/dlls/gdi32/driver.c
> @@ -344,7 +344,7 @@ static INT nulldrv_GetDeviceCaps( PHYSDEV dev, INT cap )
>      case PHYSICALOFFSETY: return 0;
>      case SCALINGFACTORX:  return 0;
>      case SCALINGFACTORY:  return 0;
> -    case VREFRESH:        return 0;
> +    case VREFRESH:        return GetDeviceCaps( dev->hdc, TECHNOLOGY ) == DT_RASDISPLAY ? 1 : 0;
>      case DESKTOPVERTRES:  return GetDeviceCaps( dev->hdc, VERTRES );
>      case DESKTOPHORZRES:  return GetDeviceCaps( dev->hdc, HORZRES );
>      case BLTALIGNMENT:    return 0;

Could you add a test (probably in dc.c:test_device_caps())?

The values returned by the testbot range from 1 -- 85, so
1 is as good a choice as any.

Huw.



More information about the wine-devel mailing list