Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

ComDBReleasePort function

ComDBReleasePort releases a COM port number in the COM port database.

Syntax


LONG WINAPI ComDBReleasePort(
  _In_  HCOMDB HComDB,
  _In_  DWORD ComNumber
);

Parameters

HComDB [in]

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

ComNumber [in]

Specifies the COM port number to release. A port number is an integer that ranges from one to COMDB_MAX_PORTS_ARBITRATED.

Return value

ComDBReleasePort returns one of the following status values.

Return codeDescription
ERROR_SUCCESS

The COM port number was released.

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. The specified port number is not in the COM port database.

ERROR_NOT_CONNECTED

The routine could not access the database. To get extended error information, call GetLastError.

 

Remarks

Releasing a COM port number means to log the port number as "not in use".

ComDBReleasePort runs in user mode.

For more information, see Obtaining and Releasing a COM Port Number.

Requirements

Header

Msports.h (include Msports.h)

Library

Msports.lib

DLL

Msports.dll

See also

ComDBClaimNextFreePort
ComDBClaimPort

 

 

Send comments about this topic to Microsoft

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.