FaxGetPortA function (winfax.h)

The FaxGetPort function returns information for a specified fax port to a fax client application. The data includes, among other items, the permanent line identifier, the current status and capability of the port, and the transmitting and called station identifiers.

Syntax

WINFAXAPI BOOL FaxGetPortA(
  [in]  HANDLE          FaxPortHandle,
  [out] PFAX_PORT_INFOA *PortInfo
);

Parameters

[in] FaxPortHandle

Type: HANDLE

Specifies a fax port handle returned by a call to the FaxOpenPort function.

[out] PortInfo

Type: PFAX_PORT_INFO*

Pointer to the address of a buffer to receive a FAX_PORT_INFO structure. The structure describes one fax port. For information about memory allocation, see the following Remarks section.

Return value

Type: BOOL

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError. GetLastError can return one of the following errors.

Return code Description
ERROR_INVALID_PARAMETER
One or both of the PortInfo or FaxPortHandle parameters are NULL.
ERROR_ACCESS_DENIED
Access is denied. FAX_PORT_QUERY access is required.
ERROR_NOT_ENOUGH_MEMORY
An error occurred during memory allocation.

Remarks

The application must call the FaxOpenPort function and specify the PORT_OPEN_QUERY access level before calling the FaxGetPort function.

A fax administration application typically calls the FaxGetPort function to query a device associated with the fax server.

To obtain a valid port handle to specify in the FaxPortHandle parameter, call the FaxOpenPort function.

The FaxGetPort function allocates the memory required for the FAX_PORT_INFO buffer pointed to by the PortInfo parameter. An application must call the FaxFreeBuffer function to deallocate the resources associated with this parameter.

For more information, see Fax Device Management and Freeing Fax Resources.

Note

The winfax.h header defines FaxGetPort as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header winfax.h
Library WinFax.lib

See also

FAX_PORT_INFO

Fax Service Client API Functions

Fax Service Client API for Windows 2000

FaxEnumPorts

FaxFreeBuffer

FaxOpenPort

FaxSetPort