Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Windows Metafile
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===WMF=== {{Infobox file format | name = Windows Metafile | icon = | logo = | extension = .wmf | mime = image/wmf<ref name="rfc7903"/> | type code = | uniform type = com.microsoft.wmf<ref name="rfc7903"/> | magic = | released = | latest release version = | latest release date = | type = [[Vector graphics]] | container for = | contained by = | extended from = | extended to = [[#EMF|EMF]] | standard = | open = | free = }} [[File:WMF-structure.svg|thumb|left|Structures of original and placeable Windows metafiles<ref>{{citation|url= https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=Windows Metafile Format|publisher=Microsoft|page=17|section=Figure 1: Structures of original and placeable Windows metafiles}}</ref>]] WMF files were not originally designed to be device independent, meaning that a file could not be played back on output devices that differed from the original device on which the file was recorded. A partial solution to this issue was invented by [[Aldus Corporation]], who added an additional "placeable" header, called the "APM header",<ref name="aldus">{{citation|title=Q66949: INFO: Windows Metafile Functions & Aldus Placeable Metafiles|publisher=Microsoft|url=https://jeffpar.github.io/kbarchive/kb/066/Q66949/|via=KnowledgeBase Archive: An Archive of Early Microsoft KnowledgeBase }}</ref> which added a bounding rectangle, a metafile version, metafile size, number of objects in the metafile and the size of the largest single record in the metafile.<ref name="wmfstructure">{{citation|url= https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=Windows Metafile Format|publisher=Microsoft|page=17|section=1.3.1 Metafile Structure}}</ref><ref>{{citation|url= https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=Windows Metafile Format|publisher=Microsoft|section=2.3.2.3 META_PLACEABLE Record|page=115}}</ref> This was later incorporated into the WMF format by [[Microsoft]], starting in [[Windows 2000]].<ref>{{citation|url= https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=Windows Metafile Format|publisher=Microsoft|page=55|quote=<55> Section 2.3.2.3: Windows NT 3.1, Windows NT 3.5, Windows NT 3.51, and Windows 95: This feature is not supported.}}</ref> WMF files are structured by a series of records, starting with a number of control records: the header record,<ref name="wmfstructure"/><ref>{{citation|url= https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=Windows Metafile Format|publisher=Microsoft|section=2.3.2.2 MTF_HEADERRECORD Record|page=114}}</ref> the aforementioned optional placeable record,<ref>{{citation|url= https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=Windows Metafile Format|publisher=Microsoft|section=2.3.2.2 MTF_HEADERRECORD Record|page=114}}</ref> and finished by an [[end of file]] record.<ref name="wmfstructure"/><ref>{{citation|url= https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=Windows Metafile Format|publisher=Microsoft|section=2.3.2.1 MTF_EOF Record|page=114}}</ref> Encapsulated by the control records are the records that make up the image itself. These records work within what is known as the ''playback device context'', which is the collection of properties and objects that make up a device's graphical environment as the metafile is being "played back" onto this output device.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf | title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification | section=1.1 Glossary|page=13|access-date=2020-01-24|publisher=Microsoft}}</ref> Records other than control records can be largely grouped into bitmap records, drawing records, object records, state records and escape records. {{Clear}} ====Bitmap records==== Bitmap records manage and output [[bitmap image]]s. {| class="wikitable" |- valign="bottom" ! Name ! Description |- | META_BITBLT | Specifies how to do a [[bit block transfer]]. These records can specify a bitmap to use as the source, or a region.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf | title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification | section=2.3.1.1 META_BITBLT Record|pages=101β103|access-date=2020-01-24 }}</ref> |- | META_DIBBITBLT | Specifies how to do a bit block transfer of a [[device-independent bitmap]] image. These records can specify a bitmap to use as the source, or a region.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf | title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification | section=2.3.1.2 META_DIBBITBLT Record|pages=103β106|access-date=2020-01-24|publisher=Microsoft}}</ref> |- | META_DIBSTRETCHBITBLT | Specifies how to do a bit block transfer of a device-independent bitmap image, but allows for expansion or contraction of the image. These records can specify a bitmap to use as the source, or a region.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf | title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification | section=2.3.1.3 META_DIBSTRETCHBITBLT Record|pages=106β108|access-date=2020-01-24|publisher=Microsoft}}</ref> |- | META_SETDIBTODEV | Specifies color to set a block of pixels in a device-independent bitmap image. These records can specify a bitmap to use as the source, or a region.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf | title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification | section=2.3.1.4 META_SETDIBTODEV Record|pages=108β109|access-date=2020-01-24|publisher=Microsoft}}</ref> |- | META_STRETCHBLT | Specifies how to do a bit block transfer, but allows for expansion or contraction of the image.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf | title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification | section=2.3.1.5 META_STRETCHBLT Record|pages=109β110|access-date=2020-01-24|publisher=Microsoft}}</ref> |- | META_STRETCHDIB | Specifies how to do a bit block transfer of a device-independent bitmap image, but allows for expansion or contraction of the image. These records can specify a bitmap to use as the source, or a region.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf | title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification | section=2.3.1.6 META_STRETCHDIB Record|pages=103β106|access-date=2020-01-24|publisher=Microsoft}}</ref> |} ====Drawing records==== Drawing records produce graphics output. {| class="wikitable" |- valign="bottom" ! Name ! Description |- | META_ARC | Draws an elliptical [[arc (geometry)|arc]].<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf | title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification | section=2.3.3.1 META_ARC Record|pages=101β103|access-date=2020-01-24}}</ref> |- | META_CHORD | Draws a [[chord (geometry)|chord]].<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf | title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification | section=2.3.3.2 META_CHORD Record|pages=117β118|access-date=2020-01-24}}</ref> |- | META_ELLIPSE | Draws an elliptical [[arc (geometry)|arc]].<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf | title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification | section=2.3.3.3 META_ELLIPSE Record|page=119|access-date=2020-01-24}}</ref> |- | META_EXTFLOODFILL | Fills an area with a brush.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf | title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification | section=2.3.3.4 META_EXTFLOODFILL Record|pages=119β120|access-date=2020-01-24}}</ref> |- | META_EXTTEXTOUT | Draw text with font, background color and text color of the playback device context.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf | title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification | section=2.3.3.5 META_EXTTEXTOUT Record|pages=119β120|access-date=2020-01-24}}</ref> |- | META_FILLREGION | Fills a region with a specified brush.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf | title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification | section=2.3.3.6 META_FILLREGION Record|page=121|access-date=2020-01-24}}</ref> |- | META_FLOODFILL | Fills an area with a brush.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf | title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification | section=2.3.3.7 META_FLOODFILL Record|pages=119β120|access-date=2020-01-24}}</ref> |- | META_FRAMEREGION | Draws a border around a region of the page with a brush.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf | title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification | section=2.3.3.8 META_FRAMEREGION Record|pages=122β123|access-date=2020-01-24}}</ref> |- | META_INVERTREGION | Paints a region of the graphic with inverted colors.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf | title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification | section=2.3.3.9 META_INVERTREGION Record|page=123|access-date=2020-01-24}}</ref> |- | META_LINETO | Draws a [[Interval (mathematics)|half-open]] [[line (geometry)|line]] from the drawing position defined in the playback device context to a specified point.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf | title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification | section=2.3.3.10 META_LINETO Record|pages=123β124|access-date=2020-01-24}}</ref> |- | META_PAINTREGION | Paint a region with the current brush specified in the playback device context.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf | title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification | section=2.3.3.11 META_PAINTREGION Record|page=124|access-date=2020-01-24}}</ref> |- | META_PATBLT | Paint a region with the current brush specified in the playback device context and then combine the brush color and surface color(s) using a [[Render output unit|raster operation]].<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf | title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification | section=2.3.3.12 META_PATBLT Record|pages=124β125|access-date=2020-01-24}}</ref> |- | META_PIE | Draw a pie-shaped wedge bounded by the intersection of an ellipse and two radials — the line is set via the pen set via the playback device context, and the area bounded by the pie shape is filled in by the current brush of the playback device context.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf | title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification | section=2.3.3.13 META_PIE Record|pages=125β126|access-date=2020-01-24}}</ref> |- | META_POLYLINE | Draws a series of line segnments by connecting the points in a specified array.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf | title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification | section=2.3.3.14 META_POLYLINE Record|page=126|access-date=2020-01-24}}</ref> |- | META_POLYGON | Paints a [[polygon]] consisting of two or more [[vertex (geometry)|vertices]] connected by straight lines. The polygon is outlined by using the pen and filled by using the brush and polygon fill mode that are defined in the playback device context.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf | title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification | section=2.3.3.15 META_POLYGON Record|page=127|access-date=2020-01-24}}</ref> |- | META_POLYPOLYGON | Paints a series of closed polygons, which may overlap. Each polygon is outlined by using the pen and filled by using the brush and polygon fill mode that are defined in the playback device context.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf | title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification | section=2.3.3.16 META_POLYPOLYGON Record|pages=127β128|access-date=2020-01-24}}</ref> |- | META_RECTANGLE | Paints a rectangle, which is outlined by using the pen and filled by using the brush and is filled by using the brush that is defined in the playback device context.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf | title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification | section=2.3.3.17 META_RECTANGLE Record|pages=127β128|access-date=2020-01-24}}</ref> |- | META_ROUNDRECT | Paints a rectangle with rounded corners. The rectangle is outlined by using the pen and filled by using the brush and is filled by using the brush that is defined in the playback device context.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf | title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification | section=2.3.3.18 META_ROUNDRECT Record|pages=128β129|access-date=2020-01-24}}</ref> |- | META_SETPIXEL | Sets the pixel at the specified coordinates to the specified color.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf | title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification | section=2.3.3.19 META_SETPIXEL Record|pages=129β130|access-date=2020-01-24}}</ref> |- | META_TEXTOUT | Outputs a [[character string]] at the specified location by using the font, background color, and text color that are defined in the playback device context.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf | title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification | section=2.3.3.20 META_TEXTOUT Record|page=130|access-date=2020-01-24}}</ref> |} ====Object records==== Object records create and manage graphics objects. In WMF files there are two broad categories of objects β graphics objects and structure objects. Structure objects are not explicitly created or deleted in a WMF, they are instead of complex structures. For example, the BitmapCoreHeader contains information about the dimensions and color format of a device-independent bitmap,<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.2.2.2. BitmapCoreHeader Object|page=85|access-date=2020-01-25}}</ref> which is itself part of a DeviceIndependentBitmap object.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.2.2.9. DeviceIndependentBitmap Object|page=91|access-date=2020-01-25}}</ref> A graphics object, however, specifies parameters for graphics output and during playback of the WMF it sets up the playback device context.<ref name="graphicsobjects">{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.2.1. Graphics Objects|page=79|access-date=2020-01-25}}</ref> Graphics objects can be ''brushes'' (defines the style, color and pattern of a brush which defines how to paint an area of the graphic), ''fonts'' (defines properties that affect how text is displayed), ''palettes'' (specifies colors as device-independent values, defined by an application), ''pens'' (specifies the graphical attributes of a line), and ''regions'' (which specify line and curve segments that define a shape).<ref name="graphicsobjects"/> {| class="wikitable" |- valign="bottom" ! Name ! Description |- | META_CREATEBRUSHINDIRECT | Creates a brush object from a LogBrush (logical brush) object.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.4.1 META_CREATEBRUSHINDIRECT Record|pages=131β132|access-date=2020-01-25}}</ref> |- | META_CREATEFONTINDIRECT | Creates a brush object from a font object.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.4.2 META_CREATEFONTINDIRECT Record|pages=132|access-date=2020-01-25}}</ref> |- | META_CREATEPALETTE | Creates a palette object. |- | META_CREATEPATTERNBRUSH<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.4.4 META_CREATEPATTERNBRUSH Record|pages=133β135|access-date=2020-01-25}}</ref> | Creates a brush object from a LogBrush (logical brush) object.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.4.3 META_CREATEPALETTE Record|pages=132β133|access-date=2020-01-25}}</ref> |- | META_CREATEPENINDIRECT | Creates a pen object.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.4.5 META_CREATEPENINDIRECT Record|pages=134β135|access-date=2020-01-25}}</ref> |- | META_CREATEREGION | Creates a region object.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.4.6 META_CREATEREGION Record|page=135|access-date=2020-01-25}}</ref> |- | META_DELETEOBJECT | Delete an object.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.4.7 META_DELETEOBJECT Record|page=135|access-date=2020-01-25}}</ref> |- | META_CREATEBRUSHINDIRECT | Creates a brush object from a LogBrush (logical brush) object.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.4.8 META_CREATEBRUSHINDIRECT Record|pages=135β136|access-date=2020-01-25}}</ref> |- | META_DIBCREATEPATTERNBRUSH | Creates a brush object from a device-independent bitmap.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.4.9 META_DIBCREATEPATTERNBRUSH Record|pages=136β137|access-date=2020-01-25}}</ref> |- | META_SELECTCLIPREGION | Specifies the region object that will be the current [[Clipping (computer graphics)|clipping region]].<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.4.10 META_SELECTCLIPREGION Record|page=137|access-date=2020-01-25}}</ref> |- | META_SELECTOBJECT | Selects the object that will be the current object for the playback device context, which works on all graphics objects except palette objects, which must be set with META_SELECTPALETTE.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.4.11 META_SELECTOBJECT Record|pages=137β138|access-date=2020-01-25}}</ref> |- | META_SELECTPALETTE | Selects the logical palette for the playback device context.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.4.11 META_SELECTPALETTE Record|page=139|access-date=2020-01-25}}</ref> |} ====State records==== State records manage the graphics properties of the playback device context.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.5 State Record Types|pages=138|access-date=2020-01-28}}</ref> {| class="wikitable" |- valign="bottom" ! Name ! Description |- | META_ANIMATEPALETTE | Redefines entries in the logical palette that is defined in the playback device context with a specified Palette Object.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.5.1 META_ANIMATEPALETTE Record|pages=140|access-date=2020-01-28}}</ref> |- | META_EXCLUDECLIPRECT | Sets the clipping region that is defined in the playback device context to the existing clipping region minus a specified rectangle.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.5.2 META_EXCLUDECLIPRECT Record|pages=140β141|access-date=2020-01-28}}</ref> |- | META_INTERSECTCLIPRECT | Sets the clipping region that is defined in the playback device context to the intersection of the existing clipping region and a specified rectangle.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.5.3 META_INTERSECTCLIPRECT Record|pages=141β142|access-date=2020-01-28}}</ref> |- | META_MOVETO | Sets the output position in the playback device context to a specified point.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.5.1 META_MOVETO Record|pages=142|access-date=2020-01-28}}</ref> |- | META_OFFSETCLIPRGN | Moves the clipping region that is defined in the playback device context by specified offsets.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.5.4 META_OFFSETCLIPRGN Record|pages=142β143|access-date=2020-01-28}}</ref> |- | META_OFFSETVIEWPORTORG | Moves the viewport origin in the playback device context by specified horizontal and vertical offsets.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.5.5 META_OFFSETVIEWPORTORG Record|page=143|access-date=2020-01-28}}</ref> |- | META_OFFSETWINDOWORG | Moves the output window origin in the playback device context by specified horizontal and vertical offsets.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.5.6 META_OFFSETWINDOWORG Record|pages=131β132|access-date=2020-01-28}}</ref> |- | META_REALIZEPALETTE | Maps entries from the logical palette that is defined in the playback device context to the system palette.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.5.7 META_REALIZEPALETTE Record|pages=143β144|access-date=2020-01-28}}</ref> |- | META_RESIZEPALETTE | Redefines the size of the logical palette that is defined in the playback device context.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.5.8 META_RESIZEPALETTE Record|page=144|access-date=2020-01-28}}</ref> |- | META_RESTOREDC | Restores the playback device context from a previously saved device context.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.5.9 META_RESTOREDC Record|page=145|access-date=2020-01-28}}</ref> |- | META_SAVEDC | Saves the playback device context for later retrieval.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.5.10 META_SAVEDC Record|page=145|access-date=2020-01-28}}</ref> |- | META_SCALEVIEWPORTEXT | Scales the horizontal and vertical extents of the viewport that is defined in the playback device context using the ratios formed by specified multiplicands and divisors.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.5.11 META_SCALEVIEWPORTEXT Record|pages=145β146|access-date=2020-01-28}}</ref> |- | META_SCALEWINDOWEXT | Scales the horizontal and vertical extents of the output window that is defined in the playback device context using the ratios formed by specified multiplicands and divisors.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.5.12 META_SCALEWINDOWEXT Record|pages=146β147|access-date=2020-01-28}}</ref> |- | META_SETBKCOLOR | Sets the background color in the playback device context to a specified color.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.5.13 META_SETBKCOLOR Record|page=147|access-date=2020-01-28}}</ref> |- | META_SETBKMODE | Sets the background mix mode in the playback device context.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.5.14 META_SETBKMODE Record|pages=147β148|access-date=2020-01-28}}</ref> |- | META_SETLAYOUT | Defines the layout orientation in the playback device context.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.5.15 META_SETLAYOUT Record|page=148|access-date=2020-01-28}}</ref> |- | META_SETMAPMODE | Defines the mapping mode in the playback device context.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.5.16 META_SETMAPMODE Record|pages=148β149|access-date=2020-01-28}}</ref> |- | META_SETMAPPERFLAGS | Defines the algorithm that the font mapper uses when it maps logical fonts to physical fonts.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.5.17 META_SETMAPPERFLAGS Record|pages=131β132|access-date=2020-01-28}}</ref> |- | META_SETPALENTRIES | Defines RGB color values in a range of entries in the logical palette that is defined in the playback device context.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.5.18 META_ANIMATEPALETTE Record|page=149|access-date=2020-01-28}}</ref> |- | META_SETPOLYFILLMODE | Defines polygon fill mode in the playback device context for graphics operations that fill polygons.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.5.19 META_SETPALENTRIES Record|pages=149β150|access-date=2020-01-28}}</ref> |- | META_SETRELABS | Unused record.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.5.20 META_SETRELABS Record|page=150|access-date=2020-01-28}}</ref> |- | META_SETROP2 | Defines the foreground raster operation mixing mode in the playback device context.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.5.21 META_SETROP2 Record|page=151|access-date=2020-01-28}}</ref> |- | META_SETSTRETCHBLTMODE | Defines the bitmap stretching mode in the playback device context.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.5.1 META_SETSTRETCHBLTMODE Record|pages=151β152|access-date=2020-01-28}}</ref> |- | META_SETTEXTALIGN | Defines text-alignment values in the playback device context.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.5.22 META_SETTEXTALIGN Record|page=152|access-date=2020-01-28}}</ref> |- | META_SETTEXTCHAREXTRA | Defines inter-character spacing for text justification in the playback device context.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.5.1 META_SETTEXTCHAREXTRA Record|pages=152β153|access-date=2020-01-28}}</ref> |- | META_SETTEXTCOLOR | Defines the text foreground color in the playback device context.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.5.23 META_SETTEXTCOLOR Record|page=153|access-date=2020-01-28}}</ref> |- | META_SETTEXTJUSTIFICATION | Defines the amount of space to add to break characters in a string of justified text.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.5.24 META_SETTEXTJUSTIFICATION Record|pages=153β154|access-date=2020-01-28}}</ref> |- | META_SETVIEWPORTEXT | Defines the horizontal and vertical extents of the viewport in the playback device context.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.5.25 META_SETVIEWPORTEXT Record|page=154|access-date=2020-01-28}}</ref> |- | META_SETVIEWPORTORG | Defines the viewport origin in the playback device context.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.5.26 META_SETVIEWPORTORG Record|pages=154β155|access-date=2020-01-28}}</ref> |- | META_SETWINDOWEXT | Defines the horizontal and vertical extents of the output window in the playback device context.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.5.27 META_SETWINDOWEXT Record|page=155|access-date=2020-01-28}}</ref> |- | META_SETWINDOWORG | Defines the output window origin in the playback device context.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.5.28 META_SETWINDOWORG Record|page=155|access-date=2020-01-28}}</ref> |} ====Escape records==== [[File:WMF Escape Record.svg|thumb|WMF generic escape record]] Escape records are a means to extend metafile functionality via records that are not otherwise defined as a WMF record type. Each escape record contains a record function, an escape function and potentially escape data. The following escape records make up a WMF file. {| class="wikitable" |- valign="bottom" ! Name ! Description |- | ABORTDOC | Stops processing the current document.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.6.2. ABORTDOC Record|pages=158β159|access-date=2020-01-28}}</ref> |- | BEGIN_PATH | Opens a path.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.6.3. BEGIN_PATH Record|page=159|access-date=2020-01-28}}</ref> |- | CHECK_JPEGFORMAT | Determines whether it can handle the given [[JPEG]] image.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.6.4. CHECK_JPEGFORMAT Record|pages=159β160|access-date=2020-01-28}}</ref> |- | CHECK_PNGFORMAT | Determines whether it can handle the given [[Portable Network Graphics|PNG]] image.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.6.5. CHECK_PNGFORMAT Record|page=160|access-date=2020-01-28}}</ref> |- | CLIP_TO_PATH | Applies a function to the current [[PostScript]] clipping path.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.6.6. CLIP_TO_PATH Record|page=160|access-date=2020-01-28}}</ref> |- | CLOSE_CHANNEL | Same as ENDDOC.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.6.7. CLOSE_CHANNEL Record|page=162|access-date=2020-01-28}}</ref> |- | DOWNLOAD_FACE | Sets the font face name on the output device.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.6.8. DOWNLOAD_FACE Record|pages=162β163|access-date=2020-01-28}}</ref> |- | DOWNLOAD_HEADER | Downloads sets of PostScript procedures.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.6.9. DOWNLOAD_HEADER Record|pages=158β159|access-date=2020-01-28}}</ref> |- | DRAW_PATTERNRECT | Draws a rectangle with a defined pattern.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.6.10. DRAW_PATTERNRECT Record|pages=163β164|access-date=2020-01-28}}</ref> |- | ENCAPSULATED_POSTSCRIPT | Sends arbitrary [[encapsulated PostScript]] (EPS) data directly to the printer driver.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.6.11. ENCAPSULATED_POSTSCRIPT Record|page=164|access-date=2020-01-28}}</ref> |- | END_PATH | Ends a path.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.6.12. END_PATH Record|pages=164β165|access-date=2020-01-28}}</ref> |- | ENDDOC | Notifies the printer driver that a new print job is ending.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.6.13. ENDDOC Record|pages=165|access-date=2020-01-28}}</ref> |- | EPS_PRINTING | Indicates the start and end of EPS printing.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.6.14. EPS_PRINTING Record|pages=165β166|access-date=2020-01-28}}</ref> |- | EXTTEXTOUT | Draws text using the currently selected font, background color, and text color.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.6.15. EXTTEXTOUT Record|pages=166β167|access-date=2020-01-28}}</ref> |- | GET_COLORTABLE | Gets color table values from the printer driver.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.6.16. GET_COLORTABLE Record|pages=167β168|access-date=2020-01-28}}</ref> |- | GET_DEVICEUNITS | Gets the device units currently configured on the output device.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.6.17. GET_DEVICEUNITS Record|page=168|access-date=2020-01-28}}</ref> |- | GET_EXTENDED_TEXTMETRICS | Gets the extended text metrics that are currently configured on the printer driver.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.6.18. GET_EXTENDED_TEXTMETRICS Record|pages=168β169|access-date=2020-01-28}}</ref> |- | GET_FACENAME | Gets the font face name currently configured on the output device.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.6.19. GET_FACENAME Record|page=169|access-date=2020-01-28}}</ref> |- | GET_PAIRKERNTABLE | Gets the [[kerning|font kern]] table currently defined on the output device.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.6.20. GET_PAIRKERNTABLE Record|pages=169β170|access-date=2020-01-28}}</ref> |- | GET_PHYSPAGESIZE | Retrieves the physical page size currently selected on the output device.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.6.21. GET_PHYSPAGESIZE Record|page=170|access-date=2020-01-28}}</ref> |- | GET_PRINTINGOFFSET | Retrieves the offset from the upper-left corner of the physical page where the actual printing or drawing begins.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.6.22. GET_PRINTINGOFFSET Record|pages=170β171|access-date=2020-01-28}}</ref> |- | GET_PS_FEATURESETTING | Queries the printer driver for information about PostScript features supported on the output device.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.6.23. GET_PS_FEATURESETTING Record|page=171|access-date=2020-01-28}}</ref> |- | GET_SCALINGFACTOR | Retrieves the scaling factors for the x-axis and the y-axis of a printer.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.6.24. GET_SCALINGFACTOR Record|pages=171β172|access-date=2020-01-28}}</ref> |- | META_ESCAPE_ENHANCED_METAFILE | Used to embed an EMF metafile within a WMF metafile.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.6.25. META_ESCAPE_ENHANCED_METAFILE Record|pages=172β173|access-date=2020-01-28}}</ref> |- | METAFILE_DRIVER | Queries the printer driver about its support for metafiles on the output device.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.6.26. METAFILE_DRIVER Record|pages=173β174|access-date=2020-01-28}}</ref> |- | NEWFRAME | Notifies the printer driver that the application has finished writing to a page.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.6.27. NEWFRAME Record|pages=174β175|access-date=2020-01-28}}</ref> |- | NEXTBAND | Notifies the printer driver that the application has finished writing to a band.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.6.28. NEXTBAND Record|pages=174β175|access-date=2020-01-28}}</ref> |- | PASSTHROUGH | Passes through arbitrary data to the printer driver.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.6.29. PASSTHROUGH Record|page=175|access-date=2020-01-28}}</ref> |- | POSTSCRIPT_DATA | Sends arbitrary PostScript data to the output device.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.6.30. POSTSCRIPT_DATA Record|page=176|access-date=2020-01-28}}</ref> |- | POSTSCRIPT_IDENTIFY | Sets the printer driver to either PostScript-centric or GDI-centric mode.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.6.31. POSTSCRIPT_IDENTIFY Record|pages=176β177|access-date=2020-01-28}}</ref> |- | POSTSCRIPT_IGNORE | Notifies the output device to ignore PostScript data.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.6.32. POSTSCRIPT_IGNORE Record|page=177|access-date=2020-01-28}}</ref> |- | POSTSCRIPT_INJECTION | Inserts a block of raw data into a PostScript stream.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.6.33. POSTSCRIPT_INJECTION Record|pages=177β178|access-date=2020-01-28}}</ref> |- | POSTSCRIPT_PASSTHROUGH | Sends arbitrary data directly to a printer driver, which is expected to process this data only when in PostScript mode.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.6.34. POSTSCRIPT_PASSTHROUGH Record|page=178|access-date=2020-01-28}}</ref> |- | OPEN_CHANNEL | Acts the same as STARTDOC, with a NULL document and output filename, and data in raw mode.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.6.35. OPEN_CHANNEL Record|page=179|access-date=2020-01-28}}</ref> |- | QUERY_DIBSUPPORT | Queries the printer driver about its support for DIBs on the output device.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.6.36. QUERY_DIBSUPPORT Record|pages=179β180|access-date=2020-01-28}}</ref> |- | QUERY_ESCSUPPORT | Queries the printer driver to determine whether a specific WMF escape function is supported on the output device.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.6.37. QUERY_ESCSUPPORT Record|page=180|access-date=2020-01-28}}</ref> |- | SET_COLORTABLE | Sets color table values.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.6.38. SET_COLORTABLE Record|pages=180β181|access-date=2020-01-28}}</ref> |- | SET_COPYCOUNT | Sets the number of copies.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.6.39. SET_COPYCOUNT Record|page=181|access-date=2020-01-28}}</ref> |- | SET_LINECAP | Specifies the line-ending mode to use in drawing to the output device.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.6.40. SET_LINECAP Record|pages=181β182|access-date=2020-01-28}}</ref> |- | SET_LINEJOIN | Specifies the line-joining mode to use in drawing to the output device.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.6.41. SET_LINEJOIN Record|pages=182β183|access-date=2020-01-28}}</ref> |- | SET_MITERLIMIT | Sets the limit for the length of miter joins to use in drawing to the output device.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.6.42. SET_MITERLIMIT Record|page=183|access-date=2020-01-28}}</ref> |- | SPCLPASSTHROUGH2 | Enables documents to include private procedures and other arbitrary data in documents.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.6.43. SPCLPASSTHROUGH2 Record|pages=183β184|access-date=2020-01-28}}</ref> |- | STARTDOC | Notifies the printer driver that a new print job is starting.<ref>{{citation|url=https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf|title=<nowiki>[MS-WMF]:</nowiki> Windows Metafile Format Specification|section=2.3.6.44. STARTDOC Record|page=184|access-date=2020-01-28}}</ref> |} There was a [[Windows Metafile vulnerability|major vulnerability]] found in escape records around the Abort escape record, which stores the abort procedure code within the record itself. This affected Windows systems (see {{CVE|2005-4560}}) and the [[Wine (software)|Wine project]] (see {{CVE|2006-0106}}). According to [[Secunia]], "The vulnerability is caused due to an error in the handling of Windows Metafile files ('.wmf') containing specially crafted SETABORTPROC 'Escape' records. Such records allow arbitrary user-defined function to be executed when the rendering of a WMF file fails."<ref name=secunia>{{cite web|archive-url=https://web.archive.org/web/20060102123654/http://secunia.com/advisories/18255/|archive-date=January 2, 2006|url=http://secunia.com/advisories/18255/|title=Microsoft Windows WMF "SETABORTPROC" Arbitrary Code Execution|id=Secunia Advisory: SA18255|publisher=[[Secunia]]}}</ref> According to the Windows 3.1 SDK documentation, the SETABORTPROC escape was obsoleted and replaced by the function of the same name in Windows 3.1, long before the WMF vulnerability was discovered.<ref>{{citation|url=https://docs.microsoft.com/en-us/windows-hardware/drivers/print/pscript-supported-escapes|title=Pscript-Supported Escapes|publisher=Microsoft|access-date=2020-01-28}}</ref> However the obsoleted escape code was retained for compatibility with 16 bit programs written for (or at least backwards compatible with) Windows 3.0. This change happened at approximately the same time as Microsoft was creating the 32 bit reimplementation of GDI for Windows NT, and it is likely that the vulnerability occurred during this effort. After [[Steve Gibson (computer programmer)|Steve Gibson]] accused Microsoft of deliberately implementing a [[backdoor (computing)|backdoor]] into their code,<ref>{{cite podcast|url=https://media.grc.com/sn/sn-022.mp3|title=The Windows MetaFile Backdoor?|website=GRC Security Now!|publisher=[[Gibson Research Corporation]]|date=January 12, 2006|access-date=2020-01-28}}</ref><ref>{{citation|title = Re: You won't want to miss tonight's Security Now!, #22|first=Steve|last=Gibson|author-link=Steve Gibson (computer programmer)|date=January 12, 2006|work=grc.news.feedback|url=https://www.grc.com/x/news.exe?cmd=article&group=grc.news.feedback&item=60006|access-date=2020-01-28}}</ref> [[Mark Russinovich]] provided a rebuttal, and stated that: {{blockquote|...things were different when the format was architected. In the Windows 3.1 βlargeβ memory model code is inherently location-independent and Windows was never patched, so both Windows and an application could simply copy an application function into the WMF file and assume it would work when played back by the same application in a later run session. In any case, its not clear that the developers envisioned applications creating on-disk metafiles with abort procedures. Also, as Microsoftβs Stephen Toulouse pointed out in [https://web.archive.org/web/20060116042756/http://blogs.technet.com/msrc/archive/2006/01/13/417431.aspx Microsoftβs rebuttal] to Steveβs claims, the security landscape in the early 1990s was very different than today and all code, including that stored in a WMF file, was inherently trusted.<ref>{{citation|url=https://techcommunity.microsoft.com/t5/windows-blog-archive/inside-the-wmf-backdoor/ba-p/723489|first=Mark|last=Russinovich|author-link=Mark Russinovich|title=Inside the WMF Backdoor|publisher=Microsoft|work=TechNet|via=Microsoft Tech Community|date=January 18, 2006}}</ref>}} Peter Ferrie of Symantec Security Response, USA also disagreed with Gibson, noting that: {{blockquote|Gibson claimed that a thread is created to run the SetAbortProc handler. In fact, no thread is created to run the handler β it is a callback, which is called by the parser, and the parser has to wait until the callback returns, otherwise the whole point of the function (to abort the printing) is lost. By his own admission, Gibson did not read the documentation (in fact, he claimed that he couldnβt find it, although it is freely available on Microsoftβs Web site), and he claimed that the device context is not available to the function handler. Of course the device context is available to the function handler — it is one of the two parameters that is passed to it (see above), and it is required in order to abort the printing. Finally, Gibson claimed that the control flow could not return to Windows. It is simply a matter of the function returning and discarding the parameters that were passed on the stack. If the record is well formed, Windows will continue to parse the file, as before. ... Gibson admits that he was guessing about a number of things. Unfortunately, he guessed poorly. I guess we know better now.<ref>{{citation|title=Inside the Windows Meta File Format|publisher=[[Virus Bulletin]]|date=February 2, 2006|first=Peter|surname=Ferrie|url=https://www.symantec.com/avcenter/reference/inside.the.windows.meta.file.format.pdf|archive-url=https://web.archive.org/web/20080516052826/http://www.symantec.com/avcenter/reference/inside.the.windows.meta.file.format.pdf|url-status=dead|archive-date=May 16, 2008|via=[[NortonLifeLock|Symantec]]|access-date=2020-01-24}}</ref>}}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)