GetDefaultCommConfig function

Retrieves the default configuration for the specified communications device.

Syntax


BOOL WINAPI GetDefaultCommConfig(
  _In_    LPCTSTR      lpszName,
  _Out_   LPCOMMCONFIG lpCC,
  _Inout_ LPDWORD      lpdwSize
);

Parameters

lpszName [in]

The name of the device. For example, COM1 through COM9 are serial ports and LPT1 through LPT9 are parallel ports.

lpCC [out]

A pointer to a buffer that receives a COMMCONFIG structure.

lpdwSize [in, out]

A pointer to a variable that specifies the size of the buffer pointed to by lpCC, in bytes. Upon return, 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

Unicode and ANSI names

GetDefaultCommConfigW (Unicode) and GetDefaultCommConfigA (ANSI)

See also

COMMCONFIG
Communications Functions
Communications Resources
SetDefaultCommConfig

 

 

Show: