BUG: GetCommProperties Leaks a Handle

Last reviewed: December 16, 1996
Article ID: Q139657
The information in this article applies to:
  • Microsoft Win32 Software Development Kit (SDK) version 3.51

SYMPTOMS

Repeated calls to GetCommProperties cause the process handle count to increase and never decrease. This can be detected by running PerfMon. This eventually causes system failures.

RESOLUTION

To work around this problem, don't call GetCommProperties repeatedly. Call GetCommProperties once, and then store the result for use later. If you must repeatedly call GetCommProperties, you should periodically exit the process and restart. You may want to create a separate, short-lived process to get the desired information and communicate it to the main process by using IPC methods.

STATUS

Microsoft has confirmed this to be a bug. This has been fixed with release of Windows NT version 4.0.


KBCategory: kbprg kbbuglist
KBSubcategory: BseCommapi
Additional reference words:


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: December 16, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.