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.

266 lines
6.8 KiB

  1. ;
  2. ; USER3A.ASM
  3. ; More Win16 USER thunks
  4. ;
  5. ; History:
  6. ;
  7. ; Created 25-Jan-1991 by Jeff Parsons (jeffpar)
  8. ; Added Win 31 thunks 22nd-March-1992 by Chandan S. Chauhan (ChandanC)
  9. ; Split off from USER2.ASM 4-Dec-92 by barryb
  10. ; Split off user3a.asm from user3.asm 2-May-95 davehart
  11. ;
  12. ;--
  13. TITLE USER3A.ASM
  14. PAGE ,132
  15. .286p
  16. .xlist
  17. include wow.inc
  18. include wowusr.inc
  19. include cmacros.inc
  20. NOEXTERNS=1 ; to suppress including most of the stuff in user.inc
  21. include user.inc
  22. .list
  23. externFP WOW16Call
  24. createSeg _TEXT,CODE,WORD,PUBLIC,CODE
  25. createSeg _DATA,DATA,WORD,PUBLIC,DATA,DGROUP
  26. defgrp DGROUP,DATA
  27. sBegin CODE
  28. assumes CS,CODE
  29. assumes DS,DATA
  30. assumes ES,NOTHING
  31. ;*--------------------------------------------------------------------------*
  32. ;*
  33. ;* CheckMsgForTranslate, CheckAccMsgForTranslate, CheckMDIAccMsgForTranslate
  34. ;*
  35. ;* Checks to see if the message number in the message is one of those
  36. ;* that the system actually uses. If not, then the API just returns with
  37. ;* a 0 in AX. This saves the 16-32-16 bit transition for most messages.
  38. ;*
  39. ;*--------------------------------------------------------------------------*
  40. ALIGN 16
  41. cProc CheckMsgForTranslate, <PUBLIC, NEAR>
  42. parmD lpMsg ; Callers parameter
  43. parmD lpReturn ; Callers Return Address
  44. ;parmW wBP ; Thunk saved BP
  45. ;parmW wDS ; Thunk saved DS
  46. cBegin
  47. les bx,lpMsg ; load msg address into es:bx
  48. mov ax,es:[bx+2] ; load message number
  49. ; we are looking for ,WM_KEYDOWN, KEYUP, SYSKEYDOWN, SYSKEYUP
  50. ; in other words, 100, 101, 104, amd 105 hex
  51. and ax,0fffah ; wipe out 2 bits that are variable
  52. xor ax, 0100h ; compensate for bit that must be on
  53. jz @f
  54. ; cmp ax,WM_KEYDOWN
  55. ; jz @f
  56. ; cmp ax,WM_KEYUP
  57. ; jz @f
  58. ; cmp ax,WM_SYSKEYDOWN
  59. ; jz @f
  60. ; cmp ax,WM_SYSKEYUP
  61. ; jz @f
  62. sub ax,ax ; flag not translated
  63. pop bp
  64. add sp,2 ; skip thunk IP
  65. retf 4 ; lpMsg -- 4 bytes to pop
  66. @@:
  67. mov sp,bp ; Do cEnd without Ret count (leave parameters there)
  68. pop bp
  69. ret
  70. cEnd <nogen>
  71. ALIGN 16
  72. cProc CheckAccMsgForTranslate, <PUBLIC, NEAR>
  73. parmW hWnd
  74. parmW hAccTbl
  75. parmD lpMsg ; Callers parameter
  76. parmD lpReturn ; Callers Return Address
  77. cBegin
  78. test hWnd,0ffffh
  79. jz SHORT t_not
  80. les bx,lpMsg ; load msg address into es:bx
  81. mov ax,es:[bx+2] ; load message number
  82. ; we are looking for ,WM_KEYDOWN, CHAR, SYSKEYDOWN, SYSCHAR
  83. ; in other words, 100, 102, 104, amd 106 hex
  84. and ax,0fff9h ; wipe out 2 bits that are variable
  85. xor ax, 0100h ; compensate for bit that must be on
  86. jz @f
  87. ; cmp ax,WM_KEYDOWN
  88. ; jz @f
  89. ; cmp ax,WM_CHAR
  90. ; jz @f
  91. ; cmp ax,WM_SYSKEYDOWN
  92. ; jz @f
  93. ; cmp ax,WM_SYSCHAR
  94. ; jz @f
  95. t_not:
  96. sub ax,ax ; flag not translated
  97. pop bp
  98. add sp,2 ; skip thunk IP
  99. retf 8 ; 8 bytes to pop
  100. @@:
  101. mov sp,bp ; Do cEnd without Ret count (leave parameters there)
  102. pop bp
  103. ret
  104. cEnd <nogen>
  105. ALIGN 16
  106. cProc CheckMDIAccMsgForTranslate, <PUBLIC, NEAR>
  107. parmD lpMsg ; Callers parameter
  108. parmD lpReturn ; Callers Return Address
  109. cBegin
  110. les bx,lpMsg ; load msg address into es:bx
  111. mov ax,es:[bx+2] ; load message number
  112. ; we are looking for ,WM_KEYDOWN, SYSKEYDOWN
  113. ; in other words, 100, 104
  114. and ax,0fffbh ; wipe out 1 bit that is variable
  115. xor ax, 0100h ; compensate for bit that must be on
  116. jz @f
  117. ; cmp ax,WM_KEYDOWN
  118. ; jz @f
  119. ; cmp ax,WM_KEYUP
  120. ; jz @f
  121. ; cmp ax,WM_SYSKEYDOWN
  122. ; jz @f
  123. ; cmp ax,WM_SYSKEYUP
  124. ; jz @f
  125. sub ax,ax ; flag not translated
  126. pop bp
  127. add sp,2 ; skip thunk IP
  128. retf 6 ; 6 bytes to pop
  129. @@:
  130. mov sp,bp ; Do cEnd without Ret count (leave parameters there)
  131. pop bp
  132. ret
  133. cEnd <nogen>
  134. ;
  135. ; Our message queues resize automagically, so just say YES
  136. ; to whatever they ask for.
  137. ;
  138. cProc SetMessageQueue,<PUBLIC,FAR,PASCAL,NODATA,WIN>
  139. ParmW qSize
  140. cBegin
  141. mov ax,1 ; just say we did it
  142. cEnd
  143. ExternFP <GetCurrentTask>
  144. ExternFP <HqCurrent>
  145. externA __MOD_DUSER
  146. cProc SysErrorBox,<PUBLIC,FAR,PASCAL,NODATA,WIN>
  147. cBegin <nogen>
  148. ; we check whether the queue exists for this process
  149. call GetCurrentTask
  150. or ax, ax
  151. jz i_SysErrorBox
  152. call HqCurrent ; flags are set on exit
  153. jz i_SysErrorBox
  154. push size SysErrorBox16
  155. t_SysErrorBox:
  156. push word ptr HI_WCALLID
  157. push __MOD_DUSER + FUN_SYSERRORBOX
  158. call WOW16Call
  159. .erre (($ - t_SysErrorBox) EQ (05h + 03h + 03h))
  160. i_SysErrorBox:
  161. retf 0eh
  162. cEnd <nogen>
  163. UserThunk SETCOMMBREAK
  164. UserThunk SETCOMMEVENTMASK
  165. UserThunk SETCOMMSTATE
  166. UserThunk SETCURSOR
  167. DUserThunk SETCURSORPOS
  168. UserThunk SETDESKPATTERN
  169. UserThunk SETDESKWALLPAPER
  170. UserThunk SETDLGITEMINT
  171. UserThunk SETDLGITEMTEXT
  172. DUserThunk SETDOUBLECLICKTIME
  173. UserThunk SETEVENTHOOK
  174. UserThunk SETFOCUS
  175. UserThunk SETGETKBDSTATE
  176. UserThunk SETGRIDGRANULARITY
  177. DUserThunk SETINTERNALWINDOWPOS
  178. UserThunk SETKEYBOARDSTATE
  179. UserThunk SETMENU
  180. UserThunk SETMENUITEMBITMAPS
  181. UserThunk SETPARENT
  182. UserThunk SETPROP
  183. ;;; UserThunk SETRECT ; LOCALAPI in winrect.asm
  184. ;;; UserThunk SETRECTEMPTY ; LOCALAPI in winrect.asm
  185. UserThunk SETSCROLLPOS
  186. UserThunk SETSCROLLRANGE
  187. UserThunk SETSYSCOLORS
  188. ;;; UserThunk SETSYSMODALWINDOW ; local api in winmisc1.asm
  189. UserThunk SETSYSTEMMENU
  190. DUserThunk SETSYSTEMTIMER ;;;;;;;
  191. UserThunk SETTIMER
  192. UserThunk SETTIMER2
  193. UserThunk SETWC2
  194. UserThunk SETWINDOWLONG
  195. UserThunk SETWINDOWPOS
  196. DUserThunk SETWINDOWSHOOKINTERNAL
  197. UserThunk SETWINDOWTEXT
  198. UserThunk SETWINDOWWORD
  199. UserThunk SHOWCARET
  200. DUserThunk SHOWCURSOR
  201. UserThunk SHOWOWNEDPOPUPS
  202. UserThunk SHOWSCROLLBAR
  203. UserThunk SHOWWINDOW
  204. DUserThunk SIGNALPROC
  205. UserThunk SNAPWINDOW
  206. ;;; UserThunk STATICWNDPROC ;LOCALAPI in wsubcls.c
  207. ;;; UserThunk STRINGFUNC ;LOCALAPI in winlang.asm
  208. DUserThunk SWAPMOUSEBUTTON
  209. DUserThunk SWITCHTOTHISWINDOW
  210. UserThunk SWITCHWNDPROC
  211. ;;; DUserThunk SYSERRORBOX ; LOCALAPI in this file
  212. UserThunk TABBEDTEXTOUT
  213. UserThunk TABTHETEXTOUTFORWIMPS
  214. UserThunk TRACKPOPUPMENU
  215. PUserThunk TRANSLATEACCELERATOR,CheckAccMsgForTranslate
  216. PUserThunk TRANSLATEMDISYSACCEL,CheckMDIAccMsgForTranslate
  217. PUserThunk TRANSLATEMESSAGE,CheckMsgForTranslate
  218. UserThunk TRANSMITCOMMCHAR
  219. UserThunk UNGETCOMMCHAR
  220. UserThunk UNHOOKWINDOWSHOOK
  221. ;;; UserThunk UNIONRECT ; LOCALAPI in winrect.asm
  222. UserThunk UNREGISTERCLASS
  223. UserThunk UPDATEWINDOW
  224. DUserThunk USERYIELD
  225. sEnd CODE
  226. end