Commit 0dab1e41 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

gdi32: Use documented structure layout for EMF-to-WMF embedding records.

parent cade5944
...@@ -2804,7 +2804,7 @@ static HENHMETAFILE extract_emf_from_comment( const BYTE *buf, UINT mf_size ) ...@@ -2804,7 +2804,7 @@ static HENHMETAFILE extract_emf_from_comment( const BYTE *buf, UINT mf_size )
chunk = (emf_in_wmf_comment *)(mr->rdParm + 2); chunk = (emf_in_wmf_comment *)(mr->rdParm + 2);
if (mr->rdFunction != META_ESCAPE || mr->rdParm[0] != MFCOMMENT) goto done; 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) if (!emf_bits)
{ {
......
...@@ -1096,13 +1096,11 @@ static BOOL add_mf_comment(HDC hdc, HENHMETAFILE emf) ...@@ -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])); chunk = HeapAlloc(GetProcessHeap(), 0, FIELD_OFFSET(emf_in_wmf_comment, emf_data[max_chunk_size]));
if(!chunk) goto end; if(!chunk) goto end;
chunk->magic = WMFC_MAGIC; chunk->comment_id = WMFC_MAGIC;
chunk->unk04 = 1; chunk->comment_type = 0x1;
chunk->unk06 = 0; chunk->version = 0x00010000;
chunk->unk08 = 0;
chunk->unk0a = 1;
chunk->checksum = 0; /* We fixup the first chunk's checksum before returning from GetWinMetaFileBits */ 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->num_chunks = (size + max_chunk_size - 1) / max_chunk_size;
chunk->chunk_size = max_chunk_size; chunk->chunk_size = max_chunk_size;
chunk->remaining_size = size; chunk->remaining_size = size;
......
...@@ -462,13 +462,11 @@ extern HMETAFILE MF_Create_HMETAFILE(METAHEADER *mh) DECLSPEC_HIDDEN; ...@@ -462,13 +462,11 @@ extern HMETAFILE MF_Create_HMETAFILE(METAHEADER *mh) DECLSPEC_HIDDEN;
#include <pshpack2.h> #include <pshpack2.h>
typedef struct typedef struct
{ {
DWORD magic; /* WMFC */ DWORD comment_id; /* WMFC */
WORD unk04; /* 1 */ DWORD comment_type; /* Always 0x00000001 */
WORD unk06; /* 0 */ DWORD version; /* Always 0x00010000 */
WORD unk08; /* 0 */
WORD unk0a; /* 1 */
WORD checksum; WORD checksum;
DWORD unk0e; /* 0 */ DWORD flags; /* Always 0 */
DWORD num_chunks; DWORD num_chunks;
DWORD chunk_size; DWORD chunk_size;
DWORD remaining_size; DWORD remaining_size;
......
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