Commit c129d13c authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

gdi32: Use NtGdiGetDeviceCaps for GetDeviceCaps implementation.

parent 2a6adcdc
......@@ -799,9 +799,9 @@ HDC WINAPI ResetDCW( HDC hdc, const DEVMODEW *devmode )
/***********************************************************************
* GetDeviceCaps (GDI32.@)
* NtGdiGetDeviceCaps (win32u.@)
*/
INT WINAPI GetDeviceCaps( HDC hdc, INT cap )
INT WINAPI NtGdiGetDeviceCaps( HDC hdc, INT cap )
{
DC *dc;
INT ret = 0;
......
......@@ -53,6 +53,7 @@ extern BOOL METADC_ExtTextOut( HDC hdc, INT x, INT y, UINT flags, const RECT *re
const WCHAR *str, UINT count, const INT *dx ) DECLSPEC_HIDDEN;
extern BOOL METADC_FillRgn( HDC hdc, HRGN hrgn, HBRUSH hbrush ) DECLSPEC_HIDDEN;
extern BOOL METADC_FrameRgn( HDC hdc, HRGN hrgn, HBRUSH hbrush, INT x, INT y ) DECLSPEC_HIDDEN;
extern INT METADC_GetDeviceCaps( HDC hdc, INT cap );
extern BOOL METADC_InvertRgn( HDC hdc, HRGN hrgn ) DECLSPEC_HIDDEN;
extern BOOL METADC_LineTo( HDC hdc, INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL METADC_MoveTo( HDC hdc, INT x, INT y ) DECLSPEC_HIDDEN;
......
......@@ -126,6 +126,16 @@ INT WINAPI SaveDC( HDC hdc )
}
/***********************************************************************
* GetDeviceCaps (GDI32.@)
*/
INT WINAPI GetDeviceCaps( HDC hdc, INT cap )
{
if (is_meta_dc( hdc )) return METADC_GetDeviceCaps( hdc, cap );
if (!get_dc_attr( hdc )) return FALSE;
return NtGdiGetDeviceCaps( hdc, cap );
}
/***********************************************************************
* GetTextAlign (GDI32.@)
*/
UINT WINAPI GetTextAlign( HDC hdc )
......
......@@ -78,12 +78,14 @@ static UINT CDECL MFDRV_SetBoundsRect( PHYSDEV dev, RECT *rect, UINT flags )
/******************************************************************
* MFDRV_GetDeviceCaps
* METADC_GetDeviceCaps
*
*A very simple implementation that returns DT_METAFILE
*/
static INT CDECL MFDRV_GetDeviceCaps(PHYSDEV dev, INT cap)
INT METADC_GetDeviceCaps( HDC hdc, INT cap )
{
if (!get_metadc_ptr( hdc )) return 0;
switch(cap)
{
case TECHNOLOGY:
......@@ -137,7 +139,7 @@ static const struct gdi_dc_funcs MFDRV_Funcs =
NULL, /* pGetCharABCWidthsI */
NULL, /* pGetCharWidth */
NULL, /* pGetCharWidthInfo */
MFDRV_GetDeviceCaps, /* pGetDeviceCaps */
NULL, /* pGetDeviceCaps */
NULL, /* pGetDeviceGammaRamp */
NULL, /* pGetFontData */
NULL, /* pGetFontRealizationInfo */
......
......@@ -89,6 +89,11 @@ static void test_dc_values(void)
attr = GetBkColor(ULongToHandle(0xdeadbeef));
ok(attr == CLR_INVALID, "attr = %x\n", attr);
SetLastError(0xdeadbeef);
attr = GetDeviceCaps(ULongToHandle(0xdeadbeef), TECHNOLOGY);
ok(!attr, "GetDeviceCaps rets %d\n", attr);
ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError() = %u\n", GetLastError());
DeleteDC( hdc );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment