GetCommConfig function

Retrieves the current configuration of a communications device.

To retrieve the default configuration settings from the device manager, use the GetDefaultCommConfig function.

Syntax


BOOL WINAPI GetCommConfig(
  _In_    HANDLE       hCommDev,
  _Out_   LPCOMMCONFIG lpCC,
  _Inout_ LPDWORD      lpdwSize
);

Parameters

hCommDev [in]

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

lpCC [out]

A pointer to a buffer that receives a COMMCONFIG structure.

lpdwSize [in, out]

The size, in bytes, of the buffer pointed to by lpCC. When the function returns, the variable contains the number of bytes copied if the function succeeds, or the number of bytes required if the buffer was too small.

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, use the GetLastError function.

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

COMMCONFIG
Communications Functions
Communications Resources
CreateFile
GetDefaultCommConfig
SetCommConfig

 

 

Show: