Calling EnumObjects() Leaks a Selector

ID: Q229670


The information in this article applies to:


SYMPTOMS

A program that calls the Win32 EnumObjects() API function may eventually stop working, with the following error message:

Program name caused a General Protection Fault in module GDI.EXE.


CAUSE

The EnumObjects() function leaks a selector each time it is called. If enough calls are made during a particular session, the local descriptor table (LDT) can become exhausted. The computer must then be rebooted.


RESOLUTION

A supported fix that corrects this problem is now available from Microsoft, but it has not been fully regression tested and should be applied only to systems experiencing this specific problem.

To resolve this problem, contact Microsoft Product Support Services to obtain the fix. For a complete list of Microsoft Product Support Services phone numbers and information on support costs, please go to the following address on the World Wide Web:

http://www.microsoft.com/support/supportnet/overview/overview.asp
The English version of this fix should have the following file attributes or later:

For Windows 95 versions 4.00.950 and 4.00.950A (Retail and OEM Service Release [OSR1]):

   Date      Time    Version      Size    File name
   ------------------------------------------------
   04/16/99  10:11am 4.01.971     312,736 Gdi.exe
   04/16/99  10:11am 4.01.971     131,072 Gdi32.dll

For Windows 95 versions 4.00.950B and 4.00.950C (OSR2 and OSR2.5):

   Date      Time    Version      Size    File name
   ------------------------------------------------
   04/16/99  11:12am 4.00.1112    331,872 Gdi.exe
   04/16/99  11:12am 4.00.1112    129,024 Gdi32.dll 

NOTE: If this product was already installed on your computer when you purchased it from the Original Equipment Manufacturer (OEM) and you need this fix, please call the Pay Per Incident number listed on the above Web site. If you contact Microsoft to obtain this fix, and if it is determined that you only require the fix you requested, no fee will be charged. However, if you request additional technical support, and if your no-charge technical support period has expired, or if you are not eligible for standard no-charge technical support, you may be charged a non-refundable fee.

For more information about eligibility for no-charge technical support, see the following article in the Microsoft Knowledge Base:
Q154871 Determining If You Are Eligible for No-Charge Technical Support


STATUS

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


MORE INFORMATION

One situation in which this problem can occur is when a Microsoft Excel 97 VBA macro sets the PageSetup properties of a worksheet object hundreds of times. For additional information about this problem, please see the following article in the Microsoft Knowledge Base:

Q192869 OFF97: PageSetup Object Causes Memory Leak and Hangs System

Additional query words:


Keywords          : win95 win98 
Version           : WINDOWS:95
Platform          : WINDOWS 
Issue type        : kbprb 

Last Reviewed: July 23, 1999