ReactOS  0.4.14-dev-52-g6116262
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)
 
static BOOL NULL_ExtTextOutW (PHYSDEV dev, INT x, INT y, UINT fuOptions, const RECT *lprc, LPCWSTR lpString, UINT cwc, const INT *lpDx)
 
static BOOL NULL_ModifyWorldTransform (PHYSDEV dev, const XFORM *xform, DWORD mode)
 
static BOOL NULL_SetWorldTransform (PHYSDEV dev, const XFORM *xform)
 
static BOOL NULL_PolyPolyline (PHYSDEV dev, const POINT *pt, const DWORD *lpt, DWORD cw)
 
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)
 
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

◆ _va_arg_n

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

◆ NDEBUG

#define NDEBUG

Definition at line 6 of file rosglue.c.

Function Documentation

◆ _assert()

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

Definition at line 573 of file rosglue.c.

577 {
579 }
#define DbgRaiseAssertionFailure
Definition: ke.h:164

◆ alloc_dc_ptr()

WINEDC* alloc_dc_ptr ( WORD  magic)

Definition at line 294 of file rosglue.c.

295 {
296  WINEDC* pWineDc;
297 
298  /* Allocate the Wine DC */
299  pWineDc = HeapAlloc(GetProcessHeap(), 0, sizeof(*pWineDc));
300  if (pWineDc == NULL)
301  {
302  return NULL;
303  }
304 
305  ZeroMemory(pWineDc, sizeof(*pWineDc));
306  pWineDc->refcount = 1;
307  pWineDc->hFont = GetStockObject(SYSTEM_FONT);
308  pWineDc->hBrush = GetStockObject(WHITE_BRUSH);
309  pWineDc->hPen = GetStockObject(BLACK_PEN);
311 
312  if (magic == OBJ_ENHMETADC)
313  {
314  /* We create a metafile DC, but we ignore the reference DC, this is
315  handled by the wine code */
316  pWineDc->hdc = NtGdiCreateMetafileDC(NULL);
317  if (pWineDc->hdc == NULL)
318  {
319  HeapFree(GetProcessHeap(), 0, pWineDc);
320  return NULL;
321  }
322 
323  pWineDc->iType = LDC_EMFLDC;
324 
325  /* Set the Wine DC as LDC */
326  GdiSetLDC(pWineDc->hdc, pWineDc);
327  }
328  else if (magic == OBJ_METADC)
329  {
331  if (pWineDc->hdc == NULL)
332  {
333  HeapFree(GetProcessHeap(), 0, pWineDc);
334  return NULL;
335  }
336  }
337  else
338  {
339  // nothing else supported!
340  ASSERT(FALSE);
341  }
342 
343  pWineDc->physDev = &pWineDc->NullPhysDev;
344  pWineDc->NullPhysDev.funcs = &DummyPhysDevFuncs;
345  pWineDc->NullPhysDev.next = NULL;
346 
347  pWineDc->NullPhysDev.hdc = pWineDc->hdc;
348  return pWineDc;
349 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
HPALETTE hPalette
Definition: gdi_private.h:83
static const struct gdi_dc_funcs DummyPhysDevFuncs
Definition: rosglue.c:50
BOOL FASTCALL GdiSetLDC(HDC hdc, PVOID pvLDC)
Definition: misc.c:802
u32_t magic(void)
HGDIOBJ WINAPI GdiCreateClientObj(_In_ PVOID pvObject, _In_ GDILOOBJTYPE eObjType)
Definition: clientobj.c:148
#define ZeroMemory
Definition: winbase.h:1635
#define WHITE_BRUSH
Definition: wingdi.h:901
PHYSDEV physDev
Definition: gdi_private.h:66
smooth NULL
Definition: ftsmooth.c:416
#define SYSTEM_FONT
Definition: wingdi.h:910
HBRUSH hBrush
Definition: gdi_private.h:76
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define DEFAULT_PALETTE
Definition: wingdi.h:912
#define OBJ_ENHMETADC
Definition: objidl.idl:1420
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
struct gdi_physdev NullPhysDev
Definition: gdi_private.h:79
__kernel_entry W32KAPI HDC APIENTRY NtGdiCreateMetafileDC(_In_ HDC hdc)
HPEN hPen
Definition: gdi_private.h:77
#define BLACK_PEN
Definition: wingdi.h:902
#define OBJ_METADC
Definition: objidl.idl:1412
LONG refcount
Definition: gdi_private.h:80
#define HeapFree(x, y, z)
Definition: compat.h:394
HFONT hFont
Definition: gdi_private.h:82
#define LDC_EMFLDC
Definition: gdi_private.h:57

Referenced by CreateEnhMetaFileW(), and MFDRV_AllocMetaFile().

◆ alloc_gdi_handle()

HGDIOBJ alloc_gdi_handle ( PVOID  pvObject,
WORD  wType,
const struct gdi_obj_funcs funcs 
)

Definition at line 224 of file rosglue.c.

228 {
229  GDILOOBJTYPE eObjType;
230 
231  /* Get the GDI object type */
232  eObjType = ConvertObjectType(wType);
233  if ((eObjType != GDILoObjType_LO_METAFILE_TYPE) &&
234  (eObjType != GDILoObjType_LO_METAFILE16_TYPE) &&
235  (eObjType != GDILoObjType_LO_METADC16_TYPE))
236  {
237  /* This is not supported! */
238  ASSERT(FALSE);
239  return NULL;
240  }
241 
242  /* Insert the client object */
243  return GdiCreateClientObj(pvObject, eObjType);
244 }
HGDIOBJ WINAPI GdiCreateClientObj(_In_ PVOID pvObject, _In_ GDILOOBJTYPE eObjType)
Definition: clientobj.c:148
smooth NULL
Definition: ftsmooth.c:416
static GDILOOBJTYPE ConvertObjectType(WORD wType)
Definition: rosglue.c:199
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
enum GDILoObjType GDILOOBJTYPE

◆ bitmap_info_size()

int bitmap_info_size ( const BITMAPINFO info,
WORD  coloruse 
)

Definition at line 448 of file rosglue.c.

451 {
452  unsigned int colors, size, masks = 0;
453 
454  if (info->bmiHeader.biSize == sizeof(BITMAPCOREHEADER))
455  {
456  const BITMAPCOREHEADER *core = (const BITMAPCOREHEADER *)info;
457  colors = (core->bcBitCount <= 8) ? 1 << core->bcBitCount : 0;
458  return sizeof(BITMAPCOREHEADER) + colors *
459  ((coloruse == DIB_RGB_COLORS) ? sizeof(RGBTRIPLE) : sizeof(WORD));
460  }
461  else /* assume BITMAPINFOHEADER */
462  {
463  if (info->bmiHeader.biClrUsed) colors = min( info->bmiHeader.biClrUsed, 256 );
464  else colors = info->bmiHeader.biBitCount > 8 ? 0 : 1 << info->bmiHeader.biBitCount;
465  if (info->bmiHeader.biCompression == BI_BITFIELDS) masks = 3;
466  size = max( info->bmiHeader.biSize, sizeof(BITMAPINFOHEADER) + masks * sizeof(DWORD) );
467  return size + colors * ((coloruse == DIB_RGB_COLORS) ? sizeof(RGBQUAD) : sizeof(WORD));
468  }
469 }
#define max(a, b)
Definition: svc.c:63
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
#define BI_BITFIELDS
Definition: mmreg.h:507
GLsizeiptr size
Definition: glext.h:5919
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
#define min(a, b)
Definition: monoChain.cc:55
#define DIB_RGB_COLORS
Definition: wingdi.h:366
static const BYTE masks[8]
Definition: dib.c:2760

◆ ConvertObjectType()

static GDILOOBJTYPE ConvertObjectType ( WORD  wType)
static

Definition at line 199 of file rosglue.c.

201 {
202  /* Get the GDI object type */
203  switch (wType)
204  {
205  case OBJ_PEN: return GDILoObjType_LO_PEN_TYPE;
207  case OBJ_DC: return GDILoObjType_LO_DC_TYPE;
210  case OBJ_FONT: return GDILoObjType_LO_FONT_TYPE;
214  case OBJ_MEMDC: return GDILoObjType_LO_DC_TYPE;
219  default: return 0;
220  }
221 }
#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:703
#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

Referenced by alloc_gdi_handle(), and GDI_GetObjPtr().

◆ DeleteColorSpace()

BOOL WINAPI DeleteColorSpace ( HCOLORSPACE  hcs)

Definition at line 538 of file rosglue.c.

540 {
541  return NtGdiDeleteColorSpace(hcs);
542 }
__kernel_entry W32KAPI BOOL APIENTRY NtGdiDeleteColorSpace(_In_ HANDLE hColorSpace)

◆ DRIVER_Dispatch()

static DWORD_PTR DRIVER_Dispatch ( _In_ PHYSDEV  physdev,
_In_ DCFUNC  eFunction,
_In_ va_list  argptr 
)
static

Definition at line 742 of file rosglue.c.

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

Referenced by METADC_Dispatch().

◆ DRIVER_PatBlt()

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 618 of file rosglue.c.

626 {
627  struct bitblt_coords coords;
628 
629  InitBitBltCoords(&coords, hdc, xLeft, yTop, cx, cy);
630 
631  return physdev->funcs->pPatBlt(physdev, &coords, dwRop);
632 }
GLuint coords
Definition: glext.h:7368
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:570
HDC hdc
Definition: main.c:9
static VOID InitBitBltCoords(struct bitblt_coords *coords, HDC hdc, int x, int y, int cx, int cy)
Definition: rosglue.c:585
_Out_opt_ int * cx
Definition: commctrl.h:570

Referenced by DRIVER_Dispatch().

◆ DRIVER_PathToRegion()

static HRGN DRIVER_PathToRegion ( PHYSDEV  physdev)
static

Definition at line 733 of file rosglue.c.

734 {
735  DPRINT1("DRIVER_PathToRegion\n");
736  return (HRGN)(ULONG_PTR)physdev->funcs->pAbortPath( physdev );
737 }
#define DPRINT1
Definition: precomp.h:8
#define ULONG_PTR
Definition: config.h:101
const struct gdi_dc_funcs * funcs
Definition: gdi_driver.h:31

Referenced by DRIVER_Dispatch().

◆ DRIVER_RestoreDC()

static BOOL DRIVER_RestoreDC ( PHYSDEV  physdev,
INT  level 
)
static

Definition at line 668 of file rosglue.c.

669 {
670  WINEDC *pWineDc = get_dc_ptr(physdev->hdc);
671 
673  {
674  /* The Restore DC function needs the save level to be set correctly.
675  Note that wine's level is 0 based, while our's is (like win) 1 based. */
676  pWineDc->saveLevel = GetDCDWord(physdev->hdc, GdiGetEMFRestorDc, 0) - 1;
677 
678  /* Fail if the level is not valid */
679  if ((abs(level) > pWineDc->saveLevel) || (level == 0))
680  return FALSE;
681  }
682 
683  return physdev->funcs->pRestoreDC(physdev,level);
684 }
#define abs(i)
Definition: fconv.c:206
GLint level
Definition: gl.h:1546
WINEDC * get_dc_ptr(HDC hdc)
Definition: rosglue.c:377
#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:81
const struct gdi_dc_funcs * funcs
Definition: gdi_driver.h:31

Referenced by DRIVER_Dispatch().

◆ DRIVER_SelectBrush()

static HBRUSH DRIVER_SelectBrush ( PHYSDEV  physdev,
HBRUSH  hbrush,
const struct brush_pattern pattern 
)
static

Definition at line 718 of file rosglue.c.

719 {
720  WINEDC *pWineDc = get_dc_ptr(physdev->hdc);
721  HBRUSH hOldBrush;
722 
723  if (!physdev->funcs->pSelectBrush(physdev, hbrush, pattern))
724  return 0;
725 
726  hOldBrush = pWineDc->hBrush;
727  pWineDc->hBrush = hbrush;
728  return hOldBrush;
729 }
WINEDC * get_dc_ptr(HDC hdc)
Definition: rosglue.c:377
static HBRUSH hbrush
HBRUSH hBrush
Definition: gdi_private.h:76
const struct gdi_dc_funcs * funcs
Definition: gdi_driver.h:31
GLubyte * pattern
Definition: glext.h:7787

Referenced by DRIVER_Dispatch().

◆ DRIVER_SelectFont()

static HFONT DRIVER_SelectFont ( PHYSDEV  physdev,
HFONT  hFont,
UINT aa_flags 
)
static

Definition at line 688 of file rosglue.c.

689 {
690  WINEDC *pWineDc = get_dc_ptr(physdev->hdc);
691  HFONT hOldFont;
692 
693  if (!physdev->funcs->pSelectFont(physdev, hFont, aa_flags))
694  return 0;
695 
696  hOldFont = pWineDc->hFont;
697  pWineDc->hFont = hFont;
698  return hOldFont;
699 }
WINEDC * get_dc_ptr(HDC hdc)
Definition: rosglue.c:377
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:82

Referenced by DRIVER_Dispatch().

◆ DRIVER_SelectPen()

static HPEN DRIVER_SelectPen ( PHYSDEV  physdev,
HPEN  hpen,
const struct brush_pattern pattern 
)
static

Definition at line 703 of file rosglue.c.

704 {
705  WINEDC *pWineDc = get_dc_ptr(physdev->hdc);
706  HPEN hOldPen;
707 
708  if (!physdev->funcs->pSelectPen(physdev, hpen, pattern))
709  return 0;
710 
711  hOldPen = pWineDc->hPen;
712  pWineDc->hPen = hpen;
713  return hOldPen;
714 }
WINEDC * get_dc_ptr(HDC hdc)
Definition: rosglue.c:377
static HPEN hpen
HPEN hPen
Definition: gdi_private.h:77
const struct gdi_dc_funcs * funcs
Definition: gdi_driver.h:31
GLubyte * pattern
Definition: glext.h:7787

Referenced by DRIVER_Dispatch().

◆ DRIVER_StretchBlt()

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 636 of file rosglue.c.

649 {
650  struct bitblt_coords coordsDst, coordsSrc;
651  struct gdi_physdev physdevSrc = {0};
652 
653  /* Source cannot be a metafile */
655  return FALSE;
656 
657  /* Source physdev uses only hdc and func */
658  physdevSrc.hdc = hdcSrc;
659 
660  InitBitBltCoords(&coordsDst, hdcDst, xDst, yDst, cxDst, cyDst);
661  InitBitBltCoords(&coordsSrc, hdcSrc, xSrc, ySrc, cxSrc, cySrc);
662 
663  return physdev->funcs->pStretchBlt(physdev, &coordsDst, &physdevSrc, &coordsSrc, dwRop);
664 }
static HDC hdcSrc
Definition: xlate.c:32
#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:585

Referenced by DRIVER_Dispatch().

◆ free_dc_ptr()

VOID free_dc_ptr ( WINEDC pWineDc)

Definition at line 352 of file rosglue.c.

353 {
354  /* Invoke the DeleteDC callback to clean up the DC */
355  pWineDc->physDev->funcs->pDeleteDC(pWineDc->physDev);
356 
357  /* FIXME */
359  {
360  /* Get rid of the LDC */
361  ASSERT((WINEDC*)GdiGetLDC(pWineDc->hdc) == pWineDc);
362  GdiSetLDC(pWineDc->hdc, NULL);
363 
364  /* Free the DC */
365  NtGdiDeleteObjectApp(pWineDc->hdc);
366  }
368  {
369  GdiDeleteClientObj(pWineDc->hdc);
370  }
371 
372  /* Free the Wine DC */
373  HeapFree(GetProcessHeap(), 0, pWineDc);
374 }
BOOL FASTCALL GdiSetLDC(HDC hdc, PVOID pvLDC)
Definition: misc.c:802
PHYSDEV physDev
Definition: gdi_private.h:66
smooth NULL
Definition: ftsmooth.c:416
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
PLDC FASTCALL GdiGetLDC(HDC hDC)
Definition: misc.c:785
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI GdiDeleteClientObj(_In_ HGDIOBJ hobj)
Definition: clientobj.c:173
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
__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

◆ free_gdi_handle()

PVOID free_gdi_handle ( HGDIOBJ  hobj)

Definition at line 247 of file rosglue.c.

248 {
249  /* Should be a client object */
250  return GdiDeleteClientObj(hobj);
251 }
PVOID WINAPI GdiDeleteClientObj(_In_ HGDIOBJ hobj)
Definition: clientobj.c:173

Referenced by DeleteMetaFile(), and EMF_Delete_HENHMETAFILE().

◆ GDI_GetObjPtr()

PVOID GDI_GetObjPtr ( HGDIOBJ  hobj,
WORD  wType 
)

Definition at line 254 of file rosglue.c.

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

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

◆ GDI_hdc_not_using_object()

VOID GDI_hdc_not_using_object ( HGDIOBJ  hobj,
HDC  hdc 
)

Definition at line 431 of file rosglue.c.

434 {
435  HDC hdcLink;
436 
437  /* Remove the HDC link for the object */
438  hdcLink = GdiRemoveClientObjLink(hobj);
439  ASSERT(hdcLink == hdc);
440 }
PVOID WINAPI GdiRemoveClientObjLink(_In_ HGDIOBJ hobj)
Definition: clientobj.c:98
static HDC
Definition: imagelist.c:92
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
HDC hdc
Definition: main.c:9

Referenced by EMFDRV_DeleteDC(), and MFDRV_DeleteDC().

◆ GDI_hdc_using_object()

VOID GDI_hdc_using_object ( HGDIOBJ  hobj,
HDC  hdc 
)

Definition at line 415 of file rosglue.c.

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

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

◆ GDI_ReleaseObj()

VOID GDI_ReleaseObj ( HGDIOBJ  hobj)

Definition at line 288 of file rosglue.c.

289 {
290  /* We don't do any reference-counting */
291 }

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

◆ get_brush_bitmap_info()

BOOL get_brush_bitmap_info ( HBRUSH  hbr,
PBITMAPINFO  pbmi,
PVOID ppvBits,
PUINT  puUsage 
)

Definition at line 472 of file rosglue.c.

477 {
478  HBITMAP hbmp;
479  HDC hdc;
480 
481  /* Call win32k to get the bitmap handle and color usage */
482  hbmp = NtGdiGetObjectBitmapHandle(hbr, puUsage);
483  if (hbmp == NULL)
484  return FALSE;
485 
486  hdc = GetDC(NULL);
487  if (hdc == NULL)
488  return FALSE;
489 
490  /* Initialize the BITMAPINFO */
491  ZeroMemory(pbmi, sizeof(*pbmi));
493 
494  /* Retrieve information about the bitmap */
495  if (!GetDIBits(hdc, hbmp, 0, 0, NULL, pbmi, *puUsage))
496  return FALSE;
497 
498  /* Now allocate a buffer for the bits */
500  if (*ppvBits == NULL)
501  return FALSE;
502 
503  /* Retrieve the bitmap bits */
504  if (!GetDIBits(hdc, hbmp, 0, pbmi->bmiHeader.biHeight, *ppvBits, pbmi, *puUsage))
505  {
506  HeapFree(GetProcessHeap(), 0, *ppvBits);
507  *ppvBits = NULL;
508  return FALSE;
509  }
510 
511  /* GetDIBits doesn't set biClrUsed, but wine code needs it, so we set it */
512  if (pbmi->bmiHeader.biBitCount <= 8)
513  {
515  }
516 
517  return TRUE;
518 }
#define TRUE
Definition: types.h:120
BITMAPINFOHEADER bmiHeader
Definition: wingdi.h:1471
HDC WINAPI GetDC(_In_opt_ HWND)
_In_ HBITMAP _In_ UINT _In_ UINT _Inout_ LPBITMAPINFO pbmi
Definition: ntgdi.h:2780
struct tagBITMAPINFOHEADER BITMAPINFOHEADER
static HDC
Definition: imagelist.c:92
#define ZeroMemory
Definition: winbase.h:1635
smooth NULL
Definition: ftsmooth.c:416
HBITMAP hbmp
#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
HDC hdc
Definition: main.c:9
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)
static HBITMAP
Definition: button.c:44
#define HeapFree(x, y, z)
Definition: compat.h:394

