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.

1987 lines
44 KiB

  1. ;****************************************************************************
  2. ;* *
  3. ;* USER.INC - *
  4. ;* *
  5. ;* User Data Structures and Defines *
  6. ;* *
  7. ;****************************************************************************
  8. ;
  9. ; Conditional include #defines:
  10. ;
  11. ; LAYER_INCLUDE - Just define POINT, RECT, WND, and CLS structs, plus ICLS_*
  12. ; NOTEXT - Blow off TEXTMETRICS and some other stuff
  13. ;
  14. ifdef WOW
  15. NOTEXT equ 1
  16. endif
  17. .286P
  18. ifndef LAYER_INCLUDE
  19. ?DF=1 ; Don't define _TEXT or _DATA
  20. ?WIN=0 ; turn off Windows support (no default preserve DS in far calls)
  21. include cmacros.inc
  22. include vint.inc
  23. createSeg _DATA,DATA,WORD,PUBLIC,DATA,DGROUP
  24. defgrp DGROUP,DATA
  25. ;createSeg _TEXT,TEXT,WORD,PUBLIC,CODE,IGROUP
  26. createSeg _GPFIX0,GPFIX0,WORD,PUBLIC,CODE,IGROUP ; GP fault trapping
  27. createSeg _GPFIX, GPFIX, WORD,PUBLIC,CODE,IGROUP
  28. createSeg _GPFIX1,GPFIX1,WORD,PUBLIC,CODE,IGROUP
  29. ;defGrp IGROUP,TEXT
  30. endif
  31. include gpfix.inc ; GP fault handler stuff
  32. VER20 equ 0201h
  33. VER300 equ 0300h
  34. VER310 equ 0310h
  35. FALSE equ 0
  36. TRUE equ 1
  37. NULL equ 0
  38. ; Debug fill constants
  39. DBGFILL_ALLOC equ 0fdh
  40. DBGFILL_FREE equ 0fbh
  41. DBGFILL_BUFFER equ 0f9h
  42. DBGFILL_STACK equ 0f7h
  43. ;*--------------------------------------------------------------------------*
  44. ;* *
  45. ;* Window and internal class structures
  46. ;* *
  47. ;*--------------------------------------------------------------------------*
  48. ;
  49. ; POINT Structure
  50. ;
  51. POINT struc
  52. ptX dw ?
  53. ptY dw ?
  54. POINT ends
  55. ;
  56. ; RECT Structure
  57. ;
  58. RECT struc
  59. rcLeft dw ?
  60. rcTop dw ?
  61. rcRight dw ?
  62. rcBottom dw ?
  63. RECT ends
  64. ifdef WOW
  65. ;
  66. ; RECTL Structure
  67. ;
  68. RECTL struc
  69. rclLeft dd ?
  70. rclTop dd ?
  71. rclRight dd ?
  72. rclBottom dd ?
  73. RECTL ends
  74. endif
  75. ifndef WOW
  76. ifdef WORDEXSTYLE
  77. WND struc
  78. wndHwndNext dw ?
  79. wndHwndChild dw ?
  80. wndPwndParent dw ?
  81. wndHwndOwner dw ?
  82. wndRcWindow db size RECT dup(?)
  83. wndRcClient db size RECT dup(?)
  84. wndHq dw ?
  85. wndHRgnUpdate dw ?
  86. wndPcls dw ?
  87. wndHInstance dw ?
  88. wndLpfnWndProc dd ?
  89. wndState dd ?
  90. wndStyle dd ?
  91. wndDwExStyle dw ?
  92. wndHMenu dw ?
  93. wndHName dw ?
  94. wndRgwScroll dw ?
  95. wndPproptab dw ?
  96. wndHwndLastActive dw ?
  97. wndHSysMenu dw ?
  98. WND ends
  99. else
  100. WND struc
  101. wndHwndNext dw ?
  102. wndHwndChild dw ?
  103. wndPwndParent dw ?
  104. wndHwndOwner dw ?
  105. wndRcWindow db size RECT dup(?)
  106. wndRcClient db size RECT dup(?)
  107. wndHq dw ?
  108. wndHRgnUpdate dw ?
  109. wndPcls dw ?
  110. wndHInstance dw ?
  111. wndLpfnWndProc dd ?
  112. wndState dd ?
  113. wndStyle dd ?
  114. wndDwExStyle dd ?
  115. wndHMenu dw ?
  116. wndHName dw ?
  117. wndRgwScroll dw ?
  118. wndPproptab dw ?
  119. wndHwndLastActive dw ?
  120. wndHSysMenu dw ?
  121. WND ends
  122. endif ; WORDEXSTYLE
  123. ;
  124. ; Internal window class structure
  125. ;
  126. CLS struc
  127. uclspclsNext dw ?
  128. uclsMagic dw ?
  129. uclsatomClassName dw ?
  130. uclshdc dw ?
  131. uclscWndReferenceCount dw ? ; Number of windows registered with this
  132. ; Class
  133. ; NOTE: the remaining fields are in the same order as in the WNDCLASS struct
  134. uclsstyle dw ? ; Class style
  135. uclslpfnWndProc dd ?
  136. uclscbclsExtra dw ?
  137. uclscbwndExtra dw ?
  138. uclshModule dw ? ; Module handle
  139. uclshIcon dw ? ; Class icon handle
  140. uclshCursor dw ? ; Class cursor handle
  141. uclshbrBackground dw ? ; Class background brush
  142. uclslpszMenuName dd ? ; Menu name
  143. uclslpszClassName dd ? ; Far ptr to class name
  144. CLS ends
  145. CLS_MAGIC equ ('N' or ('K' * 256))
  146. ; System class ID constants
  147. ;
  148. ; See comments in USER.H
  149. ;
  150. ICLS_BUTTON equ 0
  151. ICLS_EDIT equ 1
  152. ICLS_STATIC equ 2
  153. ICLS_LISTBOX equ 3
  154. ICLS_SCROLLBAR equ 4
  155. ICLS_COMBOBOX equ 5 ; End of special dlgmgr indices
  156. ICLS_CTL_MAX equ 6 ; Number of public control classes
  157. ICLS_DESKTOP equ 6
  158. ICLS_DIALOG equ 7
  159. ICLS_MENU equ 8
  160. ICLS_SWITCH equ 9
  161. ICLS_ICONTITLE equ 10
  162. ICLS_MDICLIENT equ 11
  163. ICLS_COMBOLISTBOX equ 12
  164. ICLS_MAX equ 13 ; Number of system classes
  165. endif ; !WOW
  166. ;
  167. ; SetWindowPos() SMWP structure header
  168. ;
  169. SMWP struc
  170. SmwpCcvr dw ?
  171. SmwpCcvrAlloc dw ?
  172. SmwpFInUse dw ?
  173. SmwpSignature dw ?
  174. ; SmwpRgcvr db 1
  175. SMWP ends
  176. SMWP_SIG equ ('W' or ('P' * 256))
  177. ifndef LAYER_INCLUDE ; If not included from layer.asm...
  178. ;
  179. ; Substitute API names with "I" internal names if RETAIL
  180. ;
  181. ifndef DEBUG
  182. include iuser.inc
  183. endif
  184. ifndef WOW
  185. ; Internal window class names
  186. ;
  187. MENUCLASS equ 8000h
  188. DESKTOPCLASS equ 8001h
  189. DIALOGCLASS equ 8002h
  190. SWITCHWNDCLASS equ 8003h
  191. ICONTITLECLASS equ 8004h
  192. ;
  193. ; Window flag Test, Set, and Clear macros
  194. ;
  195. TSTWF macro pwnd, flag
  196. LOCAL wlow, whigh
  197. wlow = LOW flag
  198. whigh = HIGH flag
  199. test byte ptr [pwnd+wndState+whigh], wlow
  200. endm
  201. SETWF macro pwnd, flag
  202. LOCAL wlow, whigh
  203. wlow = LOW flag
  204. whigh = HIGH flag
  205. or byte ptr [pwnd+wndState+whigh], wlow
  206. endm
  207. CLRWF macro pwnd, flag
  208. LOCAL nwlow, whigh
  209. nwlow = NOT(LOW flag)
  210. whigh = HIGH flag
  211. and byte ptr [pwnd+wndState+whigh], nwlow
  212. endm
  213. ;
  214. ; Window Flags
  215. ;
  216. ; hwnd->state flags (offset 0, 1, 2, 3)
  217. ;
  218. WFMPRESENT equ 0001h
  219. WFVPRESENT equ 0002h
  220. WFHPRESENT equ 0004h
  221. WFCPRESENT equ 0008h
  222. WFSENDSIZEMOVE equ 0010h
  223. WFNOPAINT equ 0020h
  224. WFFRAMEON equ 0040h
  225. WFHASSPB equ 0080h
  226. WFNONCPAINT equ 0101h
  227. WFSENDERASEBKGND equ 0102h
  228. WFERASEBKGND equ 0104h
  229. WFSENDNCPAINT equ 0108h
  230. WFINTERNALPAINT equ 0110h ; Internal paint required flag
  231. WFUPDATEDIRTY equ 0120h
  232. WFHIDDENPOPUP equ 0140h
  233. WFMENUDRAW equ 0180h
  234. WFHASPALETTE equ 0201h
  235. WFPAINTNOTPROCESSED equ 0202h
  236. WFWIN31COMPAT equ 0204h
  237. WFALWAYSSENDNCPAINT equ 0208h
  238. WFPIXIEHACK equ 0210h
  239. WFTOGGLETOPMOST equ 0220h
  240. ;
  241. ; hwnd->style style bits (offsets 4, 5, 6, 7)
  242. ;
  243. WFTYPEMASK equ 07C0h
  244. WFTILED equ 0700h
  245. WFICONICPOPUP equ 07C0h
  246. WFPOPUP equ 0780h
  247. WFCHILD equ 0740h
  248. WFMINIMIZED equ 0720h
  249. WFVISIBLE equ 0710h
  250. WFDISABLED equ 0708h
  251. WFDISABLE equ WFDISABLED
  252. WFCLIPSIBLINGS equ 0704h
  253. WFCLIPCHILDREN equ 0702h
  254. WFMAXIMIZED equ 0701h
  255. WFICONIC equ WFMINIMIZED
  256. WFMINBOX equ 0602h
  257. WFMAXBOX equ 0601h
  258. WFBORDERMASK equ 06C0h
  259. WFBORDER equ 0680h
  260. WFCAPTION equ 06C0h
  261. WFDLGFRAME equ 0640h
  262. WFTOPLEVEL equ 0640h
  263. WFVSCROLL equ 0620h
  264. WFHSCROLL equ 0610h
  265. WFSYSMENU equ 0608h
  266. WFSIZEBOX equ 0604h
  267. WFGROUP equ 0602h
  268. WFTABSTOP equ 0601h
  269. ; If this dlg bit is set, WM_ENTERIDLE message will not be sent
  270. WFNOIDLEMSG equ 0501h
  271. ;
  272. ; hwnd->dwExStyle extended style bits (offsets 8, 9)
  273. ;
  274. WEFDLGMODALFRAME equ 0801h
  275. WEFDRAGOBJECT equ 0802h
  276. WEFNOPARENTNOTIFY equ 0804h
  277. WEFTOPMOST equ 0808h
  278. WEFACCEPTFILES equ 0810h
  279. WEFTRANSPARENT equ 0820h ; "Transparent" child window
  280. ; Class styles
  281. ;
  282. CFVREDRAW equ 0001h
  283. CFHREDRAW equ 0002h
  284. CFKANJIWINDOW equ 0004h
  285. CFDBLCLKS equ 0008h
  286. CFOEMCHARS equ 0010h
  287. CFOWNDC equ 0020h
  288. CFCLASSDC equ 0040h
  289. CFPARENTDC equ 0080h
  290. CFNOKEYCVT equ 0101h
  291. CFNOCLOSE equ 0102h
  292. CFLVB equ 0104h
  293. CFCLSDC equ CFCLASSDC
  294. CFSAVEBITS equ 0108h
  295. CFSAVEPOPUPBITS equ CFSAVEBITS
  296. CFBYTEALIGNCLIENT equ 0110h
  297. CFBYTEALIGNWINDOW equ 0120h
  298. ST_CLASS equ 1
  299. ST_WND equ 2
  300. ST_STRING equ 3
  301. ST_MENU equ 4
  302. ST_CLIP equ 5
  303. ST_CBOX equ 6
  304. ST_PALETTE equ 7
  305. ST_ED equ 8
  306. ST_BWL equ 9
  307. ST_OWNERDRAWMENU equ 10
  308. ST_SPB equ 11
  309. ST_CHECKPOINT equ 12
  310. ST_DCE equ 13
  311. ST_MWP equ 14
  312. ST_PROP equ 15
  313. ST_LBIV equ 16
  314. ST_MISC equ 17
  315. ST_ATOMS equ 18
  316. ST_LOCKINPUTSTATE equ 19
  317. ST_HOOKNODE equ 20
  318. ST_USERSEEUSERDOALLOC equ 21
  319. ST_HOTKEYLIST equ 22
  320. ST_POPUPMENU equ 23
  321. ST_HANDLETABLE equ 32
  322. ST_FREE equ 0ffh
  323. endif ; !WOW
  324. ifdef DEBUG
  325. ifndef winmisc1
  326. LocalAlloc equ <UserLocalAlloc>
  327. LocalFree equ <UserLocalFree>
  328. LocalLock equ <UserLocalLock>
  329. LocalUnlock equ <UserLocalUnlock>
  330. LocalReAlloc equ <UserLocalReAlloc>
  331. LocalSize equ <UserLocalSize>
  332. TAGSIZE equ 4 ; Size of a tag in debug USER
  333. endif
  334. endif
  335. ; The following is required to special-case the SetWindowWord(., GCW_HMODULE);
  336. GCW_HMODULE = (-16)
  337. ; Conditional Block includes: (True states)
  338. ; NOTEXT - don't include TextMetric struc & text drawing modes & stock objs.
  339. ifndef NOTEXT
  340. ;
  341. ; TEXTMETRIC Structure
  342. ;
  343. TEXTMETRIC struc
  344. tmHeight dw ?
  345. tmAscent dw ?
  346. tmDescent dw ?
  347. tmInternalLeading dw ?
  348. tmExternalLeading dw ?
  349. tmAveCharWidth dw ?
  350. tmMaxCharWidth dw ?
  351. tmWeight dw ?
  352. tmItalic db ?
  353. tmUnderlined db ?
  354. tmStruckOut db ?
  355. tmFirstChar db ?
  356. tmLastChar db ?
  357. tmDefaultChar db ?
  358. tmBreakChar db ?
  359. tmPitch db ?
  360. tmOverhang dw ?
  361. tmDigitizedAspectX dw ?
  362. tmDigitizedAspectY dw ?
  363. tmCharSet db ?
  364. TEXTMETRIC ends
  365. ;
  366. ; Text Drawing modes
  367. ;
  368. TRANSPARENT equ 1
  369. OPAQUE equ 2
  370. ;
  371. ; Stock Logical Objects
  372. ;
  373. WHITE_BRUSH equ 0
  374. LTGRAY_BRUSH equ 1
  375. GRAY_BRUSH equ 2
  376. DKGRAY_BRUSH equ 3
  377. BLACK_BRUSH equ 4
  378. HOLLOW_BRUSH equ 5
  379. WHITE_PEN equ 6
  380. BLACK_PEN equ 7
  381. NULL_PEN equ 8
  382. DOT_MARKER equ 9
  383. OEM_FIXED_FONT equ 10
  384. ANSI_FIXED_FONT equ 11
  385. ANSI_VAR_FONT equ 12
  386. endif ; NOTEXT
  387. ANSI_CHARSET equ 0
  388. OEM_CHARSET equ 255
  389. ifndef WOW
  390. ;
  391. ; Styles for CombineRgn
  392. ;
  393. RGN_AND equ 1
  394. RGN_OR equ 2
  395. RGN_XOR equ 3
  396. RGN_DIFF equ 4
  397. RGN_COPY equ 5
  398. ;
  399. ; Predefined cursor & icon IDs
  400. ;
  401. IDC_ARROW equ 1
  402. IDC_IBEAM equ 2
  403. IDC_WAIT equ 3
  404. IDC_UPARROW equ 8
  405. IDC_SIZE equ 9
  406. IDC_ICON equ 10
  407. IDI_APPLICATION equ 1
  408. IDI_NOTE equ 2
  409. IDI_ERROR equ 3
  410. endif ; !WOW
  411. ;
  412. ; Memory manager flags
  413. ;
  414. LMEM_FIXED equ 0000h
  415. LMEM_MOVEABLE equ 0002h
  416. LMEM_ZEROINIT equ 0040h
  417. LMEM_DISCARDABLE equ 0F00h
  418. LHND equ LMEM_MOVEABLE+LMEM_ZEROINIT
  419. LPTR equ LMEM_FIXED+LMEM_ZEROINIT
  420. GMEM_FIXED equ 0000h
  421. GMEM_MOVEABLE equ 0002h
  422. GMEM_ZEROINIT equ 0040h
  423. GMEM_SHAREALL equ 2000h
  424. GMEM_LOWER equ 1000h
  425. GMEM_DISCARDABLE equ 0F00h
  426. GHND equ GMEM_MOVEABLE+GMEM_ZEROINIT
  427. GPTR equ GMEM_FIXED+GMEM_ZEROINIT
  428. ifndef WOW
  429. ;*--------------------------------------------------------------------------*
  430. ;* *
  431. ;* Miscellaneous structures & constants *
  432. ;* *
  433. ;*--------------------------------------------------------------------------*
  434. BITMAP struc
  435. bmType dw ?
  436. bmWidth dw ?
  437. bmHeight dw ?
  438. bmWidthBytes dw ?
  439. bmPlanes db ?
  440. bmBitsPixel db ?
  441. bmBits dq ?
  442. BITMAP ends
  443. PAINTSTRUCT struc
  444. PShdc dw ?
  445. PSfErase dw ?
  446. PSrcPaint db size RECT dup(?)
  447. PSfRestore dw ?
  448. PSfIncUpdate dw ?
  449. PSrgbReserved db 16 dup(?)
  450. PAINTSTRUCT ends
  451. ;
  452. ; Message structure
  453. ;
  454. MSGSTRUCT struc
  455. msHWND dw ?
  456. msMESSAGE dw ?
  457. msWPARAM dw ?
  458. msLPARAM dd ?
  459. msTIME dd ?
  460. msPT dd ?
  461. MSGSTRUCT ends
  462. NEWPARMS struc
  463. nprmHwnd dw ?
  464. nprmCmd db ?
  465. NEWPARMS ends
  466. ;
  467. ; CreateStruct structure
  468. ;
  469. ; Note: This is used in WinUtil.ASM
  470. ; Modify this definition when this struct is modified in WINDOWS.H
  471. ;
  472. CREATESTRUCT struc
  473. csLPCreateParams dd ?
  474. csHInstance dw ?
  475. csHMenu dw ?
  476. csHwndParent dw ?
  477. csCY dw ?
  478. csCX dw ?
  479. csY dw ?
  480. csX dw ?
  481. csStyle dd ?
  482. csLPszName dd ?
  483. csLPszClass dd ?
  484. csExStyle dd ?
  485. CREATESTRUCT ends
  486. ;
  487. ; ShowWindow commands
  488. ;
  489. HIDE_WINDOW equ 0
  490. SHOW_OPENWINDOW equ 1
  491. SHOW_ICONWINDOW equ 2
  492. ;
  493. ; PostError constants
  494. ;
  495. WARNING equ 0 ; command codes
  496. MINOR_ERROR equ 1
  497. FATAL_ERROR equ 2
  498. IGNORE equ 0 ; response codes
  499. RETRY equ 1
  500. ABORT equ 2
  501. ;
  502. ; GDI-related constants & commands
  503. ;
  504. ERRORREGION equ 0
  505. NULLREGION equ 1
  506. SIMPLEREGION equ 2
  507. COMPLEXREGION equ 3
  508. ;
  509. ; StretchBlt modes
  510. ;
  511. BLACKONWHITE equ 1
  512. WHITEONBLACK equ 2
  513. COLORONCOLOR equ 3
  514. ;
  515. ; PolyFill modes
  516. ;
  517. ALTERNATE equ 1
  518. WINDING equ 2
  519. ;
  520. ; Size message commands
  521. ;
  522. SIZENORMAL equ 0
  523. SIZEICONIC equ 1
  524. SIZEFULLSCREEN equ 2
  525. ;
  526. ; Key state masks for mouse messages
  527. ;
  528. MK_LBUTTON equ 0001h
  529. MK_RBUTTON equ 0002h
  530. MK_SHIFT equ 0004h
  531. MK_ALTERNATE equ 0008h
  532. MK_CONTROL equ 0010h
  533. ;
  534. ; Predefined clipboard formats
  535. ;
  536. CF_TEXT equ 1
  537. CF_BITMAP equ 2
  538. CF_METAFILEPICT equ 3
  539. CF_SYLK equ 4
  540. CF_DIF equ 5
  541. CF_TIFF equ 6
  542. CF_OEMTEXT equ 7
  543. CF_DIB equ 8
  544. CF_PALETTE equ 9
  545. CF_PENDATA equ 10
  546. CF_OWNERDISPLAY equ 80h ; owner display
  547. CF_DSPTEXT equ 81h ; display text
  548. CF_DSPBITMAP equ 82h ; display bitmap
  549. CF_DSPMETAFILE equ 83h ; display metafile
  550. ;
  551. ; Private clipboard format range
  552. ;
  553. CF_PRIVATEFIRST equ 200h ; Anything in this range doesn't
  554. CF_PRIVATELAST equ 2FFh ; get GlobalFree'd
  555. CF_GDIOBJFIRST equ 300h ; Anything in this range gets
  556. CF_GDIOBJLAST equ 3FFh ; DeleteObject'ed
  557. MAKEINTRESOURCE macro a
  558. mov ax,a
  559. cwd
  560. endm
  561. ;
  562. ; Predefined resource types
  563. ;
  564. RT_CURSOR equ 1 ; must be passed through MAKEINTRESOURCE
  565. RT_BITMAP equ 2
  566. RT_ICON equ 3
  567. RT_MENU equ 4
  568. RT_DIALOG equ 5
  569. RT_STRING equ 6
  570. RT_FONTDIR equ 7
  571. RT_FONT equ 8
  572. ;
  573. ; Virtual Key definitions
  574. ;
  575. VK_MOUSE equ 00H
  576. VK_LBUTTON equ 01h
  577. VK_RBUTTON equ 02h
  578. VK_CANCEL equ 03h
  579. VK_MBUTTON equ 04h
  580. VK_BACK equ 08h
  581. VK_TAB equ 09h
  582. VK_CLEAR equ 0Ch
  583. VK_RETURN equ 0Dh
  584. VK_SHIFT equ 10h
  585. VK_CONTROL equ 11h
  586. VK_MENU equ 12h
  587. VK_PAUSE equ 13h
  588. VK_CAPITAL equ 14h
  589. VK_ESCAPE equ 1Bh
  590. VK_SPACE equ 20h
  591. VK_PRIOR equ 21h
  592. VK_NEXT equ 22h
  593. VK_END equ 23h
  594. VK_HOME equ 24h
  595. VK_LEFT equ 25h
  596. VK_UP equ 26h
  597. VK_RIGHT equ 27h
  598. VK_DOWN equ 28h
  599. VK_SELECT equ 29h
  600. VK_PRINT equ 2Ah
  601. VK_EXECUTE equ 2Bh
  602. VK_SNAPSHOT equ 2Ch
  603. VK_INSERT equ 2Dh
  604. VK_DELETE equ 2Eh
  605. VK_HELP equ 2Fh
  606. VK_NUMPAD0 equ 60h
  607. VK_NUMPAD1 equ 61h
  608. VK_NUMPAD2 equ 62h
  609. VK_NUMPAD3 equ 63h
  610. VK_NUMPAD4 equ 64h
  611. VK_NUMPAD5 equ 65h
  612. VK_NUMPAD6 equ 66h
  613. VK_NUMPAD7 equ 67h
  614. VK_NUMPAD8 equ 68h
  615. VK_NUMPAD9 equ 69h
  616. VK_MULTIPLY equ 6Ah
  617. VK_ADD equ 6Bh
  618. VK_SEPARATOR equ 6Ch
  619. VK_SUBTRACT equ 6Dh
  620. VK_DECIMAL equ 6Eh
  621. VK_DIVIDE equ 6Fh
  622. VK_F1 equ 70h
  623. VK_F2 equ 71h
  624. VK_F3 equ 72h
  625. VK_F4 equ 73h
  626. VK_F5 equ 74h
  627. VK_F6 equ 75h
  628. VK_F7 equ 76h
  629. VK_F8 equ 77h
  630. VK_F9 equ 78h
  631. VK_F10 equ 79h
  632. VK_F11 equ 7Ah
  633. VK_F12 equ 7Bh
  634. VK_F13 equ 7Ch
  635. VK_F14 equ 7Dh
  636. VK_F15 equ 7Eh
  637. VK_F16 equ 7Fh
  638. ;
  639. ; Menu flags for Change/Check/Enable MenuItem
  640. ;
  641. MF_CHANGE equ 0080h
  642. MF_INSERT equ 0000h
  643. MF_APPEND equ 0100h
  644. MF_DELETE equ 0200h
  645. MF_BYPOSITION equ 0400h
  646. MF_BYCOMMAND equ 0000h
  647. MF_GRAYED equ 0001h
  648. MF_DISABLED equ 0002h
  649. MF_ENABLED equ 0000h
  650. MF_CHECKED equ 0008h
  651. MF_BITMAP equ 0004h
  652. MF_STRING equ 0000h
  653. MF_POPUP equ 0010h
  654. MF_DIVIDER equ 0020h
  655. MF_BREAK equ 0040h
  656. ;
  657. ; Window Procedure Messages
  658. ;
  659. WM_NULL equ 0000h
  660. WM_CREATE equ 0001h
  661. WM_DESTROY equ 0002h
  662. WM_BRUSHALIGN equ 0003h
  663. WM_SIZEWAIT equ 0004h
  664. WM_SIZE equ 0005h
  665. WM_ACTIVATE equ 0006h
  666. WM_SETFOCUS equ 0007h
  667. WM_KILLFOCUS equ 0008h
  668. WM_SETVISIBLE equ 0009h
  669. WM_ENABLE equ 000Ah
  670. WM_SETREDRAW equ 000Bh
  671. WM_SETTEXT equ 000Ch
  672. WM_GETTEXT equ 000Dh
  673. WM_GETTEXTLENGTH equ 000Eh
  674. WM_PAINT equ 000Fh
  675. WM_CLOSE equ 0010h
  676. WM_QUERYQUIT equ 0011h
  677. WM_QUIT equ 0012h
  678. WM_QUERYOPEN equ 0013h
  679. WM_ERASEBKGND equ 0014h
  680. WM_SYSCOLORCHANGE equ 0015h
  681. WM_ENDSESSION equ 0016h
  682. WM_SYSTEMERROR equ 0017h
  683. WM_SHOWWINDOW equ 0018h
  684. WM_CTLCOLOR equ 0019h
  685. WM_WININICHANGE equ 001Ah
  686. WM_DEVMODECHANGE equ 001Bh
  687. WM_ACTIVATEAPP equ 001Ch
  688. WM_QUEUESYNC equ 0023h
  689. WM_SETFONT equ 0030h
  690. WM_GETFONT equ 0031h
  691. WM_WINDOWPOSCHANGING equ 0046h
  692. WM_WINDOWPOSCHANGED equ 0047h
  693. WM_NCCREATE equ 0081h
  694. WM_NCDESTROY equ 0082h
  695. WM_NCCALCSIZE equ 0083h
  696. WM_NCHITTEST equ 0084h
  697. WM_NCPAINT equ 0085h
  698. WM_NCACTIVATE equ 0086h
  699. WM_GETDLGCODE equ 0087h
  700. WM_ENDDIALOG equ 0088h
  701. WM_NCMOUSEMOVE equ 00A0h
  702. WM_NCLBUTTONDOWN equ 00A1h
  703. WM_NCLBUTTONUP equ 00A2h
  704. WM_NCLBUTTONDBLCLK equ 00A3h
  705. WM_NCRBUTTONDOWN equ 00A4h
  706. WM_NCRBUTTONUP equ 00A5h
  707. WM_NCRBUTTONDBLCLK equ 00A6h
  708. WM_NCMBUTTONDOWN equ 00A7h
  709. WM_NCMBUTTONUP equ 00A8h
  710. WM_NCMBUTTONDBLCLK equ 00A9h
  711. WM_KEYFIRST equ 0100h
  712. WM_KEYLAST equ 0107h
  713. WM_KEYDOWN equ 0100h
  714. WM_KEYUP equ 0101h
  715. WM_CHAR equ 0102h
  716. WM_DEADCHAR equ 0103h
  717. WM_SYSKEYDOWN equ 0104h
  718. WM_SYSKEYUP equ 0105h
  719. WM_SYSCHAR equ 0106h
  720. WM_SYSDEADCHAR equ 0107h
  721. WM_INITDIALOG equ 0110h
  722. WM_COMMAND equ 0111h
  723. WM_SYSCOMMAND equ 0112h
  724. WM_TIMER equ 0113h
  725. WM_HSCROLL equ 0114h
  726. WM_VSCROLL equ 0115h
  727. WM_INITMENU equ 0116h
  728. WM_INITMENUPOPUP equ 0117h
  729. WM_SYSTIMER equ 0118h
  730. WM_MOUSEFIRST equ 0200h
  731. WM_MOUSELAST equ 0209h
  732. WM_MOUSEMOVE equ 0200h
  733. WM_LBUTTONDOWN equ 0201h
  734. WM_LBUTTONUP equ 0202h
  735. WM_LBUTTONDBLCLK equ 0203h
  736. WM_RBUTTONDOWN equ 0204h
  737. WM_RBUTTONUP equ 0205h
  738. WM_RBUTTONDBLCLK equ 0206h
  739. WM_MBUTTONDOWN equ 0207h
  740. WM_MBUTTONUP equ 0208h
  741. WM_MBUTTONDBLCLK equ 0209h
  742. WM_DROPOBJECT equ 022Ah
  743. WM_QUERYDROPOBJECT equ 022Bh
  744. WM_BEGINDRAG equ 022Ch
  745. WM_DRAGLOOP equ 022Dh
  746. WM_DRAGSELECT equ 022Eh
  747. WM_DRAGMOVE equ 022Fh
  748. WM_DROPFILES equ 0233h
  749. WM_CUT equ 0300h
  750. WM_COPY equ 0301h
  751. WM_PASTE equ 0302h
  752. WM_CLEAR equ 0303h
  753. WM_UNDO equ 0304h
  754. WM_RENDERFORMAT equ 0305h
  755. WM_RENDERALLFORMATS equ 0306h
  756. WM_DESTROYCLIPBOARD equ 0307h
  757. WM_DRAWCLIPBOARD equ 0308h
  758. WM_PAINTCLIPBOARD equ 0309h
  759. WM_VSCROLLCLIPBOARD equ 030Ah
  760. WM_SIZECLIPBOARD equ 030Bh
  761. WM_ASKCBFORMATNAME equ 030Ch
  762. WM_INTERNAL_COALESCE_FIRST equ 0390h ; internal
  763. WM_COALESCE_FIRST equ 0390h
  764. WM_COALESCE_LAST equ 039Fh
  765. ; The following message range reserved ;Internal
  766. ; for multi-media ;Internal
  767. WM_MM_RESERVED_FIRST equ 03A0h ;Internal
  768. WM_MM_RESERVED_LAST equ 03DFh ;Internal
  769. WM_INTERNAL_COALESCE_LAST equ (WM_MM_RESERVED_FIRST+16) ;internal
  770. WM_INTERNAL_DDE_FIRST equ 03E0h ;Internal
  771. WM_INTERNAL_DDE_LAST equ 03EFh ;Internal
  772. ; The following messages are reserved for CBT ;Internal
  773. WM_CBT_RESERVED_FIRST equ 03F0h ;Internal
  774. WM_CBT_RESERVED_LAST equ 03FFh ;Internal
  775. WM_USER equ 0400h
  776. ;
  777. ; System Menu Command Values
  778. ;
  779. SC_SIZE equ 0F000h
  780. SC_MOVE equ 0F010h
  781. SC_ICON equ 0F020h
  782. SC_ZOOM equ 0F030h
  783. SC_NEXTWINDOW equ 0F040h
  784. SC_PREVWINDOW equ 0F050h
  785. SC_CLOSE equ 0F060h
  786. ;******** RedrawWindow() flags
  787. RDW_INVALIDATE equ 0001h ; Invalidate
  788. RDW_INTERNALPAINT equ 0002h ; Set WFINTERNALPAINT
  789. RDW_ERASE equ 0004h ; Set WFSENDERASEBKGND
  790. RDW_VALIDATE equ 0008h ; Validate
  791. RDW_NOINTERNALPAINT equ 0010h ; Clear WFINTERNALPAINT
  792. RDW_NOERASE equ 0020h ; Clear WFSENDERASEBKGND
  793. RDW_NOCHILDREN equ 0040h ; Don't include children
  794. RDW_ALLCHILDREN equ 0080h ; Include all children
  795. RDW_UPDATENOW equ 0100h ; Update the window now if needed
  796. RDW_ERASENOW equ 0200h ; Erase the background now (implied by UPDATENOW)
  797. ; Internal-only RedrawWindow() flags
  798. ;
  799. RDW_FRAME equ 0400h ; Set WFSENDNCPAINT
  800. RDW_NOFRAME equ 0800h ; Clear WFSENDNCPAINT
  801. RDW_REDRAWWINDOW equ 1000h ; Called from RedrawWindow()
  802. RDW_SUBTRACTSELF equ 2000h ; Subtract self from hrgn
  803. RDW_COPYRGN equ 4000h ; Copy the passed-in region
  804. ; WM_HOTKEYEVENT stuff
  805. WM_HOTKEYEVENT equ 0045h
  806. endif ; !WOW
  807. ;
  808. ; SetWindowsHook() definitions
  809. ;
  810. WH_MSGFILTER equ -1
  811. WH_JOURNALRECORD equ 0
  812. WH_JOURNALPLAYBACK equ 1
  813. WH_KEYBOARD equ 2
  814. WH_GETMESSAGE equ 3
  815. WH_CALLWNDPROC equ 4
  816. WH_CBT equ 5
  817. WH_SYSMSGFILTER equ 6
  818. WH_MOUSE equ 7
  819. WH_HARDWARE equ 8
  820. WH_DEBUG equ 9
  821. WH_SHELL equ 10
  822. ifndef WOW
  823. ;
  824. ; Standard hook code values
  825. ;
  826. HC_GETLPLPFN equ -3
  827. HC_LPLPFNNEXT equ -2
  828. HC_LPFNNEXT equ -1
  829. HC_ACTION equ 0
  830. HC_GETNEXT equ 1
  831. HC_SKIP equ 2
  832. HC_SYSMODALON equ 4
  833. HC_SYSMODALOFF equ 5
  834. endif ; !WOW
  835. ; Lowest and highest valued windows hook IDs
  836. WH_MINHOOK equ -1
  837. WH_MAXHOOK equ 10
  838. WH_CHOOKS equ (WH_MAXHOOK - WH_MINHOOK + 1)
  839. HOOKNODE struc
  840. hkPhkNext dw ?
  841. hkLpfn dd ?
  842. hkIdHook dw ?
  843. hkHq dw ?
  844. hkHmodOwner dw ?
  845. hkFCalled dw ?
  846. HOOKNODE ends
  847. HHOOK_MAGIC equ ('H' or ('K' * 256))
  848. ; SetHotKeyHook() definitions
  849. HOTKEYHOOK struc
  850. hkhPfn dd ?
  851. hkhHmodule dw ?
  852. HOTKEYHOOK ends
  853. CHOTKEYHOOKMAX equ 16
  854. ifndef NOEXTERNS
  855. sBegin DATA
  856. ifndef WOW
  857. ExternW rgphkSysHooks
  858. endif
  859. sEnd DATA
  860. endif ;NOEXTERNS
  861. MAX_SEB_STYLES equ 8 ; number of SEB_* values
  862. SEB_OK equ 1 ; Button with "OK".
  863. SEB_CANCEL equ 2 ; Button with "Cancel"
  864. SEB_YES equ 3 ; Button with "&Yes"
  865. SEB_NO equ 4 ; Button with "&No"
  866. SEB_RETRY equ 5 ; Button with "&Retry"
  867. SEB_ABORT equ 6 ; Button with "&Abort"
  868. SEB_IGNORE equ 7 ; Button with "&Ignore"
  869. SEB_CLOSE equ 8 ; Button with "Close"
  870. SEB_DEFBUTTON equ 8000h ;Mask to make this button default
  871. SEB_BTN1 equ 1 ; Button 1 was selected
  872. SEB_BTN2 equ 2 ; Button 1 was selected
  873. SEB_BTN3 equ 3 ; Button 1 was selected
  874. ;
  875. ; InvalidateDCCache() flags
  876. ;
  877. IDC_DEFAULT equ 0001h
  878. IDC_CHILDRENONLY equ 0002h
  879. IDC_CLIENTONLY equ 0004h
  880. ;
  881. ; Window field offsets for GetWindowLong() and GetWindowWord()
  882. ;
  883. GWL_WNDPROC = (-4)
  884. GWW_HINSTANCE = (-6)
  885. GWW_HWNDPARENT = (-8)
  886. GWW_ID = (-12)
  887. GWL_STYLE = (-16)
  888. GWL_EXSTYLE = (-20)
  889. ;
  890. ; Class field offsets for GetClassLong() and GetClassWord()
  891. ;
  892. GCL_MENUNAME = (-8)
  893. GCW_HBRBACKGROUND = (-10)
  894. GCW_HCURSOR = (-12)
  895. GCW_HICON = (-14)
  896. GCW_HMODULE = (-16)
  897. GCW_CBWNDEXTRA = (-18)
  898. GCW_CBCLSEXTRA = (-20)
  899. GCL_WNDPROC = (-24)
  900. GCW_STYLE = (-26)
  901. GCW_ATOM = (-32)
  902. ;
  903. ; CTLCOLOR_* for the message WM_CTLCOLOR.
  904. ;
  905. CTLCOLOR_MSGBOX equ 0
  906. CTLCOLOR_EDIT equ 1
  907. CTLCOLOR_LISTBOX equ 2
  908. CTLCOLOR_BTN equ 3
  909. CTLCOLOR_DLG equ 4
  910. CTLCOLOR_SCROLLBAR equ 5
  911. CTLCOLOR_MAX equ 8 ; 3 bits max
  912. DLGC_WANTARROWS equ 01h
  913. DLGC_HASSETSEL equ 08h
  914. DLGC_WANTCHARS equ 80h
  915. SUENUMCHILDREN equ 0001h
  916. SUPAINTFRAME equ 0002h
  917. SUSTOPCLIPCHILDREN equ 0004h
  918. SUVALIDATE equ 8000h
  919. MB_OKCANCEL equ 00001h
  920. MB_ICONHAND equ 00010h
  921. MB_SYSTEMMODAL equ 01000h
  922. ASMSYSCLROBJECTS struc
  923. syshbrScrollbar dw ?
  924. syshbrDesktop dw ?
  925. syshbrActiveCaption dw ?
  926. syshbrInactiveCaption dw ?
  927. syshbrMenu dw ?
  928. syshbrWindow dw ?
  929. syshbrWindowFrame dw ?
  930. syshbrMenuText dw ?
  931. syshbrWindowText dw ?
  932. syshbrCaptionText dw ?
  933. syshbrActiveBorder dw ?
  934. syshbrInactiveBorder dw ?
  935. syshbrAppWorkspace dw ?
  936. syshbrHiliteBk dw ?
  937. syshbrHiliteText dw ?
  938. syshbrBtnFace dw ?
  939. syshbrBtnShadow dw ?
  940. syshbrGrayText dw ?
  941. ASMSYSCLROBJECTS ends
  942. ASMSYSCOLORS struc
  943. sysclrScrollbar dd ?
  944. sysclrDesktop dd ?
  945. sysclrActiveCaption dd ?
  946. sysclrInactiveCaption dd ?
  947. sysclrMenu dd ?
  948. sysclrWindow dd ?
  949. sysclrWindowFrame dd ?
  950. sysclrMenuText dd ?
  951. sysclrWindowText dd ?
  952. sysclrCaptionText dd ?
  953. sysclrActiveBorder dd ?
  954. sysclrInactiveBorder dd ?
  955. sysclrAppWorkspace dd ?
  956. sysclrHiliteBk dd ?
  957. sysclrHiliteText dd ?
  958. sysclrBtnFace dd ?
  959. sysclrBtnShadow dd ?
  960. sysclrGrayText dd ?
  961. ASMSYSCOLORS ends
  962. SCREEN struc
  963. scrncy dw ?
  964. scrncx dw ?
  965. scrnrc db size RECT dup(?)
  966. scrncLock dw ?
  967. scrncclm dw ?
  968. scrncclmSave dw ?
  969. scrncwnd dw ?
  970. SCREEN ends
  971. ;
  972. ; Property List structures
  973. ;
  974. PROP struc
  975. propAtom dw 0
  976. propValue dw 0
  977. PROP ends
  978. PROPTABLE struc
  979. proptabCprop dw 0
  980. proptabRgprop db size PROP dup(?)
  981. PROPTABLE ends
  982. ;*--------------------------------------------------------------------------*
  983. ;* *
  984. ;* Window Class Structures and Defines *
  985. ;* *
  986. ;*--------------------------------------------------------------------------*
  987. WNDCLASS struc
  988. clsStyle dw ? ; Class style
  989. clsLpfnWndProc dd ?
  990. clsCbClsExtra dw ?
  991. clsCbWndExtra dw ?
  992. clsHInstance dw ? ; Instance handle
  993. clsHIcon dw ? ; Class icon handle
  994. clsHCursor dw ? ; Class cursor handle
  995. clsHbrBackground dw ? ; Class background brush
  996. clsLpszMenuName dd ? ; Menu name
  997. clsLpszClassName dd ? ; Far ptr to class name
  998. WNDCLASS ends
  999. WNDSTRUC struc
  1000. WSwndStyle dd ?
  1001. WSwndID dw ?
  1002. WSwndText dw ?
  1003. WSwndParent dw ?
  1004. WSwndInstance dw ?
  1005. WSwndClassProc dd ?
  1006. WNDSTRUC ends
  1007. ;
  1008. ; Window Styles (high words only)
  1009. ;
  1010. WS_TILED equ 0000h
  1011. WS_POPUP equ 8000h
  1012. WS_CHILD equ 4000h
  1013. WS_ICONIC equ 2000h
  1014. WS_VISIBLE equ 1000h
  1015. WS_DISABLED equ 0800h
  1016. WS_CLIPSIBLINGS equ 0400h
  1017. WS_CLIPCHILDREN equ 0200h
  1018. WS_COLUMN equ 0100h
  1019. WS_BORDER equ 0080h
  1020. WS_CAPTION equ 0040h
  1021. WS_VSCROLL equ 0020h
  1022. WS_HSCROLL equ 0010h
  1023. WS_SYSMENU equ 0008h
  1024. WS_SIZEBOX equ 0004h
  1025. WS_GROUP equ 0002h
  1026. WS_TABSTOP equ 0001h
  1027. ;
  1028. ; Class Styles
  1029. ;
  1030. CS_VREDRAW equ 0001h
  1031. CS_HREDRAW equ 0002h
  1032. CS_KEYCVTWINDOW equ 0004h
  1033. CS_DBLCLKS equ 0008h
  1034. CS_OEMCHARS equ 0010h
  1035. CS_OWNDC equ 0020h
  1036. CS_CLASSDC equ 0040h
  1037. CS_PARENTDC equ 0080h
  1038. CS_NOKEYCVT equ 0100h
  1039. CS_LVB equ 0400h
  1040. CS_SAVEPOPUPBITS equ 0800h
  1041. CS_GLOBALCLASS equ 4000h
  1042. ;
  1043. ; WinWhere Area Codes
  1044. ;
  1045. HTTRANSPARENT equ -1
  1046. HTNOWHERE equ 0
  1047. HTCLIENT equ 1
  1048. HTCAPTION equ 2
  1049. HTCLOSEBOX equ 3
  1050. HTGROWBOX equ 4
  1051. HTMENU equ 5
  1052. HTHSCROLL equ 6
  1053. HTVSCROLL equ 7
  1054. ;*--------------------------------------------------------------------------*
  1055. ;* Message Structures and Defines *
  1056. ;*--------------------------------------------------------------------------*
  1057. ;
  1058. ; Message Structure
  1059. ;
  1060. MSG struc
  1061. msgHwnd dw ?
  1062. msgMessage dw ?
  1063. msgWParam dw ?
  1064. msgLParam dd ?
  1065. msgTime dd ?
  1066. msgPt dd ?
  1067. MSG ends
  1068. INTERNALMSG struc
  1069. imExtraMsgInfo dd ?
  1070. imMsg db size MSG dup (?)
  1071. INTERNALMSG ends
  1072. ;
  1073. ; System Queue Message Structure
  1074. ;
  1075. SYSMSG struc
  1076. smParamL dw ?
  1077. smMessage dw ?
  1078. smParamH dw ?
  1079. smTime dd ?
  1080. SYSMSG ends
  1081. INTERNALSYSMSG struc
  1082. ismExtraMsgInfo dd ?
  1083. ismMsg db size SYSMSG dup (?)
  1084. INTERNALSYSMSG ends
  1085. ; GetQueueStatus bits.
  1086. QS_KEY equ 0001h ; WM_KEY/SYSKEYUP/DOWN
  1087. QS_MOUSEMOVE equ 0002h ; WM_MOUSEMOVE
  1088. QS_MOUSEBUTTON equ 0004h ; WM_NC/L/R/MBUTTONUP/DOWN/DBLCLK
  1089. QS_MOUSE equ (QS_MOUSEMOVE or QS_MOUSEBUTTON) ; Any mouse event
  1090. QS_POSTMESSAGE equ 0008h ; Message posted with PostMessage()
  1091. QS_TIMER equ 0010h ; WM_TIMER
  1092. QS_PAINT equ 0020h ; WM_PAINT
  1093. QS_SENDMESSAGE equ 0040h ; Pending SendMessage() calls from other app
  1094. ifdef DISABLE
  1095. QS_HOTKEYEVENT equ 0080h ; WM_HOTKEYEVENT (WIN 3.1 ONLY)
  1096. endif
  1097. ; Internal values
  1098. QS_SMRESULT equ 8000h
  1099. QS_SMPARAMSFREE equ 4000h
  1100. QS_INPUT equ (QS_MOUSEMOVE or QS_MOUSEBUTTON or QS_KEY)
  1101. ifdef DISABLE
  1102. QS_ALLINPUT equ (QS_INPUT or QS_POSTMESSAGE or QS_TIMER or QS_PAINT or QS_HOTKEYEVENT)
  1103. else
  1104. QS_ALLINPUT equ (QS_INPUT or QS_POSTMESSAGE or QS_TIMER or QS_PAINT)
  1105. endif
  1106. ; Q flags field values
  1107. QF_SEMWAIT equ 01h
  1108. QF_INIT equ 02h
  1109. QF_PALETTEAPP equ 04h
  1110. ;
  1111. ; Queue Structure
  1112. ;
  1113. Q struc
  1114. qHqNext dw ?
  1115. qHTask dw ?
  1116. qCbEntry dw ?
  1117. qCMsgs dw ?
  1118. qPmsgRead dw ?
  1119. qPmsgWrite dw ?
  1120. qPmsgMax dw ?
  1121. qTimeLast dd ?
  1122. qPtLast dd ?
  1123. qIdLast dw ?
  1124. qdwExtraInfoLast dd ?
  1125. qUnused dw ?
  1126. qMsgLParam dd ?
  1127. qMsgWParam dw ?
  1128. qMsgMessage dw ?
  1129. qMsgHwnd dw ?
  1130. qResult dd ?
  1131. qCQuit dw ?
  1132. qExitCode dw ?
  1133. qFlags dw ?
  1134. qpMsgFilterChain dw ? ; Near Ptr to the head of the hook chain
  1135. qHDS dw ?
  1136. qWVersion dw ?
  1137. qHqSender dw ? ; New Input Stuff starts here
  1138. qHqSendList dw ?
  1139. qHqSendNext dw ?
  1140. qCPaintsReady dw ?
  1141. qCTimersReady dw ?
  1142. qChangeBits dw ?
  1143. qWakeBits dw ?
  1144. qWakeMask dw ?
  1145. qPResult dw ?
  1146. qPResultSend dw ?
  1147. qPResultReceive dw ?
  1148. qPhkCurrent dw ?
  1149. qRgphkHooks dw WH_CHOOKS dup (?)
  1150. qSemInput dd ?
  1151. qHqSemNext dw ?
  1152. qRgmsg db size INTERNALMSG dup (?)
  1153. Q ends
  1154. ;
  1155. ; Timer Structure
  1156. ;
  1157. TIMER struc
  1158. tmrHq dw ?
  1159. tmrHwnd dw ?
  1160. tmrID dw ?
  1161. tmrCount dw ?
  1162. tmrRate dw ?
  1163. tmrFSys db ?
  1164. tmrReady db ?
  1165. tmrLpfn dd ?
  1166. TIMER ends
  1167. CPUBLICTIMERS equ 32
  1168. CSYSTEMTIMERS equ 2
  1169. CTIMERSMAX equ CPUBLICTIMERS + CSYSTEMTIMERS
  1170. ifndef WOW
  1171. ; GetSystemMetrics() codes.
  1172. SM_CXSCREEN equ 0
  1173. SM_CYSCREEN equ 1
  1174. SM_CXVSCROLL equ 2
  1175. SM_CYHSCROLL equ 3
  1176. SM_CYCAPTION equ 4
  1177. SM_CXBORDER equ 5
  1178. SM_CYBORDER equ 6
  1179. SM_CXDLGFRAME equ 7
  1180. SM_CYDLGFRAME equ 8
  1181. SM_CYVTHUMB equ 9
  1182. SM_CXHTHUMB equ 10
  1183. SM_CXICON equ 11
  1184. SM_CYICON equ 12
  1185. SM_CXCURSOR equ 13
  1186. SM_CYCURSOR equ 14
  1187. SM_CYMENU equ 15
  1188. SM_CXFULLSCREEN equ 16
  1189. SM_CYFULLSCREEN equ 17
  1190. SM_CYKANJIWINDOW equ 18
  1191. SM_MOUSEPRESENT equ 19
  1192. SM_CYVSCROLL equ 20
  1193. SM_CXHSCROLL equ 21
  1194. SM_DEBUG equ 22
  1195. SM_SWAPBUTTON equ 23
  1196. SM_RESERVED1 equ 24
  1197. SM_RESERVED2 equ 25
  1198. SM_RESERVED3 equ 26
  1199. SM_RESERVED4 equ 27
  1200. SM_CXMIN equ 28
  1201. SM_CYMIN equ 29
  1202. SM_CXSIZE equ 30
  1203. SM_CYSIZE equ 31
  1204. SM_CXFRAME equ 32
  1205. SM_CYFRAME equ 33
  1206. SM_CXMINTRACK equ 34
  1207. SM_CYMINTRACK equ 35
  1208. SM_CXDOUBLECLK equ 36
  1209. SM_CYDOUBLECLK equ 37
  1210. SM_CXICONSPACING equ 38
  1211. SM_CYICONSPACING equ 39
  1212. SM_MENUDROPALIGNMENT equ 40
  1213. SM_PENWINDOWS equ 41
  1214. SM_DBCSENABLED equ 42
  1215. SM_CMETRICSMAX equ 43
  1216. IFNDEF NOCOLOR
  1217. ; System colors
  1218. COLOR_SCROLLBAR = 0
  1219. COLOR_BACKGROUND = 1
  1220. COLOR_ACTIVECAPTION = 2
  1221. COLOR_INACTIVECAPTION = 3
  1222. COLOR_MENU = 4
  1223. COLOR_WINDOW = 5
  1224. COLOR_WINDOWFRAME = 6
  1225. COLOR_MENUTEXT = 7
  1226. COLOR_WINDOWTEXT = 8
  1227. COLOR_CAPTIONTEXT = 9
  1228. COLOR_ACTIVEBORDER = 10
  1229. COLOR_INACTIVEBORDER = 11
  1230. COLOR_APPWORKSPACE = 12
  1231. COLOR_HIGHLIGHT = 13
  1232. COLOR_HIGHLIGHTTEXT = 14
  1233. COLOR_BTNFACE = 15
  1234. COLOR_BTNSHADOW = 16
  1235. COLOR_GRAYTEXT = 17
  1236. COLOR_BTNTEXT = 18
  1237. COLOR_INACTIVECAPTIONTEXT = 19
  1238. COLOR_BTNHILIGHT = 20
  1239. COLOR_MAX = 20
  1240. ENDIF ;NOCOLOR
  1241. ; DrawFrame commands
  1242. DF_SHIFT0 equ 0000h
  1243. DF_SHIFT1 equ 0001h
  1244. DF_SHIFT2 equ 0002h
  1245. DF_SHIFT3 equ 0003h
  1246. DF_PATCOPY equ 0000h
  1247. DF_PATINVERT equ 0004h
  1248. DF_SCROLLBAR equ (COLOR_SCROLLBAR * 8)
  1249. DF_BACKGROUND equ (COLOR_BACKGROUND * 8)
  1250. DF_ACTIVECAPTION equ (COLOR_ACTIVECAPTION * 8)
  1251. DF_INACTIVECAPTION equ (COLOR_INACTIVECAPTION * 8)
  1252. DF_MENU equ (COLOR_MENU * 8)
  1253. DF_WINDOW equ (COLOR_WINDOW * 8)
  1254. DF_WINDOWFRAME equ (COLOR_WINDOWFRAME * 8)
  1255. DF_MENUTEXT equ (COLOR_MENUTEXT * 8)
  1256. DF_WINDOWTEXT equ (COLOR_WINDOWTEXT * 8)
  1257. DF_CAPTIONTEXT equ (COLOR_CAPTIONTEXT * 8)
  1258. DF_ACTIVEBORDER equ (COLOR_ACTIVEBORDER * 8)
  1259. DF_INACTIVEBORDER equ (COLOR_INACTIVEBORDER * 8)
  1260. DF_APPWORKSPACE equ (COLOR_APPWORKSPACE * 8)
  1261. DF_GRAY equ (DF_APPWORKSPACE + (1 * 8))
  1262. endif ; !WOW
  1263. ifndef NOEXTERNS
  1264. ;*--------------------------------------------------------------------------*
  1265. ;* Externs for the Interrupt Level Global Variables *
  1266. ;*--------------------------------------------------------------------------*
  1267. ; This file is included to access intrerrupt variables. It declares them in
  1268. ; the right segment, externs [csds], the variable that has the segment
  1269. ; that these variables will be in, and assumes ds to the CODE segment
  1270. createSeg _INTDS, INTDS, BYTE, PUBLIC, DATA
  1271. sBegin INTDS
  1272. ifndef WOW
  1273. ExternB fDontMakeAltUpASysKey
  1274. ExternD hwEventHook
  1275. ifdef userhimem
  1276. ExternW fffedelta
  1277. endif
  1278. ExternW msgJournal
  1279. ExternD dtJournal
  1280. ExternD ptTrueCursor
  1281. ExternD dwMouseMoveExtraInfo
  1282. ExternD ptCursor
  1283. ifdef DOS30
  1284. ExternD lpSysProc
  1285. endif
  1286. ExternW hqActive
  1287. ExternW hqCapture
  1288. ExternW hqMouse
  1289. ExternW hqKeyboard
  1290. endif ; !WOW
  1291. ExternW hqList
  1292. ExternW hqSysQueue
  1293. ExternW hqSysModal
  1294. ExternW cQEntries
  1295. ifndef WOW
  1296. ExternW fMouseMoved
  1297. ;; ExternB fAltKeyUp
  1298. ExternB rgbAsyncKeyState
  1299. ExternW fEnableInput
  1300. ExternW fSwapButtons
  1301. endif ; !WOW
  1302. ExternW hqCursor
  1303. ifndef WOW
  1304. ExternW cMsgRsrv
  1305. ExternB vKeyDown
  1306. ExternD timerInfo
  1307. ExternB TimerTable
  1308. ExternW TimerTableMax
  1309. ExternW hSysTimer
  1310. ExternD tSysTimer
  1311. ExternW dtSysTimer
  1312. ExternB fInScanTimers
  1313. endif ; !WOW
  1314. ExternW szDivZero
  1315. ExternW szSysError
  1316. ifndef WOW
  1317. ExternW x_mickey_rate
  1318. ExternW y_mickey_rate
  1319. ExternW cur_x_mickey
  1320. ExternW cur_y_mickey
  1321. ExternW rcCursorClip
  1322. ExternW cxScreenCS
  1323. ExternW cyScreenCS
  1324. ExternW MouseThresh1
  1325. ExternW MouseThresh2
  1326. ExternW MouseSpeed
  1327. ifndef PMODE
  1328. ExternD lpMouseStack
  1329. ExternD prevSSSP
  1330. ExternB NestCount
  1331. endif
  1332. ExternW hqSysLock
  1333. ExternW idSysLock
  1334. ExternW fJournalPlayback
  1335. endif ; !WOW
  1336. sEnd INTDS
  1337. endif
  1338. ifndef WOW
  1339. ;*--------------------------------------------------------------------------*
  1340. ;* OEM Inquire Structures for Timer, Keyboard, Mouse, and Cursor modules *
  1341. ;*--------------------------------------------------------------------------*
  1342. STIMERINFO struc
  1343. tiResolution dd 0 ; #microseconds each timer tick
  1344. STIMERINFO ends
  1345. SKBINFO struc
  1346. kbBegin1 db 0 ; some range values for the East Asia
  1347. kbEnd1 db 0
  1348. kbBegin2 db 0
  1349. kbEnd2 db 0
  1350. kbStateSize dw 0 ; #bytes of state info maintained by TOASCII
  1351. SKBINFO ends
  1352. SMOUSEINFO struc
  1353. msExists db 0 ; true => mouse exists
  1354. msRelative db 0 ; true => relative coordinate
  1355. msNumButtons dw 0 ; number of buttons on the mouse
  1356. msRate dw 0 ; maximum rate of mouse input events
  1357. msXThresh dw 0 ; threshold before acceleration
  1358. msYThresh dw 0 ;
  1359. msXRes dw 0 ; x resolution
  1360. msYRes dw 0 ; y resolution
  1361. SMOUSEINFO ends
  1362. SCURSORINFO struc
  1363. dpXRate dw 0 ; horizontal mickey/pixel ratio
  1364. dpYRate dw 0 ; vertical mickey/pixel ratio
  1365. dpXMask dw 0
  1366. dpYMask dw 0
  1367. dpXCurSize dw 0
  1368. dpYCurSize dw 0
  1369. dpXIcoSize dw 0
  1370. dpYIcoSize dw 0
  1371. SCURSORINFO ends
  1372. ;
  1373. ; OEM Info Structures
  1374. ;
  1375. OEMBITMAPINFO struc
  1376. oemhBitmap dw ?
  1377. oemwidth dw ?
  1378. oemheight dw ?
  1379. OEMBITMAPINFO ends
  1380. OEMSINFO struc
  1381. oembmFull db size OEMBITMAPINFO dup(?)
  1382. oembmUpArrow db size OEMBITMAPINFO dup(?)
  1383. oembmDnArrow db size OEMBITMAPINFO dup(?)
  1384. oembmRgArrow db size OEMBITMAPINFO dup(?)
  1385. oembmLfArrow db size OEMBITMAPINFO dup(?)
  1386. oembmReduce db size OEMBITMAPINFO dup(?)
  1387. oembmZoom db size OEMBITMAPINFO dup(?)
  1388. oembmRestore db size OEMBITMAPINFO dup(?)
  1389. oembmMenuArrow db size OEMBITMAPINFO dup(?)
  1390. oembmComboArrow db size OEMBITMAPINFO dup(?)
  1391. oembmReduceD db size OEMBITMAPINFO dup(?)
  1392. oembmZoomD db size OEMBITMAPINFO dup(?)
  1393. oembmRestoreD db size OEMBITMAPINFO dup(?)
  1394. oembmUpArrowD db size OEMBITMAPINFO dup(?)
  1395. oembmDnArrowD db size OEMBITMAPINFO dup(?)
  1396. oembmRgArrowD db size OEMBITMAPINFO dup(?)
  1397. oembmLfArrowD db size OEMBITMAPINFO dup(?)
  1398. oemcxHThumb dw ?
  1399. oemcyVVThumb dw ?
  1400. oemcxMin dw ?
  1401. oemcyMin dw ?
  1402. oemcxIconSlot dw ?
  1403. oemcyIconSlot dw ?
  1404. oemcxIcon dw ?
  1405. oemcyIcon dw ?
  1406. oemcxPixelsPerInc dw ?
  1407. oemcyPixelsPerInch dw ?
  1408. oemcxCursor dw ?
  1409. oemcyCursor dw ?
  1410. oemDispDrvExpWinVer dw ?
  1411. oemScreenBitCount dw ?
  1412. oemcSKanji dw ?
  1413. oemfMouse dw ?
  1414. OEMSINFO ends
  1415. OEMSINFOMONO struc
  1416. oembmAdjust db size OEMBITMAPINFO dup(?)
  1417. oembmSize db size OEMBITMAPINFO dup(?)
  1418. oembmCheck db size OEMBITMAPINFO dup(?)
  1419. oembmbtnbmp db size OEMBITMAPINFO dup(?)
  1420. oembmCorner db size OEMBITMAPINFO dup(?)
  1421. oemcxbmpChk dw ?
  1422. oemcybmpChk dw ?
  1423. OEMSINFOMONO ends
  1424. endif ; !WOW
  1425. ;*--------------------------------------------------------------------------*
  1426. ;* Debugging Defines *
  1427. ;*--------------------------------------------------------------------------*
  1428. ;
  1429. ; RIP codes
  1430. ;
  1431. RIP_CHECKDC equ 0FFF2h ; decimal -14
  1432. RIP_WLSINSEM equ 0FFF3h ; decimal -13
  1433. RIP_CHECKSEM equ 0FFF4h ; decimal -12
  1434. RIP_SENDMESSAGEINSEM equ 0FFF5h ; decimal -11
  1435. RIP_SEMNOTINORDER equ 0FFF6h ; decimal -10
  1436. RIP_RWLEAVEUNDERFLOW equ 0FFF7h ; decimal -9
  1437. RIP_WINDOWLEFTLOCKED equ 0FFF9h ; decimal -7 ; hq->cLock !equ 0 in GetMessage.
  1438. RIP_BADLOCKWINDOW equ 0FFFAh ; decimal -6 ; Window passed was NULL.
  1439. RIP_LOCKUNDERFLOW equ 0FFFBh ; decimal -5 ; Too many UnlockWindows.
  1440. RIP_INSEMAPHORE equ 0FFFCh ; decimal -4
  1441. RIP_BADSEMCLEAR equ 0FFFDh ; decimal -3
  1442. RIP_BADLOCKCOUNT equ 0FFFEh ; decimal -2
  1443. RIP_MEMALLOC equ 1
  1444. RIP_MEMREALLOC equ 2
  1445. RIP_MEMFREE equ 3
  1446. RIP_MEMLOCK equ 4
  1447. RIP_MEMUNLOCK equ 5
  1448. RIP_SENDMESSAGELOCK equ 6
  1449. RIP_BADWINDOWHANDLE equ 7
  1450. RIP_DCBUSY equ 8
  1451. RIP_NODEFWINDOWPROC equ 9
  1452. RIP_CLIPBOARDOPEN equ 000Ah
  1453. RIP_DCCAHCHEFULL equ 000Bh
  1454. RIP_INVALKEYBOARD equ 000Ch
  1455. RIP_INVALMOUSE equ 000Dh
  1456. RIP_INVALCURSOR equ 000Eh
  1457. RIP_DSUNLOCKED equ 000Fh
  1458. RIP_INVALLOCKSYSQ equ 0010h
  1459. RIP_CARETBUSY equ 0011h
  1460. RIP_GETCWRANGE equ 0012h
  1461. RIP_HWNDOWNSDCS equ 0013h ; One hwnd owns all the DCs.
  1462. RIP_BADHQ equ 0014h ; Operation on something of wrong task
  1463. RIP_NOQUEUE equ 0019h ; GetAppVer() is called before queues are
  1464. ; created.
  1465. RIP_BADHOOKHANDLE equ 001Bh
  1466. RIP_BADHOOKID equ 001Ch
  1467. RIP_BADHOOKPROC equ 001Dh
  1468. RIP_BADHOOKMODULE equ 001Eh
  1469. RIP_BADHOOKCODE equ 001Fh
  1470. RIP_HOOKNOTALLOWED equ 0020h
  1471. RIP_UNREMOVEDPROP equ 0021h
  1472. RIP_BADPROPNAME equ 0022h
  1473. RIP_BADTASKHANDLE equ 0025h
  1474. RIP_GETSETINFOERR1 equ 0027h ; Bad negative index for Get/Set/Window etc.,
  1475. RIP_GETSETINFOERR2 equ 0028h ; Bad Positive index for Get/Set/Window etc.,
  1476. RIP_WINDOWIDNOTFOUND equ 002Ah ; Dialog control ID not found
  1477. RIP_SYSTEMERRORBOXFAILED equ 002Bh ; Hard sys error box failed due to no hq
  1478. RIP_INVALIDMENUHANDLE equ 002Ch ; Invalid menu handle
  1479. RIP_MESSAGEBOXWITHNOQUEUE equ 002Eh ; Message box called with no message queue initialized
  1480. RIP_DLGWINDOWEXTRANOTALLOCATED equ 002Fh ; DLGWINDOWEXTRA bytes not allocated for dlg box
  1481. RIP_INTERTASKSENDMSGHANG equ 0030h ; Intertask send message with tasks locked
  1482. RIP_INVALIDPARAM equ 0031h
  1483. RIP_ASSERTFAILED equ 0032h
  1484. RIP_INVALIDFUNCTIONCALLED equ 0033h
  1485. RIP_LOCKINPUTERROR equ 0034h
  1486. RIP_NULLWNDPROC equ 0035h ; SetWindowLong uses a NULL wnd proc
  1487. RIP_BAD_UNHOOK equ 0036h ; SetWindowsHook is called to unhook.
  1488. RIP_QUEUE_FULL equ 0037h ; PostMessage failed due to full queue.
  1489. ;
  1490. ; DebugErr() macro
  1491. ;
  1492. ifdef DEBUG
  1493. ifndef winmisc1
  1494. externFP DebugOutput,<C>
  1495. endif
  1496. DebugErr macro flags,msg
  1497. local a,b
  1498. push cs
  1499. push offset a
  1500. push flags or DBF_USER
  1501. cCall DebugOutput
  1502. add sp,2+4 ; DebugOutput is cdecl!
  1503. jmp short b
  1504. a:
  1505. db "USER: "
  1506. db msg
  1507. db 0
  1508. b:
  1509. endm
  1510. else ; DEBUG
  1511. DebugErr macro flags,msg
  1512. endm
  1513. endif ; DEBUG
  1514. externFP LogError
  1515. include LogError.inc
  1516. UserLogError macro flags,errcode,msg
  1517. DebugErr <flags>,<msg>
  1518. push errcode
  1519. push 0
  1520. push 0
  1521. call LogError
  1522. endm
  1523. ;
  1524. ; Fast, inline check for valid window.
  1525. ; NOTE: MUST BE USED INSIDE beg_fault_trap/end_fault_trap
  1526. ;
  1527. FastIsWindow macro seg,reg
  1528. mov reg,seg:[reg].wndPcls
  1529. cmp seg:[reg].uclsMagic,CLS_MAGIC
  1530. endm
  1531. ;*--------------------------------------------------------------------------*
  1532. ;* Utility Macros *
  1533. ;*--------------------------------------------------------------------------*
  1534. ; Similar to LabelFP, except used for "validate in debug only" entry points.
  1535. ; Declares Iname if debug, name if
  1536. ;
  1537. LabelVDO macro name
  1538. ifdef DEBUG
  1539. LabelFP <PUBLIC, I&name>
  1540. else
  1541. LabelFP <PUBLIC, I&name>
  1542. LabelFP <PUBLIC, name>
  1543. endif
  1544. endm
  1545. ; Same as cProc, except used for "Validate in Debug Only" entry points.
  1546. ; Declares Iname if debug, name if retail.
  1547. ;
  1548. cProcVDO macro name,opts,savelist
  1549. ifdef DEBUG
  1550. cProc <I&name>,<opts>,<savelist>
  1551. else
  1552. LabelFP <PUBLIC, I&name>
  1553. cProc <name>,<opts>,<savelist>
  1554. endif
  1555. endm
  1556. ;
  1557. ; EatTwoBytes macro
  1558. ;
  1559. EatTwoBytes macro
  1560. db 0A9h ;; Opcode for CMP AX,(immediate word)
  1561. endm
  1562. ;
  1563. ; Push DWORD macro
  1564. ;
  1565. pushd macro d
  1566. push word ptr (d)+2
  1567. push word ptr (d)
  1568. endm
  1569. ;
  1570. ; Call an internal far entry point
  1571. ;
  1572. wcall macro adr
  1573. push cs
  1574. call near ptr (adr)
  1575. endm
  1576. ;
  1577. ; Short jump macro
  1578. ;
  1579. jmps macro adr
  1580. jmp short (adr)
  1581. endm
  1582. ;
  1583. ; XMOV macro
  1584. ;
  1585. ; Use instead of MOV ax,reg. Saves a byte.
  1586. ;
  1587. xmov macro a,b
  1588. xchg a,b
  1589. endm
  1590. ifndef WOW
  1591. ;----------------------------------------------------------------------------
  1592. ; New set of Critical Region Macros
  1593. ; The necessity for new set of macros is
  1594. ; 1. We need to avoid "cli" if it is already disabled (saves 300 cycles
  1595. ; under 386pmode because "cli" and "sti" are simulated by Windows).
  1596. ; 2. PostMessage() might be called with interrupts already disabled; so,
  1597. ; we should not blindly do a "sti" when we do LeaveCrit
  1598. ; WARNINGS:
  1599. ; 1. These two macros must be properly nested.
  1600. ;----------------------------------------------------------------------------
  1601. ; WARNINGS for NewEnterCrit:
  1602. ; (1) This trashes the zero flag.
  1603. ; (2) This trashes the register that is passed as the parameter;
  1604. ; (3) It pushes flags onto stack which will be popped up by NewLeaveCrit
  1605. ;----------------------------------------------------------------------------
  1606. NewEnterCrit macro Reg
  1607. LOCAL SkipCli ;; Declare symbol for macro
  1608. pushf ;; Save flags on stack for the use of NewLeaveCrit
  1609. pushf
  1610. pop Reg ;; Load flags into BX register
  1611. test Reg, 0200h ;; see if interrupts are already disabled
  1612. jz SkipCli ;; Skip doing a "cli" and save 300 cycles!!!
  1613. FCLI ;; We have to clear the interrupts
  1614. SkipCli:
  1615. endm
  1616. ;----------------------------------------------------------------------------
  1617. ; WARNINGS for NewLeaveCrit:
  1618. ; (1) This preserves the Z flag.
  1619. ; (2) This trashes the registers that are passed as the parameters;
  1620. ; (3) It pops the flags pushed by NewEnterCrit.
  1621. ; NOTE: It is much easier to use pushf and popf combination to preserve
  1622. ; the Z flag, but 286 processors have a bug which results in the
  1623. ; interrupts enabled irrespect of the state of the flag before and
  1624. ; after the popf; That is why we do not use popf anywhere in this
  1625. ; macro;
  1626. ;----------------------------------------------------------------------------
  1627. NewLeaveCrit macro Reg, ZFlagReg
  1628. LOCAL SkipSti ;; Declare symbol for Macro
  1629. pushf ;; To save the Z flag
  1630. pop ZFlagReg ;; Save the Z flag
  1631. pop Reg ;; pop flags pushed by NewEnterCrit
  1632. test Reg, 0200h ;; see if interrupts were disabled even
  1633. ;; before entering the critical region
  1634. jz SkipSti ;; Skip doing a "sti".
  1635. FSTI
  1636. SkipSti:
  1637. not ZFlagReg
  1638. test ZFlagReg, 0040h ;; Restore Z flag to the value before
  1639. ;; entering NewLeaveCrit
  1640. endm
  1641. endif ; !WOW
  1642. ;
  1643. ; Old Critical Region macros
  1644. ;
  1645. EnterCrit macro
  1646. FCLI
  1647. endm
  1648. LeaveCrit macro
  1649. FSTI
  1650. endm
  1651. ifndef WOW
  1652. ;
  1653. ; AllocP Macro
  1654. ;
  1655. ; Caution: You can not use ax regiter as a parameter for this Macro!
  1656. ;
  1657. AllocP macro wType, cb
  1658. ifdef DEBUG
  1659. ifndef winmisc1
  1660. mov ax, wType
  1661. push ax
  1662. endif
  1663. endif
  1664. push LPTR
  1665. push cb
  1666. call LocalAlloc
  1667. endm
  1668. ;
  1669. ; AllocH Macro
  1670. ;
  1671. ; CAUTION: You can NOT use ax register as a parameter for this MACRO!
  1672. ;
  1673. AllocH macro wType, cb
  1674. ifdef DEBUG
  1675. ifndef winmisc1
  1676. push wType
  1677. endif
  1678. endif
  1679. push LHND
  1680. push cb
  1681. call LocalAlloc
  1682. endm
  1683. FreeP macro Ptr
  1684. push Ptr
  1685. call LocalFree
  1686. endm
  1687. ;
  1688. ; ReAllocH Macro
  1689. ;
  1690. ReAllocH macro h, cb
  1691. push h
  1692. push cb
  1693. push LMEM_ZEROINIT
  1694. call LocalReAlloc
  1695. endm
  1696. ;
  1697. ; FreeH Macro
  1698. ;
  1699. FreeH macro h
  1700. push h
  1701. call LocalFree
  1702. endm
  1703. ;
  1704. ; LockH is assumed to preserve all registers (except flags)
  1705. ;
  1706. LockH macro h, p
  1707. inc byte ptr [h+3]
  1708. mov p,[h]
  1709. endm
  1710. ;
  1711. ; UnlockH is assumed to preserve all registers (except flags)
  1712. ;
  1713. UnlockH macro h
  1714. dec byte ptr [h+3]
  1715. endm
  1716. endif ; !WOW
  1717. ifndef WOW
  1718. ;----------------------------------------------------------------------------
  1719. ; GetES
  1720. ; This macro gets the current value of USER's data segment and loads it
  1721. ; into ES register.
  1722. ; NOTE: This Macro might destroy the AX register.
  1723. ;----------------------------------------------------------------------------
  1724. UserDStoES macro
  1725. mov ax,_DATA
  1726. mov es,ax
  1727. endm
  1728. UserDStoDS macro
  1729. mov ax,_DATA
  1730. mov ds,ax
  1731. endm
  1732. WF_PMODE = 0001h
  1733. WF_CPU286 = 0002h
  1734. WF_CPU386 = 0004h
  1735. WF_WIN286 = 0010h
  1736. WF_WIN386 = 0020h
  1737. WF_LARGEFRAME = 0100h
  1738. WF_SMALLFRAME = 0200h
  1739. endif ; !WOW
  1740. endif ; LAYER_INCLUDE