Freigeben über


ICorProfilerInfo::GetILFunctionBody Method

Gets a pointer to the body of a method in Microsoft intermediate language (MSIL) code, starting at its header.

HRESULT GetILFunctionBody(
    [in]  ModuleID    moduleId,
    [in]  mdMethodDef methodId,
    [out] LPCBYTE     *ppMethodHeader,
    [out] ULONG       *pcbMethodSize);

Parameters

Parameter Description

moduleId

[in] The ID of the module in which the function resides.

methodId

[in] The metadata token for the method.

ppMethodHeader

[out] A pointer to the method's header.

pcbMethodSize

[out] An integer that specifies the size of the method.

Remarks

A method is scoped by the module in which it lives. Because the GetILFunctionBody method is designed to give a tool access to the MSIL code before it has been loaded by the common language runtime, it uses the metadata token of the method to find the desired instance.

GetILFunctionBody can return a CORPROF_E_FUNCTION_NOT_IL HRESULT if the methodId points to a method without any MSIL code (such as an abstract method, or a platform invoke (PInvoke) method).

Requirements

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

Header: CorProf.idl

Library: CorGuids.lib

.NET Framework Version: 2.0

See Also

Reference

ICorProfilerInfo Interface