FaxEnumPortsW function (winfax.h)

The FaxEnumPorts function enumerates all fax devices currently attached to the fax server to which the client has connected. The function returns detailed information for each fax port to the fax client application.

Syntax

WINFAXAPI BOOL FaxEnumPortsW(
  [in]  HANDLE          FaxHandle,
  [out] PFAX_PORT_INFOW *PortInfo,
  [out] LPDWORD         PortsReturned
);

Parameters

[in] FaxHandle

Type: HANDLE

Specifies a fax server handle returned by a call to the FaxConnectFaxServer function.

[out] PortInfo

Type: PFAX_PORT_INFO*

Pointer to the address of a buffer to receive an array of FAX_PORT_INFO structures. Each structure describes one fax port. The data includes, among other items, the permanent line identifier, and the current status and capability of the port. For information about memory allocation, see the following Remarks section.

[out] PortsReturned

Type: LPDWORD

Pointer to a DWORD variable to receive the number of FAX_PORT_INFO structures the function returns in the PortInfo parameter.

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_JOB_QUERY access is required.
ERROR_INVALID_PARAMETER
One or all of the PortsReturned, PortInfo, or FaxHandle parameters are NULL.
ERROR_NOT_ENOUGH_MEMORY
An error occurred during memory allocation.

Remarks

The FaxEnumPorts function returns a list of fax jobs on the fax server of interest, as well as information available about each job. A fax administration application typically calls this function to display the fax job queue for administrative or query purposes. For more information, see Managing Fax Jobs.

The FaxEnumPorts function allocates the memory required for the FAX_JOB_ENTRY buffer array pointed to by the JobEntry parameter. An application must call the FaxFreeBuffer function to deallocate the resources associated with this parameter. For more information, see Freeing Fax Resources.

Note

The winfax.h header defines FaxEnumPorts 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_JOB_ENTRY

Fax Service Client API Functions

Fax Service Client API for Windows 2000

FaxConnectFaxServer

FaxFreeBuffer

FaxGetJob