◆ get_dc_ptr()

WINEDC* get_dc_ptr ( HDC  hdc)

Definition at line 377 of file rosglue.c.

378 {
379  /* Check for EMF DC */
381  {
382  /* The Wine DC is stored as the LDC */
383  return (WINEDC*)GdiGetLDC(hdc);
384  }
385 
386  /* Check for METADC16 */
388  {
389  return GdiGetClientObjLink(hdc);
390  }
391 
392  return NULL;
393 }
PVOID WINAPI GdiGetClientObjLink(_In_ HGDIOBJ hobj)
Definition: clientobj.c:61
smooth NULL
Definition: ftsmooth.c:416
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
PLDC FASTCALL GdiGetLDC(HDC hDC)
Definition: misc.c:785
HDC hdc
Definition: main.c:9

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

◆ get_nulldrv_dc()

WINEDC* get_nulldrv_dc ( PHYSDEV  dev)

Definition at line 185 of file rosglue.c.

186 {
187  return CONTAINING_RECORD( dev, WINEDC, NullPhysDev );
188 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by get_physdev_dc(), and nulldrv_BeginPath().

◆ get_physdev_dc()

WINEDC* get_physdev_dc ( PHYSDEV  dev)

◆ GetPhysDev()

static PHYSDEV GetPhysDev ( HDC  hdc)
static

Definition at line 602 of file rosglue.c.

604 {
605  WINEDC *pWineDc;
606 
607  pWineDc = get_dc_ptr(hdc);
608  if (pWineDc == NULL)
609  {
610  return NULL;
611  }
612 
613  return pWineDc->physDev;
614 }
WINEDC * get_dc_ptr(HDC hdc)
Definition: rosglue.c:377
PHYSDEV physDev
Definition: gdi_private.h:66
smooth NULL
Definition: ftsmooth.c:416
HDC hdc
Definition: main.c:9

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

◆ InitBitBltCoords()

static VOID InitBitBltCoords ( struct bitblt_coords coords,
HDC  hdc,
int  x,
int  y,
int  cx,
int  cy 
)
static

Definition at line 585 of file rosglue.c.

592 {
593  coords->log_x = x;
594  coords->log_y = y;
595  coords->log_width = cx;
596  coords->log_height = cy;
597  coords->layout = GetLayout(hdc);
598 }
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLuint coords
Definition: glext.h:7368
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:570
HDC hdc
Definition: main.c:9
DWORD WINAPI GetLayout(_In_ HDC hdc)
Definition: coord.c:741
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
_Out_opt_ int * cx
Definition: commctrl.h:570

Referenced by DRIVER_PatBlt(), and DRIVER_StretchBlt().

◆ METADC16_Escape()

INT WINAPI METADC16_Escape ( _In_ HDC  hdc,
_In_ INT  nEscape,
_In_ INT  cbInput,
_In_ LPCSTR  lpvInData,
_Out_ LPVOID  lpvOutData 
)

Definition at line 1284 of file rosglue.c.

1290 {
1291  DWORD_PTR dwResult;
1292 
1293  /* Do not record MFCOMMENT */
1294  if (nEscape == MFCOMMENT)
1295  {
1296  // HACK required by wine code...
1297  //return 1;
1298  }
1299 
1301  &dwResult,
1302  SP_ERROR,
1303  hdc,
1304  nEscape,
1305  cbInput,
1306  lpvInData,
1307  lpvOutData);
1308 
1309  return (INT)dwResult;
1310 }
#define SP_ERROR
Definition: wingdi.h:317
#define MFCOMMENT
Definition: wingdi.h:1007
int32_t INT
Definition: typedefs.h:56
HDC hdc
Definition: main.c:9
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:1119

