IActionOnCLREvent::OnEvent Method

Performs callbacks on events that have been registered by using a call to the ICLROnEventManager::RegisterActionOnEvent method.

HRESULT OnEvent (
    [in] EClrEvent event,
    [in] PVOID     data
);

Parameters

  • event
    [in] One of the EClrEvent values, which indicates the type of event.

  • data
    [in] A pointer to an object that contains details about event.

Return Value

HRESULT

Description

S_OK

OnEvent returned successfully.

HOST_E_CLRNOTAVAILABLE

The common language runtime (CLR) has not been loaded into a process, or the CLR is in a state in which it cannot run managed code or process the call successfully.

HOST_E_TIMEOUT

The call timed out.

HOST_E_NOT_OWNER

The caller does not own the lock.

HOST_E_ABANDONED

An event was cancelled while a blocked thread or fiber was waiting on it.

E_FAIL

An unknown catastrophic failure occurred. If a method returns E_FAIL, the CLR is no longer usable within the process. Subsequent calls to any hosting method return HOST_E_CLRNOTAVAILABLE.

Remarks

The data parameter is a pointer to an object of unspecified type. If the event parameter is Event_DomainUnload, data is the numeric identifier for the AppDomain that was unloaded. The host can take appropriate action using this identifier as a key.

If event is Event_MDAFired, data is a pointer to an MDAInfo instance that contains the message output from a Managed Debugging Assistant (MDA). MDAs are a feature of the CLR that help developers with debugging, by generating XML messages about events that are otherwise difficult to trap. Such messages can be especially useful in debugging transitions between managed and unmanaged code. For more information, see Diagnosing Errors with Managed Debugging Assistants.

Requirements

Platforms: Windows 2000, Windows XP, Windows Server 2003 family

Header: MSCorEE.idl

Library: Included as a resource in MSCorEE.dll

.NET Framework Version: 2.0

See Also

Concepts

Diagnosing Errors with Managed Debugging Assistants

EClrEvent Enumeration

IActionOnCLREvent Interface

ICLRControl Interface

ICLROnEventManager Interface

MDAInfo Structure