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.

92 lines
2.1 KiB

  1. ;***
  2. ;lowhelpr.asm
  3. ;
  4. ; Copyright (C) 1995-2001, Microsoft Corporation. All rights reserved.
  5. ;
  6. ;Purpose:
  7. ; Contains _CallSettingFrame(), which must be in asm for NLG purposes.
  8. ;
  9. ;Notes:
  10. ;
  11. ;Revision History:
  12. ; 03-30-95 JWM Module created.
  13. ; 06-09-95 JWM NLG_CATCH_LEAVE now implemented.
  14. ; 08-21-95 JWM Bug fix: Olympus 16585.
  15. ; 08-30-96 SKS Save esi, edi around call to funclet
  16. ; 09-12-95 JWM labvel _NLG_Return moved above new pops (Orion 9224).
  17. ; 03-09-01 PML Add FPO directives for proper callstacks (vs7#221754)
  18. ;
  19. ;*******************************************************************************
  20. title lowhelpr.asm
  21. .xlist
  22. include cruntime.inc
  23. include exsup.inc
  24. .list
  25. EXTERN _NLG_Notify:NEAR
  26. EXTERN _NLG_Notify1:NEAR
  27. PUBLIC _CallSettingFrame
  28. PUBLIC _NLG_Return
  29. extern _NLG_Destination:_NLG_INFO
  30. CODESEG
  31. ;////////////////////////////////////////////////////////////////////////////
  32. ;/
  33. ;/ _CallSettingFrame - sets up EBP and calls the specified funclet. Restores
  34. ;/ EBP on return.
  35. ;/
  36. ;/ Return value is return value of funclet (whatever is in EAX).
  37. ;/
  38. public _CallSettingFrame
  39. _CallSettingFrame proc stdcall, funclet:IWORD, pRN:IWORD, dwInCode:DWORD
  40. ; FPO = 0 dwords locals allocated in prolog
  41. ; 3 dword parameters
  42. ; 8 bytes in prolog
  43. ; 4 registers saved (includes locals to work around debugger bug)
  44. ; 1 EBP is used
  45. ; 0 frame type = FPO
  46. .FPO (0,3,8,4,1,0)
  47. sub esp,4
  48. push ebx
  49. push ecx
  50. mov eax,pRN
  51. add eax,0Ch ; TODO - need sizeof(EHRegistrationNode), not 0Ch
  52. mov dword ptr [ebp-4],eax
  53. mov eax,funclet
  54. push ebp ; Save our frame pointer
  55. push dwInCode
  56. mov ecx,dwInCode
  57. mov ebp,dword ptr [ebp-4] ; Load target frame pointer
  58. call _NLG_Notify1 ; Notify debugger
  59. push esi
  60. push edi
  61. call eax ; Call the funclet
  62. _NLG_Return::
  63. pop edi
  64. pop esi
  65. mov ebx,ebp
  66. pop ebp
  67. mov ecx,dwInCode
  68. push ebp
  69. mov ebp,ebx
  70. cmp ecx, 0100h
  71. jne _NLG_Continue
  72. mov ecx, 02h
  73. _NLG_Continue:
  74. push ecx
  75. call _NLG_Notify1 ; Notify debugger yet again
  76. pop ebp ; Restore our frame pointer
  77. pop ecx
  78. pop ebx
  79. ret 0Ch
  80. _CallSettingFrame ENDP
  81. END