Referenced by Escape().

◆ METADC_DeleteDC()

BOOL WINAPI METADC_DeleteDC ( _In_ HDC  hdc)

Definition at line 1269 of file rosglue.c.

1271 {
1272  /* Only ALTDCs are supported */
1274  {
1275  DPRINT1("Trying to delete METADC %p\n", hdc);
1276  return FALSE;
1277  }
1278  // FIXME call the driver?
1279  return NtGdiDeleteObjectApp(hdc);
1280 }
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
HDC hdc
Definition: main.c:9
__kernel_entry W32KAPI BOOL APIENTRY NtGdiDeleteObjectApp(_In_ HANDLE hobj)
#define DPRINT1
Definition: precomp.h:8

Referenced by DeleteDC().

◆ METADC_DeleteObject()

VOID WINAPI METADC_DeleteObject ( HGDIOBJ  hobj)

Definition at line 1228 of file rosglue.c.

1229 {
1230  GDILOOBJTYPE eObjectType;
1231  HDC hdc;
1232  PHYSDEV physdev;
1233 
1234  /* Check for one of the types we actually handle here */
1235  eObjectType = GDI_HANDLE_GET_TYPE(hobj);
1236  if ((eObjectType != GDILoObjType_LO_BRUSH_TYPE) &&
1237  (eObjectType != GDILoObjType_LO_PEN_TYPE) &&
1238  (eObjectType != GDILoObjType_LO_EXTPEN_TYPE) &&
1239  (eObjectType != GDILoObjType_LO_PALETTE_TYPE) &&
1240  (eObjectType != GDILoObjType_LO_FONT_TYPE))
1241  {
1242  return;
1243  }
1244 
1245  /* Check if we have a client object link and remove it if it was found.
1246  The link is the HDC that the object was selected into. */
1247  hdc = GdiRemoveClientObjLink(hobj);
1248  if (hdc == NULL)
1249  {
1250  /* The link was not found, so we are not handling this object here */
1251  return;
1252  }
1253 
1254  /* Get the physdev */
1255  physdev = GetPhysDev(hdc);
1256  if (physdev == NULL)
1257  {
1258  /* This happens, when the METADC is already closed, when we delete
1259  the object. Simply ignore it */
1260  DPRINT1("METADC was already closed, cannot delete object. Ignoring.\n");
1261  return;
1262  }
1263 
1264  physdev->funcs->pDeleteObject(physdev, hobj);
1265 }
PVOID WINAPI GdiRemoveClientObjLink(_In_ HGDIOBJ hobj)
Definition: clientobj.c:98
static HDC
Definition: imagelist.c:92
smooth NULL
Definition: ftsmooth.c:416
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
HDC hdc
Definition: main.c:9
#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:602

