Signed-off-by: Nikolay Sivov nsivov@codeweavers.com ---
The only goal is to remove "unknowns" that's been documented since. I think this patch does not conflict with last ntgdi batch.
dlls/gdi32/enhmetafile.c | 2 +- dlls/gdi32/metafile.c | 10 ++++------ dlls/gdi32/ntgdi_private.h | 10 ++++------ 3 files changed, 9 insertions(+), 13 deletions(-)
diff --git a/dlls/gdi32/enhmetafile.c b/dlls/gdi32/enhmetafile.c index 25ffcff93bf..b12db98d9e6 100644 --- a/dlls/gdi32/enhmetafile.c +++ b/dlls/gdi32/enhmetafile.c @@ -2804,7 +2804,7 @@ static HENHMETAFILE extract_emf_from_comment( const BYTE *buf, UINT mf_size ) chunk = (emf_in_wmf_comment *)(mr->rdParm + 2);
if (mr->rdFunction != META_ESCAPE || mr->rdParm[0] != MFCOMMENT) goto done; - if (chunk->magic != WMFC_MAGIC) goto done; + if (chunk->comment_id != WMFC_MAGIC) goto done;
if (!emf_bits) { diff --git a/dlls/gdi32/metafile.c b/dlls/gdi32/metafile.c index b0428960b50..6b4df5680ba 100644 --- a/dlls/gdi32/metafile.c +++ b/dlls/gdi32/metafile.c @@ -1096,13 +1096,11 @@ static BOOL add_mf_comment(HDC hdc, HENHMETAFILE emf) chunk = HeapAlloc(GetProcessHeap(), 0, FIELD_OFFSET(emf_in_wmf_comment, emf_data[max_chunk_size])); if(!chunk) goto end;
- chunk->magic = WMFC_MAGIC; - chunk->unk04 = 1; - chunk->unk06 = 0; - chunk->unk08 = 0; - chunk->unk0a = 1; + chunk->comment_id = WMFC_MAGIC; + chunk->comment_type = 0x1; + chunk->version = 0x00010000; chunk->checksum = 0; /* We fixup the first chunk's checksum before returning from GetWinMetaFileBits */ - chunk->unk0e = 0; + chunk->flags = 0; chunk->num_chunks = (size + max_chunk_size - 1) / max_chunk_size; chunk->chunk_size = max_chunk_size; chunk->remaining_size = size; diff --git a/dlls/gdi32/ntgdi_private.h b/dlls/gdi32/ntgdi_private.h index c3ae797ddf6..755d3193615 100644 --- a/dlls/gdi32/ntgdi_private.h +++ b/dlls/gdi32/ntgdi_private.h @@ -462,13 +462,11 @@ extern HMETAFILE MF_Create_HMETAFILE(METAHEADER *mh) DECLSPEC_HIDDEN; #include <pshpack2.h> typedef struct { - DWORD magic; /* WMFC */ - WORD unk04; /* 1 */ - WORD unk06; /* 0 */ - WORD unk08; /* 0 */ - WORD unk0a; /* 1 */ + DWORD comment_id; /* WMFC */ + DWORD comment_type; /* Always 0x00000001 */ + DWORD version; /* Always 0x00010000 */ WORD checksum; - DWORD unk0e; /* 0 */ + DWORD flags; /* Always 0 */ DWORD num_chunks; DWORD chunk_size; DWORD remaining_size;