ReactOS  r76032
rosglue.c File Reference
#include <precomp.h>
#include "gdi_private.h"
#include <debug.h>
Include dependency graph for rosglue.c:

Go to the source code of this file.

Macros

#define NDEBUG
 
#define _va_arg_n(p, t, i)   (*(t*)((intptr_t*)(p) + i))
 

Functions

WINEDCget_nulldrv_dc (PHYSDEV dev)
 
BOOL nulldrv_BeginPath (PHYSDEV dev)
 
BOOL nulldrv_EndPath (PHYSDEV dev)
 
BOOL nulldrv_AbortPath (PHYSDEV dev)
 
BOOL nulldrv_CloseFigure (PHYSDEV dev)
 
BOOL nulldrv_SelectClipPath (PHYSDEV dev, INT mode)
 
BOOL nulldrv_FillPath (PHYSDEV dev)
 
BOOL nulldrv_StrokeAndFillPath (PHYSDEV dev)
 
BOOL nulldrv_StrokePath (PHYSDEV dev)
 
BOOL nulldrv_FlattenPath (PHYSDEV dev)
 
BOOL nulldrv_WidenPath (PHYSDEV dev)
 
static INT_PTR NULL_Unused ()
 
static INT NULL_SaveDC (PHYSDEV dev)
 
static BOOL NULL_RestoreDC (PHYSDEV dev, INT level)
 
static INT NULL_SetMapMode (PHYSDEV dev, INT iMode)
 
static HFONT NULL_SelectFont (PHYSDEV dev, HFONT hFont, UINT *aa_flags)
 
static BOOL NULL_SetWindowExtEx (PHYSDEV dev, INT cx, INT cy, SIZE *size)
 
static BOOL NULL_SetViewportExtEx (PHYSDEV dev, INT cx, INT cy, SIZE *size)
 
static BOOL NULL_SetWindowOrgEx (PHYSDEV dev, INT x, INT y, POINT *pt)
 
static BOOL NULL_SetViewportOrgEx (PHYSDEV dev, INT x, INT y, POINT *pt)
 
static INT NULL_ExtSelectClipRgn (PHYSDEV dev, HRGN hrgn, INT iMode)
 
static INT NULL_IntersectClipRect (PHYSDEV dev, INT left, INT top, INT right, INT bottom)
 
static INT NULL_OffsetClipRgn (PHYSDEV dev, INT x, INT y)
 
static INT NULL_ExcludeClipRect (PHYSDEV dev, INT left, INT top, INT right, INT bottom)
 
WINEDCget_physdev_dc (PHYSDEV dev)
 
static GDILOOBJTYPE ConvertObjectType (WORD wType)
 
HGDIOBJ alloc_gdi_handle (PVOID pvObject, WORD wType, const struct gdi_obj_funcs *funcs)
 
PVOID free_gdi_handle (HGDIOBJ hobj)
 
PVOID GDI_GetObjPtr (HGDIOBJ hobj, WORD wType)
 
VOID GDI_ReleaseObj (HGDIOBJ hobj)
 
WINEDCalloc_dc_ptr (WORD magic)
 
VOID free_dc_ptr (WINEDC *pWineDc)
 
WINEDCget_dc_ptr (HDC hdc)
 
VOID release_dc_ptr (WINEDC *dc)
 
void push_dc_driver_ros (PHYSDEV *dev, PHYSDEV physdev, const struct gdi_dc_funcs *funcs)
 
VOID GDI_hdc_using_object (HGDIOBJ hobj, HDC hdc)
 
VOID GDI_hdc_not_using_object (HGDIOBJ hobj, HDC hdc)
 
int bitmap_info_size (const BITMAPINFO *info, WORD coloruse)
 
BOOL get_brush_bitmap_info (HBRUSH hbr, PBITMAPINFO pbmi, PVOID *ppvBits, PUINT puUsage)
 
BOOL WINAPI SetVirtualResolution (HDC hdc, DWORD cxVirtualDevicePixel, DWORD cyVirtualDevicePixel, DWORD cxVirtualDeviceMm, DWORD cyVirtualDeviceMm)
 
BOOL WINAPI DeleteColorSpace (HCOLORSPACE hcs)
 
BOOL WINAPI SetWorldTransformForMetafile (_In_ HDC hdc, _Out_ CONST XFORM *pxform)
 
void __cdecl _assert (const char *exp, const char *file, unsigned line)
 
static VOID InitBitBltCoords (struct bitblt_coords *coords, HDC hdc, int x, int y, int cx, int cy)
 
static PHYSDEV GetPhysDev (HDC hdc)
 
static BOOL DRIVER_PatBlt (_In_ PHYSDEV physdev, _In_ HDC hdc, _In_ INT xLeft, _In_ INT yTop, _In_ INT cx, _In_ INT cy, _In_ DWORD dwRop)
 
static BOOL DRIVER_StretchBlt (_In_ PHYSDEV physdev, _In_ HDC hdcDst, _In_ INT xDst, _In_ INT yDst, _In_ INT cxDst, _In_ INT cyDst, _In_opt_ HDC hdcSrc, _In_ INT xSrc, _In_ INT ySrc, _In_ INT cxSrc, _In_ INT cySrc, _In_ DWORD dwRop)
 
static BOOL DRIVER_RestoreDC (PHYSDEV physdev, INT level)
 
static HFONT DRIVER_SelectFont (PHYSDEV physdev, HFONT hFont, UINT *aa_flags)
 
static HPEN DRIVER_SelectPen (PHYSDEV physdev, HPEN hpen, const struct brush_pattern *pattern)
 
static HBRUSH DRIVER_SelectBrush (PHYSDEV physdev, HBRUSH hbrush, const struct brush_pattern *pattern)
 
static HRGN DRIVER_PathToRegion (PHYSDEV physdev)
 
static DWORD_PTR DRIVER_Dispatch (_In_ PHYSDEV physdev, _In_ DCFUNC eFunction, _In_ va_list argptr)
 
BOOL METADC_Dispatch (_In_ DCFUNC eFunction, _Out_ PDWORD_PTR pdwResult, _In_ DWORD_PTR dwError, _In_ HDC hdc,...)
 
BOOL WINAPI METADC_GetAndSetDCDWord (_Out_ DWORD *pdwResult, _In_ HDC hdc, _In_ UINT uFunction, _In_ DWORD dwIn, _In_ ULONG ulMFId, _In_ USHORT usMF16Id, _In_ DWORD dwError)
 
VOID WINAPI METADC_DeleteObject (HGDIOBJ hobj)
 
BOOL WINAPI METADC_DeleteDC (_In_ HDC hdc)
 
INT WINAPI METADC16_Escape (_In_ HDC hdc, _In_ INT nEscape, _In_ INT cbInput, _In_ LPCSTR lpvInData, _Out_ LPVOID lpvOutData)
 

Variables

static INT i = 0
 
static const struct gdi_dc_funcs DummyPhysDevFuncs
 

Macro Definition Documentation

#define _va_arg_n (   p,
  t,
  i 
)    (*(t*)((intptr_t*)(p) + i))

Referenced by DRIVER_Dispatch().

#define NDEBUG

Definition at line 6 of file rosglue.c.

Function Documentation

void __cdecl _assert ( const char exp,
const char file,
unsigned  line 
)

Definition at line 567 of file rosglue.c.

571 {
573 }
#define DbgRaiseAssertionFailure
Definition: ke.h:164
WINEDC* alloc_dc_ptr ( WORD  magic)

Definition at line 290 of file rosglue.c.

Referenced by CreateEnhMetaFileW(), and MFDRV_AllocMetaFile().

291 {
292  WINEDC* pWineDc;
293 
294  /* Allocate the Wine DC */
295  pWineDc = HeapAlloc(GetProcessHeap(), 0, sizeof(*pWineDc));
296  if (pWineDc == NULL)
297  {
298  return NULL;
299  }
300 
301  ZeroMemory(pWineDc, sizeof(*pWineDc));
302  pWineDc->refcount = 1;
303  pWineDc->hFont = GetStockObject(SYSTEM_FONT);
304  pWineDc->hBrush = GetStockObject(WHITE_BRUSH);
305  pWineDc->hPen = GetStockObject(BLACK_PEN);
307 
308  if (magic == OBJ_ENHMETADC)
309  {
310  /* We create a metafile DC, but we ignore the reference DC, this is
311  handled by the wine code */
312  pWineDc->hdc = NtGdiCreateMetafileDC(NULL);
313  if (pWineDc->hdc == NULL)
314  {
315  HeapFree(GetProcessHeap(), 0, pWineDc);
316  return NULL;
317  }
318 
319  /* Set the Wine DC as LDC */
320  GdiSetLDC(pWineDc->hdc, pWineDc);
321  }
322  else if (magic == OBJ_METADC)
323  {
325  if (pWineDc->hdc == NULL)
326  {
327  HeapFree(GetProcessHeap(), 0, pWineDc);
328  return NULL;
329  }
330  }
331  else
332  {
333  // nothing else supported!
334  ASSERT(FALSE);
335  }
336 
337  pWineDc->physDev = &pWineDc->NullPhysDev;
338  pWineDc->NullPhysDev.funcs = &DummyPhysDevFuncs;
339  pWineDc->NullPhysDev.next = NULL;
340 
341  pWineDc->NullPhysDev.hdc = pWineDc->hdc;
342  return pWineDc;
343 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
HPALETTE hPalette
Definition: gdi_private.h:65
static const struct gdi_dc_funcs DummyPhysDevFuncs
Definition: rosglue.c:46
BOOL FASTCALL GdiSetLDC(HDC hdc, PVOID pvLDC)
Definition: misc.c:789
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel)?(CompletionRoutine!=NULL):TRUE)
u32_t magic(void)
HGDIOBJ WINAPI GdiCreateClientObj(_In_ PVOID pvObject, _In_ GDILOOBJTYPE eObjType)
Definition: clientobj.c:148
#define ZeroMemory
Definition: winbase.h:1621
#define WHITE_BRUSH
Definition: wingdi.h:900
#define FALSE
Definition: types.h:117
PHYSDEV physDev
Definition: gdi_private.h:59
smooth NULL
Definition: ftsmooth.c:557
#define SYSTEM_FONT
Definition: wingdi.h:909
HBRUSH hBrush
Definition: gdi_private.h:63
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define DEFAULT_PALETTE
Definition: wingdi.h:911
#define OBJ_ENHMETADC
Definition: objidl.idl:1420
struct gdi_physdev NullPhysDev
Definition: gdi_private.h:58
__kernel_entry W32KAPI HDC APIENTRY NtGdiCreateMetafileDC(_In_ HDC hdc)
HPEN hPen
Definition: gdi_private.h:64
#define BLACK_PEN
Definition: wingdi.h:901
#define OBJ_METADC
Definition: objidl.idl:1412
LONG refcount
Definition: gdi_private.h:60
#define HeapFree(x, y, z)
Definition: compat.h:394
HFONT hFont
Definition: gdi_private.h:62
HGDIOBJ alloc_gdi_handle ( PVOID  pvObject,
WORD  wType,
const struct gdi_obj_funcs funcs 
)

