FaxSetPortA function (winfax.h)

A fax client application calls the FaxSetPort function to change the configuration of the fax port of interest. The configuration data can include, among other items, the capability of the port, its priority, rings before answer, and the transmitting and called station identifiers..

Syntax

WINFAXAPI BOOL FaxSetPortA(
  [in] HANDLE               FaxPortHandle,
  [in] const FAX_PORT_INFOA *PortInfo
);

Parameters

[in] FaxPortHandle

Type: HANDLE

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

[in] PortInfo

Type: const FAX_PORT_INFO*

Pointer to a FAX_PORT_INFO structure. The structure contains data to modify the configuration of the specified fax port.

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_ACCESS_DENIED
Access is denied. FAX_PORT_SET access is required.
ERROR_DEVICE_IN_USE
The port indicated by the FaxPortHandle parameter is busy.
ERROR_INVALID_PARAMETER
One or both of the FaxPortHandle or PortInfo parameters are NULL.

Remarks

The application must call the FaxOpenPort function and specify the PORT_OPEN_MODIFY access level before calling the FaxSetPort function.

Only the following members of the FAX_PORT_INFO structure can be set using this function: Flags, Rings, Priority, Tsid, and Csid

A fax administration application typically calls the FaxSetPort function to administer the fax devices associated with the fax server. To query the devices, call the FaxGetPort function.

To obtain a valid port handle to specify in the FaxPortHandle parameter of the FaxSetPort function, call the FaxOpenPort function. For more information, see Fax Device Management.

Note

The winfax.h header defines FaxSetPort as an alias that 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 is 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

FaxGetPort

FaxOpenPort