Your browser does not allow scripts
Please click here to view a static table of contents without scripts
FT_W32_CloseHandle
Return to Introduction  Previous page  Next page
Close the specified device.

BOOL
FT_W32_CloseHandle
(FT_HANDLE ftHandle)




Parameters
ftHandle
Handle of the device.


Return Value
If the function is successful, the return value is nonzero.
If the function is unsuccessful, the return value is zero.

Example

This example shows how to close a device after opening it for non-overlapped I/O using its description.

FT_STATUS ftStatus;
FT_HANDLE ftHandle;
char Buf[64];

ftStatus = FT_ListDevices(0,Buf,FT_LIST_BY_INDEX|FT_OPEN_BY_DESCRIPTION);
ftHandle = FT_W32_CreateFile(Buf,GENERIC_READ|GENERIC_WRITE,0,0,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL | FT_OPEN_BY_DESCRIPTION,
0);
if (ftHandle == INVALID_HANDLE_VALUE){
  // FT_W32_CreateDevice failed}
else {
  // FT_W32_CreateFile OK, so do some work, and eventually ...
  FT_W32_CloseHandle(ftHandle);
}