Definition at line 220 of file rosglue.c.

224 {
225  GDILOOBJTYPE eObjType;
226 
227  /* Get the GDI object type */
228  eObjType = ConvertObjectType(wType);
229  if ((eObjType != GDILoObjType_LO_METAFILE_TYPE) &&
230  (eObjType != GDILoObjType_LO_METAFILE16_TYPE) &&
231  (eObjType != GDILoObjType_LO_METADC16_TYPE))
232  {
233  /* This is not supported! */
234  ASSERT(FALSE);
235  return NULL;
236  }
237 
238  /* Insert the client object */
239  return GdiCreateClientObj(pvObject, eObjType);
240 }
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel)?(CompletionRoutine!=NULL):TRUE)
HGDIOBJ WINAPI GdiCreateClientObj(_In_ PVOID pvObject, _In_ GDILOOBJTYPE eObjType)
Definition: clientobj.c:148
#define FALSE
Definition: types.h:117
smooth NULL
Definition: ftsmooth.c:557
static GDILOOBJTYPE ConvertObjectType(WORD wType)
Definition: rosglue.c:195
enum GDILoObjType GDILOOBJTYPE
int bitmap_info_size ( const BITMAPINFO info,
WORD  coloruse 
)

Definition at line 442 of file rosglue.c.

445 {
446  unsigned int colors, size, masks = 0;
447 
448  if (info->bmiHeader.biSize == sizeof(BITMAPCOREHEADER))
449  {
450  const BITMAPCOREHEADER *core = (const BITMAPCOREHEADER *)info;
451  colors = (core->bcBitCount <= 8) ? 1 << core->bcBitCount : 0;
452  return sizeof(BITMAPCOREHEADER) + colors *
453  ((coloruse == DIB_RGB_COLORS) ? sizeof(RGBTRIPLE) : sizeof(WORD));
454  }
455  else /* assume BITMAPINFOHEADER */
456  {
457  if (info->bmiHeader.biClrUsed) colors = min( info->bmiHeader.biClrUsed, 256 );
458  else colors = info->bmiHeader.biBitCount > 8 ? 0 : 1 << info->bmiHeader.biBitCount;
459  if (info->bmiHeader.biCompression == BI_BITFIELDS) masks = 3;
460  size = max( info->bmiHeader.biSize, sizeof(BITMAPINFOHEADER) + masks * sizeof(DWORD) );
461  return size + colors * ((coloruse == DIB_RGB_COLORS) ? sizeof(RGBQUAD) : sizeof(WORD));
462  }
463 }
#define max(a, b)
Definition: svc.c:63
unsigned short WORD
Definition: ntddk_ex.h:93
BITMAPINFOHEADER bmiHeader
Definition: wingdi.h:1453
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
#define BI_BITFIELDS
Definition: mmreg.h:505
DWORD DWORD
Definition: winlogon.h:75
DWORD biCompression
Definition: amvideo.idl:35
GLsizeiptr size
Definition: glext.h:5919
#define min(a, b)
Definition: monoChain.cc:55
#define DIB_RGB_COLORS
Definition: wingdi.h:365
static const BYTE masks[8]
Definition: dib.c:2769
static GDILOOBJTYPE ConvertObjectType ( WORD  wType)
static

Definition at line 195 of file rosglue.c.

Referenced by alloc_gdi_handle(), and GDI_GetObjPtr().

197 {
198  /* Get the GDI object type */
199  switch (wType)
200  {
201  case OBJ_PEN: return GDILoObjType_LO_PEN_TYPE;
203  case OBJ_DC: return GDILoObjType_LO_DC_TYPE;
206  case OBJ_FONT: return GDILoObjType_LO_FONT_TYPE;
210  case OBJ_MEMDC: return GDILoObjType_LO_DC_TYPE;
215  default: return 0;
216  }
217 }
#define OBJ_MEMDC
Definition: objidl.idl:1418
#define OBJ_PEN
Definition: objidl.idl:1409
#define OBJ_ENHMETAFILE
Definition: objidl.idl:1421
#define OBJ_COLORSPACE
Definition: wingdi.h:702
#define OBJ_REGION
Definition: objidl.idl:1416
#define OBJ_METAFILE
Definition: objidl.idl:1417
#define OBJ_ENHMETADC
Definition: objidl.idl:1420
#define OBJ_DC
Definition: objidl.idl:1411
#define OBJ_PAL
Definition: objidl.idl:1413
#define OBJ_FONT
Definition: objidl.idl:1414
#define OBJ_EXTPEN
Definition: objidl.idl:1419
#define OBJ_BRUSH
Definition: objidl.idl:1410
#define OBJ_METADC
Definition: objidl.idl:1412
#define OBJ_BITMAP
Definition: objidl.idl:1415
BOOL WINAPI DeleteColorSpace ( HCOLORSPACE  hcs)

Definition at line 532 of file rosglue.c.

534 {
535  return NtGdiDeleteColorSpace(hcs);
536 }
__kernel_entry W32KAPI BOOL APIENTRY NtGdiDeleteColorSpace(_In_ HANDLE hColorSpace)
static DWORD_PTR DRIVER_Dispatch ( _In_ PHYSDEV  physdev,
_In_ DCFUNC  eFunction,
_In_ va_list  argptr 
)
static

Definition at line 736 of file rosglue.c.

Referenced by METADC_Dispatch().

