Source code of Windows XP (NT5)
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.

95 lines
1.4 KiB

  1. ;++
  2. ;
  3. ; Copyright (c) 1989 Microsoft Corporation
  4. ;
  5. ; Module Name:
  6. ;
  7. ; stackchk.inc
  8. ;
  9. ; Abstract:
  10. ;
  11. ; This module implements stack checking for the dos extender
  12. ;
  13. ; Author:
  14. ;
  15. ; Dave Hastings (daveh) 20-Apr-1993
  16. ;
  17. ;--
  18. if DBG
  19. FIX_STACK macro
  20. local foo,foo1
  21. push bp
  22. mov bp,pbReflStack
  23. cmp bp,offset DGROUP:bReflStack
  24. ja foo1
  25. BOP BOP_DBGBREAKPOINT
  26. foo1: mov bp,sp
  27. ; cmp word ptr [bp - CB_STKFRAME + 2],0AAAAH
  28. ; je foo
  29. ; BOP BOP_DBGBREAKPOINT
  30. foo: mov word ptr [bp - CB_STKFRAME + 2],0AAAAH
  31. pop bp
  32. endm
  33. CHECK_STACK macro
  34. local foo
  35. push bp
  36. mov bp,pbReflStack
  37. ; cmp word ptr [bp + 2],0AAAAh
  38. ; je foo
  39. ; BOP BOP_DBGBREAKPOINT
  40. foo: pop bp
  41. endm
  42. ifdef NEC_98
  43. ASSERT_CLI macro
  44. endm
  45. else
  46. ASSERT_CLI macro
  47. local foo1
  48. push ds
  49. push 40h
  50. pop ds
  51. test ds:[314h],0200h
  52. jz foo1
  53. BOP BOP_DBGBREAKPOINT
  54. foo1: pop ds
  55. endm
  56. endif ;!NEC_98
  57. ASSERT_REFLSTK_OK macro
  58. local foo1
  59. cmp pbReflStack,offset DGROUP:pbReflStack
  60. jna foo1
  61. BOP BOP_DBGBREAKPOINT
  62. foo1:
  63. endm
  64. else
  65. FIX_STACK macro
  66. endm
  67. CHECK_STACK macro
  68. endm
  69. ASSERT_CLI macro
  70. endm
  71. ASSERT_REFLSTK_OK macro
  72. endm
  73. endif