ReactOS  0.4.14-dev-323-g6fe6a88
metafile.c File Reference
#include <win32k.h>
#include <debug.h>
Include dependency graph for metafile.c:

Go to the source code of this file.

Classes

struct  _METATYPEOBJ
 

Macros

#define NDEBUG
 

Typedefs

typedef struct _METATYPEOBJ METATYPEOBJ
 
typedef struct _METATYPEOBJPMETATYPEOBJ
 

Functions

HDC APIENTRY NtGdiCreateMetafileDC (IN HDC hdc)
 
HANDLE APIENTRY NtGdiCreateServerMetaFile (IN DWORD iType, IN ULONG cjData, IN PBYTE pjData, IN DWORD mm, IN DWORD xExt, IN DWORD yExt)
 
ULONG APIENTRY NtGdiGetServerMetaFileBits (IN HANDLE hmo, IN ULONG cjData, OUT OPTIONAL PBYTE pjData, OUT PDWORD piType, OUT PDWORD pmm, OUT PDWORD pxExt, OUT PDWORD pyExt)
 
LONG APIENTRY NtGdiConvertMetafileRect (IN HDC hDC, IN OUT PRECTL pRect)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 13 of file metafile.c.

Typedef Documentation

◆ METATYPEOBJ

◆ PMETATYPEOBJ

Function Documentation

◆ NtGdiConvertMetafileRect()

LONG APIENTRY NtGdiConvertMetafileRect ( IN HDC  hDC,
IN OUT PRECTL  pRect 
)

Definition at line 172 of file metafile.c.

174 {
176  return 0;
177 }
#define UNIMPLEMENTED
Definition: debug.h:114

◆ NtGdiCreateMetafileDC()

HDC APIENTRY NtGdiCreateMetafileDC ( IN HDC  hdc)

Definition at line 37 of file metafile.c.

38 {
39  //if (hdc)
40  /* Call the internal function to create an alternative info DC */
42  // No HDC call NtUser.
43  //return UserGetDesktopDC(DCTYPE_INFO, TRUE, FALSE);
44 }
#define TRUE
Definition: types.h:120
HDC APIENTRY GreCreateCompatibleDC(HDC hdc, BOOL bAltDc)
Definition: dclife.c:817
HDC hdc
Definition: main.c:9

◆ NtGdiCreateServerMetaFile()

HANDLE APIENTRY NtGdiCreateServerMetaFile ( IN DWORD  iType,
IN ULONG  cjData,
IN PBYTE  pjData,
IN DWORD  mm,
IN DWORD  xExt,
IN DWORD  yExt 
)

Definition at line 51 of file metafile.c.