740 {
741  UINT aa_flags = 0;
742 
743 /* Note that this is a hack that relies on some assumptions regarding the
744  Windows ABI. It relies on the fact that all vararg functions put their
745  parameters on the stack in the correct order. Additionally it relies
746  on the fact that none of the functions we handle here, pass any 64
747  bit arguments on a 32 bit architecture. */
748 #define _va_arg_n(p,t,i) (*(t*)((intptr_t*)(p) + i))
749 
750  switch (eFunction)
751  {
752  case DCFUNC_AbortPath:
753  return physdev->funcs->pAbortPath(physdev);
754  case DCFUNC_Arc:
755  return physdev->funcs->pArc(physdev,
756  _va_arg_n(argptr, INT, 0), // left
757  _va_arg_n(argptr, INT, 1), // top
758  _va_arg_n(argptr, INT, 2), // right
759  _va_arg_n(argptr, INT, 3), // bottom
760  _va_arg_n(argptr, INT, 4), // xstart
761  _va_arg_n(argptr, INT, 5), // ystart
762  _va_arg_n(argptr, INT, 6), // xend
763  _va_arg_n(argptr, INT, 7)); // yend
764  case DCFUNC_BeginPath:
765  return physdev->funcs->pBeginPath(physdev);
766  case DCFUNC_Chord:
767  return physdev->funcs->pChord(physdev,
768  _va_arg_n(argptr, INT, 0),
769  _va_arg_n(argptr, INT, 1),
770  _va_arg_n(argptr, INT, 2),
771  _va_arg_n(argptr, INT, 3),
772  _va_arg_n(argptr, INT, 4),
773  _va_arg_n(argptr, INT, 5),
774  _va_arg_n(argptr, INT, 6),
775  _va_arg_n(argptr, INT, 7));
776  case DCFUNC_CloseFigure:
777  return physdev->funcs->pCloseFigure(physdev);
778  case DCFUNC_Ellipse:
779  return physdev->funcs->pEllipse(physdev,
780  _va_arg_n(argptr, INT, 0),
781  _va_arg_n(argptr, INT, 1),
782  _va_arg_n(argptr, INT, 2),
783  _va_arg_n(argptr, INT, 3));
784  case DCFUNC_EndPath:
785  return physdev->funcs->pEndPath(physdev);
787  return physdev->funcs->pExcludeClipRect(physdev,
788  _va_arg_n(argptr, INT, 0),
789  _va_arg_n(argptr, INT, 1),
790  _va_arg_n(argptr, INT, 2),
791  _va_arg_n(argptr, INT, 3));
792  case DCFUNC_ExtEscape:
793  ASSERT(physdev->funcs->pExtEscape != NULL);
794  return physdev->funcs->pExtEscape(physdev,
795  _va_arg_n(argptr, INT, 0),
796  _va_arg_n(argptr, INT, 1),
797  _va_arg_n(argptr, LPCVOID, 2),
798  _va_arg_n(argptr, INT, 3),
799  _va_arg_n(argptr, LPVOID, 4));
800  case DCFUNC_ExtFloodFill:
801  return physdev->funcs->pExtFloodFill(physdev,
802  _va_arg_n(argptr, INT, 0),
803  _va_arg_n(argptr, INT, 1),
804  _va_arg_n(argptr, COLORREF, 2),
805  _va_arg_n(argptr, UINT, 3));
807  return physdev->funcs->pExtSelectClipRgn(physdev,
808  _va_arg_n(argptr, HRGN, 0), // hrgn
809  _va_arg_n(argptr, INT, 1)); // iMode
810  case DCFUNC_ExtTextOut:
811  return physdev->funcs->pExtTextOut(physdev,
812  _va_arg_n(argptr, INT, 0),// x
813  _va_arg_n(argptr, INT, 1),// y
814  _va_arg_n(argptr, UINT, 2),// fuOptions
815  _va_arg_n(argptr, const RECT *, 3),// lprc,
816  _va_arg_n(argptr, LPCWSTR, 4),// lpString,
817  _va_arg_n(argptr, UINT, 5),// cchString,
818  _va_arg_n(argptr, const INT *, 6));// lpDx);
819  case DCFUNC_FillPath:
820  return physdev->funcs->pFillPath(physdev);
821  case DCFUNC_FillRgn:
822  return physdev->funcs->pFillRgn(physdev,
823  _va_arg_n(argptr, HRGN, 0),
824  _va_arg_n(argptr, HBRUSH, 1));
825  case DCFUNC_FlattenPath:
826  return physdev->funcs->pFlattenPath(physdev);
827  case DCFUNC_FrameRgn:
828  return physdev->funcs->pFrameRgn(physdev,
829  _va_arg_n(argptr, HRGN, 0),
830  _va_arg_n(argptr, HBRUSH, 1),
831  _va_arg_n(argptr, INT, 2),
832  _va_arg_n(argptr, INT, 3));
834  return physdev->funcs->pGetDeviceCaps(physdev, va_arg(argptr, INT));
835  case DCFUNC_GdiComment:
836  return physdev->funcs->pGdiComment(physdev,
837  _va_arg_n(argptr, UINT, 0),
838  _va_arg_n(argptr, const BYTE*, 1));
840  return physdev->funcs->pIntersectClipRect(physdev,
841  _va_arg_n(argptr, INT, 0),
842  _va_arg_n(argptr, INT, 1),
843  _va_arg_n(argptr, INT, 2),
844  _va_arg_n(argptr, INT, 3));
845  case DCFUNC_InvertRgn:
846  return physdev->funcs->pInvertRgn(physdev,
847  va_arg(argptr, HRGN));
848  case DCFUNC_LineTo:
849  return physdev->funcs->pLineTo(physdev,
850  _va_arg_n(argptr, INT, 0),
851  _va_arg_n(argptr, INT, 1));
853  return physdev->funcs->pModifyWorldTransform(physdev,
854  _va_arg_n(argptr, const XFORM*, 0),
855  _va_arg_n(argptr, DWORD, 1));
856  case DCFUNC_MoveTo:
857  return physdev->funcs->pMoveTo(physdev,
858  _va_arg_n(argptr, INT, 0),
859  _va_arg_n(argptr, INT, 1));
861  return physdev->funcs->pOffsetClipRgn(physdev,
862  _va_arg_n(argptr, INT, 0), // hrgn
863  _va_arg_n(argptr, INT, 1)); // iMode
865  return physdev->funcs->pOffsetViewportOrgEx(physdev,
866  _va_arg_n(argptr, INT, 0), // X
867  _va_arg_n(argptr, INT, 1), // Y
868  _va_arg_n(argptr, LPPOINT, 2)); // lpPoint
870  return physdev->funcs->pOffsetWindowOrgEx(physdev,
871  _va_arg_n(argptr, INT, 0), // X
872  _va_arg_n(argptr, INT, 1), // Y
873  _va_arg_n(argptr, LPPOINT, 2)); // lpPoint
874  case DCFUNC_PatBlt:
875  return DRIVER_PatBlt(physdev,
876  physdev->hdc,
877  _va_arg_n(argptr, INT, 0),
878  _va_arg_n(argptr, INT, 1),
879  _va_arg_n(argptr, INT, 2),
880  _va_arg_n(argptr, INT, 3),
881  _va_arg_n(argptr, DWORD, 4));
882  case DCFUNC_Pie:
883  return physdev->funcs->pPie(physdev,
884  _va_arg_n(argptr, INT, 0),
885  _va_arg_n(argptr, INT, 1),
886  _va_arg_n(argptr, INT, 2),
887  _va_arg_n(argptr, INT, 3),
888  _va_arg_n(argptr, INT, 4),
889  _va_arg_n(argptr, INT, 5),
890  _va_arg_n(argptr, INT, 6),
891  _va_arg_n(argptr, INT, 7));
892  case DCFUNC_PolyBezier:
893  return physdev->funcs->pPolyBezier(physdev,
894  _va_arg_n(argptr, const POINT*, 0),
895  _va_arg_n(argptr, DWORD, 1));
896  case DCFUNC_PolyBezierTo:
897  return physdev->funcs->pPolyBezierTo(physdev,
898  _va_arg_n(argptr, const POINT*, 0),
899  _va_arg_n(argptr, DWORD, 1));
900  case DCFUNC_PolyDraw:
901  return physdev->funcs->pPolyDraw(physdev,
902  _va_arg_n(argptr, const POINT*, 0),
903  _va_arg_n(argptr, const BYTE*, 1),
904  _va_arg_n(argptr, DWORD, 2));
905  case DCFUNC_Polygon:
906  return physdev->funcs->pPolygon(physdev,
907  _va_arg_n(argptr, const POINT*, 0),
908  _va_arg_n(argptr, INT, 1));
909  case DCFUNC_Polyline:
910  return physdev->funcs->pPolyline(physdev,
911  _va_arg_n(argptr, const POINT*, 0),
912  _va_arg_n(argptr, INT, 1));
913  case DCFUNC_PolylineTo:
914  return physdev->funcs->pPolylineTo(physdev,
915  _va_arg_n(argptr, const POINT*, 0),
916  _va_arg_n(argptr, INT, 1));
917  case DCFUNC_PolyPolygon:
918  return physdev->funcs->pPolyPolygon(physdev,
919  _va_arg_n(argptr, const POINT*, 0),
920  _va_arg_n(argptr, const INT*, 1),
921  _va_arg_n(argptr, DWORD, 2));
922  case DCFUNC_PolyPolyline:
923  return physdev->funcs->pPolyPolyline(physdev,
924  _va_arg_n(argptr, const POINT*, 0),
925  _va_arg_n(argptr, const DWORD*, 1),
926  _va_arg_n(argptr, DWORD, 2));
929  {
931  return GDI_ERROR;
932  }
933  return physdev->funcs->pRealizePalette(physdev, NULL, FALSE);
934  case DCFUNC_Rectangle:
935  return physdev->funcs->pRectangle(physdev,
936  _va_arg_n(argptr, INT, 0),
937  _va_arg_n(argptr, INT, 1),
938  _va_arg_n(argptr, INT, 2),
939  _va_arg_n(argptr, INT, 3));
940  case DCFUNC_RestoreDC:
941  return DRIVER_RestoreDC(physdev, va_arg(argptr, INT));
942  case DCFUNC_RoundRect:
943  return physdev->funcs->pRoundRect(physdev,
944  _va_arg_n(argptr, INT, 0),
945  _va_arg_n(argptr, INT, 1),
946  _va_arg_n(argptr, INT, 2),
947  _va_arg_n(argptr, INT, 3),
948  _va_arg_n(argptr, INT, 4),
949  _va_arg_n(argptr, INT, 5));
950 
951  case DCFUNC_SaveDC:
952  return physdev->funcs->pSaveDC(physdev);
954  return physdev->funcs->pScaleViewportExtEx(physdev,
955  _va_arg_n(argptr, INT, 0), // xNum
956  _va_arg_n(argptr, INT, 1), // xDenom
957  _va_arg_n(argptr, INT, 2), // yNum
958  _va_arg_n(argptr, INT, 3), // yDenom
959  _va_arg_n(argptr, LPSIZE, 4)); // lpSize
961  return physdev->funcs->pScaleWindowExtEx(physdev,
962  _va_arg_n(argptr, INT, 0), // xNum
963  _va_arg_n(argptr, INT, 1), // xDenom
964  _va_arg_n(argptr, INT, 2), // yNum
965  _va_arg_n(argptr, INT, 3), // yDenom
966  _va_arg_n(argptr, LPSIZE, 4)); // lpSize
967  case DCFUNC_SelectBrush:
968  return (DWORD_PTR)DRIVER_SelectBrush(physdev, va_arg(argptr, HBRUSH), NULL);
970  return physdev->funcs->pSelectClipPath(physdev, va_arg(argptr, INT));
971  case DCFUNC_SelectFont:
972  return (DWORD_PTR)DRIVER_SelectFont(physdev, va_arg(argptr, HFONT), &aa_flags);
974  return (DWORD_PTR)physdev->funcs->pSelectPalette(physdev,
975  _va_arg_n(argptr, HPALETTE, 0),
976  _va_arg_n(argptr, BOOL, 1));
977  case DCFUNC_SelectPen:
978  return (DWORD_PTR)DRIVER_SelectPen(physdev, va_arg(argptr, HPEN), NULL);
980  return physdev->funcs->pSetDCBrushColor(physdev, va_arg(argptr, COLORREF));
982  return physdev->funcs->pSetDCPenColor(physdev, va_arg(argptr, COLORREF));
984  return physdev->funcs->pSetDIBitsToDevice(physdev,
985  _va_arg_n(argptr, INT, 0),
986  _va_arg_n(argptr, INT, 1),
987  _va_arg_n(argptr, DWORD, 2),
988  _va_arg_n(argptr, DWORD, 3),
989  _va_arg_n(argptr, INT, 4),
990  _va_arg_n(argptr, INT, 5),
991  _va_arg_n(argptr, UINT, 6),
992  _va_arg_n(argptr, UINT, 7),
993  _va_arg_n(argptr, LPCVOID, 8),
994  _va_arg_n(argptr, BITMAPINFO*, 9),
995  _va_arg_n(argptr, UINT, 10));
996  case DCFUNC_SetBkColor:
997  return physdev->funcs->pSetBkColor(physdev, va_arg(argptr, COLORREF));
998  case DCFUNC_SetBkMode:
999  return physdev->funcs->pSetBkMode(physdev, va_arg(argptr, INT));
1000  case DCFUNC_SetLayout:
1001  // FIXME: MF16 is UNIMPLEMENTED
1002  return physdev->funcs->pSetLayout(physdev,
1003  _va_arg_n(argptr, DWORD, 0));
1004  //case DCFUNC_SetMapMode:
1005  // return physdev->funcs->pSetMapMode(physdev, va_arg(argptr, INT));
1006  case DCFUNC_SetPixel:
1007  return physdev->funcs->pSetPixel(physdev,
1008  _va_arg_n(argptr, INT, 0),
1009  _va_arg_n(argptr, INT, 1),
1010  _va_arg_n(argptr, COLORREF, 2));
1012  return physdev->funcs->pSetPolyFillMode(physdev, va_arg(argptr, INT));
1013  case DCFUNC_SetROP2:
1014  return physdev->funcs->pSetROP2(physdev, va_arg(argptr, INT));
1016  return physdev->funcs->pSetStretchBltMode(physdev, va_arg(argptr, INT));
1017  case DCFUNC_SetTextAlign:
1018  return physdev->funcs->pSetTextAlign(physdev, va_arg(argptr, UINT));
1020  return physdev->funcs->pSetTextCharacterExtra(physdev, va_arg(argptr, INT));
1021  case DCFUNC_SetTextColor:
1022  return physdev->funcs->pSetTextColor(physdev, va_arg(argptr, COLORREF));
1024  return physdev->funcs->pSetTextJustification(physdev,
1025  _va_arg_n(argptr, INT, 0),
1026  _va_arg_n(argptr, INT, 1));
1028  return physdev->funcs->pSetViewportExtEx(physdev,
1029  _va_arg_n(argptr, INT, 0), // nXExtent
1030  _va_arg_n(argptr, INT, 1), // nYExtent
1031  _va_arg_n(argptr, LPSIZE, 2)); // lpSize
1033  return physdev->funcs->pSetViewportOrgEx(physdev,
1034  _va_arg_n(argptr, INT, 0), // X
1035  _va_arg_n(argptr, INT, 1), // Y
1036  _va_arg_n(argptr, LPPOINT, 2)); // lpPoint
1037  case DCFUNC_SetWindowExtEx:
1038  return physdev->funcs->pSetWindowExtEx(physdev,
1039  _va_arg_n(argptr, INT, 0), // nXExtent
1040  _va_arg_n(argptr, INT, 1), // nYExtent
1041  _va_arg_n(argptr, LPSIZE, 2)); // lpSize
1042  case DCFUNC_SetWindowOrgEx:
1043  return physdev->funcs->pSetWindowOrgEx(physdev,
1044  _va_arg_n(argptr, INT, 0), // X
1045  _va_arg_n(argptr, INT, 1), // Y
1046  _va_arg_n(argptr, LPPOINT, 2)); // lpPoint
1047  case DCFUNC_StretchBlt:
1048  return DRIVER_StretchBlt(physdev,
1049  physdev->hdc,
1050  _va_arg_n(argptr, INT, 0),
1051  _va_arg_n(argptr, INT, 1),
1052  _va_arg_n(argptr, INT, 2),
1053  _va_arg_n(argptr, INT, 3),
1054  _va_arg_n(argptr, HDC, 4),
1055  _va_arg_n(argptr, INT, 5),
1056  _va_arg_n(argptr, INT, 6),
1057  _va_arg_n(argptr, INT, 7),
1058  _va_arg_n(argptr, INT, 8),
1059  _va_arg_n(argptr, DWORD, 9));
1061  return physdev->funcs->pStrokeAndFillPath(physdev);
1062  case DCFUNC_StrokePath:
1063  return physdev->funcs->pStrokePath(physdev);
1064  case DCFUNC_WidenPath:
1065  return physdev->funcs->pWidenPath(physdev);
1066  case DCFUNC_AngleArc:
1067  return physdev->funcs->pAngleArc(physdev,
1068  _va_arg_n(argptr, INT, 0),
1069  _va_arg_n(argptr, INT, 1),
1070  _va_arg_n(argptr, DWORD, 2),
1071  _va_arg_n(argptr, FLOAT, 3),
1072  _va_arg_n(argptr, FLOAT, 4 ));
1073  case DCFUNC_ArcTo:
1074  return physdev->funcs->pArcTo(physdev,
1075  _va_arg_n(argptr, INT, 0),
1076  _va_arg_n(argptr, INT, 1),
1077  _va_arg_n(argptr, INT, 2),
1078  _va_arg_n(argptr, INT, 3),
1079  _va_arg_n(argptr, INT, 4),
1080  _va_arg_n(argptr, INT, 5),
1081  _va_arg_n(argptr, INT, 6),
1082  _va_arg_n(argptr, INT, 7));
1083  case DCFUNC_GradientFill:
1084  return physdev->funcs->pGradientFill(physdev,
1085  _va_arg_n(argptr, TRIVERTEX *, 0),
1086  _va_arg_n(argptr, ULONG, 1),
1087  _va_arg_n(argptr, void *, 2),
1088  _va_arg_n(argptr, ULONG , 3),
1089  _va_arg_n(argptr, ULONG , 4));
1090  case DCFUNC_PathToRegion:
1091  return (DWORD_PTR)DRIVER_PathToRegion(physdev);
1092 
1093  /* These are not implemented in wine */
1094  case DCFUNC_AlphaBlend:
1095  case DCFUNC_MaskBlt:
1096  case DCFUNC_PlgBlt:
1097  case DCFUNC_TransparentBlt:
1098  UNIMPLEMENTED;
1099  return 0;
1100 
1101  default:
1102  __debugbreak();
1103  return 0;
1104  }
1105 }
#define HDC
Definition: msvc.h:22
#define _va_arg_n(p, t, i)
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel)?(CompletionRoutine!=NULL):TRUE)
#define HRGN
Definition: msvc.h:39
static HPEN DRIVER_SelectPen(PHYSDEV physdev, HPEN hpen, const struct brush_pattern *pattern)
Definition: rosglue.c:697
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
void __cdecl __debugbreak(void)
Definition: intrin_ppc.h:698
int32_t INT
Definition: typedefs.h:56
DWORD DWORD
Definition: winlogon.h:75
static BOOL DRIVER_PatBlt(_In_ PHYSDEV physdev, _In_ HDC hdc, _In_ INT xLeft, _In_ INT yTop, _In_ INT cx, _In_ INT cy, _In_ DWORD dwRop)
Definition: rosglue.c:612
static BOOL DRIVER_RestoreDC(PHYSDEV physdev, INT level)
Definition: rosglue.c:662
#define FALSE
Definition: types.h:117
static BOOL DRIVER_StretchBlt(_In_ PHYSDEV physdev, _In_ HDC hdcDst, _In_ INT xDst, _In_ INT yDst, _In_ INT cxDst, _In_ INT cyDst, _In_opt_ HDC hdcSrc, _In_ INT xSrc, _In_ INT ySrc, _In_ INT cxSrc, _In_ INT cySrc, _In_ DWORD dwRop)
Definition: rosglue.c:630
smooth NULL
Definition: ftsmooth.c:557
static HRGN DRIVER_PathToRegion(PHYSDEV physdev)
Definition: rosglue.c:727
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
unsigned int BOOL
Definition: ntddk_ex.h:94
uint32_t DWORD_PTR
Definition: typedefs.h:63
unsigned char BYTE
Definition: ntddk_ex.h:96
static HFONT DRIVER_SelectFont(PHYSDEV physdev, HFONT hFont, UINT *aa_flags)
Definition: rosglue.c:682
#define va_arg(ap, T)
Definition: acmsvcex.h:89
unsigned int UINT
Definition: ndis.h:50
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
CONST void * LPCVOID
Definition: windef.h:214
float FLOAT
Definition: typedefs.h:67
unsigned int ULONG
Definition: retypes.h:1
#define UNIMPLEMENTED
Definition: debug.h:114
#define GDI_ERROR
Definition: wingdi.h:1290
DWORD COLORREF
Definition: windef.h:313
static HBRUSH DRIVER_SelectBrush(PHYSDEV physdev, HBRUSH hbrush, const struct brush_pattern *pattern)
Definition: rosglue.c:712
static BOOL DRIVER_PatBlt ( _In_ PHYSDEV  physdev,
_In_ HDC  hdc,
_In_ INT  xLeft,
_In_ INT  yTop,
_In_ INT  cx,
_In_ INT  cy,
_In_ DWORD  dwRop 
)
static

