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:
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 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.
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.