FaxGetDeviceStatusW function (winfax.h)

The FaxGetDeviceStatus function returns to a fax client application current status information for the fax device of interest. The returned data includes, among other items, device and station identifiers, sender and recipient names, and routing information.

Syntax

WINFAXAPI BOOL FaxGetDeviceStatusW(
  [in]  HANDLE              FaxPortHandle,
  [out] PFAX_DEVICE_STATUSW *DeviceStatus
);

Parameters

[in] FaxPortHandle

Type: HANDLE

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

[out] DeviceStatus

Type: PFAX_DEVICE_STATUS*

Pointer to the address of a buffer to receive a FAX_DEVICE_STATUS structure. The structure describes the status of one fax device. 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 DeviceStatus 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

A fax administration application typically calls the FaxGetDeviceStatus function to display the status of a fax device associated with a fax server. The FaxGetDeviceStatus function allocates the memory required for the FAX_DEVICE_STATUS buffer pointed to by the DeviceStatus 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 FaxGetDeviceStatus 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

   
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_DEVICE_STATUS

Fax Service Client API Functions

Fax Service Client API for Windows 2000

FaxFreeBuffer

FaxOpenPort