Definition at line 612 of file rosglue.c.

Referenced by DRIVER_Dispatch().

620 {
621  struct bitblt_coords coords;
622 
623  InitBitBltCoords(&coords, hdc, xLeft, yTop, cx, cy);
624 
625  return physdev->funcs->pPatBlt(physdev, &coords, dwRop);
626 }
GLuint coords
Definition: glext.h:7368
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:570
HDC hdc
Definition: msvc.h:53
static VOID InitBitBltCoords(struct bitblt_coords *coords, HDC hdc, int x, int y, int cx, int cy)
Definition: rosglue.c:579
_Out_opt_ int * cx
Definition: commctrl.h:570
static HRGN DRIVER_PathToRegion ( PHYSDEV  physdev)
static

Definition at line 727 of file rosglue.c.

Referenced by DRIVER_Dispatch().

728 {
729  DPRINT1("DRIVER_PathToRegion\n");
730  return (HRGN)physdev->funcs->pAbortPath( physdev );
731 }
#define HRGN
Definition: msvc.h:39
#define DPRINT1
Definition: precomp.h:8
const struct gdi_dc_funcs * funcs
Definition: gdi_driver.h:31
static BOOL DRIVER_RestoreDC ( PHYSDEV  physdev,
INT  level 
)
static

Definition at line 662 of file rosglue.c.

Referenced by DRIVER_Dispatch().

663 {
664  WINEDC *pWineDc = get_dc_ptr(physdev->hdc);
665 
667  {
668  /* The Restore DC function needs the save level to be set correctly.
669  Note that wine's level is 0 based, while our's is (like win) 1 based. */
670  pWineDc->saveLevel = GetDCDWord(physdev->hdc, GdiGetEMFRestorDc, 0) - 1;
671 
672  /* Fail if the level is not valid */
673  if ((abs(level) > pWineDc->saveLevel) || (level == 0))
674  return FALSE;
675  }
676 
677  return physdev->funcs->pRestoreDC(physdev,level);
678 }
#define abs(i)
Definition: fconv.c:206
GLint level
Definition: gl.h:1546
WINEDC * get_dc_ptr(HDC hdc)
Definition: rosglue.c:371
#define FALSE
Definition: types.h:117
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
DWORD WINAPI GetDCDWord(_In_ HDC hdc, _In_ UINT u, _In_ DWORD dwError)
Definition: dc.c:763
INT saveLevel
Definition: gdi_private.h:61
const struct gdi_dc_funcs * funcs
Definition: gdi_driver.h:31
static HBRUSH DRIVER_SelectBrush ( PHYSDEV  physdev,
HBRUSH  hbrush,
const struct brush_pattern pattern 
)
static

Definition at line 712 of file rosglue.c.

Referenced by DRIVER_Dispatch().

713 {
714  WINEDC *pWineDc = get_dc_ptr(physdev->hdc);
715  HBRUSH hOldBrush;
716 
717  if (!physdev->funcs->pSelectBrush(physdev, hbrush, pattern))
718  return 0;
719 
720  hOldBrush = pWineDc->hBrush;
721  pWineDc->hBrush = hbrush;
722  return hOldBrush;
723 }
WINEDC * get_dc_ptr(HDC hdc)
Definition: rosglue.c:371
static HBRUSH hbrush
HBRUSH hBrush
Definition: gdi_private.h:63
const struct gdi_dc_funcs * funcs
Definition: gdi_driver.h:31
static HFONT DRIVER_SelectFont ( PHYSDEV  physdev,
HFONT  hFont,
UINT aa_flags 
)
static

Definition at line 682 of file rosglue.c.

Referenced by DRIVER_Dispatch().

683 {
684  WINEDC *pWineDc = get_dc_ptr(physdev->hdc);
685  HFONT hOldFont;
686 
687  if (!physdev->funcs->pSelectFont(physdev, hFont, aa_flags))
688  return 0;
689 
690  hOldFont = pWineDc->hFont;
691  pWineDc->hFont = hFont;
692  return hOldFont;
693 }
WINEDC * get_dc_ptr(HDC hdc)
Definition: rosglue.c:371
HFONT hFont
Definition: main.c:53
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
const struct gdi_dc_funcs * funcs
Definition: gdi_driver.h:31
HFONT hFont
Definition: gdi_private.h:62
static HPEN DRIVER_SelectPen ( PHYSDEV  physdev,
HPEN  hpen,
const struct brush_pattern pattern 
)
static

Definition at line 697 of file rosglue.c.

Referenced by DRIVER_Dispatch().

698 {
699  WINEDC *pWineDc = get_dc_ptr(physdev->hdc);
700  HPEN hOldPen;
701 
702  if (!physdev->funcs->pSelectPen(physdev, hpen, pattern))
703  return 0;
704 
705  hOldPen = pWineDc->hPen;
706  pWineDc->hPen = hpen;
707  return hOldPen;
708 }
WINEDC * get_dc_ptr(HDC hdc)
Definition: rosglue.c:371
static HPEN hpen
HPEN hPen
Definition: gdi_private.h:64
const struct gdi_dc_funcs * funcs
Definition: gdi_driver.h:31
static BOOL DRIVER_StretchBlt ( _In_ PHYSDEV  physdev,
_In_ HDC  hdcDst,
_In_ INT  xDst,
_In_ INT  yDst,
_In_ INT  cxDst,
_In_ INT  cyDst,
_In_opt_ HDC  hdcSrc,
_In_ INT  xSrc,
_In_ INT  ySrc,
_In_ INT  cxSrc,
_In_ INT  cySrc,
_In_ DWORD  dwRop 
)
static

Definition at line 630 of file rosglue.c.

Referenced by DRIVER_Dispatch().

643 {
644  struct bitblt_coords coordsDst, coordsSrc;
645  struct gdi_physdev physdevSrc = {0};
646 
647  /* Source cannot be a metafile */
649  return FALSE;
650 
651  /* Source physdev uses only hdc and func */
652  physdevSrc.hdc = hdcSrc;
653 
654  InitBitBltCoords(&coordsDst, hdcDst, xDst, yDst, cxDst, cyDst);
655  InitBitBltCoords(&coordsSrc, hdcSrc, xSrc, ySrc, cxSrc, cySrc);
656 
657  return physdev->funcs->pStretchBlt(physdev, &coordsDst, &physdevSrc, &coordsSrc, dwRop);
658 }
int int int int int int ySrc
Definition: wglext.h:473
static HDC hdcSrc
Definition: xlate.c:32
#define FALSE
Definition: types.h:117
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
static HDC hdcDst
Definition: xlate.c:32
static VOID InitBitBltCoords(struct bitblt_coords *coords, HDC hdc, int x, int y, int cx, int cy)
Definition: rosglue.c:579
int int int int int xSrc
Definition: wglext.h:473
VOID free_dc_ptr ( WINEDC pWineDc)

Definition at line 346 of file rosglue.c.

347 {
348  /* Invoke the DeleteDC callback to clean up the DC */
349  pWineDc->physDev->funcs->pDeleteDC(pWineDc->physDev);
350 
351  /* FIXME */
353  {
354  /* Get rid of the LDC */
355  ASSERT((WINEDC*)GdiGetLDC(pWineDc->hdc) == pWineDc);
356  GdiSetLDC(pWineDc->hdc, NULL);
357 
358  /* Free the DC */
359  NtGdiDeleteObjectApp(pWineDc->hdc);
360  }
362  {
363  GdiDeleteClientObj(pWineDc->hdc);
364  }
365 
366  /* Free the Wine DC */
367  HeapFree(GetProcessHeap(), 0, pWineDc);
368 }
BOOL FASTCALL GdiSetLDC(HDC hdc, PVOID pvLDC)
Definition: misc.c:789
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel)?(CompletionRoutine!=NULL):TRUE)
PHYSDEV physDev
Definition: gdi_private.h:59
smooth NULL
Definition: ftsmooth.c:557
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
PLDC FASTCALL GdiGetLDC(HDC hDC)
Definition: misc.c:772
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI GdiDeleteClientObj(_In_ HGDIOBJ hobj)
Definition: clientobj.c:173
__kernel_entry W32KAPI BOOL APIENTRY NtGdiDeleteObjectApp(_In_ HANDLE hobj)
const struct gdi_dc_funcs * funcs
Definition: gdi_driver.h:31
#define HeapFree(x, y, z)
Definition: compat.h:394
PVOID free_gdi_handle ( HGDIOBJ  hobj)

Definition at line 243 of file rosglue.c.

Referenced by DeleteMetaFile(), and EMF_Delete_HENHMETAFILE().

244 {
245  /* Should be a client object */
246  return GdiDeleteClientObj(hobj);
247 }
PVOID WINAPI GdiDeleteClientObj(_In_ HGDIOBJ hobj)
Definition: clientobj.c:173
PVOID GDI_GetObjPtr ( HGDIOBJ  hobj,
WORD  wType 
)

Definition at line 250 of file rosglue.c.

Referenced by EMF_GetEnhMetaHeader(), get_metafile_bits(), and GetMetaFileBitsEx().

253 {
254  GDILOOBJTYPE eObjType;
255 
256  /* Check if the object type matches */
257  eObjType = ConvertObjectType(wType);
258  if ((eObjType == 0) || (GDI_HANDLE_GET_TYPE(hobj) != eObjType))
259  {
260  return NULL;
261  }
262 
263  /* Check if we have an ALTDC */
264  if (eObjType == GDILoObjType_LO_ALTDC_TYPE)
265  {
266  /* Object is stored as LDC */
267  return GdiGetLDC(hobj);
268  }
269 
270  /* Check for client objects */
271  if ((eObjType == GDILoObjType_LO_METAFILE_TYPE) ||
272  (eObjType == GDILoObjType_LO_METAFILE16_TYPE) ||
273  (eObjType == GDILoObjType_LO_METADC16_TYPE))
274  {
275  return GdiGetClientObjLink(hobj);
276  }
277 
278  /* This should never happen! */
279  ASSERT(FALSE);
280  return NULL;
281 }
PVOID WINAPI GdiGetClientObjLink(_In_ HGDIOBJ hobj)
Definition: clientobj.c:61
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel)?(CompletionRoutine!=NULL):TRUE)
#define FALSE
Definition: types.h:117
smooth NULL
Definition: ftsmooth.c:557
static GDILOOBJTYPE ConvertObjectType(WORD wType)
Definition: rosglue.c:195
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
PLDC FASTCALL GdiGetLDC(HDC hDC)
Definition: misc.c:772
enum GDILoObjType GDILOOBJTYPE
VOID GDI_hdc_not_using_object ( HGDIOBJ  hobj,
HDC  hdc 
)

Definition at line 425 of file rosglue.c.

Referenced by EMFDRV_DeleteDC(), and MFDRV_DeleteDC().

428 {
429  HDC hdcLink;
430 
431  /* Remove the HDC link for the object */
432  hdcLink = GdiRemoveClientObjLink(hobj);
433  ASSERT(hdcLink == hdc);
434 }
#define HDC
Definition: msvc.h:22
PVOID WINAPI GdiRemoveClientObjLink(_In_ HGDIOBJ hobj)
Definition: clientobj.c:98
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel)?(CompletionRoutine!=NULL):TRUE)
HDC hdc
Definition: msvc.h:53
VOID GDI_hdc_using_object ( HGDIOBJ  hobj,
HDC  hdc 
)

Definition at line 409 of file rosglue.c.

