Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
26b1c661
Commit
26b1c661
authored
Jun 30, 2017
by
Piotr Caban
Committed by
Alexandre Julliard
Jul 03, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winedump: Add initial support for handling EMF+ records.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
032d32f9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
125 additions
and
2 deletions
+125
-2
emf.c
tools/winedump/emf.c
+125
-2
No files found.
tools/winedump/emf.c
View file @
26b1c661
...
@@ -35,6 +35,15 @@
...
@@ -35,6 +35,15 @@
#include "windef.h"
#include "windef.h"
#include "winbase.h"
#include "winbase.h"
#include "wingdi.h"
#include "wingdi.h"
#include "gdiplusenums.h"
typedef
struct
{
WORD
Type
;
WORD
Flags
;
DWORD
Size
;
DWORD
DataSize
;
}
EmfPlusRecordHeader
;
static
const
char
*
debugstr_wn
(
const
WCHAR
*
wstr
,
unsigned
int
n
)
static
const
char
*
debugstr_wn
(
const
WCHAR
*
wstr
,
unsigned
int
n
)
{
{
...
@@ -67,6 +76,7 @@ static unsigned int read_int(const unsigned char *buffer)
...
@@ -67,6 +76,7 @@ static unsigned int read_int(const unsigned char *buffer)
}
}
#define EMRCASE(x) case x: printf("%-20s %08x\n", #x, length); break
#define EMRCASE(x) case x: printf("%-20s %08x\n", #x, length); break
#define EMRPLUSCASE(x) case x: printf(" %-20s %04x %08x %08x\n", #x, header->Flags, header->Size, header->DataSize); break
static
unsigned
offset
=
0
;
static
unsigned
offset
=
0
;
...
@@ -162,7 +172,120 @@ static int dump_emfrecord(void)
...
@@ -162,7 +172,120 @@ static int dump_emfrecord(void)
EMRCASE
(
EMR_WIDENPATH
);
EMRCASE
(
EMR_WIDENPATH
);
EMRCASE
(
EMR_SELECTCLIPPATH
);
EMRCASE
(
EMR_SELECTCLIPPATH
);
EMRCASE
(
EMR_ABORTPATH
);
EMRCASE
(
EMR_ABORTPATH
);
EMRCASE
(
EMR_GDICOMMENT
);
case
EMR_GDICOMMENT
:
{
printf
(
"%-20s %08x
\n
"
,
"EMR_GDICOMMENT"
,
length
);
/* Handle EMF+ records */
if
(
length
>=
16
&&
!
memcmp
((
char
*
)
PRD
(
offset
+
12
,
sizeof
(
unsigned
int
)),
"EMF+"
,
4
))
{
const
EmfPlusRecordHeader
*
header
;
const
unsigned
int
*
data_size
;
offset
+=
8
;
length
-=
8
;
data_size
=
PRD
(
offset
,
sizeof
(
*
data_size
));
printf
(
"data size = %x
\n
"
,
*
data_size
);
offset
+=
8
;
length
-=
8
;
while
(
length
>=
sizeof
(
*
header
))
{
header
=
PRD
(
offset
,
sizeof
(
*
header
));
switch
(
header
->
Type
)
{
EMRPLUSCASE
(
EmfPlusRecordTypeInvalid
);
EMRPLUSCASE
(
EmfPlusRecordTypeHeader
);
EMRPLUSCASE
(
EmfPlusRecordTypeEndOfFile
);
EMRPLUSCASE
(
EmfPlusRecordTypeComment
);
EMRPLUSCASE
(
EmfPlusRecordTypeGetDC
);
EMRPLUSCASE
(
EmfPlusRecordTypeMultiFormatStart
);
EMRPLUSCASE
(
EmfPlusRecordTypeMultiFormatSection
);
EMRPLUSCASE
(
EmfPlusRecordTypeMultiFormatEnd
);
EMRPLUSCASE
(
EmfPlusRecordTypeObject
);
EMRPLUSCASE
(
EmfPlusRecordTypeClear
);
EMRPLUSCASE
(
EmfPlusRecordTypeFillRects
);
EMRPLUSCASE
(
EmfPlusRecordTypeDrawRects
);
EMRPLUSCASE
(
EmfPlusRecordTypeFillPolygon
);
EMRPLUSCASE
(
EmfPlusRecordTypeDrawLines
);
EMRPLUSCASE
(
EmfPlusRecordTypeFillEllipse
);
EMRPLUSCASE
(
EmfPlusRecordTypeDrawEllipse
);
EMRPLUSCASE
(
EmfPlusRecordTypeFillPie
);
EMRPLUSCASE
(
EmfPlusRecordTypeDrawPie
);
EMRPLUSCASE
(
EmfPlusRecordTypeDrawArc
);
EMRPLUSCASE
(
EmfPlusRecordTypeFillRegion
);
EMRPLUSCASE
(
EmfPlusRecordTypeFillPath
);
EMRPLUSCASE
(
EmfPlusRecordTypeDrawPath
);
EMRPLUSCASE
(
EmfPlusRecordTypeFillClosedCurve
);
EMRPLUSCASE
(
EmfPlusRecordTypeDrawClosedCurve
);
EMRPLUSCASE
(
EmfPlusRecordTypeDrawCurve
);
EMRPLUSCASE
(
EmfPlusRecordTypeDrawBeziers
);
EMRPLUSCASE
(
EmfPlusRecordTypeDrawImage
);
EMRPLUSCASE
(
EmfPlusRecordTypeDrawImagePoints
);
EMRPLUSCASE
(
EmfPlusRecordTypeDrawString
);
EMRPLUSCASE
(
EmfPlusRecordTypeSetRenderingOrigin
);
EMRPLUSCASE
(
EmfPlusRecordTypeSetAntiAliasMode
);
EMRPLUSCASE
(
EmfPlusRecordTypeSetTextRenderingHint
);
EMRPLUSCASE
(
EmfPlusRecordTypeSetTextContrast
);
EMRPLUSCASE
(
EmfPlusRecordTypeSetInterpolationMode
);
EMRPLUSCASE
(
EmfPlusRecordTypeSetPixelOffsetMode
);
EMRPLUSCASE
(
EmfPlusRecordTypeSetCompositingMode
);
EMRPLUSCASE
(
EmfPlusRecordTypeSetCompositingQuality
);
EMRPLUSCASE
(
EmfPlusRecordTypeSave
);
EMRPLUSCASE
(
EmfPlusRecordTypeRestore
);
EMRPLUSCASE
(
EmfPlusRecordTypeBeginContainer
);
EMRPLUSCASE
(
EmfPlusRecordTypeBeginContainerNoParams
);
EMRPLUSCASE
(
EmfPlusRecordTypeEndContainer
);
EMRPLUSCASE
(
EmfPlusRecordTypeSetWorldTransform
);
EMRPLUSCASE
(
EmfPlusRecordTypeResetWorldTransform
);
EMRPLUSCASE
(
EmfPlusRecordTypeMultiplyWorldTransform
);
EMRPLUSCASE
(
EmfPlusRecordTypeTranslateWorldTransform
);
EMRPLUSCASE
(
EmfPlusRecordTypeScaleWorldTransform
);
EMRPLUSCASE
(
EmfPlusRecordTypeRotateWorldTransform
);
EMRPLUSCASE
(
EmfPlusRecordTypeSetPageTransform
);
EMRPLUSCASE
(
EmfPlusRecordTypeResetClip
);
EMRPLUSCASE
(
EmfPlusRecordTypeSetClipRect
);
EMRPLUSCASE
(
EmfPlusRecordTypeSetClipPath
);
EMRPLUSCASE
(
EmfPlusRecordTypeSetClipRegion
);
EMRPLUSCASE
(
EmfPlusRecordTypeOffsetClip
);
EMRPLUSCASE
(
EmfPlusRecordTypeDrawDriverString
);
EMRPLUSCASE
(
EmfPlusRecordTypeStrokeFillPath
);
EMRPLUSCASE
(
EmfPlusRecordTypeSerializableObject
);
EMRPLUSCASE
(
EmfPlusRecordTypeSetTSGraphics
);
EMRPLUSCASE
(
EmfPlusRecordTypeSetTSClip
);
EMRPLUSCASE
(
EmfPlusRecordTotal
);
default:
printf
(
" unknown EMF+ record %x %04x %08x
\n
"
,
header
->
Type
,
header
->
Flags
,
header
->
Size
);
break
;
}
if
(
length
<
sizeof
(
*
header
)
||
header
->
Size
%
4
)
return
-
1
;
length
-=
sizeof
(
*
header
);
offset
+=
sizeof
(
*
header
);
for
(
i
=
0
;
i
<
header
->
Size
-
sizeof
(
*
header
);
i
+=
4
)
{
if
(
i
%
16
==
0
)
printf
(
" "
);
if
(
!
(
ptr
=
PRD
(
offset
,
4
)))
return
-
1
;
length
-=
4
;
offset
+=
4
;
printf
(
"%08x "
,
read_int
(
ptr
));
if
((
i
%
16
==
12
)
||
(
i
+
4
==
header
->
Size
-
sizeof
(
*
header
)))
printf
(
"
\n
"
);
}
}
return
0
;
}
break
;
}
EMRCASE
(
EMR_FILLRGN
);
EMRCASE
(
EMR_FILLRGN
);
EMRCASE
(
EMR_FRAMERGN
);
EMRCASE
(
EMR_FRAMERGN
);
EMRCASE
(
EMR_INVERTRGN
);
EMRCASE
(
EMR_INVERTRGN
);
...
@@ -178,7 +301,7 @@ static int dump_emfrecord(void)
...
@@ -178,7 +301,7 @@ static int dump_emfrecord(void)
if
(
length
>=
sizeof
(
*
clip
)
+
sizeof
(
*
data
))
if
(
length
>=
sizeof
(
*
clip
)
+
sizeof
(
*
data
))
rc_count
=
data
->
rdh
.
nCount
;
rc_count
=
data
->
rdh
.
nCount
;
printf
(
"%-20s %08x
\n
"
,
"EMREXTSELECTCLIPRGN"
,
length
);
printf
(
"%-20s %08x
\n
"
,
"EMR
_
EXTSELECTCLIPRGN"
,
length
);
printf
(
"mode %d, rects %d
\n
"
,
clip
->
iMode
,
rc_count
);
printf
(
"mode %d, rects %d
\n
"
,
clip
->
iMode
,
rc_count
);
for
(
i
=
0
,
rc
=
(
const
RECT
*
)
data
->
Buffer
;
i
<
rc_count
;
i
++
,
rc
++
)
for
(
i
=
0
,
rc
=
(
const
RECT
*
)
data
->
Buffer
;
i
<
rc_count
;
i
++
,
rc
++
)
printf
(
" (%d,%d)-(%d,%d)"
,
rc
->
left
,
rc
->
top
,
rc
->
right
,
rc
->
bottom
);
printf
(
" (%d,%d)-(%d,%d)"
,
rc
->
left
,
rc
->
top
,
rc
->
right
,
rc
->
bottom
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment