Redigera

Dela via


EvtClose function (winevt.h)

Closes an open handle.

Syntax

BOOL EvtClose(
  [in] EVT_HANDLE Object
);

Parameters

[in] Object

An open event handle to close.

Return value

Return code/value Description
TRUE
The function succeeded
FALSE
The function failed. To get the error code, call the GetLastError function.

Remarks

You cannot use the handle after the handle is closed. When you close a parent handle, any opened handles that were created using the handle are also closed. For example, if you query for events, the query result contains a handle for each event that matches the query. Best practice suggests that you close each event handle when you are done with the event but if you do not, when you close the query handle, all event handles are also closed.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header winevt.h
Library Wevtapi.lib
DLL Wevtapi.dll