ICorProfilerInfo Interface

Provides methods for use by code profilers to communicate with the common language runtime (CLR) to control event monitoring and request information.

Note

Each method in the ICorProfilerInfo interface returns an HRESULT to indicate success or failure. See CorError.h for a list of possible return codes.

Methods

Method Description
BeginInprocDebugging Method Initializes in-process debugging support. This method is obsolete in .NET Framework version 2.0.
EndInprocDebugging Method Shuts down an in-process debugging session. This method is obsolete in .NET Framework version 2.0.
ForceGC Method Forces garbage collection to occur within the runtime.
GetAppDomainInfo Method Gets information about the specified application domain.
GetAssemblyInfo Method Gets information about the specified assembly.
GetClassFromObject Method Gets the ClassID of an

object, given its ObjectID.
GetClassFromToken Method Gets the ID of the class, given the metadata token. This method is obsolete in .NET Framework version 2.0. Use the ICorProfilerInfo2::GetClassFromTokenAndTypeArgs method instead.
GetClassIDInfo Method Gets the parent module and the metadata token for the specified class.
GetCodeInfo Method Gets the extent of native code associated with the specified function ID. This method is obsolete. Use the ICorProfilerInfo2::GetCodeInfo2 method instead.
GetCurrentThreadID Method Gets the ID of the current thread, if it is a managed thread.
GetEventMask Method Gets the current event categories for which the profiler wants to receive event notifications from the CLR.
GetFunctionFromIP Method Maps a managed code instruction pointer to a FunctionID.
GetFunctionFromToken Method Gets the ID of a function. This method is obsolete in .NET Framework version 2.0. Use the ICorProfilerInfo2::GetFunctionFromTokenAndTypeArgs method instead.
GetFunctionInfo Method Gets the parent class and metadata token for the specified function.
GetHandleFromThread Method Maps the ID of a thread to a Win32 thread handle.
GetILFunctionBody Method Gets a pointer to the body of a method in common intermediate language (CIL) code, starting at its header.
GetILFunctionBodyAllocator Method Gets an interface that provides a method to allocate memory to be used for swapping out the body of a method in CIL code.
GetILToNativeMapping Method Gets a map from CIL offsets to native offsets for the code contained in the specified function.
GetInprocInspectionInterface Method Gets an object that can be queried for an ICorDebugProcess interface. This method is obsolete in .NET Framework version 2.0.
GetInprocInspectionIThisThread Method Gets an object that can be queried for the ICorDebugThread interface. This method is obsolete in .NET Framework version 2.0.
GetModuleInfo Method Given a module ID, returns the file name of the module and the ID of the module's parent assembly.
GetModuleMetaData Method Gets a metadata interface instance that maps to the specified module.
GetObjectSize Method Gets the size of a specified object.
GetThreadContext Method Gets the context identity currently associated with the specified thread.
GetThreadInfo Method Gets the current Win32 thread identity for the specified thread.
GetTokenAndMetadataFromFunction Method Gets the metadata token and an instance of the metadata interface that can be used against the token for the specified function.
IsArrayClass Method Determines whether the specified class is an array class.
SetEnterLeaveFunctionHooks Method Specifies profiler-implemented functions to be called on "enter", "leave", and "tailcall" hooks of managed functions.
SetEventMask Method Sets a value that specifies the types of events for which the profiler wants to receive notification from the CLR.
SetFunctionIDMapper Method Specifies the profiler-implemented function that will be called to map FunctionID values to alternative values, which are passed to the profiler's function entry/exit hooks.
SetFunctionReJIT Method Not implemented. Do not use.
SetILFunctionBody Method Replaces the body of the specified function in the specified module.
SetILInstrumentedCodeMap Method Specifies how the offsets of a specified function's original CIL map to the new offsets of the function's profiler-modified CIL.

Remarks

A profiler calls a method in the ICorProfilerInfo interface to communicate with the CLR to control event monitoring and request information.

The methods of the ICorProfilerInfo interface are implemented by the CLR using the free-threaded model. Each method returns an HRESULT to indicate success or failure. See CorError.h for a list of possible return codes.

The CLR passes, via the profiler's implementation of ICorProfilerCallback::Initialize, an ICorProfilerInfo interface to each code profiler during initialization. A code profiler can then call methods of the ICorProfilerInfo interface to get information about managed code being executed under the control of the CLR.

Requirements

Platforms: See System Requirements.

Header: CorProf.idl, CorProf.h

Library: CorGuids.lib

.NET Framework Versions: Available since 2.0

See also