Device Contention in Windows

ID: Q130402


The information in this article applies to:


SUMMARY

"Device contention" refers to the ability of Windows to arbitrate requests for the use of a device (usually a serial port) by more than one program, one of which is not a Windows-based program. Windows 95 does not by default allow a Windows-based program to use a serial port that was previously used by a non-Windows-based program running in a virtual machine (VM) until that VM is closed. This behavior is different from previous versions of Windows, in which the default behavior is for the device to be released after a two- second period of inactivity.


MORE INFORMATION

The state of Windows device contention is determined by the value for the "COM<n>AutoAssign=<x>" setting in the [386Enh] section of the System.ini file, where <n> is the number of the serial port and <x> is a value from -1 to 1000.

The default setting in Windows is -1. This setting causes Windows not to release a serial port previously used by a non-Windows-based program running in a VM until that program's VM is closed. When an MS-DOS-based or Windows-based communications program requests the use of a serial port, Windows checks to see if the port is in use. If the port is available, Windows gives the program access to the port. You can change this behavior by adding "COM<n>AutoAssign=<x>" to the [386Enh] section of the System.ini file. The default value for this setting in Windows version 3.1 is 2, causing Windows to grant access to the port after two seconds of port inactivity. In Windows 95/98, this default has been changed for compatibility with some of the Windows 95/98 tools that have automatic answering capability (such as Microsoft Fax and Dial-Up Networking Server).

If a Windows-based program attempts to use the serial port before the VM is closed, you receive one of the following error messages:

WARNING: If you set COM<n>AutoAssign=2, do not run a 32-bit communications program (such as HyperTerminal) and then attempt to run an MS-DOS-based communications program. Because of the way the 32-bit program controls the port, the MS-DOS-based program will be unable to access it and may cause your system to stop responding (hang).

If you need hot-swapping capability between an MS-DOS-based communications program and a Windows-based communication program, add the following entry to the [386Enh] section of the System.ini file:

   Com<n>AutoAssign=0 

This setting allows an MS-DOS-based application to hand off a "hot port" to a Windows-based program with no delay. This is sometimes necessary in bulletin board administration. This configuration can cause some problems or instabilities because two programs can send commands to the modem at the same time.

NOTE: Although all the settings described in this article work, we recommend that you use the default setting of -1.

Additional query words: comxautoassign


Keywords          : kbenv kberrmsg win95 win98 
Version           : 95
Platform          : WINDOWS 
Issue type        : kbinfo 

Last Reviewed: January 16, 1999