FaxGetRoutingInfoA function (winfax.h)

The FaxGetRoutingInfo function returns to a fax client application routing information for a fax routing method that is associated with a specific fax device.

Syntax

WINFAXAPI BOOL FaxGetRoutingInfoA(
  [in]  HANDLE  FaxPortHandle,
  [in]  LPCSTR  RoutingGuid,
  [out] LPBYTE  *RoutingInfoBuffer,
  [out] LPDWORD RoutingInfoBufferSize
);

Parameters

[in] FaxPortHandle

Type: HANDLE

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

[in] RoutingGuid

Type: LPCTSTR

Pointer to a constant null-terminated character string that specifies the GUID that uniquely identifies the fax routing method of interest.

For information about fax routing methods, see About the Fax Routing Extension API. For information about the relationship between routing methods and GUIDs, see Fax Routing Methods.

[out] RoutingInfoBuffer

Type: LPBYTE*

Pointer to the address of a buffer to receive the fax routing information.

[out] RoutingInfoBufferSize

Type: LPDWORD

Pointer to a DWORD variable to receive the size of the buffer, in bytes, pointed to by the RoutingInfoBuffer 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_PORT_QUERY access is required.
ERROR_INVALID_PARAMETER
One or all of the RoutingGuid, RoutingInfoBuffer, RoutingInfoBufferSize, or FaxPortHandle parameters are NULL.
ERROR_NOT_ENOUGH_MEMORY
An error occurred during memory allocation.
ERROR_INVALID_DATA
The RoutingGuid parameter is invalid.

Remarks

The fax service administration application, a Microsoft Management Console (MMC) snap-in component that manages the specified fax routing method, typically calls the FaxGetRoutingInfo function. This is because the format of the routing data is unavailable to a fax client application. The routing data is relevant only to the exported fax routing method and to the fax service administration application.

An application that manages a specific fax routing method can call the FaxGetRoutingInfo function to modify the routing information for the method on a specified fax device. To enumerate all fax routing methods associated with a device, call the FaxEnumRoutingMethods function.

The FaxEnumGlobalRoutingInfo function retrieves routing information that applies globally to the fax server, such as routing priority. An application can modify global data with a call to the FaxSetGlobalRoutingInfo function.

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

For more information, see Managing Fax Routing Data and Freeing Fax Resources.

Note

The winfax.h header defines FaxGetRoutingInfo 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_GLOBAL_ROUTING_INFO

Fax Service Client API Functions

Fax Service Client API for Windows 2000

FaxEnumGlobalRoutingInfo

FaxEnumRoutingMethods

FaxFreeBuffer

FaxOpenPort

FaxSetGlobalRoutingInfo

FaxSetRoutingInfo