ClosePort - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// winsplp.h

BOOL ClosePort(
  _In_ HANDLE hPort
);
View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-winsplp-closeport)

ClosePort function

Description

A language or port monitor's ClosePort function closes a printer port.

Parameters

hPort [in]

Caller-supplied pointer to a port handle.

Return value

If the operation succeeds, the function should return TRUE. Otherwise it should return FALSE.

Syntax

BOOL ClosePort(
  _In_ HANDLE hPort
);

Remarks

Language monitors and port monitor server DLLs are required to define a ClosePort function and include the function's address in a MONITOR2 structure.

The handle received as the function's hPort argument is the port handle that the monitor's OpenPort or OpenPortEx function supplied.

The ClosePort function should close the port by making the received port handle invalid. It should also free all system resources that were allocated by the monitor's OpenPort or OpenPortEx function.

See also

OpenPortEx

MONITOR2

OpenPort