Share via


CeCloseHandle (RAPI) (Windows Embedded CE 6.0)

1/6/2010

This function closes an open object handle that was created using RAPI functions.

Syntax

BOOL CeCloseHandle( 
  HANDLE hObject 
);

Parameters

  • hObject
    Handle to an open object.

Return Value

Nonzero indicates success. Zero indicates failure. To get extended error information, call CeGetLastError and CeRapiGetError.

Remarks

The CeCloseHandle function closes handles to the following objects.

  • Communications device
  • Database
  • Event
  • File
  • Mutex
  • Process
  • Socket
  • Thread

CeCloseHandle invalidates the specified object handle, decrements the object's handle count, and performs object retention checks. After the last handle to an object is closed, the object is removed from the system.

Closing a thread handle does not terminate the associated thread. To remove a thread object, you must terminate the thread, and then close all handles to the thread.

Use CeCloseHandle to close handles returned by calls to the CeCreateFile function. Use CeFindClose to close handles returned by calls to the CeFindFirstFile function.

Requirements

Header rapi.h
Library rapi.lib
Windows Embedded CE Windows CE 3.0 and later

See Also

Reference

RAPI Functions
CeDeleteFile (RAPI)