ICorProfilerInfo3::SetEnterLeaveFunctionHooks3WithInfo 方法
指定将在托管函数的 FunctionEnter3WithInfo、FunctionLeave3WithInfo 和 FunctionTailcall3WithInfo 挂钩上调用的探查器实现函数。
语法
HRESULT SetEnterLeaveFunctionHooks3WithInfo(
[in] FunctionEnter3WithInfo *pFuncEnter3,
[in] FunctionLeave3withInfo *pFuncLeave3,
[in] FunctionTailcall3WithInfo *pFuncTailcall3);
参数
pFuncEnter3
[in] 指向要用作 FunctionEnter3WithInfo
回调的实现的指针。
pFuncLeave3
[in] 指向要用作 FunctionLeave3WithInfo
回调的实现的指针。
pFuncTailcall3
[in] 指向要用作 FunctionTailcall3WithInfo
回调的实现的指针。
注解
FunctionEnter3WithInfo、FunctionLeave3WithInfo 和 FunctionTailcall3WithInfo 挂钩提供堆栈帧和参数检查。 若要访问该信息,必须设置 COR_PRF_ENABLE_FUNCTION_ARGS
、COR_PRF_ENABLE_FUNCTION_RETVAL
和/或 COR_PRF_ENABLE_FRAME_INFO
标志。 探查器可以使用 ICorProfilerInfo::SetEventMask 方法设置事件标志,然后使用 SetEnterLeaveFunctionHooks3WithInfo
方法注册此函数的实现。
一次只能有一组回调处于活动状态,最新版本优先。 因此,如果探查器同时调用 SetEnterLeaveFunctionHooks2 和 SetEnterLeaveFunctionHooks3WithInfo
,则使用 SetEnterLeaveFunctionHooks3WithInfo
。
SetEnterLeaveFunctionHooks3WithInfo
方法只能从探查器的 ICorProfilerCallback::Initialize 回调中调用。
要求
平台:请参阅系统要求。
头文件: CorProf.idl、CorProf.h
库:CorGuids.lib
.NET Framework 版本:自 4 起可用
另请参阅
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