ReactOS 0.4.16-dev-197-g92996da
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:118

◆ 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}
HDC APIENTRY GreCreateCompatibleDC(HDC hdc, BOOL bAltDc)
Definition: dclife.c:817
#define TRUE
Definition: types.h:120
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
77 {
78 ProbeForRead( pjData, cjData, 1 );
79 RtlCopyMemory( pmto->pjData, pjData, cjData) ;
80 }
82 {
83 Pass = FALSE;
84 }
86
87 if (Pass)
88 {
91 return pmto->BaseObject.hHmgr;
92 }
93 else
94 {
96 }
97 }
98 }
99 return NULL;
100}
HGDIOBJ hHmgr(VOID)
Definition: baseobj.hpp:95
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
VOID NTAPI ProbeForRead(IN CONST VOID *Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:102
#define _SEH2_END
Definition: filesup.c:22
#define _SEH2_TRY
Definition: filesup.c:19
unsigned int BOOL
Definition: ntddk_ex.h:94
@ GDILoObjType_LO_META_TYPE
Definition: gdi_private.h:42
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
static struct proto Pass[]
Definition: mkg3states.c:58
#define GDI_OBJ_HMGR_PUBLIC
Definition: ntgdihdl.h:116
#define GDITAG_TYPE_EMF
Definition: ntgdityp.h:246
#define GDITAG_TYPE_MFP
Definition: ntgdityp.h:247
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:66
ULONG cjData
Definition: metafile.c:25
BASEOBJECT BaseObject
Definition: metafile.c:20
DWORD yExt
Definition: metafile.c:24
DWORD iType
Definition: metafile.c:21
PBYTE pjData[4]
Definition: metafile.c:26
DWORD mm
Definition: metafile.c:22
DWORD xExt
Definition: metafile.c:23
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
VOID NTAPI GDIOBJ_vSetObjectOwner(POBJ pobj, ULONG ulNewOwner)
Definition: gdiobj.c:965
POBJ NTAPI GDIOBJ_AllocObjWithHandle(ULONG ObjectType, ULONG cjSize)
Definition: gdiobj.c:1522
VOID NTAPI GDIOBJ_vUnlockObject(POBJ pobj)
Definition: gdiobj.c:880
VOID NTAPI GDIOBJ_vDeleteObject(POBJ pobj)
Definition: gdiobj.c:1111
struct _METATYPEOBJ * PMETATYPEOBJ
_In_ ULONG iType
Definition: winddi.h:3748

◆ 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 {
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}
VOID NTAPI ProbeForWrite(IN PVOID Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:143
unsigned long DWORD
Definition: ntddk_ex.h:95
@ GDIObjType_META_TYPE
Definition: ntgdityp.h:141
uint32_t ULONG
Definition: typedefs.h:59
PGDIOBJ NTAPI GDIOBJ_LockObject(HGDIOBJ hobj, UCHAR objt)
Definition: gdiobj.c:826