Microsoft KB Archive/324537

= Hang or Exception 0E After Unplugging a USB Modem with an Active Connection =

Article ID: 324537

Article Last Modified on 2/1/2007

-

APPLIES TO

 Microsoft Windows Millennium Edition Microsoft Windows 98 Second Edition Microsoft Windows 98 Standard Edition Microsoft Platform Software Development Kit-January 2000 Edition, when used with:  Microsoft Windows 98 Standard Edition

 Microsoft Windows 98 Second Edition

 Microsoft Windows Millennium Edition</li></ul> </li></ul>

-

<div class="notice_section">

This article was previously published under Q324537

<div class="symptoms_section">

SYMPTOMS
If a program is communicating with a Universal Serial Bus (USB) modem and you unplug the modem, the program may stop responding (hang) or you may receive an &quot;Exception 0E&quot; error message on a blue screen some time afterward (such as when you end the program's communication session with the USB modem).

NOTE: A USB modem in this context may also be a wide-area network (WAN) device, such as a digital subscriber line (DSL) or integrated services digital network (ISDN) terminal adapter.

<div class="cause_section">

CAUSE
If you physically disconnect a USB modem (such as by unplugging or turning off the modem) while a program is communicating with the modem through the virtual serial port, the USB serial communications driver stack does not indicate to the program that the modem has been disconnected. Depending on how the program is written to communicate with the virtual serial port, the program may hang, or it may trigger an exception 0E (&quot;Invalid Page Fault&quot;) error when the program releases its connection to the virtual serial port.

<div class="workaround_section">

WORKAROUND
To work around this problem, do not physically disconnect the USB modem while a communications session is active. Close the connection by using the software that is communicating with the USB modem, and then disconnect the USB modem.

<div class="status_section">

STATUS
Microsoft has confirmed that this is a problem in the versions of Windows that are listed at the beginning of this article.

<div class="moreinformation_section">

MORE INFORMATION
If program opens a handle to the virtual serial port and tries to write to the port while the modem is disconnected, the write operation does not complete successfully. If the program blocks while it waits for the write operation to complete, the program hangs when it tries to write to the port. If the program does not block on the write operation but instead times out and abandons the write operation, the &quot;Exception 0E&quot; error message may appear on a blue screen when the program closes the handle to the virtual serial port.

This problem is aggravated by the fact that the Windows Application Programming Interfaces (APIs) that are used to communicate through the virtual serial port return the same error codes when the modem is disconnected as when it is connected. For example, when you use overlapped I/O, a WriteFile call returns a Win32 error of ERROR_IO_PENDING when the modem is connected and when it is disconnected. In contrast, these APIs on Microsoft Windows 2000 and Microsoft Windows XP return a different error (ERROR_IO_INCOMPLETE) when the modem is disconnected. This permits the program to easily determine when the modem has been disconnected and to take appropriate action.

Developers who write programs to communicate with USB modems on Windows 98, Windows 98 Second Edition, and Windows Millennium Edition (Me) can work around this problem by making API calls to register the program to receive Plug and Play notifications that pertain to the USB modem. This permits the program to detect when the modem has been disconnected and to take appropriate action (such as to immediately close the connection with the virtual serial port without performing any additional writes to the port).

Keywords: kberrmsg kbprb KB324537

-

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

© Microsoft Corporation. All rights reserved.