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.

106 lines
1.6 KiB

  1. TITLE LDSTACK - stack walking procedure
  2. .xlist
  3. include kernel.inc
  4. include newexe.inc
  5. include tdb.inc
  6. include eems.inc
  7. .list
  8. ;externFP GlobalHandle
  9. ;externFP FarLoadSegment
  10. ;externW pStackTop
  11. ;externW pStackBot
  12. DataBegin
  13. ;externB Kernel_flags
  14. ;externW segSwapArea
  15. ;externW oOldSP
  16. ;externW hOldSS
  17. ;externW fEEMS
  18. ;externW pGlobalHeap
  19. ;externW curTDB
  20. ;externW headTDB
  21. DataEnd
  22. sBegin CODE
  23. assumes CS,CODE
  24. ;externNP MyLock
  25. ;externNP LoadSegment
  26. sEnd CODE
  27. sBegin MISCCODE
  28. assumes cs, MISCCODE
  29. assumes ds, nothing
  30. assumes es, nothing
  31. jmpbuf struc
  32. jb_ret DD ?
  33. jb_sp DW ?
  34. jb_bp DW ?
  35. jb_si DW ?
  36. jb_di DW ?
  37. jb_hds DW ?
  38. jb_ip DW ?
  39. jb_hss DW ?
  40. jmpbuf ends
  41. savedSI = -4
  42. savedDI = -6
  43. cProcVDO Catch,<PUBLIC,FAR>,<ds,si,di>
  44. parmD lpJmpBuf
  45. cBegin
  46. push [bp].savedCS
  47. push [bp].savedIP
  48. push [bp].savedBP
  49. les bx,lpJmpBuf
  50. mov es:[bx].jb_hss,ss
  51. mov es:[bx].jb_hds,ds
  52. mov es:[bx].jb_di,di
  53. mov es:[bx].jb_si,si
  54. pop es:[bx].jb_bp
  55. pop word ptr es:[bx].jb_ret[0]
  56. pop word ptr es:[bx].jb_ret[2]
  57. mov es:[bx].jb_sp,sp
  58. xor ax,ax
  59. CatchRet:
  60. cEnd
  61. cProcVDO Throw,<PUBLIC,FAR>
  62. ; parmD lpJmpBuf
  63. ; parmW AXvalue
  64. cBegin nogen
  65. mov bx,sp
  66. mov di,ss:[bx+4]
  67. lds si,ss:[bx+6]
  68. mov ss,ds:[si].jb_hss
  69. mov sp,ds:[si].jb_sp
  70. mov bp,sp
  71. add bp,-savedDI
  72. push ds:[si].jb_bp
  73. pop ss:[bp].savedBP
  74. push ds:[si].jb_si
  75. pop ss:[bp].savedSI
  76. push ds:[si].jb_di
  77. pop ss:[bp].savedDI
  78. push ds:[si].jb_hds
  79. pop ss:[bp].savedDS
  80. mov ax,word ptr ds:[si].jb_ret[2]
  81. mov ss:[bp].savedCS,ax
  82. mov ax,word ptr ds:[si].jb_ret[0]
  83. mov ss:[bp].savedIP,ax
  84. mov ax,di
  85. jmp CatchRet
  86. cEnd nogen
  87. sEnd MISCCODE
  88. end