Microsoft KB Archive/319740

= MFC applications leak GDI objects on computers that are running Windows Server 2003 or Windows XP =

Article ID: 319740

Article Last Modified on 11/16/2007

-

APPLIES TO


 * Microsoft Windows XP Home Edition
 * Microsoft Windows XP Professional
 * Microsoft Windows Server 2003, Datacenter Edition (32-bit x86)
 * Microsoft Windows Server 2003, Datacenter Edition for Itanium-Based Systems
 * Microsoft Windows Server 2003, Enterprise Edition (32-bit x86)
 * Microsoft Windows Server 2003, Enterprise Edition for Itanium-based Systems
 * Microsoft Windows Server 2003, Standard Edition (32-bit x86)
 * Microsoft Windows Server 2003, Web Edition
 * Microsoft Windows XP Home Edition
 * Microsoft Windows XP Professional

-



This article was previously published under Q319740



SYMPTOMS
When you run a Microsoft Foundation Classes (MFC) application on a computer that is running Microsoft Windows XP with Service Pack 2 (SP2) installed, you may see memory leaks for Graphics Device Interface (GDI) objects when you create and destroy child windows. To see the memory leaks, view the GDI objects of the process in Task Manager.

This problem also occurs on a computer that is running Windows Server 2003 when the Themes service is started. By default, the Themes service is disabled on Windows Server 2003.



CAUSE
This problem occurs because of a bug in the implementation of the new theming interface.



Windows Server 2003
A supported hotfix is now available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing this specific problem. This hotfix might receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next Windows Server 2003 service pack that contains this hotfix.

To resolve this problem, submit a request to Microsoft Online Customer Services to obtain the hotfix. To submit an online request to obtain the hotfix, visit the following Microsoft Web site:

http://go.microsoft.com/?linkid=6294451

Note If additional issues occur or any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. To create a separate service request, visit the following Microsoft Web site:

http://support.microsoft.com/contactus/?ws=support

Prerequisites
No prerequisites are required.

Restart requirement
You must restart your computer after you apply this hotfix.

Hotfix replacement information
This hotfix does not replace any other hotfixes.

File information
The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.

Prerequisites
To install this hotfix, you must have Windows XP Service Pack 2 (SP2) installed.

Restart requirement
You must restart your computer after you apply this hotfix.

Hotfix replacement information
This hotfix does not replace any other previously released hotfixes.

File information
The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.



The following file is available for download from the Microsoft Download Center:

Download the Update for Windows XP (KB319740) package now.

Release Date: March 21, 2006

For more information about how to download Microsoft support files, click the following article number to view the article in the Microsoft Knowledge Base:

119591 How to obtain Microsoft support files from online services

Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help prevent any unauthorized changes to the file.



WORKAROUND
If this GDI leak is seriously degrading performance, you can turn off the new user interface theming in Windows XP. To do this, follow these steps:
 * 1) Click Start, and then click Control Panel.
 * 2) Click Appearance and Themes, and then click Display.
 * 3) On the Themes tab of the Display Properties dialog box, click Windows Classic in the Theme list.
 * 4) Click Apply, and then click OK.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.

Keywords: atdownload kbhotfixserver kbqfe kbwinxp64bit2003sp1fix kbwinxpsp3fix kbwinxppresp3fix kbbug kbfix kbshell KB319740

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.