ICorProfilerInfo2::SetEnterLeaveFunctionHooks2 方法
指定在托管函数的“进入”、“离开”和“尾调用”挂钩的更新版本上调用的探查器实现的函数。
语法
HRESULT SetEnterLeaveFunctionHooks2(
[in] FunctionEnter2 *pFuncEnter,
[in] FunctionLeave2 *pFuncLeave,
[in] FunctionTailcall2 *pFuncTailcall);
参数
pFuncEnter
[in] 指向要用作 FunctionEnter2 回调的实现的指针。
pFuncLeave
[in] 指向要用作 FunctionLeave2 回调的实现的指针。
pFuncTailcall
[in] 指向要用作 FunctionTailcall2 回调的实现的指针。
注解
SetEnterLeaveFunctionHooks2
方法类似于 ICorProfilerInfo::SetEnterLeaveFunctionHooks 方法。 使用前者可指定要用作较新版本的进入/离开/尾调用回调的函数,而后者可指定要用作旧版本的进入/离开/尾调用回调的函数。
一次只能有一组回调处于活动状态。 因此,如果探查器同时调用 ICorProfilerInfo::SetEnterLeaveFunctionHooks
和 SetEnterLeaveFunctionHooks2
,则使用 SetEnterLeaveFunctionHooks2
。
SetEnterLeaveFunctionHooks2
方法只能从探查器的 ICorProfilerCallback::Initialize 回调中调用。
要求
平台:请参阅系统要求。
头文件: CorProf.idl、CorProf.h
库:CorGuids.lib
.NET Framework 版本:自 2.0 起可用