ClosePort

BOOL  (WINAPI *pfnClosePort)(

    HANDLE hPort
  );

ClosePort closes the port specified by hPort when there are no printers connected to it.

Parameters

hPort

Handle to the port that is to be closed. This handle was acquired by the spooler in a previous call to OpenPort or OpenPortEx.

Return Value

ClosePort returns TRUE if the operation is successful.

Comments

The spooler calls ClosePort when a monitor other than the current one should hold the port, or when no printers are connected to the port specified by hPort.

If ClosePort receives an invalid handle, it should log an ERROR_INVALID_HANDLE error and fail. Otherwise, the monitor should clean up any resources, such as data structures that it allocated for the port, at this time.

ClosePort must be implemented by both port and language monitors.

See Also

OpenPort, OpenPortEx