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
d745c8d4
Commit
d745c8d4
authored
Oct 15, 2022
by
Piotr Caban
Committed by
Alexandre Julliard
Oct 17, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winedump: Don't use static offset in dump_emfrecord.
parent
cf78df36
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
12 deletions
+10
-12
emf.c
tools/winedump/emf.c
+10
-12
No files found.
tools/winedump/emf.c
View file @
d745c8d4
...
...
@@ -77,15 +77,13 @@ static unsigned int read_int(const unsigned char *buffer)
#define EMRCASE(x) case x: printf("%-20s %08x\n", #x, length); break
#define EMRPLUSCASE(x) case x: printf(" %-20s %04x %08x %08x\n", #x, (UINT)header->Flags, (UINT)header->Size, (UINT)header->DataSize); break
static
unsigned
offset
=
0
;
static
int
dump_emfrecord
(
void
)
static
unsigned
long
dump_emfrecord
(
unsigned
long
offset
)
{
const
unsigned
char
*
ptr
;
unsigned
int
type
,
length
,
i
;
ptr
=
PRD
(
offset
,
8
);
if
(
!
ptr
)
return
-
1
;
if
(
!
ptr
)
return
0
;
type
=
read_int
(
ptr
);
length
=
read_int
(
ptr
+
4
);
...
...
@@ -277,7 +275,7 @@ static int dump_emfrecord(void)
}
if
(
length
<
sizeof
(
*
header
)
||
header
->
Size
%
4
)
return
-
1
;
return
0
;
length
-=
sizeof
(
*
header
);
offset
+=
sizeof
(
*
header
);
...
...
@@ -286,7 +284,7 @@ static int dump_emfrecord(void)
{
if
(
i
%
16
==
0
)
printf
(
" "
);
if
(
!
(
ptr
=
PRD
(
offset
,
4
)))
return
-
1
;
if
(
!
(
ptr
=
PRD
(
offset
,
4
)))
return
0
;
length
-=
4
;
offset
+=
4
;
printf
(
"%08x "
,
read_int
(
ptr
));
...
...
@@ -295,7 +293,7 @@ static int dump_emfrecord(void)
}
}
return
0
;
return
offset
;
}
break
;
...
...
@@ -463,7 +461,7 @@ static int dump_emfrecord(void)
}
if
(
(
length
<
8
)
||
(
length
%
4
)
)
return
-
1
;
return
0
;
length
-=
8
;
...
...
@@ -473,14 +471,14 @@ static int dump_emfrecord(void)
{
if
(
i
%
16
==
0
)
printf
(
" "
);
if
(
!
(
ptr
=
PRD
(
offset
,
4
)))
return
-
1
;
if
(
!
(
ptr
=
PRD
(
offset
,
4
)))
return
0
;
offset
+=
4
;
printf
(
"%08x "
,
read_int
(
ptr
));
if
(
(
i
%
16
==
12
)
||
(
i
+
4
==
length
))
printf
(
"
\n
"
);
}
return
0
;
return
offset
;
}
enum
FileSig
get_kind_emf
(
void
)
...
...
@@ -495,6 +493,6 @@ enum FileSig get_kind_emf(void)
void
emf_dump
(
void
)
{
offset
=
0
;
while
(
!
dump_emfrecord
(
));
unsigned
long
offset
=
0
;
while
(
(
offset
=
dump_emfrecord
(
offset
)
));
}
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