Referenced by EMFDRV_SelectBrush(), EMFDRV_SelectFont(), EMFDRV_SelectPalette(), EMFDRV_SelectPen(), EMFDRV_SetDCBrushColor(), EMFDRV_SetDCPenColor(), MFDRV_SelectBrush(), MFDRV_SelectFont(), and MFDRV_SelectPen().

412 {
413  /* Record that we have an object in use by a METADC. We simply link the
414  object to the HDC that we use. Wine API does not give us a way to
415  respond to failure, so we silently ignore it */
416  if (!GdiCreateClientObjLink(hobj, hdc))
417  {
418  /* Ignore failure, and return */
419  DPRINT1("Failed to create link for selected METADC object.\n");
420  return;
421  }
422 }
BOOL WINAPI GdiCreateClientObjLink(_In_ HGDIOBJ hobj, _In_ PVOID pvObject)
Definition: clientobj.c:24
HDC hdc
Definition: msvc.h:53
#define DPRINT1
Definition: precomp.h:8
VOID GDI_ReleaseObj ( HGDIOBJ  hobj)

Definition at line 284 of file rosglue.c.

Referenced by EMF_GetEnhMetaHeader(), get_metafile_bits(), and GetMetaFileBitsEx().

285 {
286  /* We don't do any reference-counting */
287 }
BOOL get_brush_bitmap_info ( HBRUSH  hbr,
PBITMAPINFO  pbmi,
PVOID ppvBits,
PUINT  puUsage 
)

Definition at line 466 of file rosglue.c.

471 {
472  HBITMAP hbmp;
473  HDC hdc;
474 
475  /* Call win32k to get the bitmap handle and color usage */
476  hbmp = NtGdiGetObjectBitmapHandle(hbr, puUsage);
477  if (hbmp == NULL)
478  return FALSE;
479 
480  hdc = GetDC(NULL);
481  if (hdc == NULL)
482  return FALSE;
483 
484  /* Initialize the BITMAPINFO */
485  ZeroMemory(pbmi, sizeof(*pbmi));
486  pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
487 
488  /* Retrieve information about the bitmap */
489  if (!GetDIBits(hdc, hbmp, 0, 0, NULL, pbmi, *puUsage))
490  return FALSE;
491 
492  /* Now allocate a buffer for the bits */
493  *ppvBits = HeapAlloc(GetProcessHeap(), 0, pbmi->bmiHeader.biSizeImage);
494  if (*ppvBits == NULL)
495  return FALSE;
496 
497  /* Retrieve the bitmap bits */
498  if (!GetDIBits(hdc, hbmp, 0, pbmi->bmiHeader.biHeight, *ppvBits, pbmi, *puUsage))
499  {
500  HeapFree(GetProcessHeap(), 0, *ppvBits);
501  *ppvBits = NULL;
502  return FALSE;
503  }
504 
505  /* GetDIBits doesn't set biClrUsed, but wine code needs it, so we set it */
506  if (pbmi->bmiHeader.biBitCount <= 8)
507  {
508  pbmi->bmiHeader.biClrUsed = 1 << pbmi->bmiHeader.biBitCount;
509  }
510 
511  return TRUE;
512 }
#define HDC
Definition: msvc.h:22
#define TRUE
Definition: types.h:120
#define HBITMAP
Definition: msvc.h:28
BITMAPINFOHEADER bmiHeader
Definition: wingdi.h:1453
HDC WINAPI GetDC(_In_opt_ HWND)
struct tagBITMAPINFOHEADER BITMAPINFOHEADER
#define ZeroMemory
Definition: winbase.h:1621
#define FALSE
Definition: types.h:117
HDC hdc
Definition: msvc.h:53
smooth NULL
Definition: ftsmooth.c:557
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__kernel_entry W32KAPI HBITMAP APIENTRY NtGdiGetObjectBitmapHandle(_In_ HBRUSH hbr, _Out_ UINT *piUsage)
Definition: brush.cpp:502
DWORD biSizeImage
Definition: amvideo.idl:36
int WINAPI GetDIBits(_In_ HDC hdc, _In_ HBITMAP hbm, _In_ UINT start, _In_ UINT cLines, _Out_opt_ LPVOID lpvBits, _At_((LPBITMAPINFOHEADER) lpbmi, _Inout_) LPBITMAPINFO lpbmi, _In_ UINT usage)
HBITMAP hbmp
Definition: msvc.h:60
#define HeapFree(x, y, z)
Definition: compat.h:394
WINEDC* get_dc_ptr ( HDC  hdc)

Definition at line 371 of file rosglue.c.

Referenced by CloseEnhMetaFile(), DRIVER_RestoreDC(), DRIVER_SelectBrush(), DRIVER_SelectFont(), DRIVER_SelectPen(), GetPhysDev(), and MFDRV_CloseMetaFile().

372 {
373  /* Check for EMF DC */
375  {
376  /* The Wine DC is stored as the LDC */
377  return (WINEDC*)GdiGetLDC(hdc);
378  }
379 
380  /* Check for METADC16 */
382  {
383  return GdiGetClientObjLink(hdc);
384  }
385 
386  return NULL;
387 }
PVOID WINAPI GdiGetClientObjLink(_In_ HGDIOBJ hobj)
Definition: clientobj.c:61
HDC hdc
Definition: msvc.h:53
smooth NULL
Definition: ftsmooth.c:557
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
PLDC FASTCALL GdiGetLDC(HDC hDC)
Definition: misc.c:772
WINEDC* get_nulldrv_dc ( PHYSDEV  dev)

Definition at line 181 of file rosglue.c.

Referenced by get_physdev_dc(), and nulldrv_BeginPath().

182 {
183  return CONTAINING_RECORD( dev, WINEDC, NullPhysDev );
184 }
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:259
WINEDC* get_physdev_dc ( PHYSDEV  dev)

Definition at line 186 of file rosglue.c.

Referenced by EMFDRV_ArcChordPie(), EMFDRV_BeginPath(), EMFDRV_Ellipse(), EMFDRV_ExtTextOut(), EMFDRV_LineTo(), EMFDRV_Polylinegon(), EMFDRV_Rectangle(), EMFDRV_RestoreDC(), EMFDRV_RoundRect(), EMFDRV_SetDCBrushColor(), EMFDRV_SetDCPenColor(), emfdrv_stroke_and_fill_path(), emfpathdrv_AbortPath(), emfpathdrv_EndPath(), pathdrv_AbortPath(), and pathdrv_EndPath().

187 {
188  while (dev->funcs != &DummyPhysDevFuncs)
189  dev = dev->next;
190  return get_nulldrv_dc( dev );
191 }
static const struct gdi_dc_funcs DummyPhysDevFuncs
Definition: rosglue.c:46
struct gdi_physdev * next
Definition: gdi_driver.h:32
WINEDC * get_nulldrv_dc(PHYSDEV dev)
Definition: rosglue.c:181
const struct gdi_dc_funcs * funcs
Definition: gdi_driver.h:31
static PHYSDEV GetPhysDev ( HDC  hdc)
static

Definition at line 596 of file rosglue.c.

Referenced by METADC_DeleteObject(), METADC_Dispatch(), METADC_GetAndSetDCDWord(), and SetWorldTransformForMetafile().

598 {
599  WINEDC *pWineDc;
600 
601  pWineDc = get_dc_ptr(hdc);
602  if (pWineDc == NULL)
603  {
604  return NULL;
605  }
606 
607  return pWineDc->physDev;
608 }
WINEDC * get_dc_ptr(HDC hdc)
Definition: rosglue.c:371
PHYSDEV physDev
Definition: gdi_private.h:59
HDC hdc
Definition: msvc.h:53
smooth NULL
Definition: ftsmooth.c:557
static VOID InitBitBltCoords ( struct bitblt_coords coords,
HDC  hdc,
int  x,
int  y,
int  cx,
int  cy 
)
static

Definition at line 579 of file rosglue.c.

Referenced by DRIVER_PatBlt(), and DRIVER_StretchBlt().

586 {
587  coords->log_x = x;
588  coords->log_y = y;
589  coords->log_width = cx;
590  coords->log_height = cy;
591  coords->layout = GetLayout(hdc);
592 }
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:570
HDC hdc
Definition: msvc.h:53
DWORD layout
Definition: gdi_driver.h:47
DWORD WINAPI GetLayout(_In_ HDC hdc)
Definition: coord.c:729
_Out_opt_ int * cx
Definition: commctrl.h:570
INT INT y
Definition: msvc.h:62
INT x
Definition: msvc.h:62
INT WINAPI METADC16_Escape ( _In_ HDC  hdc,
_In_ INT  nEscape,
_In_ INT  cbInput,
_In_ LPCSTR  lpvInData,
_Out_ LPVOID  lpvOutData 
)

Definition at line 1262 of file rosglue.c.

Referenced by Escape().

1268 {
1269  DWORD_PTR dwResult;
1270 
1271  /* Do not record MFCOMMENT */
1272  if (nEscape == MFCOMMENT)
1273  {
1274  // HACK required by wine code...
1275  //return 1;
1276  }
1277 
1279  &dwResult,
1280  SP_ERROR,
1281  hdc,
1282  nEscape,
1283  cbInput,
1284  lpvInData,
1285  lpvOutData);
1286 
1287  return (INT)dwResult;
1288 }
#define SP_ERROR
Definition: wingdi.h:316
#define MFCOMMENT
Definition: wingdi.h:996
int32_t INT
Definition: typedefs.h:56
HDC hdc
Definition: msvc.h:53
uint32_t DWORD_PTR
Definition: typedefs.h:63
BOOL METADC_Dispatch(_In_ DCFUNC eFunction, _Out_ PDWORD_PTR pdwResult, _In_ DWORD_PTR dwError, _In_ HDC hdc,...)
Definition: rosglue.c:1108
BOOL WINAPI METADC_DeleteDC ( _In_ HDC  hdc)

Definition at line 1247 of file rosglue.c.

Referenced by DeleteDC().

