获取当前函数的调用栈函数RtlCaptureStackBackTrace

平日里用VS开发工具在调时在Debug下有一个选项Call Stack快捷键是Alt+7可以看出函数调用的来龙去脉,原来有一个这样原函数存在。


RtlCaptureStackBackTrace

The RtlCaptureStackBackTrace routine captures a stack back trace by walking up the stack and recording the information for each frame.

USHORT
RtlCaptureStackBackTrace(
__in ULONG
FramesToSkip,
__in ULONG
FramesToCapture,
__out_ecount(
FramesToCapture) PVOID *BackTrace,
__out_opt PULONG
BackTraceHash
);

Parameters
FramesToSkip
The number of frames to skip from the start of the back trace.
FramesToCapture
The number of frames to be captured.
BackTrace
An array of pointers captured from the current stack trace.
BackTraceHash
An optional value that can be used to organize hash tables. If this parameter is NULL, no hash value is computed.

This value is calculated based on the values of the pointers returned in the BackTrace array. Two identical stack traces will generate identical hash values.

Return Value

The number of captured frames.

Comments

The RtlCaptureStackBackTrace routine captures a stack back trace by walking up the stack and recording the information for each frame.

Important This is an exported function that MUST probe the ability to take page faults.

In Windows XP and Windows Server 2003, the sum of the FramesToSkip and FramesToCapture parameters must be less than 63.

Requirements

Versions: Available in Windows XP and later versions of the Windows operating systems.

IRQL: <= DISPATCH_LEVEL

Headers: Declared in Ntifs.h. Include Ntifs.h or FltKernel.h.

Library: Contained in Ntoskrnl.lib.


  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值