PWINDBG_STACKTRACE_ROUTINE callback function (wdbgexts.h)

The PWINDBG_STACKTRACE_ROUTINE (StackTrace) function retrieves a stack trace for the process being debugged. Returns the number of frames read into the buffer pointed to by StackFrames.

Syntax

PWINDBG_STACKTRACE_ROUTINE PwindbgStacktraceRoutine;

ULONG PwindbgStacktraceRoutine(
  [in]  ULONG FramePointer,
  [in]  ULONG StackPointer,
  [in]  ULONG ProgramCounter,
  [out] PEXTSTACKTRACE StackFrames,
  [in]  ULONG Frames
)
{...}

Parameters

[in] FramePointer

Specifies the frame pointer. If no specific value is desired, this should simply be set to zero.

[in] StackPointer

Specifies the stack pointer. If no specific value is desired, this should simply be set to zero.

[in] ProgramCounter

Specifies the instruction pointer. If no specific value is desired, this should simply be set to zero.

[out] StackFrames

Receives the stack information. StackFrames must be a pointer to a buffer that is large enough to hold the number of stack frames specified by Frames. The stack frames are stored in the following data structure:

typedef struct _tagEXTSTACKTRACE {
    ULONG       FramePointer;
    ULONG       ProgramCounter;
    ULONG       ReturnAddress;
    ULONG       Args[4];
} EXTSTACKTRACE, *PEXTSTACKTRACE;

[in] Frames

Specifies the maximum number of frames that will fit into the buffer.

Return value

The actual number of frames written to the buffer pointed to by StackFrames.

Remarks

For a WdbgExts extension, include Wdbgexts.h. For

a DbgEng extension, include Wdbgexts.h before

Dbgeng.h. See Writing DbgEng Extension Code for

details.

Requirements

Requirement Value
Target Platform Desktop
Header wdbgexts.h (include Wdbgexts.h, Dbgeng.h)