Commit 4d649c62 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

winedump: Dump metafiles in EMF spool files.

parent d745c8d4
......@@ -77,7 +77,7 @@ 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 long dump_emfrecord(unsigned long offset)
unsigned long dump_emfrecord(unsigned long offset)
{
const unsigned char* ptr;
unsigned int type, length, i;
......
......@@ -120,7 +120,24 @@ static unsigned long dump_emfspool_record(unsigned long off)
break;
}
dump_data((const unsigned char *)(hdr + 1), hdr->cjSize, "");
switch (hdr->ulID)
{
case EMRI_METAFILE:
case EMRI_FORM_METAFILE:
case EMRI_BW_METAFILE:
case EMRI_BW_FORM_METAFILE:
case EMRI_METAFILE_DATA:
{
unsigned long emf_off = off + sizeof(*hdr);
while ((emf_off = dump_emfrecord(emf_off)) && emf_off < off + sizeof(*hdr) + hdr->cjSize);
break;
}
default:
dump_data((const unsigned char *)(hdr + 1), hdr->cjSize, "");
break;
}
return off + sizeof(*hdr) + hdr->cjSize;
}
......
......@@ -248,6 +248,7 @@ void dbg_dump( void );
enum FileSig get_kind_lnk(void);
void lnk_dump( void );
enum FileSig get_kind_emf(void);
unsigned long dump_emfrecord(unsigned long offset);
void emf_dump( void );
enum FileSig get_kind_emfspool(void);
void emfspool_dump(void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment