From aldeid
Jump to navigation Jump to search


Closes an open object handle.


BOOL WINAPI CloseHandle(
  _In_  HANDLE hObject


hObject [in]
A valid handle to an open object.

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

If the application is running under a debugger, the function will throw an exception if it receives either a handle value that is not valid or a pseudo-handle value. This can happen if you close a handle twice, or if you call CloseHandle on a handle returned by the FindFirstFile function instead of calling the FindClose function.