Microsoft KB Archive/272725

{|
 * width="100%"|

BUG: Playing WMF with a Palette into Another WMF Leaks a Palette Resource

 * }

Q272725

-

The information in this article applies to:


 * Microsoft Windows 95
 * Microsoft Windows 98
 * Microsoft Windows 98 Second Edition
 * Microsoft Windows Millennium Edition

-

SYMPTOMS
When a Windows Metafile (WMF) is created that contains a palette record, and that WMF is playing into another WMF, a palette resource is leaked.

RESOLUTION
To work around this bug, do not play a WMF that contains a palette into another WMF. Instead, for example, play the WMF into a bitmap (DIB) and then put the bitmap in the target WMF. Note that this method results in a loss of scalability.

STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.

Steps to Reproduce Behavior
To reproduce this bug, create a WMF with a SelectPalette call in it. Then play that WMF into another WMF DC. A palette resource is leaked even if the WMFs are deleted afterwards. The resource is regained when the application exits.

Additional query words: palette selectpalette createpalette LOGPALETTE leak resource system GDI

Keywords : kbGDI kbMetafile kbPalettes kbSDKPlatform kbSDKWin32 kbDSupport kbGrpDSGDI

Issue type : kbbug

Technology : kbWinMEsearch kbWin95search kbWin98search kbWin98SEsearch kbWin95 kbWin98 kbWinME kbWin98SE