Share via


IRAPISession::CeCloseHandle

Send Feedback

This function closes an open object handle that was created using RAPI or RAPI2 methods.

BOOL CeCloseHandle( 
  HANDLE hObject 
);

Parameters

  • hObject
    Handle to an open object.

Return Values

Nonzero indicates success. Zero indicates failure. To get extended error information, call IRAPISession::CeGetLastError. Call GetLastError to get information about errors that are not related to RAPI2.

Remarks

The IRAPISession::CeCloseHandle function closes handles to the following objects.

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

IRAPISession::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 IRAPISession::CeCloseHandle to close handles returned by calls to the IRAPISession::CeCreateFile method. Use IRAPISession::CeFindClose to close handles returned by calls to the IRAPISession::CeFindFirstFile method.

To get extended error information, call IRAPISession::CeGetLastError and IRAPISession::CeRapiGetError.

Requirements

OS Versions: Windows CE 5.01 and later.
Header: Rapi2.h.
Link Library: Ole32.lib, Rapiuuid.lib.

See Also

IRAPISession::IUnknown | IRAPISession::CeDeleteFile | IRAPISession::CeCreateFile | IRAPISession::CeFindClose | IRAPISession::CeFindFirstFile

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.