windows-nt/Source/XPSP1/NT/base/ntdll/frame.c

58 lines
756 B
C
Raw Normal View History

2020-09-26 03:20:57 -05:00
/*++
Copyright (c) 1989 Microsoft Corporation
Module Name:
frame.c
Abstract:
Code to set/restore the active frame pointer in the TEB for
additional debugging assistance.
Author:
Michael Grier (mgrier) 3/2/2001
Revision History:
--*/
#include <nt.h>
#include <ntrtl.h>
#include <nturtl.h>
NTSYSAPI
VOID
NTAPI
RtlPushFrame(
IN PTEB_ACTIVE_FRAME Frame
)
{
const PTEB Teb = NtCurrentTeb();
Frame->Previous = Teb->ActiveFrame;
Teb->ActiveFrame = Frame;
}
NTSYSAPI
VOID
NTAPI
RtlPopFrame(
IN PTEB_ACTIVE_FRAME Frame
)
{
const PTEB Teb = NtCurrentTeb();
Teb->ActiveFrame = Frame->Previous;
}
NTSYSAPI
PTEB_ACTIVE_FRAME
NTAPI
RtlGetFrame(
VOID
)
{
return NtCurrentTeb()->ActiveFrame;
}