GetCommState function

Retrieves the current control settings for a specified communications device.

Syntax


BOOL WINAPI GetCommState(
  _In_    HANDLE hFile,
  _Inout_ LPDCB  lpDCB
);

Parameters

hFile [in]

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

lpDCB [in, out]

A pointer to a DCB structure that receives the control settings information.

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.

Examples

For an example, see Configuring a Communications Resource.

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows Server 2003

Header

Winbase.h (include Windows.h)

Library

Kernel32.lib

DLL

Kernel32.dll

See also

Communications Functions
Communications Resources
CreateFile
DCB
SetCommState

 

 

Show: