Module: wine Branch: master Commit: 0e49547c7ae1ce33ffd293bb784650572bbd75cc URL: https://gitlab.winehq.org/wine/wine/-/commit/0e49547c7ae1ce33ffd293bb7846505...
Author: Piotr Caban piotr@codeweavers.com Date: Sat Oct 15 20:52:44 2022 +0200
winedump: Add support for EMRI_METAFILE_EXT records.
---
tools/winedump/emfspool.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
diff --git a/tools/winedump/emfspool.c b/tools/winedump/emfspool.c index 9e591f6dd67..7d6344facd1 100644 --- a/tools/winedump/emfspool.c +++ b/tools/winedump/emfspool.c @@ -61,6 +61,14 @@ typedef struct unsigned int cjSize; } record_hdr;
+static inline void print_longlong(ULONGLONG value) +{ + if (sizeof(value) > sizeof(unsigned long) && value >> 32) + printf("0x%lx%08lx", (unsigned long)(value >> 32), (unsigned long)value); + else + printf("0x%lx", (unsigned long)value); +} + static const WCHAR* read_wstr(unsigned long off) { const WCHAR *beg, *end; @@ -133,6 +141,20 @@ static unsigned long dump_emfspool_record(unsigned long off) break; }
+ case EMRI_METAFILE_EXT: + case EMRI_BW_METAFILE_EXT: + { + const ULONGLONG *emf_off = PRD(off + sizeof(*hdr), sizeof(*emf_off)); + if (!emf_off) + fatal("truncated file\n"); + printf(" %-20s ", "offset"); + print_longlong(*emf_off); + printf(" (absolute position "); + print_longlong(off - *emf_off); + printf(")\n"); + break; + } + default: dump_data((const unsigned char *)(hdr + 1), hdr->cjSize, ""); break;