AddPort

BOOL AddPort(
    LPTSTR   pName,
    HWND     hWnd,
    LPTSTR   pMonitorName
);
 

A port management function that adds a port to the list of currently supported ports in the spooler environment.

pName Points to a zero-terminated string that specifies the name of the server to which the port is connected. If this string is NULL, the port is local.
hWnd A handle to the parent window of the dialog box used by the AddPort function.
pMonitorName Points to a zero-terminated string that specifies the monitor associated with the port.

The port monitor function AddPort browses the network to find existing ports and displays a dialog box for the user to get information needed to create the port. Your implementation of the AddPort function should call the EnumPorts function to validate the port name entered by the user to ensure no duplicate port names are added to the spooler environment.