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.

315 lines
9.7 KiB

  1. ; Equates and Strucs.
  2. ;------------------------------------------------------------------------------
  3. ; D425 For OS2 compatibiltiy box, /L option status query 01/14/88 J.K.
  4. ; D493 New INIT request structure for error message 02/25/88 J.K.
  5. ; P4934 Change ANSI 2F function number to 1Ah 05/20/88 F.G.
  6. ;------------------------------------------------------------------------------
  7. ; DEVICE Header DS:[SI] -- to locate the next CON header
  8. ; NEXT device header ES:[DI]
  9. HP EQU DS:[SI]
  10. NHD EQU ES:[DI]
  11. ; CON data structure CS:[BX]
  12. CONPTR EQU CS:[BX]
  13. ; STATES
  14. BUF_DATA STRUC
  15. DEV_HDRO DW -1 ; device driver header offset
  16. DEV_HDRS DW -1
  17. CON_STRAO DW -1 ; dos CON strategy offset
  18. CON_STRAS DW -1
  19. CON_INTRO DW -1 ; dos CON strategy offset
  20. CON_INTRS DW -1
  21. BUF_DATA ENDS
  22. ; INIT Structures and equates
  23. IFNDEF TRUE
  24. TRUE EQU -1
  25. ENDIF
  26. IFNDEF FALSE
  27. FALSE EQU 0
  28. ENDIF
  29. BRKADR EQU 6Ch ; Break vector address
  30. CR EQU 13 ; carriage return
  31. BACKSP EQU 8 ; backspace
  32. ESC_CHAR EQU 1BH
  33. ASNMAX EQU 400 ; (increased) SIZE OF KEY ASSIGNMENT BUFFER
  34. ROM_BIOS EQU 40h ; Segment of ROM_BIOS data area
  35. EQUIP_FLAG EQU 10h ; equipment flag. (for LCD)
  36. KBD_FLAG_3 EQU 96h ; offset of KBD_FLAG_3 in data area
  37. NUM_ROWS EQU 84h ; offset of number of rows in data area
  38. EXT16_FLAG EQU 00010000b ; mask for Extended INT16 bit
  39. INIT_VID_MASK EQU 0FFCFh ; mask for equipment list
  40. LCD_COLOR_MODE EQU 20h ; LCD as color
  41. LCD_MONO_MODE EQU 30h ; LCD as MONOchrome
  42. UNKNOWN_CMD EQU 8103H ; unknown command status byte
  43. RC_EOL EQU -1 ; parser return code for EOL
  44. RC_NO_ERROR EQU 0 ; parser return code for not in switch list
  45. INVALID_PARM EQU 10 ; PARSE Invalid parameter message number
  46. SSTRING EQU 3 ; PARSE Too many parameters message
  47. FUNC_CALL EQU 1BH ; VGA functionality call
  48. ALT_SELECT EQU 12H ; EGA alternate select call
  49. EGA_INFO EQU 10H ; EGA return information subcall
  50. ALT_PRT_SC EQU 20H ; select alternate print screen subcall
  51. MONOCHROME EQU 1 ; monochrome attached to EGA
  52. COLOR EQU 0 ; some color attached to EGA
  53. PS2_MONO EQU 7 ; display adapter types...
  54. PS2_COLOR EQU 8
  55. MOD30_MONO EQU 0BH
  56. MOD30_COLOR EQU 0CH
  57. LCD_MODEL EQU 0F9H ; Convertible model byte value
  58. GET_SYS_ID EQU 0C0H ; INT15H call for system identification
  59. GET_STATUS EQU 43H ; read system status (Convertible)
  60. MONO_ADDRESS EQU 0B000H ; base address for monochrome
  61. COLOR_ADDRESS EQU 0B800H ; base address for CGA
  62. UNOCCUPIED EQU -1 ; value in VIDEO_MODE_TABLE if space unused
  63. LCD_ACTIVE EQU 00000001B ; LCD adapter is present
  64. MONO_ACTIVE EQU 00000010B ; monochrome adapter is present
  65. CGA_ACTIVE EQU 00000100B ; CGA adapter is present
  66. MCGA_ACTIVE EQU 00001000B ; MCGA is present
  67. E5151_ACTIVE EQU 00010000B ; EGA with monochrome is present
  68. E5153_ACTIVE EQU 00100000B ; EGA with color display is present
  69. E5154_ACTIVE EQU 01000000B ; EGA with enhanced color display is present
  70. VGA_ACTIVE EQU 10000000B ; VGA is present
  71. INT10_LOW EQU (4*10H) ; interrupt 10 vector location
  72. INT10_HI EQU (4*10H)+2
  73. INT2F_LOW EQU (4*2FH) ; interrupt 2F vector location
  74. INT2F_HI EQU (4*2FH)+2
  75. ONE EQU 1
  76. THREE EQU 3
  77. EIGHT EQU 8
  78. NINE EQU 9
  79. FOURTEEN EQU 14
  80. REQ_CRSR_POS EQU 3 ; function call to return cursor position
  81. MODE7 EQU 7
  82. MODE13 EQU 13
  83. MODE15 EQU 15
  84. MODE19 EQU 19
  85. ; Request Header Structure (INIT)
  86. INIT_REQ_HDR STRUC ; INIT Request header structure
  87. DB 13 DUP(?) ; standard request header
  88. NUM_UNITS DB ? ; number of units (N/A)
  89. END_ADDRESS_O DW ? ; ending address of resident code
  90. END_ADDRESS_S DW ?
  91. ARG_PTR DD ? ; ptr. to remaining arguments
  92. DRIVE_NUM DB ? ; drive number (N/A)
  93. CONFIG_ERRMSG DW 0 ; Flag to control "Error in CONFIG.SYS.." msg.
  94. INIT_REQ_HDR ENDS
  95. ; Information Block Structure
  96. ; (for functionality call)
  97. INFO_BLOCK STRUC ; information block for functionality call
  98. STATIC_ADDRESS DD ? ; address of static functionality table
  99. DB 33 DUP(?) ; don't care
  100. ACTIVE_DISPLAY DB ? ; active display code
  101. ALT_DISPLAY DB ? ; alternate display code
  102. DB 3 DUP(?) ; don't care
  103. CURRENT_SCANS DB ? ; current number of scan lines
  104. DB 2 DUP(?) ; don't care
  105. MISC_INFO DB ? ; miscellaneous state information
  106. DB 18 DUP(?) ; don't care
  107. INFO_BLOCK ENDS
  108. ; Video table entry structure
  109. MODE_TABLE STRUC
  110. V_MODE DB -1 ; video mode
  111. D_MODE DB -1 ; display mode
  112. RESERVED_BYTE DB 0 ; reserved
  113. COLORS DW -1 ; colors
  114. SCR_WIDTH DW -1 ; screen width (pels)
  115. SCR_LENGTH DW -1 ; screen length (pels)
  116. SCR_COLS DW -1 ; number columns
  117. SCR_ROWS DW -1 ; number rows
  118. MODE_TABLE ENDS
  119. ; Structure of Static Block
  120. ; (for functionality call
  121. STATIC_BLOCK STRUC ; format of static functionality table
  122. DB 7 DUP(?) ; don't care
  123. SCAN_TEXT DB ? ; available scan lines in text modes
  124. STATIC_BLOCK ENDS
  125. ; Structure of System ID call return block
  126. SYS_ID STRUC ; format of return system config data
  127. DW ? ; don't care
  128. MODEL_BYTE DB ? ; model byte
  129. SYS_ID ENDS
  130. ; INT2f Strucs and Equates
  131. MULT_ANSI EQU 1Ah ; ANSI multiplex number
  132. INSTALL_CHECK EQU 0 ; install check for ANSI
  133. IOCTL_2F EQU 1 ; 2F interface to IOCTL
  134. DA_INFO_2F EQU 2h ; J.K. Information passing to ANSI.
  135. ; Subfunction code for IOCTL_2F
  136. GET_SUBFUNC EQU 7FH ; WGR Same structure as GET_IOCTL(ANSI)
  137. ;Info Struture for DA_INFO_2F. (DS:DX point to this packet)
  138. ;J.K. Note: For DOS 4.00, DA_INFO_PACKET is used by DISPLAY.SYS to signal ANSI.SYS that
  139. ;DISPLAY.SYS is calling/finishing INT 10h SET MODE call. ANSI.SYS needs this
  140. ;infomration since it also hooks INT 10h vector.
  141. ;For this DA_SETMODE_FLAG purpose, DA_INFO_LEVEL and DA_INFO_DIRECTION should always be
  142. ;set to 0. This can be extended for another information passing scheme between
  143. ;DISPLAY.SYS and ANSI.SYS in the future version.
  144. ;For DA_SETMODE_FLAG, DISPLAY.SYS should be extremely careful that when it calls
  145. ;with DA_SETMODE_FLAG =1, then it should calls with DA_SETMODE_FLAG=0
  146. ;when it finished INT 10h function call. Otherwise, the system goes .....
  147. ;D425. At the request of OS2 compatibility box, when the user ask to ANSI
  148. ; with DA_INFO_LEVEL=1, then ANSI sets DA_OPTION_L_STATE based on /L option
  149. ; status.
  150. DA_INFO_PACKET STRUC
  151. DA_INFO_LEVEL DB 0 ; 0=used for SET_MODE_FLAG 1=for L_STATE
  152. DA_SETMODE_FLAG DB 0 ; 1: DISPLAY.SYS is calling INT 10h call, SET MODE. 0=finished.
  153. DA_L_STATE DB 0 ; 1 = /L active, 0 = /L inactive
  154. DA_INFO_PACKET ENDS
  155. ; GENERIC IOCTL Strucs and Equates
  156. DISPLAY_TYPE EQU 3 ; MAJ_FUNC type for display
  157. GET_FUNC EQU 7FH ; MIN_FUNC for get subfunction
  158. SET_FUNC EQU 5FH ; MIN_FUNC for set subfunction
  159. REQ_VID_MODE EQU 0FH ; request video mode INT10h function call
  160. DONE EQU 0100H ; set done bit for IOCTL status
  161. CMD_ERROR EQU 8000H ; set error bit for IOCTL status
  162. INVALID_FUNC EQU 1 ; invalid function
  163. NOT_SUPPORTED EQU 10 ; return code non-supported ioctl function
  164. NOT_AVAILABLE EQU 12 ; return code for font not available
  165. TEXT_MODE EQU 1 ; text mode = 1 in request packet
  166. GRAPHICS_MODE EQU 2 ; graphics mode = 2
  167. DEFAULT_LENGTH EQU 25 ; normal screen length
  168. OFF EQU 0000H
  169. ON EQU 0001H
  170. INT_BIT EQU 00100000b ; mask for int. bit from functionality call
  171. FOUND EQU 1 ; flag value for FOUND
  172. NOT_FOUND EQU 0 ; flag value for not FOUND
  173. SET_MODE EQU 0 ; set mode INT10H function number
  174. DISPLAY_CHECK EQU 0AD00H ; install check for DISPLAY.SYS
  175. CHECK_ACTIVE EQU 0AD02H ; active code page check for DISPLAY.SY
  176. INSTALLED EQU 0FFH ; present in AL if installed
  177. LOAD_8X8 EQU 1112H ; register value for 8x8 ROM load
  178. SET_BLOCK_0 EQU 1103H ; activate block = 0.
  179. CHECK_FOR_FONT EQU 0AD10H ; check for 8x8 RAM font - DISPLAY.SYS
  180. SELECT_SCAN EQU 30H ; subfunction to set scan lines (VGA)
  181. SET_INTENSIFY EQU 0 ; value to enable intensify.
  182. SET_BLINK EQU 1 ; value to enable blink.
  183. BLINK_TOGGLE EQU 1003H ; INT10 call to toggle int/blink bit.
  184. CURSOR_FLAG EQU 87H ; cursor flag byte in ROM_BIOS
  185. SET_CURSOR_CALL EQU 1 ; INT10 function call to set cursor typ
  186. VIDEO_MASK EQU 7FH ; turn of clear buffer bit of mode value
  187. MULT_ANSI EQU 1Ah ; ANSI multiplex number ;AC003
  188. INSTALL_CHECK EQU 0 ; install check for ANSI
  189. IOCTL_2F EQU 1 ; 2F interface to IOCTL
  190. NOT_CY EQU 0FFFEH ; turn carry bit off
  191. CY EQU 1 ; turn carry bit off
  192. INVALID_FLAGS EQU 0FFFEH ; test for invalid flags in control word
  193. TURN_OFF EQU 0FEH ; values to turn off and on cursor..
  194. TURN_ON EQU NOT TURN_OFF ; emulation
  195. SUB_SIZE EQU 11 ; sublist size
  196. LEFT_ASCIIZ EQU 00010000B ; left-aligned asciiz string
  197. UNLIMITED EQU 0 ; unlimited message size.
  198. CMDLEN = 0 ;LENGTH OF THIS COMMAND
  199. UNIT = 1 ;SUB UNIT SPECIFIER
  200. CMD = 2 ;COMMAND CODE
  201. STATUS = 3 ;STATUS
  202. MEDIA = 13 ;MEDIA DESCRIPTOR
  203. TRANS = 14 ;TRANSFER ADDRESS
  204. COUNT = 18 ;COUNT OF BLOCKS OR CHARACTERS
  205. START = 20 ;FIRST BLOCK TO TRANSFER
  206. ; REQUEST PACKET STRUCTURE (Generic IOCTL)
  207. REQ_PCKT STRUC
  208. INFO_LEVEL DB ? ; information level (should be 0)
  209. DB ? ; reserved
  210. DATA_LENGTH DW ? ; length of remaining data
  211. RP_FLAGS DW ? ; control flags
  212. RP_MODE DB ? ; display mode
  213. RESERVED2 DB ? ; reserved
  214. RP_COLORS DW ? ; # of colors
  215. RP_WIDTH DW ? ; screen width
  216. RP_LENGTH DW ? ; screen length
  217. RP_COLS DW ? ; columns
  218. RP_ROWS DW ? ; rows
  219. REQ_PCKT ENDS
  220. ; Scan Lines available structure
  221. SCAN_LINE_STR STRUC
  222. NUM_LINES DW ? ; number of scan lines
  223. REP_1BH DB ? ; representation in 1Bh call
  224. REP_12H DB ? ; representation in 12h call
  225. SCAN_LINE_STR ENDS
  226. ; SUBLIST struc
  227. SUB_STRUC STRUC
  228. DB 2 DUP(?)
  229. SUB_PTR_O DW ?
  230. SUB_PTR_S DW ?
  231. SUB_STRUC ENDS
  232. ; RESULT BUFFER struc
  233. RESULT_STRUC STRUC
  234. RESULT_TYPE DB ?
  235. DB ?
  236. RES_SYN_PTR DW ?
  237. RES_PTR DD ?
  238. RESULT_STRUC ENDS
  239. BREAK MACRO subtitle
  240. SUBTTL subtitle
  241. PAGE ,132
  242. ENDM
  243. AsmVars Macro varlist
  244. IRP var,<varlist>
  245. AsmVar var
  246. ENDM
  247. ENDM
  248. AsmVar Macro var
  249. IFNDEF var
  250. var = FALSE
  251. ENDIF
  252. ENDM