diff --git a/dlls/gdi32/driver.c b/dlls/gdi32/driver.c index 3cb9c2d1e65..a00fe510233 100644 --- a/dlls/gdi32/driver.c +++ b/dlls/gdi32/driver.c @@ -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; } diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index 038766e5688..6d23e7e0ecc 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -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; diff --git a/dlls/gdi32/gdidc.c b/dlls/gdi32/gdidc.c index c512982c35d..0545dfef696 100644 --- a/dlls/gdi32/gdidc.c +++ b/dlls/gdi32/gdidc.c @@ -135,6 +135,17 @@ INT WINAPI GetDeviceCaps( HDC hdc, INT cap ) return NtGdiGetDeviceCaps( hdc, 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.@) */ diff --git a/dlls/gdi32/mfdrv/init.c b/dlls/gdi32/mfdrv/init.c index 40fdc5d7a01..7b9880cd789 100644 --- a/dlls/gdi32/mfdrv/init.c +++ b/dlls/gdi32/mfdrv/init.c @@ -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 */ diff --git a/include/ntgdi.h b/include/ntgdi.h index 618ac89a042..a48464f67a8 100644 --- a/include/ntgdi.h +++ b/include/ntgdi.h @@ -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 );