Condividi tramite


AddPort function pointer

The AddPort function is obsolete and is for use only with Windows NT 4.0 and previous versions.

AddPort creates a port and adds it to the list of ports currently supported by the specified monitor in the spooler environment.

Syntax

typedef BOOL ( WINAPI *pfnAddPort)(
  _In_ HANDLE hMonitor,
  _In_ LPWSTR pName,
  _In_ HWND   hWnd,
  _In_ LPWSTR pMonitorName
);

Parameters

  • hMonitor [in]
    Caller supplied monitor instance handle. This is the handle returned by the monitor's InitializePrintMonitor2 function. (This parameter does not exist if the print monitor supports InitializePrintMonitor2 instead of InitializePrintMonitor2.)

  • pName [in]
    Pointer to a null-terminated string that specifies the name of the server to which the port is connected. If pName is NULL, the port is local.

  • hWnd [in]
    Handle to the parent window of the dialog box in which the port name will be entered.

  • pMonitorName [in]
    Pointer to a null-terminated string that specifies the monitor associated with the port.

Return value

The return value is TRUE if the function is successful, and FALSE otherwise.

Remarks

The spooler calls AddPort when it receives an application request to add a port to its environment. The spooler forwards the call to the named port monitor on the named server.

AddPort allows a port to be added interactively. A monitor should prompt a user to enter the port name in a dialog box on the window associated with hWnd. AddPort should validate the entered port name by calling the Win32 EnumPorts function to ensure that no duplicate port names are added to the spooler environment. A monitor should also verify that the port is one that it supports.

The spooler does not support remote AddPort calls. Consequently, AddPort implementations can ignore the pName and pMonitorName parameters.

Requirements

Target platform

Desktop

Header

Winsplp.h (include Winsplp.h)

See also

DeletePort

InitializePrintMonitor2

 

 

Send comments about this topic to Microsoft