GetDefaultCommConfigA function (winbase.h)
Retrieves the default configuration for the specified communications device.
BOOL GetDefaultCommConfigA( [in] LPCSTR lpszName, [out] LPCOMMCONFIG lpCC, [in, out] LPDWORD lpdwSize );
The name of the device. For example, COM1 through COM9 are serial ports and LPT1 through LPT9 are parallel ports.
A pointer to a buffer that receives a COMMCONFIG structure.
[in, out] lpdwSize
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.
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.
The winbase.h header defines GetDefaultCommConfig 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.
|Minimum supported client||Windows XP|
|Minimum supported server||Windows Server 2003|
|Header||winbase.h (include Windows.h)|