Programming Installation for Plug and Play Serial Ports and COM Ports

Note

This topic describes programming traditional COM ports. For information on USB attached serial ports, see USB serial driver (Usbser.sys).

By default, the combined operation of the Ports class installer and the Serial function driver configure a serial port as a COM port. Serial creates a COM port device interface for a serial port if the SerialSkipExternalNaming entry value for a device does not exist or is set to zero. For more information about how Serial creates a COM port device interface for a COM port and how to override this operation, see External Naming of COM Ports.

The Ports class installer performs the following tasks when it installs a serial port:

  1. Selects a COM port number and sets a port name in the PortName entry value under the device's hardware key. The port name has the format COM<n>, where <n> is the port number. If Serial creates a COM port interface for the serial port, Serial uses the value of PortName as the symbolic link name for the COM port.

  2. Displays a default property page dialog box, which allows a user to select settings for the port. For information about how to install a custom properties page, see Create an Advanced Properties Page for a COM Port.

  3. Sets the device friendly name for the device. You obtain the name using the SPDRP_FRIENDLYNAME flag with SetupDiGetDeviceRegistryProperty.

You can supply a co-installer to set Registry settings for a Plug and Play serial device. If an entry value is not present in the registry, Serial uses a default value for the port.