Referenced by DeleteObject().

◆ METADC_Dispatch()

BOOL METADC_Dispatch ( _In_ DCFUNC  eFunction,
_Out_ PDWORD_PTR  pdwResult,
_In_ DWORD_PTR  dwError,
_In_ HDC  hdc,
  ... 
)

Definition at line 1119 of file rosglue.c.

1125 {
1126  PHYSDEV physdev;
1127  va_list argptr;
1128 
1129  /* Handle only METADC16 and ALTDC */
1132  {
1133  /* Let the caller handle it */
1134  return FALSE;
1135  }
1136 
1137  // See if this is other than a METADATA issue.
1139  {
1140  WINEDC* pwdc = (WINEDC*)GdiGetLDC(hdc);
1141  if (pwdc && pwdc->iType != LDC_EMFLDC)
1142  {
1143  /* Let the caller handle it */
1144  return FALSE;
1145  }
1146  }
1147 
1148  physdev = GetPhysDev(hdc);
1149  if (physdev == NULL)
1150  {
1152  *pdwResult = dwError;
1153  return TRUE;
1154  }
1155 
1156  i = eFunction;
1157  va_start(argptr, hdc);
1158  *pdwResult = DRIVER_Dispatch(physdev, eFunction, argptr);
1159  va_end(argptr);
1160  i = 0;
1161 
1162  /* Return TRUE to indicate that we want to return from the parent */
1164  (*pdwResult == dwError));
1165 }
#define TRUE
Definition: types.h:120
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
#define va_end(ap)
Definition: acmsvcex.h:90
smooth NULL
Definition: ftsmooth.c:416
char * va_list
Definition: acmsvcex.h:78
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
PLDC FASTCALL GdiGetLDC(HDC hDC)
Definition: misc.c:785
#define SetLastError(x)
Definition: compat.h:409
HDC hdc
Definition: main.c:9
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:742
#define va_start(ap, A)
Definition: acmsvcex.h:91
static PHYSDEV GetPhysDev(HDC hdc)
Definition: rosglue.c:602
#define LDC_EMFLDC
Definition: gdi_private.h:57

