KsCloseComm

The availability of this function depends on what the device supports.

Closes an open object handle.

Syntax

BOOL KsCloseComm(
     HANDLE hFile
);

Parameters

hFile: an open object handle.

Return value

If the function succeeds, it returns TRUE, otherwise FALSE. To get extended error information, call GetLastError.

Remarks

KsCloseComm closes handles to thread and file objects. It invalidates the specified object handle, decrements the object's handle count, and performs object-retention checks. Once the last handle to an object is closed, the object is removed from the operating system.

In the RTSS environment, KsCloseComm can also be used to close any RTX64 object. Use the RtCloseHandle to close RTSS objects. In the Windows environment, KsCloseComm can only close Win objects.

Example

N/A

Requirements

  RT Win32
Minimum supported version 4.0 4.0
Header kscom.h kscom.h
Library KsApi_Rtss.lib ksapi.h

See also

KsCreateComm

KsSetupComm