VCOMM Device Initialization

VCOMM is a static VxD always loaded at boot time in Windows 95. It functions as the Plug and Play "device loader" for installed devices of class "ports" or "modem". This means VCOMM is called to load these devices when they are enumerated by the Plug and Play Configuration Manager. This is usually at boot time for COM ports, LPT ports, and internal and external modems. However, PCMCIA ports and modems can be enumerated "on the fly" when inserted at any time during a Windows 95 session.

When the Plug and Play Configuration Manager calls VCOMM to load an enumerated device, it passes a handle to the "devnode" data structure for the device. The devnode contains information about the device, including its resource allocation and registry key locations. When called to load a device, VCOMM does the following:

1. Remembers the PortName and FriendlyName strings specified in the device's hardware key. Later, when called to open the device by one of these names, VCOMM will match it to the software key for this device to determine the port driver VxD to load. Note that the port driver is not loaded immediately when the device is enumerated. Rather, it is only loaded when opened by a VCOMM client such as Remote Access or a communications application. This speeds boot time, and prevents unnecessary consumption of system resources until the device is actually opened.

2. Assigns a "PortName" to the device in its hardware key, if its devnode contains system resources. For COM ports (PortSubClass="01") and PCMCIA modems (PortSubClass="02"), PortName is assigned according to the base I/O port address, as shown below. Devices with non-standard base addresses receive port names starting at COM5 and higher.

03F8

COM1

02F8

COM2

03E8

COM3

02E8

COM4

3220

COM3 (PS/2)


For LPT ports (PortSubClass="00"), PortName is assigned according to the relative location of the base address in the BIOS data table at 40:8. That is, if the base address is the first entry in the table, it is assigned PortName="LPT1", and so on. PortName is not assigned if the base address is not contained in the BIOS data table.

Note that internal and external modems devnodes do not have resources, so are not assigned PortNames.

In addition to creating the PortName key, VCOMM writes a new string value for FriendlyName and DeviceDesc, by appending the device's PortName to its DriverDesc (taken from the software key); for example, "Communications Port (COM1)" and "Printer Port (LPT1)". This serves two functions: to make the FriendlyName unique in the system, and to cause the port name to appear in the Device Manager page of the System control panel.

3. Calls the contention handler specified by the Contention value in the software key, if present; for example, "*vcd" for serial ports and PCMCIA modems. This causes the contention handler to begin virtualization of the device, using the I/O ports, IRQ, and so on, passed to it by VCOMM. Note that unlike previous versions of Windows, contention handler VxDs such as VCD and VPD no longer virtualize ports based on entries in the BIOS data table and SYSTEM.INI. This has been made dynamic to accommodate the Plug and Play architecture, especially dynamic insertion and removal of PCMCIA ports and modems.

4. Loads the Plug and Play enumerator VxD for the device specified by the Enumerator value in the software key, if present. The enumerator VxD subsequently registers with the Configuration Manager, and is called at some later point to detect devices attached to the port, such as modems and printers.

When a device is removed (for example, a PCMCIA port or modem is removed), the Configuration Manager notifies VCOMM. VCOMM unloads the port driver, if necessary, and calls the device's contention handler VxD, if any, to end virtualization of its resources.