Share via


ICorProfilerCallback::ManagedToUnmanagedTransition Method

Notifies the profiler that a transition from managed code to unmanaged code has occurred.

HRESULT ManagedToUnmanagedTransition(
    [in] FunctionID functionId,
    [in] COR_PRF_TRANSITION_REASON reason);

Parameters

  • functionId
    [in] The ID of the function that is being called.

  • reason
    [in] A value of the COR_PRF_TRANSITION_REASON enumeration that indicates whether the transition occurred because of a call into unmanaged code from managed code, or because of a return from a managed function called by an unmanaged one.

Remarks

If the value of reason is COR_PRF_TRANSITION_CALL, the function ID is that of the unmanaged function, which will never have been compiled using the just-in-time compiler. Unmanaged functions have basic information associated with them, such as a name and some metadata. If the unmanaged function was called by using implicit platform invoke (PInvoke), the runtime cannot determine the destination of the call and the value of functionId will be null. For more information on implicit PInvoke, see Using C++ Interop (Implicit PInvoke).

Requirements

Platforms: See .NET Framework System Requirements.

Header: CorProf.idl, CorProf.h

Library: CorGuids.lib

.NET Framework Versions: 4, 3.5 SP1, 3.5, 3.0 SP1, 3.0, 2.0 SP1, 2.0

See Also

Reference

ICorProfilerCallback Interface

ICorProfilerCallback::UnmanagedToManagedTransition Method

Other Resources

Using Explicit PInvoke in C++ (DllImport Attribute)