Referenced by METADC16_Escape().

◆ METADC_GetAndSetDCDWord()

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 1169 of file rosglue.c.

1177 {
1178  PHYSDEV physdev;
1179 
1180  /* Ignore these, we let wine code handle this */
1181  UNREFERENCED_PARAMETER(ulMFId);
1182  UNREFERENCED_PARAMETER(usMF16Id);
1183 
1184  physdev = GetPhysDev(hdc);
1185  if (physdev == NULL)
1186  {
1188  *pdwResult = dwError;
1189  return TRUE;
1190  }
1191 
1192  /* Check the function */
1193  switch (uFunction)
1194  {
1195  case GdiGetSetMapMode:
1196  *pdwResult = physdev->funcs->pSetMapMode(physdev, dwIn);
1197  break;
1198 
1199  case GdiGetSetArcDirection:
1201  *pdwResult = 0;
1202  else
1203  *pdwResult = physdev->funcs->pSetArcDirection(physdev, dwIn);
1204  break;
1205 
1206  case GdiGetSetRelAbs:
1208  *pdwResult = physdev->funcs->pSetRelAbs(physdev, dwIn);
1209  else
1210  {
1211  UNIMPLEMENTED;
1212  *pdwResult = 0;
1213  }
1214  break;
1215 
1216 
1217  default:
1218  __debugbreak();
1219  }
1220 
1221  /* Return TRUE to indicate that we want to return from the parent */
1223  (*pdwResult == dwError));
1224 }
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
void __cdecl __debugbreak(void)
Definition: intrin_ppc.h:698
smooth NULL
Definition: ftsmooth.c:416
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
#define SetLastError(x)
Definition: compat.h:409
HDC hdc
Definition: main.c:9
_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:602