59 {
60  BOOL Pass = TRUE;
61  PMETATYPEOBJ pmto;
62 
63  if ( ( iType == GDITAG_TYPE_EMF || iType == GDITAG_TYPE_MFP ) &&
64  cjData &&
65  pjData )
66  {
68  if ( pmto )
69  {
70  pmto->iType = iType;
71  pmto->mm = mm;
72  pmto->xExt = xExt;
73  pmto->yExt = yExt;
74  pmto->cjData = cjData;
75 
76  _SEH2_TRY
77  {
78  ProbeForRead( pjData, cjData, 1 );
79  RtlCopyMemory( pmto->pjData, pjData, cjData) ;
80  }
82  {
83  Pass = FALSE;
84  }
85  _SEH2_END;
86 
87  if (Pass)
88  {
91  return pmto->BaseObject.hHmgr;
92  }
93  else
94  {
96  }
97  }
98  }
99  return NULL;
100 }
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
PBYTE pjData[4]
Definition: metafile.c:26
_In_ ULONG iType
Definition: winddi.h:3748
DWORD xExt
Definition: metafile.c:23
_SEH2_TRY
Definition: create.c:4250
DWORD iType
Definition: metafile.c:21
struct _METATYPEOBJ * PMETATYPEOBJ
unsigned int BOOL
Definition: ntddk_ex.h:94
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
HGDIOBJ hHmgr(VOID)
Definition: baseobj.hpp:95
smooth NULL
Definition: ftsmooth.c:416
#define GDITAG_TYPE_MFP
Definition: ntgdityp.h:246
VOID NTAPI GDIOBJ_vDeleteObject(POBJ pobj)
Definition: gdiobj.c:1108
DWORD yExt
Definition: metafile.c:24
VOID NTAPI GDIOBJ_vUnlockObject(POBJ pobj)
Definition: gdiobj.c:877
VOID NTAPI ProbeForRead(IN CONST VOID *Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:102
ULONG cjData
Definition: metafile.c:25
BASEOBJECT BaseObject
Definition: metafile.c:20
#define GDITAG_TYPE_EMF
Definition: ntgdityp.h:245
_SEH2_END
Definition: create.c:4424
POBJ NTAPI GDIOBJ_AllocObjWithHandle(ULONG ObjectType, ULONG cjSize)
Definition: gdiobj.c:1485
#define GDI_OBJ_HMGR_PUBLIC
Definition: ntgdihdl.h:116
VOID NTAPI GDIOBJ_vSetObjectOwner(POBJ pobj, ULONG ulNewOwner)
Definition: gdiobj.c:962
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
static struct proto Pass[]
Definition: mkg3states.c:58
DWORD mm
Definition: metafile.c:22

Referenced by GdiConvertMetaFilePict().

◆ NtGdiGetServerMetaFileBits()

ULONG APIENTRY NtGdiGetServerMetaFileBits ( IN HANDLE  hmo,
IN ULONG  cjData,
OUT OPTIONAL PBYTE  pjData,
OUT PDWORD  piType,
OUT PDWORD  pmm,
OUT PDWORD  pxExt,
OUT PDWORD  pyExt 
)

Definition at line 107 of file metafile.c.

116 {
117  ULONG cjRet = 0;
118  PMETATYPEOBJ pmto;
119 
121 
122  if (!pmto)
123  return 0;
124 
125  if ( pmto->iType == GDITAG_TYPE_EMF || pmto->iType == GDITAG_TYPE_MFP )
126  {
127  cjRet = pmto->cjData;
128 
129  if ( cjData )
130  {
131  if (cjData == pmto->cjData)
132  {
133  _SEH2_TRY
134  {
135  ProbeForWrite( piType, sizeof(DWORD), 1);
136  *piType = pmto->iType;
137 
138  ProbeForWrite( pmm, sizeof(DWORD), 1);
139  *pmm = pmto->mm;
140 
141  ProbeForWrite( pxExt, sizeof(DWORD), 1);
142  *pxExt = pmto->xExt;
143 
144  ProbeForWrite( pyExt, sizeof(DWORD), 1);
145  *pyExt = pmto->yExt;
146 
147  ProbeForWrite( pjData, cjData, 1 );
148  RtlCopyMemory( pjData, pmto->pjData, cjData) ;
149  }
151  {
152  cjRet = 0;
153  }
154  _SEH2_END;
155  }
156  else
157  {
158  cjRet = 0;
159  }
160  }
161  }
162 
164  return cjRet;
165 }
PGDIOBJ NTAPI GDIOBJ_LockObject(HGDIOBJ hobj, UCHAR objt)
Definition: gdiobj.c:823
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
PBYTE pjData[4]
Definition: metafile.c:26
DWORD xExt
Definition: metafile.c:23
VOID NTAPI ProbeForWrite(IN PVOID Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:143
_SEH2_TRY
Definition: create.c:4250
DWORD iType
Definition: metafile.c:21
struct _METATYPEOBJ * PMETATYPEOBJ
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define GDITAG_TYPE_MFP
Definition: ntgdityp.h:246
DWORD yExt
Definition: metafile.c:24
unsigned long DWORD
Definition: ntddk_ex.h:95
VOID NTAPI GDIOBJ_vUnlockObject(POBJ pobj)
Definition: gdiobj.c:877
ULONG cjData
Definition: metafile.c:25
BASEOBJECT BaseObject
Definition: metafile.c:20
#define GDITAG_TYPE_EMF
Definition: ntgdityp.h:245
_SEH2_END
Definition: create.c:4424
unsigned int ULONG
Definition: retypes.h:1
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
DWORD mm
Definition: metafile.c:22

Referenced by GdiCreateLocalMetaFilePict().