共用方式為


ICorProfilerInfo2::SetEnterLeaveFunctionHooks2 方法

指定要在 Managed 函式之 "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 介面