ICorProfilerInfo4::RequestRevert Method

Reverts all instances of the specified functions to their original versions.

Syntax

HRESULT RequestRevert (  
   [in] ULONG    cFunctions,  
   [in, size_is(cFunctions)]  ModuleID    moduleIds[],  
   [in, size_is(cFunctions)]  mdMethodDef methodIds[],  
   [out, size_is(cFunctions)]  HRESULT status[]);  

Parameters

cFunctions
[in] The number of functions to revert.

moduleIds
[in] Specifies the moduleId portion of the (module, methodDef) pairs that identify the functions to be reverted.

methodIds
[in] Specifies the methodId portion of the (module, methodDef) pairs that identify the functions to be reverted.

status
[out] An array of HRESULTs listed in the "Status HRESULTs" section later in this topic. Each HRESULT indicates the success or failure of trying to revert each function specified in the parallel arrays moduleIds and methodIds.

Return Value

This method returns the following specific HRESULTs as well as HRESULT errors that indicate method failure.

HRESULT Description
S_OK An attempt was made to revert all requests; however, the returned status array must be checked to determine which functions were successfully reverted.
CORPROF_E_CALLBACK4_REQUIRED The profiler must implement the ICorProfilerCallback4 interface for this call to be supported.
CORPROF_E_REJIT_NOT_ENABLED JIT recompilation has not been enabled. You must enable JIT recompilation during initialization by using the ICorProfilerInfo::SetEventMask method to set the COR_PRF_ENABLE_REJIT flag.
E_INVALIDARG cFunctions is 0, or moduleIds or methodIds is NULL.
E_OUTOFMEMORY The CLR was unable to complete the request because it ran out of memory.

Status HRESULTS

Status array HRESULT Description
S_OK The corresponding function was successfully reverted.
E_INVALIDARG The moduleID or methodDef parameter is NULL.
CORPROF_E_DATAINCOMPLETE The module is not fully loaded yet, or it is in the process of being unloaded.
CORPROF_E_MODULE_IS_DYNAMIC The specified module was dynamically generated (for example by Reflection.Emit). Therefore, it is not supported by this method.
CORPROF_E_ACTIVE_REJIT_REQUEST_NOT_FOUND The CLR could not revert the specified function, because a corresponding active recompilation request was not found. Either the recompilation was never requested or the function was already reverted.
Other The operating system returned a failure outside the control of the CLR. For example, if a system call to change the access protection of a page of memory fails, the operating system error will be displayed.

Remarks

The next time any of the reverted function instances are called, the original versions of the functions will be run. If a function is already running, it will finish executing the version that is running.

Requirements

Platforms: See System Requirements.

Header: CorProf.idl, CorProf.h

Library: CorGuids.lib

.NET Framework Versions: Available since 4.5

See also