INF: CopyMetaFile Creates Incorrectly Sized Destination

ID Number: Q82232

3.10

WINDOWS

Summary:

When an application calls the CopyMetaFile function to create a copy

of a metafile, the size of the metafile is listed incorrectly in the

destination metafile. The destination size is three words larger than

the source metafile.

More Information:

The debugging version of Windows 3.1 contains code to validate the

size of a memory metafile. This code walks through every record in a

metafile and computes the total size. The code compares the computed

size with the size listed in the header. If the sizes do not match,

the debugging version of Windows displays the following message:

Metafile has incorrect size

In most cases, this message indicates a corrupted or incorrectly

formed metafile. However, this message is also generated as a result

of copying an existing metafile due to the problem detailed above.

Note: By itself, the "metafile has incorrect size" message is harmless

and can be safely ignored. However, under certain circumstances, the

debugging version of Windows will also display the following message:

Metafile is not terminated properly

This message indicates a more serious problem because, as the

validation code walked through the array of metafile records, it did

not locate a terminator record. An attempt to play an improperly

terminated metafile usually results in a General Protection Fault

(GP-Fault). To prevent this fault, GDI aborts the call to PlayMetaFile

and returns failure.

Additional reference words: 3.10