Sample PnP ISA Class Installer

The Windows NT DDK includes a sample control panel applet and class installer for a PnP (Plug and Play) ISA device. The sample illustrates providing your own device configuration user interface. It is a pared down version of the Ports applet, focusing on PnP COM ports.

The sample is with the other setup samples and includes three main files:

cpl.c Control panel management
pnpports.c The class installer and the dialog routines for the control panel applet
util.c Support routines

Some of the significant routines in pnpports.c include:

PortsClassInstaller Main entry point for the class installer.
ShortCommDlg Main dialog routine; finds and lists all the PnP ISA COM ports.
CommDlg Displays the COM port settings.
DoPnPAdvancedPortDialog Displays the Advanced Port Settings dialog, creates the Properties Page, and calls setup APIs to get the resource selection property page.

This routine also contains the code for respecting the "quiet install" flag (DI_QUIETINSTALL) for OEM preinstallation. If this flag is present, and the device has already been assigned a forced configuration, then the class installer should suppress any configuration dialogs.

InstallPnPSerialPort Given a device information element, this routine installs a serial port, performs PnP configuration, and displays an advanced settings dialog to the user.

To replace the default Windows NT Ports class installer with the PnP Ports sample class installer, register pnpports.cpl as the class installer for Ports devices as follows:

1.Run regedt32 and go to the following key:

Machine\System\CurrentControlSet\Control\Class

2.Locate the following subkey representing the class GUID for Ports devices:

{4D36E978-E325-11CE-BFC1-08002BE10318}

This subkey contains a Class value entry set to "Ports".

3.Modify the Installer32 value entry to appear as follows:

Installer32 : REG_SZ : pnpports.cpl,PortsClassInstaller

Any future device installer requests for Ports-class devices will go to pnpports.cpl.

See the Programmer's Guide in the Windows NT DDK documentation for more information on registering a class installer and other information about device installation.