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.

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