1249 {
1250  /* Only ALTDCs are supported */
1252  {
1253  DPRINT1("Trying to delete METADC %p\n", hdc);
1254  return FALSE;
1255  }
1256  // FIXME call the driver?
1257  return NtGdiDeleteObjectApp(hdc);
1258 }
#define FALSE
Definition: types.h:117
HDC hdc
Definition: msvc.h:53
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
__kernel_entry W32KAPI BOOL APIENTRY NtGdiDeleteObjectApp(_In_ HANDLE hobj)
#define DPRINT1
Definition: precomp.h:8
VOID WINAPI METADC_DeleteObject ( HGDIOBJ  hobj)

Definition at line 1206 of file rosglue.c.

Referenced by DeleteObject().

1207 {
1208  GDILOOBJTYPE eObjectType;
1209  HDC hdc;
1210  PHYSDEV physdev;
1211 
1212  /* Check for one of the types we actually handle here */
1213  eObjectType = GDI_HANDLE_GET_TYPE(hobj);
1214  if ((eObjectType != GDILoObjType_LO_BRUSH_TYPE) &&
1215  (eObjectType != GDILoObjType_LO_PEN_TYPE) &&
1216  (eObjectType != GDILoObjType_LO_EXTPEN_TYPE) &&
1217  (eObjectType != GDILoObjType_LO_PALETTE_TYPE) &&
1218  (eObjectType != GDILoObjType_LO_FONT_TYPE))
1219  {
1220  return;
1221  }
1222 
1223  /* Check if we have a client object link and remove it if it was found.
1224  The link is the HDC that the object was selected into. */
1225  hdc = GdiRemoveClientObjLink(hobj);
1226  if (hdc == NULL)
1227  {
1228  /* The link was not found, so we are not handling this object here */
1229  return;
1230  }
1231 
1232  /* Get the physdev */
1233  physdev = GetPhysDev(hdc);
1234  if (physdev == NULL)
1235  {
1236  /* This happens, when the METADC is already closed, when we delete
1237  the object. Simply ignore it */
1238  DPRINT1("METADC was already closed, cannot delete object. Ignoring.\n");
1239  return;
1240  }
1241 
1242  physdev->funcs->pDeleteObject(physdev, hobj);
1243 }
#define HDC
Definition: msvc.h:22
PVOID WINAPI GdiRemoveClientObjLink(_In_ HGDIOBJ hobj)
Definition: clientobj.c:98
HDC hdc
Definition: msvc.h:53
smooth NULL
Definition: ftsmooth.c:557
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
#define DPRINT1
Definition: precomp.h:8
const struct gdi_dc_funcs * funcs
Definition: gdi_driver.h:31
enum GDILoObjType GDILOOBJTYPE
static PHYSDEV GetPhysDev(HDC hdc)
Definition: rosglue.c:596
BOOL METADC_Dispatch ( _In_ DCFUNC  eFunction,
_Out_ PDWORD_PTR  pdwResult,
_In_ DWORD_PTR  dwError,
_In_ HDC  hdc,
  ... 
)

Definition at line 1108 of file rosglue.c.

Referenced by METADC16_Escape().

1114 {
1115  PHYSDEV physdev;
1116  va_list argptr;
1117 
1118  /* Handle only METADC16 and ALTDC */
1121  {
1122  /* Let the caller handle it */
1123  return FALSE;
1124  }
1125 
1126  physdev = GetPhysDev(hdc);
1127  if (physdev == NULL)
1128  {
1130  *pdwResult = dwError;
1131  return TRUE;
1132  }
1133 
1134  i = eFunction;
1135  va_start(argptr, hdc);
1136  *pdwResult = DRIVER_Dispatch(physdev, eFunction, argptr);
1137  va_end(argptr);
1138  i = 0;
1139 
1140  /* Return TRUE to indicate that we want to return from the parent */
1142  (*pdwResult == dwError));
1143 }
#define TRUE
Definition: types.h:120
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
#define va_end(ap)
Definition: acmsvcex.h:90
#define FALSE
Definition: types.h:117
HDC hdc
Definition: msvc.h:53
smooth NULL
Definition: ftsmooth.c:557
char * va_list
Definition: acmsvcex.h:78
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
#define SetLastError(x)
Definition: compat.h:409
static INT i
Definition: rosglue.c:22
_In_ UINT _In_ DWORD _Out_ DWORD * pdwResult
Definition: ntgdi.h:248
static DWORD_PTR DRIVER_Dispatch(_In_ PHYSDEV physdev, _In_ DCFUNC eFunction, _In_ va_list argptr)
Definition: rosglue.c:736
#define va_start(ap, A)
Definition: acmsvcex.h:91
static PHYSDEV GetPhysDev(HDC hdc)
Definition: rosglue.c:596
BOOL WINAPI METADC_GetAndSetDCDWord ( _Out_ DWORD pdwResult,
_In_ HDC  hdc,
_In_ UINT  uFunction,
_In_ DWORD  dwIn,
_In_ ULONG  ulMFId,
_In_ USHORT  usMF16Id,
_In_ DWORD  dwError 
)

Definition at line 1147 of file rosglue.c.

1155 {
1156  PHYSDEV physdev;
1157 
1158  /* Ignore these, we let wine code handle this */
1159  UNREFERENCED_PARAMETER(ulMFId);
1160  UNREFERENCED_PARAMETER(usMF16Id);
1161 
1162  physdev = GetPhysDev(hdc);
1163  if (physdev == NULL)
1164  {
1166  *pdwResult = dwError;
1167  return TRUE;
1168  }
1169 
1170  /* Check the function */
1171  switch (uFunction)
1172  {
1173  case GdiGetSetMapMode:
1174  *pdwResult = physdev->funcs->pSetMapMode(physdev, dwIn);
1175  break;
1176 
1177  case GdiGetSetArcDirection:
1179  *pdwResult = 0;
1180  else
1181  *pdwResult = physdev->funcs->pSetArcDirection(physdev, dwIn);
1182  break;
1183 
1184  case GdiGetSetRelAbs:
1186  *pdwResult = physdev->funcs->pSetRelAbs(physdev, dwIn);
1187  else
1188  {
1189  UNIMPLEMENTED;
1190  *pdwResult = 0;
1191  }
1192  break;
1193 
1194 
1195  default:
1196  __debugbreak();
1197  }
1198 
1199  /* Return TRUE to indicate that we want to return from the parent */
1201  (*pdwResult == dwError));
1202 }
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:315
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
void __cdecl __debugbreak(void)
Definition: intrin_ppc.h:698
HDC hdc
Definition: msvc.h:53
smooth NULL
Definition: ftsmooth.c:557
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
#define SetLastError(x)
Definition: compat.h:409
_In_ UINT _In_ DWORD _Out_ DWORD * pdwResult
Definition: ntgdi.h:248
_In_ UINT _In_ DWORD dwIn
Definition: ntgdi.h:248
#define UNIMPLEMENTED
Definition: debug.h:114
const struct gdi_dc_funcs * funcs
Definition: gdi_driver.h:31
static PHYSDEV GetPhysDev(HDC hdc)
Definition: rosglue.c:596
static INT NULL_ExcludeClipRect ( PHYSDEV  dev,
INT  left,
INT  top,
INT  right,
INT  bottom 
)
static

Definition at line 44 of file rosglue.c.

44 { return 1; }
static INT NULL_ExtSelectClipRgn ( PHYSDEV  dev,
HRGN  hrgn,
INT  iMode 
)
static

Definition at line 41 of file rosglue.c.

41 { return 1; }
static INT NULL_IntersectClipRect ( PHYSDEV  dev,
INT  left,
INT  top,
INT  right,
INT  bottom 
)
static

Definition at line 42 of file rosglue.c.

42 { return 1; }
static INT NULL_OffsetClipRgn ( PHYSDEV  dev,
INT  x,
INT  y 
)
static

Definition at line 43 of file rosglue.c.

43 { return SIMPLEREGION; }
#define SIMPLEREGION
Definition: wingdi.h:360
static BOOL NULL_RestoreDC ( PHYSDEV  dev,
INT  level 
)
static

Definition at line 34 of file rosglue.c.

34 { return TRUE; }
#define TRUE
Definition: types.h:120
static INT NULL_SaveDC ( PHYSDEV  dev)
static

Definition at line 33 of file rosglue.c.

33 { return 1; }
static HFONT NULL_SelectFont ( PHYSDEV  dev,
HFONT  hFont,
UINT aa_flags 
)
static

Definition at line 36 of file rosglue.c.

36 { return NULL; }
smooth NULL
Definition: ftsmooth.c:557
static INT NULL_SetMapMode ( PHYSDEV  dev,
INT  iMode 
)
static

Definition at line 35 of file rosglue.c.

35 { return 1; }
static BOOL NULL_SetViewportExtEx ( PHYSDEV  dev,
INT  cx,
INT  cy,
SIZE size 
)
static

Definition at line 38 of file rosglue.c.

38 { return TRUE; }
#define TRUE
Definition: types.h:120
static BOOL NULL_SetViewportOrgEx ( PHYSDEV  dev,
INT  x,
INT  y,
POINT pt 
)
static

Definition at line 40 of file rosglue.c.

40 { return TRUE; }
#define TRUE
Definition: types.h:120
static BOOL NULL_SetWindowExtEx ( PHYSDEV  dev,
INT  cx,
INT  cy,
SIZE size 
)
static

Definition at line 37 of file rosglue.c.

37 { return TRUE; }
#define TRUE
Definition: types.h:120
static BOOL NULL_SetWindowOrgEx ( PHYSDEV  dev,
INT  x,
INT  y,
POINT pt 
)
static

Definition at line 39 of file rosglue.c.

39 { return TRUE; }
#define TRUE
Definition: types.h:120
static INT_PTR NULL_Unused ( )
static

Definition at line 26 of file rosglue.c.

27 {
28  DPRINT1("NULL_Unused %d\n",i);
29  // __debugbreak();
30  return 0;
31 }
static INT i
Definition: rosglue.c:22
#define DPRINT1
Definition: precomp.h:8
BOOL nulldrv_AbortPath ( PHYSDEV  dev)

Definition at line 354 of file path.c.

