BUG: ReadFile Timeout on Mailslot Causes Memory Leak

Last reviewed: November 26, 1997
Article ID: Q177329
The information in this article applies to:
  • Microsoft Win32 Application Programming Interface (API) included with: - Microsoft Windows 95 OEM Service Release version 2 - Microsoft Windows 95

SYMPTOMS

If a mailslot is created using CreateMailslot() API with a timeout value greater than zero, the ReadFile() API leaks memory when the timeout expires and the function returns FALSE. After many calls to the ReadFile() API, the system becomes unstable and subsequent ReadFile() API calls whose timers expire will start returning TRUE. As a result, the system will no longer be able to execute other DOS applications.

RESOLUTION

To work around this, create the mailslot with either a zero or MAILSLOT_WAIT_FOREVER timeout value. This means that a ReadFile() API call will block until there is data to be read from the mailslot.

STATUS

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

Version           : WINDOWS:95
Platform          : Win95
Hardware          : x86
Issue type        : kbbug


================================================================================


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: November 26, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.