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. |
interface ICorProfilerInfo : IUnknown
{
HRESULT GetClassFromObject(
[in] ObjectID objectId,
[out] ClassID *pClassId);
HRESULT GetClassFromToken(
[in] ModuleID moduleId,
[in] mdTypeDef typeDef,
[out] ClassID *pClassId);
HRESULT GetCodeInfo(
[in] FunctionID functionId,
[out] LPCBYTE *pStart,
[out] ULONG *pcSize);
HRESULT GetEventMask(
[out] DWORD *pdwEvents);
HRESULT GetFunctionFromIP(
[in] LPCBYTE ip,
[out] FunctionID *pFunctionId);
HRESULT GetFunctionFromToken(
[in] ModuleID moduleId,
[in] mdToken token,
[out] FunctionID *pFunctionId);
HRESULT GetHandleFromThread(
[in] ThreadID threadId,
[out] HANDLE *phThread);
HRESULT GetObjectSize(
[in] ObjectID objectId,
[out] ULONG *pcSize);
HRESULT IsArrayClass(
[in] ClassID classId,
[out] CorElementType *pBaseElemType,
[out] ClassID *pBaseClassId,
[out] ULONG *pcRank);
HRESULT GetThreadInfo(
[in] ThreadID threadId,
[out] DWORD *pdwWin32ThreadId);
HRESULT GetCurrentThreadID(
[out] ThreadID *pThreadId);
HRESULT GetClassIDInfo(
[in] ClassID classId,
[out] ModuleID *pModuleId,
[out] mdTypeDef *pTypeDefToken);
HRESULT GetFunctionInfo(
[in] FunctionID functionId,
[out] ClassID *pClassId,
[out] ModuleID *pModuleId,
[out] mdToken *pToken);
HRESULT SetEventMask(
[in] DWORD dwEvents);
HRESULT SetEnterLeaveFunctionHooks(
[in] FunctionEnter *pFuncEnter,
[in] FunctionLeave *pFuncLeave,
[in] FunctionTailcall *pFuncTailcall);
HRESULT SetFunctionIDMapper(
[in] FunctionIDMapper *pFunc);
HRESULT GetTokenAndMetaDataFromFunction(
[in] FunctionID functionId,
[in] REFIID riid,
[out] IUnknown **ppImport,
[out] mdToken *pToken);
HRESULT GetModuleInfo(
[in] ModuleID moduleId,
[out] LPCBYTE *ppBaseLoadAddress,
[in] ULONG cchName,
[out] ULONG *pcchName,
[out, size_is(cchName), length_is(*pcchName)]
WCHAR szName[] ,
[out] AssemblyID *pAssemblyId);
HRESULT GetModuleMetaData(
[in] ModuleID moduleId,
[in] DWORD dwOpenFlags,
[in] REFIID riid,
[out] IUnknown **ppOut);
HRESULT GetILFunctionBody(
[in] ModuleID moduleId,
[in] mdMethodDef methodId,
[out] LPCBYTE *ppMethodHeader,
[out] ULONG *pcbMethodSize);
HRESULT GetILFunctionBodyAllocator(
[in] ModuleID moduleId,
[out] IMethodMalloc **ppMalloc);
HRESULT SetILFunctionBody(
[in] ModuleID moduleId,
[in] mdMethodDef methodid,
[in] LPCBYTE pbNewILMethodHeader);
HRESULT GetAppDomainInfo(
[in] AppDomainID appDomainId,
[in] ULONG cchName,
[out] ULONG *pcchName,
[out, size_is(cchName), length_is(*pcchName)]
WCHAR szName[] ,
[out] ProcessID *pProcessId);
HRESULT GetAssemblyInfo(
[in] AssemblyID assemblyId,
[in] ULONG cchName,
[out] ULONG *pcchName,
[out, size_is(cchName), length_is(*pcchName)]
WCHAR szName[] ,
[out] AppDomainID *pAppDomainId,
[out] ModuleID *pModuleId);
HRESULT SetFunctionReJIT(
[in] FunctionID functionId);
HRESULT ForceGC();
HRESULT SetILInstrumentedCodeMap(
[in] FunctionID functionId,
[in] BOOL fStartJit,
[in] ULONG cILMapEntries,
[in, size_is(cILMapEntries)] COR_IL_MAP rgILMapEntries[] );
HRESULT GetInprocInspectionInterface(
[out] IUnknown **ppicd);
HRESULT GetInprocInspectionIThisThread(
[out] IUnknown **ppicd);
HRESULT GetThreadContext(
[in] ThreadID threadId,
[out] ContextID *pContextId);
HRESULT BeginInprocDebugging(
[in] BOOL fThisThreadOnly,
[out] DWORD *pdwProfilerContext);
HRESULT EndInprocDebugging(
[in] DWORD dwProfilerContext);
HRESULT GetILToNativeMapping(
[in] FunctionID functionId,
[in] ULONG32 cMap,
[out] ULONG32 *pcMap,
[out, size_is(cMap), length_is(*pcMap)]
COR_DEBUG_IL_TO_NATIVE_MAP map[]);
}
Methods
Method |
Description |
---|---|
Initializes in-process debugging support. This method is obsolete in the .NET Framework version 2.0. |
|
Shuts down an in-process debugging session. This method is obsolete in the .NET Framework version 2.0. |
|
Forces garbage collection to occur within the runtime. |
|
Gets information about the specified application domain. |
|
Gets information about the specified assembly. |
|
Gets the ClassID of an object, given its ObjectID. |
|
Gets the ID of the class, given the metadata token. This method is obsolete in the .NET Framework version 2.0. Use the ICorProfilerInfo2::GetClassFromTokenAndTypeArgs method instead. |
|
Gets the parent module and the metadata token for the specified class. |
|
Gets the extent of native code associated with the specified function ID. This method is obsolete. Use the ICorProfilerInfo2::GetCodeInfo2 method instead. |
|
Gets the ID of the current thread, if it is a managed thread. |
|
Gets the current event categories for which the profiler wants to receive event notifications from the CLR. |
|
Maps a managed code instruction pointer to a FunctionID. |
|
Gets the ID of a function. This method is obsolete in the .NET Framework version 2.0. Use the ICorProfilerInfo2::GetFunctionFromTokenAndTypeArgs method instead. |
|
Gets the parent class and metadata token for the specified function. |
|
Maps the ID of a thread to a Win32 thread handle. |
|
Gets a pointer to the body of a method in Microsoft intermediate language (MSIL) code, starting at its header. |
|
Gets an interface that provides a method to allocate memory to be used for swapping out the body of a method in MSIL code. |
|
Gets a map from MSIL offsets to native offsets for the code contained in the specified function. |
|
Gets an object that can be queried for an ICorDebugProcess interface. This method is obsolete in the .NET Framework version 2.0. |
|
Gets an object that can be queried for the ICorDebugThread interface. This method is obsolete in the .NET Framework version 2.0. |
|
Gets information about the specified module. |
|
Gets a metadata interface instance that maps to the specified module. |
|
Gets the size of a specified object. |
|
Gets the context identity currently associated with the specified thread. |
|
Gets the current Win32 thread identity for the specified thread. |
|
Gets the metadata token and an instance of the metadata interface that can be used against the token for the specified function. |
|
Determines whether the specified class is an array class. |
|
Specifies profiler-implemented functions to be called on "enter", "leave", and "tailcall" hooks of managed functions. |
|
Sets a value that specifies the types of events for which the profiler wants to receive notification from the CLR. |
|
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. |
|
Not implemented. Do not use. |
|
Replaces the body of the specified function in the specified module. |
|
Specifies how the offsets of a specified function's original MSIL map to the new offsets of the function's profiler-modified MSIL. |
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: Windows 2000, Windows XP, Windows Server 2003 family
Header: CorProf.idl
Library: CorGuids.lib
.NET Framework Version: 2.0