GetCommProperties function (winbase.h)

Retrieves information about the communications properties for a specified communications device.

Syntax

BOOL GetCommProperties(
  [in]  HANDLE     hFile,
  [out] LPCOMMPROP lpCommProp
);

Parameters

[in] hFile

A handle to the communications device. The CreateFile function returns this handle.

[out] lpCommProp

A pointer to a COMMPROP structure in which the communications properties information is returned. This information can be used in subsequent calls to the SetCommState, SetCommTimeouts, or SetupComm function to configure the communications device.

Return value

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.

Remarks

The GetCommProperties function returns information from a device driver about the configuration settings that are supported by the driver.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps | UWP apps]
Minimum supported server Windows Server 2003 [desktop apps | UWP apps]
Target Platform Windows
Header winbase.h (include Windows.h)
Library Kernel32.lib
DLL Kernel32.dll

See also

COMMPROP

Communications Functions

Communications Resources

CreateFile

SetCommState

SetCommTimeouts

SetupComm