Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
813 B

  1. /*++
  2. Copyright (c) 1989 Microsoft Corporation
  3. Module Name:
  4. frame.c
  5. Abstract:
  6. Code to set/restore the active frame pointer in the TEB for
  7. additional debugging assistance.
  8. Author:
  9. Michael Grier (mgrier) 3/2/2001
  10. Revision History:
  11. --*/
  12. #include <nt.h>
  13. #include <ntrtl.h>
  14. #include <nturtl.h>
  15. NTSYSAPI
  16. VOID
  17. NTAPI
  18. RtlPushFrame(
  19. IN PTEB_ACTIVE_FRAME Frame
  20. )
  21. {
  22. const PTEB Teb = NtCurrentTeb();
  23. Frame->Previous = Teb->ActiveFrame;
  24. Teb->ActiveFrame = Frame;
  25. }
  26. NTSYSAPI
  27. VOID
  28. NTAPI
  29. RtlPopFrame(
  30. IN PTEB_ACTIVE_FRAME Frame
  31. )
  32. {
  33. const PTEB Teb = NtCurrentTeb();
  34. Teb->ActiveFrame = Frame->Previous;
  35. }
  36. NTSYSAPI
  37. PTEB_ACTIVE_FRAME
  38. NTAPI
  39. RtlGetFrame(
  40. VOID
  41. )
  42. {
  43. return NtCurrentTeb()->ActiveFrame;
  44. }