RtlCaptureStackBackTrace function (winnt.h)

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

Syntax

NTSYSAPI WORD RtlCaptureStackBackTrace(
  [in]            DWORD  FramesToSkip,
  [in]            DWORD  FramesToCapture,
  [out]           PVOID  *BackTrace,
  [out, optional] PDWORD BackTraceHash
);

Parameters

[in] FramesToSkip

The number of frames to skip from the start of the back trace.

[in] FramesToCapture

The number of frames to be captured.

[out] BackTrace

An array of pointers captured from the current stack trace.

[out, optional] 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.

Requirements

Requirement Value
Minimum supported client Available in starting with Windows XP.
Target Platform Universal
Header winnt.h (include Ntifs.h, FltKernel.h)
Library NtosKrnl.lib; OneCoreUAP.lib on Windows 10
DLL NtDll.dll (user mode); NtosKrnl.exe (kernel mode)
IRQL <= DISPATCH_LEVEL