ICorProfilerInfo2::SetEnterLeaveFunctionHooks2 方法

指定要在托管函数的“enter”、“leave”和“tailcall”挂钩的更新版本上调用的探查器实现函数。

HRESULT SetEnterLeaveFunctionHooks2(
    [in] FunctionEnter2    *pFuncEnter,
    [in] FunctionLeave2    *pFuncLeave,
    [in] FunctionTailcall2 *pFuncTailcall);

参数

  • pFuncEnter
    [in] 一个指向要用作 FunctionEnter2 回调的实现的指针。

  • pFuncLeave
    [in] 一个指向要用作 FunctionLeave2 回调的实现的指针。

  • pFuncTailcall
    [in] 一个指向要用作 FunctionTailcall2 回调的实现的指针。

备注

SetEnterLeaveFunctionHooks2 方法类似于 ICorProfilerInfo::SetEnterLeaveFunctionHooks 方法。 使用前一方法可以指定要用作 enter/leave/tailcall 回调的较新版本的函数,而使用后一方法可以指定要用作 enter/leave/tailcall 回调的较早版本的函数。

一次只能有一组回调处于活动状态。 因此,如果探查器同时调用 ICorProfilerInfo::SetEnterLeaveFunctionHooksSetEnterLeaveFunctionHooks2,将使用 SetEnterLeaveFunctionHooks2

SetEnterLeaveFunctionHooks2 方法只能从该探查器的 ICorProfilerCallback::Initialize 回调中调用。

要求

**平台:**请参见 .NET Framework 系统要求

**头文件:**CorProf.idl、CorProf.h

**库:**CorGuids.lib

**.NET Framework 版本:**4、3.5 SP1、3.5、3.0 SP1、3.0、2.0 SP1、2.0

请参见

参考

ICorProfilerInfo 接口

ICorProfilerInfo2 接口