gdi32: Don't return screen resolution on printer devices.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2018-09-05 19:52:16 +02:00
parent fc62dac4dc
commit d99f682118
2 changed files with 8 additions and 2 deletions

View File

@ -355,7 +355,7 @@ static INT nulldrv_GetDeviceCaps( PHYSDEV dev, INT cap )
case SCALINGFACTORY: return 0;
case VREFRESH: return GetDeviceCaps( dev->hdc, TECHNOLOGY ) == DT_RASDISPLAY ? 1 : 0;
case DESKTOPHORZRES:
if (pGetSystemMetrics)
if (GetDeviceCaps( dev->hdc, TECHNOLOGY ) == DT_RASDISPLAY && pGetSystemMetrics)
{
DPI_AWARENESS_CONTEXT context;
UINT ret;
@ -366,7 +366,7 @@ static INT nulldrv_GetDeviceCaps( PHYSDEV dev, INT cap )
}
return GetDeviceCaps( dev->hdc, HORZRES );
case DESKTOPVERTRES:
if (pGetSystemMetrics)
if (GetDeviceCaps( dev->hdc, TECHNOLOGY ) == DT_RASDISPLAY && pGetSystemMetrics)
{
DPI_AWARENESS_CONTEXT context;
UINT ret;

View File

@ -471,6 +471,12 @@ static void test_device_caps( HDC hdc, HDC ref_dc, const char *descr, int scale
}
else
{
ok( GetDeviceCaps( ref_dc, DESKTOPHORZRES ) == GetDeviceCaps( ref_dc, HORZRES ),
"Got DESKTOPHORZRES %d on %s, expected %d\n",
GetDeviceCaps( ref_dc, DESKTOPHORZRES ), descr, GetDeviceCaps( ref_dc, HORZRES ));
ok( GetDeviceCaps( ref_dc, DESKTOPVERTRES ) == GetDeviceCaps( ref_dc, VERTRES ),
"Got DESKTOPVERTRES %d on %s, expected %d\n",
GetDeviceCaps( ref_dc, DESKTOPVERTRES ), descr, GetDeviceCaps( ref_dc, VERTRES ));
SetRect( &ref_rect, 0, 0, GetDeviceCaps( ref_dc, DESKTOPHORZRES ),
GetDeviceCaps( ref_dc, DESKTOPVERTRES ) );
}