Commit 73d483d7 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

gdi32: Use NtGdiExtEscape for ExtEscape.

parent 225004e1
......@@ -1253,25 +1253,12 @@ INT WINAPI Escape( HDC hdc, INT escape, INT in_count, LPCSTR in_data, LPVOID out
/******************************************************************************
* ExtEscape [GDI32.@]
* NtGdiExtEscape (win32u.@)
*
* Access capabilities of a particular device that are not available through GDI.
*
* PARAMS
* hdc [I] Handle to device context
* nEscape [I] Escape function
* cbInput [I] Number of bytes in input structure
* lpszInData [I] Pointer to input structure
* cbOutput [I] Number of bytes in output structure
* lpszOutData [O] Pointer to output structure
*
* RETURNS
* Success: >0
* Not implemented: 0
* Failure: <0
*/
INT WINAPI ExtEscape( HDC hdc, INT nEscape, INT cbInput, LPCSTR lpszInData,
INT cbOutput, LPSTR lpszOutData )
INT WINAPI NtGdiExtEscape( HDC hdc, WCHAR *driver, int driver_id, INT escape, INT input_size,
const char *input, INT output_size, char *output )
{
PHYSDEV physdev;
INT ret;
......@@ -1280,7 +1267,7 @@ INT WINAPI ExtEscape( HDC hdc, INT nEscape, INT cbInput, LPCSTR lpszInData,
if (!dc) return 0;
update_dc( dc );
physdev = GET_DC_PHYSDEV( dc, pExtEscape );
ret = physdev->funcs->pExtEscape( physdev, nEscape, cbInput, lpszInData, cbOutput, lpszOutData );
ret = physdev->funcs->pExtEscape( physdev, escape, input_size, input, output_size, output );
release_dc_ptr( dc );
return ret;
}
......
......@@ -55,6 +55,8 @@ extern BOOL METADC_Chord( HDC hdc, INT left, INT top, INT right, INT bottom, INT
extern BOOL METADC_Ellipse( HDC hdc, INT left, INT top, INT right, INT bottom ) DECLSPEC_HIDDEN;
extern BOOL METADC_ExcludeClipRect( HDC hdc, INT left, INT top, INT right,
INT bottom ) DECLSPEC_HIDDEN;
extern BOOL METADC_ExtEscape( HDC hdc, INT escape, INT input_size, const void *input,
INT output_size, void *output ) DECLSPEC_HIDDEN;
extern BOOL METADC_ExtFloodFill( HDC hdc, INT x, INT y, COLORREF color,
UINT fill_type ) DECLSPEC_HIDDEN;
extern BOOL METADC_ExtSelectClipRgn( HDC hdc, HRGN hrgn, INT mode ) DECLSPEC_HIDDEN;
......
......@@ -136,6 +136,17 @@ INT WINAPI GetDeviceCaps( HDC hdc, INT cap )
}
/***********************************************************************
* ExtEscape [GDI32.@]
*/
INT WINAPI ExtEscape( HDC hdc, INT escape, INT input_size, const char *input,
INT output_size, char *output )
{
if (is_meta_dc( hdc ))
return METADC_ExtEscape( hdc, escape, input_size, input, output_size, output );
return NtGdiExtEscape( hdc, NULL, 0, escape, input_size, input, output_size, output );
}
/***********************************************************************
* GetTextAlign (GDI32.@)
*/
UINT WINAPI GetTextAlign( HDC hdc )
......
......@@ -35,25 +35,25 @@ static BOOL CDECL MFDRV_DeleteDC( PHYSDEV dev );
/**********************************************************************
* MFDRV_ExtEscape
* METADC_ExtEscape
*/
static INT CDECL MFDRV_ExtEscape( PHYSDEV dev, INT nEscape, INT cbInput, LPCVOID in_data,
INT cbOutput, LPVOID out_data )
BOOL METADC_ExtEscape( HDC hdc, INT escape, INT input_size, const void *input,
INT output_size, void *output )
{
METARECORD *mr;
DWORD len;
INT ret;
BOOL ret;
if (cbOutput) return 0; /* escapes that require output cannot work in metafiles */
if (output_size) return FALSE; /* escapes that require output cannot work in metafiles */
len = sizeof(*mr) + sizeof(WORD) + ((cbInput + 1) & ~1);
len = sizeof(*mr) + sizeof(WORD) + ((input_size + 1) & ~1);
mr = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
mr->rdSize = len / 2;
mr->rdFunction = META_ESCAPE;
mr->rdParm[0] = nEscape;
mr->rdParm[1] = cbInput;
memcpy(&(mr->rdParm[2]), in_data, cbInput);
ret = MFDRV_WriteRecord( dev, mr, len);
mr->rdParm[0] = escape;
mr->rdParm[1] = input_size;
memcpy( &mr->rdParm[2], input, input_size );
ret = metadc_record( hdc, mr, len );
HeapFree(GetProcessHeap(), 0, mr);
return ret;
}
......@@ -123,7 +123,7 @@ static const struct gdi_dc_funcs MFDRV_Funcs =
NULL, /* pEnumFonts */
NULL, /* pEnumICMProfiles */
NULL, /* pExtDeviceMode */
MFDRV_ExtEscape, /* pExtEscape */
NULL, /* pExtEscape */
NULL, /* pExtFloodFill */
NULL, /* pExtTextOut */
MFDRV_FillPath, /* pFillPath */
......
......@@ -190,8 +190,8 @@ HRGN WINAPI NtGdiExtCreateRegion( const XFORM *xform, DWORD count, const RGN
INT WINAPI NtGdiExtGetObjectW( HGDIOBJ handle, INT count, void *buffer );
INT WINAPI NtGdiExtSelectClipRgn( HDC hdc, HRGN region, INT mode );
BOOL WINAPI NtGdiFillRgn( HDC hdc, HRGN hrgn, HBRUSH hbrush );
INT WINAPI NtGdiExtEscape( HDC hdc, INT escape, INT input_size, const char *input,
INT output_size, char *output );
INT WINAPI NtGdiExtEscape( HDC hdc, WCHAR *driver, INT driver_id, INT escape, INT input_size,
const char *input, INT output_size, char *output );
BOOL WINAPI NtGdiExtFloodFill( HDC hdc, INT x, INT y, COLORREF color, UINT type );
BOOL WINAPI NtGdiFrameRgn( HDC hdc, HRGN hrgn, HBRUSH brush,
INT width, INT height );
......
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