Commit 6167fd32 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

gdi32: Use NtGdiCreateClientObj for CreateMetaFile.

Instead of alloc_dc_ptr. Metafile DCs are not real DCs. Signed-off-by: 's avatarJacek Caban <jacek@codeweavers.com> Signed-off-by: 's avatarHuw Davies <huw@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 728f96bf
......@@ -55,7 +55,6 @@ static inline DC *get_dc_obj( HDC hdc )
{
case NTGDI_OBJ_DC:
case NTGDI_OBJ_MEMDC:
case NTGDI_OBJ_METADC:
case NTGDI_OBJ_ENHMETADC:
return dc;
default:
......@@ -755,6 +754,8 @@ BOOL WINAPI DeleteDC( HDC hdc )
TRACE("%p\n", hdc );
if (is_meta_dc( hdc )) return METADC_DeleteDC( hdc );
GDI_CheckNotLock();
if (!(dc = get_dc_ptr( hdc ))) return FALSE;
......
......@@ -52,6 +52,7 @@ extern BOOL METADC_BitBlt( HDC hdc_dst, INT x_dst, INT y_dst, INT width, INT hei
HDC hdc_src, INT x_src, INT y_src, DWORD rop );
extern BOOL METADC_Chord( HDC hdc, INT left, INT top, INT right, INT bottom, INT xstart,
INT ystart, INT xend, INT yend ) DECLSPEC_HIDDEN;
extern BOOL METADC_DeleteDC( HDC hdc );
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;
......
......@@ -149,63 +149,3 @@ BOOL METADC_SetMapperFlags( HDC hdc, DWORD flags )
{
return metadc_param2( hdc, META_SETMAPPERFLAGS, HIWORD(flags), LOWORD(flags) );
}
BOOL CDECL MFDRV_AbortPath( PHYSDEV dev )
{
return FALSE;
}
BOOL CDECL MFDRV_BeginPath( PHYSDEV dev )
{
return FALSE;
}
BOOL CDECL MFDRV_CloseFigure( PHYSDEV dev )
{
return FALSE;
}
BOOL CDECL MFDRV_EndPath( PHYSDEV dev )
{
return FALSE;
}
BOOL CDECL MFDRV_FillPath( PHYSDEV dev )
{
return FALSE;
}
BOOL CDECL MFDRV_FlattenPath( PHYSDEV dev )
{
return FALSE;
}
BOOL CDECL MFDRV_SelectClipPath( PHYSDEV dev, INT iMode )
{
return FALSE;
}
BOOL CDECL MFDRV_StrokeAndFillPath( PHYSDEV dev )
{
return FALSE;
}
BOOL CDECL MFDRV_StrokePath( PHYSDEV dev )
{
return FALSE;
}
BOOL CDECL MFDRV_WidenPath( PHYSDEV dev )
{
return FALSE;
}
COLORREF CDECL MFDRV_SetDCBrushColor( PHYSDEV dev, COLORREF color )
{
return CLR_INVALID;
}
COLORREF CDECL MFDRV_SetDCPenColor( PHYSDEV dev, COLORREF color )
{
return CLR_INVALID;
}
......@@ -59,16 +59,6 @@ BOOL METADC_Arc( HDC hdc, INT left, INT top, INT right, INT bottom,
/***********************************************************************
* MFDRV_ArcTo
*/
BOOL CDECL MFDRV_ArcTo( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
INT xstart, INT ystart, INT xend, INT yend )
{
return FALSE;
}
/***********************************************************************
* METADC_Pie
*/
BOOL METADC_Pie( HDC hdc, INT left, INT top, INT right, INT bottom,
......@@ -401,14 +391,6 @@ BOOL METADC_FillRgn( HDC hdc, HRGN hrgn, HBRUSH hbrush )
}
/**********************************************************************
* MFDRV_FillRgn
*/
BOOL CDECL MFDRV_FillRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush )
{
return TRUE;
}
/**********************************************************************
* METADC_FrameRgn
*/
BOOL METADC_FrameRgn( HDC hdc, HRGN hrgn, HBRUSH hbrush, INT x, INT y )
......@@ -446,24 +428,3 @@ BOOL METADC_ExtSelectClipRgn( HDC hdc, HRGN hrgn, INT mode )
metadc_remove_handle( metadc, iRgn );
return ret;
}
/**********************************************************************
* MFDRV_PolyBezier
* Since MetaFiles don't record Beziers and they don't even record
* approximations to them using lines, we need this stub function.
*/
BOOL CDECL MFDRV_PolyBezier( PHYSDEV dev, const POINT *pts, DWORD count )
{
return FALSE;
}
/**********************************************************************
* MFDRV_PolyBezierTo
* Since MetaFiles don't record Beziers and they don't even record
* approximations to them using lines, we need this stub function.
*/
BOOL CDECL MFDRV_PolyBezierTo( PHYSDEV dev, const POINT *pts, DWORD count )
{
return FALSE;
}
......@@ -33,7 +33,7 @@
struct metadc
{
struct gdi_physdev dev;
HDC hdc;
METAHEADER *mh; /* Pointer to metafile header */
UINT handles_size, cur_handles;
HGDIOBJ *handles;
......@@ -66,25 +66,4 @@ extern BOOL metadc_param8( HDC hdc, short func, short param1, short param2,
extern BOOL metadc_record( HDC hdc, METARECORD *mr, DWORD rlen ) DECLSPEC_HIDDEN;
extern BOOL metadc_write_record( struct metadc *metadc, METARECORD *mr, DWORD rlen ) DECLSPEC_HIDDEN;
/* Metafile driver functions */
extern BOOL CDECL MFDRV_AbortPath( PHYSDEV dev ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_ArcTo( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
INT xstart, INT ystart, INT xend, INT yend ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_BeginPath( PHYSDEV dev ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_CloseFigure( PHYSDEV dev ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_EndPath( PHYSDEV dev ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_FillPath( PHYSDEV dev ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_FillRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_FlattenPath( PHYSDEV dev ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_PolyBezier( PHYSDEV dev, const POINT* pt, DWORD count ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_PolyBezierTo( PHYSDEV dev, const POINT* pt, DWORD count ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_ScaleWindowExtEx( PHYSDEV dev, INT xNum, INT xDenom, INT yNum, INT yDenom, SIZE *size ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_SelectClipPath( PHYSDEV dev, INT iMode ) DECLSPEC_HIDDEN;
extern COLORREF CDECL MFDRV_SetDCBrushColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
extern COLORREF CDECL MFDRV_SetDCPenColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_StrokeAndFillPath( PHYSDEV dev ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_StrokePath( PHYSDEV dev ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_WidenPath( PHYSDEV dev ) DECLSPEC_HIDDEN;
#endif /* __WINE_METAFILEDRV_H */
......@@ -153,6 +153,8 @@ BOOL WINAPI DeleteObject( HGDIOBJ obj )
struct hdc_list *hdc_list = NULL;
struct wine_rb_entry *entry;
if (is_meta_dc( obj )) return METADC_DeleteDC( obj );
EnterCriticalSection( &obj_map_cs );
if ((entry = wine_rb_get( &obj_map, obj )))
......
......@@ -3059,7 +3059,6 @@ static void test_metafile_file(void)
SetLastError(0xdeadbeef);
metafile = CloseMetaFile(dc);
todo_wine
ok(!metafile && GetLastError() == ERROR_INVALID_HANDLE, "CloseMetaFile returned %p (%u)\n",
metafile, GetLastError());
......@@ -3714,7 +3713,6 @@ static void test_mf_select(void)
ok(ret, "DeleteObject failed: %u\n", GetLastError());
obj = GetCurrentObject(hdc, OBJ_PEN);
todo_wine
ok(!obj, "GetCurrentObject succeeded\n");
SetLastError(0xdeadbeef);
......
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