355 {
356  //DC *dc = get_nulldrv_dc( dev );
357  DPRINT("nulldrv_AbortPath dev %p\n",dev);
358  //if (dc->path) free_gdi_path( dc->path );
359  //dc->path = NULL;
360  return TRUE;
361 }
#define TRUE
Definition: types.h:120
void DPRINT(...)
Definition: polytest.cpp:61
BOOL nulldrv_BeginPath ( PHYSDEV  dev)

Definition at line 331 of file path.c.

332 {
333  DC *dc = get_nulldrv_dc( dev );
334  struct path_physdev *physdev;
335 
336  if (!path_driver.pCreateDC( &dc->physDev, NULL, NULL, NULL, NULL ))
337  {
338  return FALSE;
339  }
340  physdev = get_path_physdev( find_dc_driver( dc, &path_driver ));
341  physdev->HasPathHook = TRUE;
342  DPRINT("nulldrv_BeginPath dev %p\n",dev);
343  DPRINT("nulldrv_BeginPath pd %p\n",physdev);
344  return TRUE;
345 }
#define TRUE
Definition: types.h:120
static PHYSDEV find_dc_driver(DC *dc, const struct gdi_dc_funcs *funcs)
Definition: gdi_private.h:137
HDC dc
Definition: cylfrac.c:34
static struct path_physdev * get_path_physdev(PHYSDEV dev)
Definition: path.c:23
#define FALSE
Definition: types.h:117
const struct gdi_dc_funcs path_driver
Definition: path.c:440
smooth NULL
Definition: ftsmooth.c:557
void DPRINT(...)
Definition: polytest.cpp:61
BOOL HasPathHook
Definition: path.c:20
Definition: polytest.cpp:40
WINEDC * get_nulldrv_dc(PHYSDEV dev)
Definition: rosglue.c:181
BOOL nulldrv_CloseFigure ( PHYSDEV  dev)

Definition at line 363 of file path.c.

364 {
365  DPRINT("nulldrv_CloseFigure dev %p\n",dev);
367  return FALSE;
368 }
#define FALSE
Definition: types.h:117
#define ERROR_CAN_NOT_COMPLETE
Definition: winerror.h:582
void DPRINT(...)
Definition: polytest.cpp:61
#define SetLastError(x)
Definition: compat.h:409
BOOL nulldrv_EndPath ( PHYSDEV  dev)

Definition at line 347 of file path.c.

348 {
349  DPRINT("nulldrv_EndPath dev %p\n",dev);
351  return FALSE;
352 }
#define FALSE
Definition: types.h:117
#define ERROR_CAN_NOT_COMPLETE
Definition: winerror.h:582
void DPRINT(...)
Definition: polytest.cpp:61
#define SetLastError(x)
Definition: compat.h:409
BOOL nulldrv_FillPath ( PHYSDEV  dev)

Definition at line 384 of file path.c.

385 {
386  DPRINT("nulldrv_FillPath dev %p\n",dev);
387  //if (GetPath( dev->hdc, NULL, NULL, 0 ) == -1) return FALSE;
388  //AbortPath( dev->hdc );
389  return TRUE;
390 }
#define TRUE
Definition: types.h:120
void DPRINT(...)
Definition: polytest.cpp:61
BOOL nulldrv_FlattenPath ( PHYSDEV  dev)

Definition at line 408 of file path.c.

409 {
410 /* DC *dc = get_nulldrv_dc( dev );
411  struct gdi_path *path; */
412  DPRINT("nulldrv_FlattenPath dev %p\n",dev);
413 /* if (!dc->path)
414  {
415  SetLastError( ERROR_CAN_NOT_COMPLETE );
416  return FALSE;
417  }
418  if (!(path = PATH_FlattenPath( dc->path ))) return FALSE;
419  free_gdi_path( dc->path );
420  dc->path = path;*/
421  return TRUE;
422 }
#define TRUE
Definition: types.h:120
void DPRINT(...)
Definition: polytest.cpp:61
BOOL nulldrv_SelectClipPath ( PHYSDEV  dev,
INT  mode 
)

Definition at line 370 of file path.c.

371 {
372  BOOL ret = FALSE;
373  HRGN hrgn = PathToRegion( dev->hdc );
374  DPRINT("nulldrv_SelectClipPath dev %p\n",dev);
375  if (hrgn)
376  {
377  ret = ExtSelectClipRgn( dev->hdc, hrgn, mode ) != ERROR;
378  DeleteObject( hrgn );
379  }
380  return ret;
381 // return TRUE;
382 }
#define HRGN
Definition: msvc.h:39
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#define ERROR(err)
Definition: vbo_exec_api.c:413
DWORD ret
Definition: path.c:52
int WINAPI ExtSelectClipRgn(_In_ HDC, _In_opt_ HRGN, _In_ int)
#define FALSE
Definition: types.h:117
void DPRINT(...)
Definition: polytest.cpp:61
unsigned int BOOL
Definition: ntddk_ex.h:94
HRGN WINAPI PathToRegion(HDC hdc)
Definition: path.c:120
static HRGN hrgn
Definition: win.c:68
BOOL nulldrv_StrokeAndFillPath ( PHYSDEV  dev)

Definition at line 392 of file path.c.

393 {
394  DPRINT("nulldrv_StrokeAndFillPath dev %p\n",dev);
395  //if (GetPath( dev->hdc, NULL, NULL, 0 ) == -1) return FALSE;
396  //AbortPath( dev->hdc );
397  return TRUE;
398 }
#define TRUE
Definition: types.h:120
void DPRINT(...)
Definition: polytest.cpp:61
BOOL nulldrv_StrokePath ( PHYSDEV  dev)

Definition at line 400 of file path.c.

401 {
402  DPRINT("nulldrv_StrokePath dev %p\n",dev);
403  //if (GetPath( dev->hdc, NULL, NULL, 0 ) == -1) return FALSE;
404  //AbortPath( dev->hdc );
405  return TRUE;
406 }
#define TRUE
Definition: types.h:120
void DPRINT(...)
Definition: polytest.cpp:61
BOOL nulldrv_WidenPath ( PHYSDEV  dev)

Definition at line 424 of file path.c.

425 {
426 /* DC *dc = get_nulldrv_dc( dev );
427  struct gdi_path *path;*/
428  DPRINT("nulldrv_WidenPath dev %p\n",dev);
429 /* if (!dc->path)
430  {
431  SetLastError( ERROR_CAN_NOT_COMPLETE );
432  return FALSE;
433  }
434  if (!(path = PATH_WidenPath( dc ))) return FALSE;
435  free_gdi_path( dc->path );
436  dc->path = path;*/
437  return TRUE;
438 }
#define TRUE
Definition: types.h:120
void DPRINT(...)
Definition: polytest.cpp:61
void push_dc_driver_ros ( PHYSDEV dev,
PHYSDEV  physdev,
const struct gdi_dc_funcs funcs 
)

Definition at line 396 of file rosglue.c.

400 {
401  while ((*dev)->funcs->priority > funcs->priority) dev = &(*dev)->next;
402  physdev->funcs = funcs;
403  physdev->next = *dev;
404  physdev->hdc = CONTAINING_RECORD(dev, WINEDC, physDev)->hdc;
405  *dev = physdev;
406 }
struct gdi_physdev * next
Definition: gdi_driver.h:32
static int dev
Definition: mkdosfs.c:536
static struct __wine_debug_functions funcs
Definition: debug.c:58
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:259
const struct gdi_dc_funcs * funcs
Definition: gdi_driver.h:31
VOID release_dc_ptr ( WINEDC dc)

Definition at line 390 of file rosglue.c.

391 {
392  /* We don't do any reference-counting */
393 }
BOOL WINAPI SetVirtualResolution ( HDC  hdc,
DWORD  cxVirtualDevicePixel,
DWORD  cyVirtualDevicePixel,
DWORD  cxVirtualDeviceMm,
DWORD  cyVirtualDeviceMm 
)

Definition at line 516 of file rosglue.c.

Referenced by CreateEnhMetaFileW(), and MFDRV_AllocMetaFile().

522 {
524  cxVirtualDevicePixel,
525  cyVirtualDevicePixel,
526  cxVirtualDeviceMm,
527  cyVirtualDeviceMm);
528 }
HDC hdc
Definition: msvc.h:53
__kernel_entry W32KAPI BOOL APIENTRY NtGdiSetVirtualResolution(_In_ HDC hdc, _In_ INT cxVirtualDevicePixel, _In_ INT cyVirtualDevicePixel, _In_ INT cxVirtualDeviceMm, _In_ INT cyVirtualDeviceMm)
BOOL WINAPI SetWorldTransformForMetafile ( _In_ HDC  hdc,
_Out_ CONST XFORM pxform 
)

Definition at line 540 of file rosglue.c.

543 {
545  {
546 #if 0
547  //HANDLE_METADC(BOOL, ModifyWorldTransform, FALSE, hdc, pxform, MWT_SET);
548  /* Get the physdev */
549  physdev = GetPhysDev(hdc);
550  if (physdev == NULL)
551  {
552  DPRINT1("Failed to get physdev for meta DC %p\n", hdc);
553  return FALSE;
554  }
555 
556  physdev->funcs->pSetWorldTransform(physdev, pxform);
557 #endif
558  // HACK!!!
559  return TRUE;
560  }
561 
562  return SetWorldTransform(hdc, pxform);
563 }
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
HDC hdc
Definition: msvc.h:53
smooth NULL
Definition: ftsmooth.c:557
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
#define DPRINT1
Definition: precomp.h:8
#define SetWorldTransform
Definition: gdi_private.h:185
static PHYSDEV GetPhysDev(HDC hdc)
Definition: rosglue.c:596

Variable Documentation

const struct gdi_dc_funcs DummyPhysDevFuncs
static

Definition at line 46 of file rosglue.c.

Referenced by alloc_dc_ptr().

INT i = 0
static

Definition at line 22 of file rosglue.c.

Referenced by METADC_Dispatch(), and NULL_Unused().