◆ NULL_ExcludeClipRect()

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; }

◆ NULL_ExtSelectClipRgn()

static INT NULL_ExtSelectClipRgn ( PHYSDEV  dev,
HRGN  hrgn,
INT  iMode 
)
static

Definition at line 41 of file rosglue.c.

41 { return 1; }

◆ NULL_ExtTextOutW()

static BOOL NULL_ExtTextOutW ( PHYSDEV  dev,
INT  x,
INT  y,
UINT  fuOptions,
const RECT lprc,
LPCWSTR  lpString,
UINT  cwc,
const INT lpDx 
)
static

Definition at line 45 of file rosglue.c.

45 { return TRUE; }
#define TRUE
Definition: types.h:120

◆ NULL_IntersectClipRect()

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; }

◆ NULL_ModifyWorldTransform()

static BOOL NULL_ModifyWorldTransform ( PHYSDEV  dev,
const XFORM xform,
DWORD  mode 
)
static

Definition at line 46 of file rosglue.c.

46 { return TRUE; }
#define TRUE
Definition: types.h:120

◆ NULL_OffsetClipRgn()

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:361

◆ NULL_PolyPolyline()

static BOOL NULL_PolyPolyline ( PHYSDEV  dev,
const POINT pt,
const DWORD lpt,
DWORD  cw 
)
static

