windows-nt/Source/XPSP1/NT/base/ntdll/frame.c
2020-09-26 16:20:57 +08:00

58 lines
756 B
C

/*++
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;
}