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.

100 lines
4.3 KiB

  1. ;-----------------------------------------------------------------------;
  2. ; Picture of stack upon entering 32-bit half of WNDPROC callback:
  3. ;
  4. ; +-----------------------+
  5. ; | callback parameters |
  6. ; +-----------------------+
  7. ; | retf to Win3.0 |
  8. ; | |
  9. ; +-----------------------+
  10. ; | 32-bit pfn |
  11. ; | |
  12. ; +-----------------------+
  13. ; | iCallbackType |
  14. ; | |
  15. ; +-----------------------+
  16. ; | bp | <-- bp/ebp, references up
  17. ; +-----------------------+
  18. ; | si |
  19. ; +-----------------------+
  20. ; | di |
  21. ; +-----------------------+
  22. ; | ds | <-- si/esi, references down if necessary
  23. ; +-----------------------+
  24. ; | THKSPACE16 | if necessary
  25. ; +-----------------------+
  26. ; | MSGSTRUCT | if necessary
  27. ; +-----------------------+
  28. ; | repacked structure(s) | if necessary
  29. ; +-----------------------+
  30. ; | retf to thunk cleanup | if necessary
  31. ; | |
  32. ; +-----------------------+
  33. ; | ss, sp | <-- ebx, references saved ss:sp
  34. ; | |
  35. ; +-----------------------+
  36. ; | dword alignment pad | if necessary
  37. ; +-----------------------+
  38. ;-----------------------------------------------------------------------;
  39. ;-----------------------------------------------------------------------;
  40. ; Picture of stack upon entering 32-bit half of non-WNDPROC callback:
  41. ;
  42. ; +-----------------------+
  43. ; | callback parameters |
  44. ; +-----------------------+
  45. ; | retf to Win3.0 |
  46. ; | |
  47. ; +-----------------------+
  48. ; | 32-bit pfn |
  49. ; | |
  50. ; +-----------------------+
  51. ; | iCallbackType |
  52. ; | |
  53. ; +-----------------------+
  54. ; | bp | <-- bp/ebp, references up
  55. ; +-----------------------+
  56. ; | si |
  57. ; +-----------------------+
  58. ; | di |
  59. ; +-----------------------+
  60. ; | ds |
  61. ; +-----------------------+
  62. ; | ss, sp | <-- ebx, references saved ss:sp
  63. ; | |
  64. ; +-----------------------+
  65. ; | dword alignment pad | if necessary
  66. ; +-----------------------+
  67. ;-----------------------------------------------------------------------;
  68. include thkframe.inc
  69. ;-----------------------------------------------------------------------;
  70. ; Message thunk local variable space. This is the stack frame set up
  71. ; by the API thunk before calling the message thunk dispatcher.
  72. ;-----------------------------------------------------------------------;
  73. THKSPACE16 struc
  74. s16_hwnd dw ? ;hwnd to receive message
  75. s16_message dw ? ;message number
  76. s16_wParam dd ? ;message wParam
  77. s16_lParam dd ? ;message lParam
  78. s16_lResult dd ? ;message return result (only if TF_THUNKRESULT)
  79. s16_fw dw ? ;miscellaneous flags
  80. s16_atomClass dw ? ;atom of window class (if negative)
  81. s16_dwExtra1 dd ? ;extra space
  82. s16_dwExtra2 dd ? ;more extra space
  83. THKSPACE16 ends
  84. ;s16_fw bit definitions
  85. TF_NOTPAIRED equ 0001h ;indicates this call is not paired with cleanup
  86. TF_THUNKMSGRESULT equ 0002h ;has a return value to thunk
  87. TF_CLEANUP equ 0004h ;doing cleaning up
  88. TF_INTERPROCESS equ 0008h ;send/call to window in different app
  89. TF_OPENFILENAME equ 0010h ;Hook fn for GetOpen/SaveFileName dlg
  90. TF_CHOOSEFONT equ 0020h ;Hook fn for ChooseFont dlg
  91. TF_CHOOSECOLOR equ 0030h ;Hook fn for ChooseColor dlg
  92. TF_PRINTDLG equ 0040h ;Hook fn for Print/PrintSetup dlg
  93. TF_FINDREPLACE equ 0050h ;Hook fn for Find/Replace dlg
  94. TF_INITDIALOG_MASK equ 00F0h ;WM_INITDIALOG values mask
  95. ;And flags with TF_INITDIALOG_MASK; right shift'em 4 bits, double it
  96. ;and you have WORD index into thunking table.