Definition at line 48 of file rosglue.c.

48 { return TRUE; }
#define TRUE
Definition: types.h:120

◆ NULL_RestoreDC()

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

◆ NULL_SaveDC()

static INT NULL_SaveDC ( PHYSDEV  dev)
static

Definition at line 33 of file rosglue.c.

33 { return 1; }

◆ NULL_SelectFont()

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:416

◆ NULL_SetMapMode()

static INT NULL_SetMapMode ( PHYSDEV  dev,
INT  iMode 
)
static

Definition at line 35 of file rosglue.c.

35 { return 1; }

◆ NULL_SetViewportExtEx()

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

◆ NULL_SetViewportOrgEx()

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

◆ NULL_SetWindowExtEx()

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

◆ NULL_SetWindowOrgEx()

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

◆ NULL_SetWorldTransform()

static BOOL NULL_SetWorldTransform ( PHYSDEV  dev,
const XFORM xform 
)
static

Definition at line 47 of file rosglue.c.

47 { return TRUE; }
#define TRUE
Definition: types.h:120

◆ NULL_Unused()

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

◆ nulldrv_AbortPath()

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

◆ nulldrv_BeginPath()

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  }
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:155
HDC dc
Definition: cylfrac.c:34
static struct path_physdev * get_path_physdev(PHYSDEV dev)
Definition: path.c:23
const struct gdi_dc_funcs path_driver
Definition: path.c:440
smooth NULL
Definition: ftsmooth.c:416
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:185

