ComDBResizeDatabase function (msports.h)

ComDBResizeDatabase resizes the COM port database.

Syntax

LONG ComDBResizeDatabase(
  [in] HCOMDB HComDB,
  [in] DWORD  NewSize
);

Parameters

[in] HComDB

Handle to the COM port database that was returned by ComDBOpen.

[in] NewSize

Specifies a new size for the COM port database, where the database size is the number of port numbers currently arbitrated in the database. This value must be an integer multiple of 1024, must be greater than the current size, and must be less than or equal to COMDB_MAX_PORTS_ARBITRATED.

Return value

ComDBResizeDatabase returns one of the following status values.

Return code Description
ERROR_SUCCESS
The database was successfully resized.
ERROR_BAD_LENGTH
NewSize is less than or equal to the current database size, or it is greater than COMDB_MAX_PORTS_ARBITRATED.
ERROR_CANTWRITE
The routine could not write to the database.
ERROR_INVALID_PARAMETER
One of the following is true: The specified handle to the COM port database is not valid. NewSize is not a multiple of 1024.
ERROR_NOT_CONNECTED
The routine could not access the database. To get extended error information, call GetLastError.

Remarks

Use ComDBGetCurrentPortUsage to obtain the current database size.

ComDBResizeDatabase runs in user mode.

For more information, see Resizing the COM Port Database.

Requirements

Requirement Value
Target Platform Desktop
Header msports.h (include Msports.h)
Library Msports.lib
DLL Msports.dll

See also

ComDBGetCurrentPortUsage