Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

ICorProfilerInfo::SetILFunctionBody Method

Replaces the body of the specified function in the specified module.

HRESULT SetILFunctionBody(
    [in] ModuleID    moduleId,
    [in] mdMethodDef methodid,
    [in] LPCBYTE     pbNewILMethodHeader);

moduleId

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

methodid

[in] The token of the function for which to replace the body.

pbNewILMethodHeader

[in] The new header for the function.

The SetILFunctionBody method replaces the relative virtual address of the function in the metadata so that it points to the new function body, and adjusts any internal data structures as required.

The SetILFunctionBody method can be called on only those functions that have never been compiled by a just-in-time (JIT) compiler.

Use the ICorProfilerInfo::GetILFunctionBodyAllocator method to allocate space for the new method to ensure that the buffer is compatible.

Platforms: See .NET Framework System Requirements.

Header: CorProf.idl, CorProf.h

Library: CorGuids.lib

.NET Framework Versions: 4.6 RC, 4.5.2, 4.5.1, 4.5, 4, 3.5 SP1, 3.5, 3.0 SP1, 3.0, 2.0 SP1, 2.0

Show:
© 2015 Microsoft