◆ nulldrv_CloseFigure()

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 ERROR_CAN_NOT_COMPLETE
Definition: winerror.h:582
void DPRINT(...)
Definition: polytest.cpp:61
#define SetLastError(x)
Definition: compat.h:409

◆ nulldrv_EndPath()

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 ERROR_CAN_NOT_COMPLETE
Definition: winerror.h:582
void DPRINT(...)
Definition: polytest.cpp:61
#define SetLastError(x)
Definition: compat.h:409

◆ nulldrv_FillPath()

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

◆ nulldrv_FlattenPath()

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

◆ nulldrv_SelectClipPath()

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 ERROR(name)
Definition: error_private.h:53
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
DWORD ret
Definition: path.c:47
int WINAPI ExtSelectClipRgn(_In_ HDC, _In_opt_ HRGN, _In_ int)
unsigned int BOOL
Definition: ntddk_ex.h:94
void DPRINT(...)
Definition: polytest.cpp:61
HRGN WINAPI PathToRegion(HDC hdc)
Definition: path.c:120
static HRGN hrgn
Definition: win.c:55
GLenum mode
Definition: glext.h:6217

◆ nulldrv_StrokeAndFillPath()

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

◆ nulldrv_StrokePath()

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

◆ nulldrv_WidenPath()

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

◆ push_dc_driver_ros()

void push_dc_driver_ros ( PHYSDEV dev,
PHYSDEV  physdev,
const struct gdi_dc_funcs funcs 
)

Definition at line 402 of file rosglue.c.

406 {
407  while ((*dev)->funcs->priority > funcs->priority) dev = &(*dev)->next;
408  physdev->funcs = funcs;
409  physdev->next = *dev;
410  physdev->hdc = CONTAINING_RECORD(dev, WINEDC, physDev)->hdc;
411  *dev = physdev;
412 }
struct gdi_physdev * next
Definition: gdi_driver.h:32
static int dev
Definition: mkdosfs.c:536
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
static struct __wine_debug_functions funcs
Definition: debug.c:59
const struct gdi_dc_funcs * funcs
Definition: gdi_driver.h:31

◆ release_dc_ptr()

VOID release_dc_ptr ( WINEDC dc)

Definition at line 396 of file rosglue.c.

397 {
398  /* We don't do any reference-counting */
399 }

◆ SetVirtualResolution()

BOOL WINAPI SetVirtualResolution ( HDC  hdc,
DWORD  cxVirtualDevicePixel,
DWORD  cyVirtualDevicePixel,
DWORD  cxVirtualDeviceMm,
DWORD  cyVirtualDeviceMm 
)

Definition at line 522 of file rosglue.c.

528 {
530  cxVirtualDevicePixel,
531  cyVirtualDevicePixel,
532  cxVirtualDeviceMm,
533  cyVirtualDeviceMm);
534 }
__kernel_entry W32KAPI BOOL APIENTRY NtGdiSetVirtualResolution(_In_ HDC hdc, _In_ INT cxVirtualDevicePixel, _In_ INT cyVirtualDevicePixel, _In_ INT cxVirtualDeviceMm, _In_ INT cyVirtualDeviceMm)
HDC hdc
Definition: main.c:9

Referenced by CreateEnhMetaFileW(), and MFDRV_AllocMetaFile().

Variable Documentation

◆ DummyPhysDevFuncs

const struct gdi_dc_funcs DummyPhysDevFuncs
static

Definition at line 50 of file rosglue.c.

Referenced by alloc_dc_ptr(), and get_physdev_dc().

◆ i

INT i = 0
static

Definition at line 22 of file rosglue.c.

Referenced by METADC_Dispatch(), and NULL_Unused().