home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddkx86v2.zip / DDKX86 / DBCSDD / INC / BVSCB.INC < prev    next >
Text File  |  1995-04-14  |  35KB  |  652 lines

  1. ;*DDK*************************************************************************/
  2. ;
  3. ; COPYRIGHT (C) Microsoft Corporation, 1989
  4. ; COPYRIGHT    Copyright (C) 1995 IBM Corporation
  5. ;
  6. ;    The following IBM OS/2 WARP source code is provided to you solely for
  7. ;    the purpose of assisting you in your development of OS/2 WARP device
  8. ;    drivers. You may use this code in accordance with the IBM License
  9. ;    Agreement provided in the IBM Device Driver Source Kit for OS/2. This
  10. ;    Copyright statement may not be removed.;
  11. ;*****************************************************************************/
  12. ;SCCSID = @(#)bvscb.inc 6.4 91/07/22
  13. ; ****************************************************************************
  14. ; *                                                                          *
  15. ; *                                                                          *
  16. ; *                                                                          *
  17. ; ****************************************************************************
  18.  
  19. ;STJFMT,,16                             ;Formatting parms for STJFMT
  20.  
  21. BVS3SEG         equ     <_TEXT>         ; 
  22. BVSISEG         equ     <_DATA>         ;                               ;@T52
  23. BVSGSEG         equ     <CDATA>         ;                               ;@T52
  24.  
  25. ;-----------------------------------------------------------------------
  26. ; The following structures are used by DBCS support
  27. ;-----------------------------------------------------------------------
  28.  
  29. ; This structure is used to get the correct function from CallTbl in BVSMAIN
  30.  
  31. FUNCTYPE        STRUC                   ;@P1
  32. func_sbcs       dw      ?               ; normal use SBCS function ;@P1
  33. func_dbcs       dw      ?               ; function to use when CAs present;@P1
  34. func_flags      dw      ?               ; function access flags ;@P1
  35. FUNCTYPE        ENDS                    ;@P1
  36.  
  37. ; The following structure is used for rectangle calculations
  38.  
  39. RECT            STRUC                   ;@P1
  40. rec_xLeft       dw      ?               ; left pos. in screen coordinate ;@P1
  41. rec_yTop        dw      ?               ; top pos. ;@P1
  42. rec_xRight      dw      ?               ; right pos. ;@P1
  43. rec_yBottom     dw      ?               ; bottom pos. ;@P1
  44. RECT            ENDS                    ;@P1
  45.  
  46. ; The following structure is used for Conversion Areas
  47.  
  48. CAS             STRUC                   ;@P1
  49. cas_Up          dw      ?               ; pointer to next in list ;@P1
  50. cas_Dn          dw      ?               ; pointer to previous in list ;@P1
  51. cas_flags       dw      ?               ; visible and busy flags ;@P1
  52. cas_areaoff     dw      ?               ; area memory offset ;@P1
  53. cas_areasel     dw      ?               ; selector ;@P1
  54. cas_length      dw      ?               ; size in characters ;@P1
  55. cas_xLeft       dw      ?               ; left pos. in screen coordinate ;@P1
  56. cas_yTop        dw      ?               ; top pos. ;@P1
  57. cas_xRight      dw      ?               ; right pos. ;@P1
  58. cas_yBottom     dw      ?               ; bottom pos. ;@P1
  59. cas_formatid    db      ?               ; attribute format ID ;@P1
  60. cas_attrcount   db      ?               ; attribute count ;@P1
  61. CAS             ENDS                    ;@P1
  62.  
  63. ; CAS flags
  64.  
  65. cas_f_visible   equ     00001h          ; 1 - visible, 0 - invisible ;@P1
  66. cas_f_format    equ     00002h          ; 1 - special attr format, 0 - as curnt mode;@P1
  67. cas_f_inactive  equ     00004h          ; 1 - inactive, 0 - CA is active ;@P1
  68. cas_f_nomove    equ     00008h          ; 1 - do not move the CA on SetState ;@P1
  69.  
  70. ; CallTbl flags
  71.  
  72. call_f_allowCA  equ     00001h          ; 1 - allowed for CA proc, 0 - not allowed ;@P1
  73.  
  74. ; DBCS Display table equate
  75.  
  76. MaxDispTblLen   equ     00020h          ; # of bytes of DBCS display width info ;@P1
  77.  
  78. ;-----------------------------------------------------------------------
  79. ; BVS Screen Group data, assume ptr in DS:BX
  80. ;-----------------------------------------------------------------------
  81.  
  82. bvscb           STRUC                   ;BVS Control Block Entry
  83.  
  84. bvs_flags       dw      0               ;Flags used by BVS
  85. bvs_bvssize     dw      0               ;Current BVSCB size
  86. bvs_envsize     dd      0               ;Current ENVB size
  87. bvs_lvbsize     dd      0               ;Current LVB size
  88.  
  89. bvs_ActiveCP    dw      0               ;Current active CodePage
  90. bvs_numconfigs  dw      0               ;Number of valid configurations
  91.  
  92. ; The following fields are saved/restored as a unit
  93.  
  94. bvs_confignum   dw      0               ;Configuration number
  95. bvs_curconfig   dw      0               ;Current configuration
  96.  
  97. bvs_cursorrow   dw      0               ;Current cursor row
  98. bvs_cursorcol   dw      0               ;Current cursor column
  99.  
  100. bvs_cursorstart dw      6               ;Current cursor start line
  101. bvs_cursorend   dw      7               ;Current cursor end line
  102. bvs_cursorwidth dw      1               ;Current cursor width
  103. bvs_cursorattr  dw      0               ;Current cursor attribute
  104.  
  105. bvs_mdlen       dw      12              ;Length of mode data
  106. bvs_type        db      1               ;Type for Mode
  107. bvs_colors      db      0               ;Colors for Mode
  108. bvs_cols        dw      80              ;Number of screen columns for text
  109. bvs_rows        dw      25              ;Number of screen rows for text
  110. bvs_gcols       dw      640             ;Number of screen columns for graphics
  111. bvs_grows       dw      200             ;Number of screen rows for graphics
  112. bvs_attrformat  db      ?               ;Attribute format
  113. bvs_attrbytes   db      ?               ;Number of attribute bytes
  114. bvs_bufaddr     dd      ?               ;Address of video buffer
  115. bvs_bufsize     dd      ?               ;Size of video buffer
  116. bvs_fullbufsz   dd      ?               ;Full buffer save size
  117. bvs_partbufsz   dd      ?               ;Partial buffer save size
  118. bvs_extdata     dd      ?               ;Extended mode data address
  119.  
  120. ; End of save/restore unit
  121.  
  122. ; Used for the scrollable region of the screen
  123.  
  124. bvs_ScrlRectLft dw      ?               ; Left most column ;@P1
  125. bvs_ScrlRectTop dw      ?               ; Top most row ;@P1
  126. bvs_ScrlRectRt  dw      ?               ; Right most column ;@P1
  127. bvs_ScrlRectBtm dw      ?               ; Bottom most row ;@P1
  128.  
  129. bvs_ttycell     db      ' '             ;Cell for WrtTTY scrolling (w/next)
  130. bvs_scrattr     db      007h            ;Screen attribute byte #1
  131. bvs_scrattr2    db      0               ;Screen attribute byte #2
  132. bvs_scrattr3    db      0               ;Screen attribute byte #3
  133.  
  134. bvs_scratch     dw      0               ;Scratch area for output operation
  135.  
  136. ; The following varibles 7 words must remain together (DOSGETDBCSEV)
  137.  
  138. bvs_DBCSEvBuff  db      10  dup (0)     ;DBCS environmental vector area
  139. bvs_CountryCode dw      0               ;Country code area ;@P1
  140. bvs_AuxCP       dw      0               ;Code page requested ;@P1
  141.  
  142. ; The following fields support ANSI variables:
  143.  
  144. bvs_TTYOff      DW      0               ;Offset of string between TTY/Interp
  145. bvs_TTYSel      DW      0               ;Selector of string between TTY/Interp
  146. bvs_TTYLen      DW      0               ;Length of string between TTY/Interp
  147. bvs_SaveCursor  DW      0               ; cursor position save
  148. bvs_AIStatus    DW      0               ; status of AnsiInterp
  149. bvs_ParmCount   DW      0               ; count of parameters saved
  150. bvs_Parameter   DB      0               ; partial parameter save
  151. bvs_QuoteChar   DB      0               ; start quote character
  152. bvs_cprTemp     DB      01Bh,'[00;00R',00Dh ; template for CurPos Report
  153.                 DB      0               ; realign the struture ;@P1
  154. bvs_ParmBuffPtr DB      256 DUP (?)     ; ANSI Parameter Buffer
  155. bvs_Kd_CP0      DW      0               ; bvs_kdSegSize
  156.                 DW      0               ; bvs_kdFreeBytes
  157.                 DW      0               ; bvs_kdLastDef
  158. bvs_Kd_CP1      DW      0               ; bvs_kdSegSize
  159.                 DW      0               ; bvs_kdFreeBytes
  160.                 DW      0               ; bvs_kdLastDef
  161. bvs_Kd_CP2      DW      0               ; bvs_kdSegSize
  162.                 DW      0               ; bvs_kdFreeBytes
  163.                 DW      0               ; bvs_kdLastDef
  164.  
  165. ; The following fields support Conversion Area Support
  166.  
  167. bvs_flags2      dw      0               ; second BVS flags word ;@P1
  168. bvs_TouchRect   db      size RECT dup (?) ;@P1
  169. bvs_WriteRect   db      size RECT dup (?) ;@P1
  170. bvs_ScratchRect db      size RECT dup (?) ;@P1
  171. bvs_ActCARect   db      size RECT dup (?) ;@P1
  172. bvs_VisCARect   db      size RECT dup (?) ;@P1
  173.  
  174. bvs_CA_died     dw      0               ;CA owner died badly, repair screen;@P1
  175. bvs_CA_pid      dw      0               ;CA owner pid ;@P1
  176. bvs_CA_free     dw      0               ;free CAS list pointer ;@P1
  177. bvs_CA_lru      dw      ?               ;least recently used CAS pointer ;@P1
  178. bvs_CA_crnt     dw      ?                ;@P1
  179. bvs_CAS         db      size CAS dup (?) ;@P1           ;@B43
  180.                 db      size CAS dup (?) ;@P1           ;@B43
  181.                 db      size CAS dup (?) ;@P1           ;@B43
  182.                 db      size CAS dup (?) ;@P1           ;@B43
  183.                 db      size CAS dup (?) ;@P1           ;@B43
  184.                 db      size CAS dup (?) ;@P1           ;@B43
  185.                 db      size CAS dup (?) ;@P1           ;@B43
  186.                 db      size CAS dup (?) ;@P1           ;@B43
  187.                 db      size CAS dup (?) ;@P1           ;@B43
  188.                 db      size CAS dup (?) ;@P1           ;@B43
  189.                 db      size CAS dup (?) ;@P1           ;@B43
  190.                 db      size CAS dup (?) ;@P1           ;@B43
  191.                 db      size CAS dup (?) ;@P1           ;@B43
  192.                 db      size CAS dup (?) ;@P1           ;@B43
  193.                 db      size CAS dup (?) ;@P1           ;@B43
  194.                 db      size CAS dup (?) ;@P1           ;@B43
  195. bvs_dbcstbllen  dw      0               ;@P1
  196. bvs_dbcstbl     dw      MaxDispTblLen/2  dup (?) ;@P1
  197.  
  198. bvscb           ENDS
  199.  
  200. CAMAX           equ     16      ;@B43   ;@P1    ; Number of CAs per screen group
  201. EXLST_ADD       equ     01h             ;@P1    ; continue to next exit list routine
  202. EXLST_REMOVE    equ     02h             ;@P1    ; continue to next exit list routine
  203. EXLST_EXIT      equ     03h             ;@P1    ; continue to next exit list routine
  204. CA_OWNER_DIED   equ     0ffffh          ;@P1    ; clean up after dead CA process
  205.  
  206. ; BVS flags
  207.  
  208. bvs_f_ansi      equ     00001h          ;Ansi enabled flag
  209. bvs_f_ansicprs  equ     00002h          ;Ansi CPR status flag
  210. bvs_f_ansijunk  equ     00004h          ;Ansi throw away during wrap flag
  211. bvs_f_ansiprog  equ     00008h          ;Ansi in progress flag
  212. bvs_f_ansiwrap  equ     00010h          ;Ansi wrap flag
  213. bvs_f_cprtsc    equ     00020h          ;Ctrl-PrtSc in progress flag
  214. bvs_f_closeprt  equ     00040h          ;Close printer flag
  215. bvs_f_mounotify equ     00080h          ;Mouse notification required
  216. bvs_f_window    equ     00100h          ;Vio windowable session
  217. bvs_f_avio      equ     00200h          ;AVIO session
  218. bvs_f_wrtthru   equ     02000h          ;Write Thru required, LVB exposed
  219. bvs_f_mouactive equ     04000h          ;Mouse Support Active for this session
  220. bvs_f_ansikey   equ     08000h          ;Ansi Enhanced Keyboard support
  221.  
  222. ; BVS flags for the second flags word
  223.  
  224. bvs_f2_dbcscp   equ     00001h          ;current CP is DBCS ;@P1
  225.  
  226. cbAttr          equ     03h             ;bytes of space for attributes ;@P1
  227.  
  228. ; Registered VIO function bit mask definition                           ;@T46
  229.                                                                         ;@T46
  230. rf_GetCurPos    equ     0001h           ;VioGetCurPos                   ;@T46
  231. rf_GetCurType   equ     0002h           ;VioGetCurType                  ;@T46
  232. rf_GetMode      equ     0004h           ;VioGetMode                     ;@T46
  233. rf_SetCurPos    equ     0008h           ;VioSetCurPos                   ;@T46
  234. rf_SetCurType   equ     0010h           ;VioSetCurType                  ;@T46
  235. rf_SetMode      equ     0020h           ;VioSetMode                     ;@T46
  236. rf_ReadCharStr  equ     0040h           ;VioReadCharStr                 ;@T46
  237. rf_ReadCellStr  equ     0080h           ;VioReadCellStr                 ;@T46
  238. rf_WrtNChar     equ     0100h           ;VioWrtNChar                    ;@T46
  239. rf_WrtNAttr     equ     0200h           ;VioWrtNAttr                    ;@T46
  240. rf_WrtNCell     equ     0400h           ;VioWrtNCell                    ;@T46
  241. rf_WrtTTY       equ     0800h           ;VioWrtTTY                      ;@T46
  242. rf_WrtCharStr   equ     1000h           ;VioWrtCharStr                  ;@T46
  243. rf_WrtCharStrAtt equ    2000h           ;VioWrtCharStrAtt               ;@T46
  244. rf_WrtCellStr   equ     4000h           ;VioWrtCellStr                  ;@T46
  245. rf_ScrollUp     equ     8000h           ;VioScrollUp                    ;@T46
  246.  
  247.  
  248. ;-----------------------------------------------------------------------
  249. ; BVS Global Data Segment
  250. ;
  251. ;-----------------------------------------------------------------------
  252. ; If BVSGDATA is changed, the corresponding structure
  253. ; _bvscommon in BVSLDRVR.H and BVSGSEG in BVSMAIN.ASM must also be changed.
  254. ;
  255. ; Besure to remake all BVH DLLs in the VDH directory also.
  256. ;-----------------------------------------------------------------------
  257.  
  258. bvsgdata        STRUC                   ;BVS Global Data Segment
  259.  
  260. bvsgCallTables  dd      16 dup (0)      ;Allow for WDH and 15 real devices
  261.  
  262. bvsgFlags       dw      0               ;Global flags
  263. bvsgInstance    dw      0               ;Instance Selector
  264. bvsgBvscbSize   dw      0FFFEh AND (1+SIZE bvscb) ;Size of the BVSCB
  265.  
  266. bvsgSISsel      dw      0               ;System InfoSeg GDT selector
  267. bvsgLISsel      dw      0               ;Local InfoSeg LDT selector
  268. bvsgMaxBase     dw      0               ;Maximum Base session number
  269.  
  270. bvsgInitPid     dw      0               ;Process ID at initialization time
  271. bvsgScrHandle   dw      0               ;Base Video Subsystem File Handle
  272.  
  273. bvsgSg0Flag     dw      0               ;SG0 on behalf of other SG
  274. bvsgSg0Bvssel   dw      0               ;SG0 BVSCB selector
  275. bvsgSg0Envsel   dw      0               ;SG0 ENVB selector
  276. bvsgSg0Lvbsel   dw      0               ;SG0 LVB selector
  277.  
  278. bvsgOpen_a      dw      0               ;Open action return field
  279. bvsgPrtsclen    dw      0               ;Print screen length
  280. bvsgPrtsc_Buffer db     134 dup (' ')   ;Print screen buffer @B719871
  281. bvsgCprTemp     db      01Bh,'[00;00R',00Dh ;Template for CurPos Report * Do
  282. bvsgBvscbName   db      '\SHAREMEM\BVS\BVSsg',0 ;Name of BVSCB          * Not
  283. bvsgMouddName   db      'MOUSE$',0      ;Mouse DD name            ;@T25 * Move
  284. bvsgPrtName     db      'PRN',0         ;Printer name asciiz string     ;@T25
  285. bvsgScrddName   db      'SCREEN$',0     ;Screen DD name                 ;@T25
  286. bvsgBlanks      db      8 dup (' ')     ;Blanks for tab removal
  287. bvsg3xBcPos     dw      0               ;3X Box cursor position save area
  288.  
  289. bvsgParmPkt     db      0               ; parameter packet area          @D663
  290. bvsgPjTitleLen  dw      ?               ; length of print job title      @D663
  291. bvsgPjTitleOff  dw      ?               ; offset of print job title      @D663
  292. bvsgPjTitleSel  dw      ?               ; segment of print job title     @D663
  293. bvsgCPrtscTitle db      'Ctrl PrtSc',0      ; asciiz of cprtsc job title @D663
  294. bvsgCPrtscTitlelen db   $ - bvsgCPrtscTitle ;length of title             @D663
  295. bvsgPrtscTitle  db      'Print Screen',0    ; asciiz of cprtsc job title @D663
  296. bvsgPrtscTitleLen db    $ - bvsgPrtscTitle  ;length of title             @D663
  297. bvsgVdd1        db      'VVIDEO1$',0    ;primary display for MVDM       ;@C39
  298. bvsgVdd2        db      'VVIDEO2$',0    ;secondary display for MVDM     ;@C39
  299.                 db      0               ;Word alignment                 ;@T73
  300. bvsgVddhandle   dd      0               ;MVDM VDD handle                ;@C39
  301.  
  302. bvsgSelTablesz  dw      0               ;Selector table entry size      ;@D549
  303. bvsgSelTable    dd      256 dup (0)     ;Selector table offset          ;@D549
  304.  
  305. ;bvsgWndwConfig dw     0               ;Config number in use by Shell ;@@A,@T46
  306.  
  307. bvsgdata        ENDS
  308.  
  309. ;@T52bvsg_cprlen     equ     bvsg_bvscbname-bvsg_cprtemp ;Length of CPR
  310. ;@T52bvsg_bvscbnameln equ    bvsg_mouddname-bvsg_bvscbname ;Length of BVSCB name
  311.  
  312. bvsg_f_mouactive equ    0001h           ;Mouse active
  313. bvsg_f_harderror equ    0002h           ;Hard error active
  314. bvsg_f_popup     equ    0004h           ;Normal popup in effect         ;@T14ff
  315. bvsg_f_tpopup    equ    0008h           ;Transparent popup in effect    ;@T14ff
  316.  
  317. ; the following are for per VDH data.  The per VDH data consists of a
  318. ; call table, a device string, a real mode pointer draw name string,
  319. ; a protect mode pointer draw name string, a device table entry and
  320. ; a word of "in use" flags.
  321. ; Per VDH data is allocated at the end of BVSCNSEG.  The segment is
  322. ; reallocated when more space is needed.
  323.  
  324.  
  325. ccalltbls       equ     10h             ;number of calltables ;@P1
  326. cbcalltbl       equ     4*11ah          ;size of a calltable ;@P1
  327. cbMaxDevName    equ     512             ;@P1
  328. cbMaxPtrName    equ     32              ;@P1
  329. cbDevTblEnt     equ     714             ;@P1
  330.  
  331. cbDevGroup      equ     cbcalltbl+cbMaxDevName+cbMaxPtrName+cbMaxPtrName+cbDevTblEnt+2
  332.  
  333. gf_devtblinit   equ     0001h           ;@P1
  334. gf_calltblsinit equ     0002h           ;@P1
  335. gf_initgenvec   equ     0004h           ;@P1
  336. gf_globinitdone equ     0008h           ;@P1
  337.  
  338. ;-----------------------------------------------------------------------
  339. ; BVS Instance Data Segment
  340. ;-----------------------------------------------------------------------
  341.  
  342. ;@T52bvsidata        STRUC                   ;BVS Instance Data Segment
  343.  
  344. ;@T52bvsi_bvssel     dw      0               ;BVSCB Selector, same order as SELSEG
  345. ;@T52bvsi_envsel     dw      0               ;ENVB Selector, same order as SELSEG
  346. ;@T52bvsi_lvbsel     dw      0               ;LVB Selector, same order as SELSEG
  347. ;@T52bvsi_sgnum      dw      0               ;Screen group number
  348.  
  349. ;@T52bvsi_gdtsel     dw      0               ;DOS Info GDT Selector
  350. ;@T52bvsi_ldtsel     dw      0               ;DOS Info LDT Selector
  351. ;@T52bvsi_level      dw      0               ;Level of Recursion
  352. ;@T52bvsi_flags      dw      0               ;Per Process flags
  353.  
  354. ;@T52bvsi_pvbsel     dw      0               ;PVB Selector
  355. ;@T52bvsi_biosel     dw      0               ;BIOS Selector
  356.  
  357. ;@T52bvsi_physaddrl  dw      0               ;Physical offset of video buffer
  358. ;@T52bvsi_physaddrh  dw      0               ;Physical segment of video buffer
  359. ;@T52bvsi_length     dw      0               ;Length of video buffer
  360. ;@T52bvsi_lenhigh    dw      0               ;Length of video buffer
  361.  
  362. ;@T52bvsi_srflen     dw      0               ;Length return area for BVSSRF
  363. ;@T52bvsi_retlen     dw      0               ;Length return area
  364. ;@T52bvsi_scrhandle  dw      0               ;Alternate handle for SCR DD
  365. ;@T52bvsi_prthandle  dw      0               ;Handle for print requests
  366.  
  367. ;@T52bvsi_pop_sgnum  dw      0               ;Original SG number
  368. ;@T52bvsi_pop_bvssel dw      0               ;Original BVSCB sel
  369. ;@T52bvsi_pop_popsel dw      0               ;Previous popup selector
  370. ;@T52bvsi_pop_vdh    dw      0               ;1 - fullscreen VDH(s) loaded   ;@T48
  371.  
  372. ;@T52bvsi_tty_dbcs   db      0               ;dbcs flag for TTY
  373. ;@T52bvsi_tty_dbcsl  db      0               ;leading byte (if tty_f_leading set);@P1
  374. ;@T52bvsi_tty_dbcst  db      0               ;trailing byte ;@P1
  375. ; end of Warning
  376. ;@T52bvsi_tty_flag   db      0               ;dbcs flags for TTY ;@P1
  377. ;@T52bvsi_register   dw      0               ;Registration info from AX ;@S22
  378.  
  379. ;@T52bvsidata        ENDS
  380.  
  381. fs_vdh_loaded   equ     1               ;use to set bvsi_pop_vdh        ;@T48
  382. tty_f_leading   equ     1               ;previous was leading byte ;@P1
  383. tty_f_off       equ     0               ;flag clear (must be 0) [reserved];@P1
  384.  
  385. bvsi_f_dbcs     equ     001h            ;DBCS flag
  386. bvsi_f_popup    equ     002h            ;On=Change to Popup,Off=return
  387. bvsi_f_p1lvb    equ     004h            ;First popup LVB in use
  388. bvsi_f_p2lvb    equ     008h            ;Second popup LVB in use
  389. bvsi_f_caproc   equ     010h            ;This is the CA process ;@P1
  390.  
  391. on              equ     1               ;flag for dbcs
  392. off             equ     0               ;flag for dbcs
  393.  
  394. ;-----------------------------------------------------------------------
  395. ; Structure defining the BIOS data area
  396. ;-----------------------------------------------------------------------
  397.  
  398. realdata        STRUC                   ;Real Mode data area (based at 40:0)
  399.                 db      00010h dup (?)
  400. real_equipflag  dw      ?               ;Bios Equipment Flag
  401.                 db      00037h dup (?)
  402. real_crtmode    db      ?               ;Bios Video Mode
  403. real_crtcols    dw      ?               ;Bios Video Columns
  404. real_crtlen     dw      ?               ;Bios Video Length
  405. real_crtstart   dw      ?               ;Bios Video Start Address
  406. real_cursorposn dw      8 dup (?)       ;Bios Cursor Positions
  407. real_cursormode dw      ?               ;Bios Cursor Mode
  408. real_activepage db      ?               ;Bios Active Video Page
  409. real_addr6845   dw      ?               ;Bios Video Port Address
  410. real_crtmodeset db      ?               ;Bios Video Mode Control Register
  411. real_crtpalette db      ?               ;Bios Palette
  412.                 db      0001Dh dup (?)
  413. real_rows       db      ?               ;Bios Video Rows
  414. real_points     dw      ?               ;Bios Video Font Pels
  415. real_info       db      ?               ;Bios EGA Info Byte
  416. real_info3      db      ?               ;Bios EGA Info3 Byte
  417.                 db      0001Fh dup (?)
  418. real_saveptr    dd      ?               ;Bios Video Save Area Pointer
  419. realdata        ENDS
  420.  
  421. real_f_cgaemu   equ     01h             ;INFO byte, CGA emulation flag
  422.  
  423. ;-----------------------------------------------------------------------
  424. ; The seltable structure represents one entry in the selector table
  425. ;       which is allocated in BVSGSEG.  The header is the same size
  426. ;       as the pairs of ENVB/LVB selectors to allow easy addressing.
  427. ;-----------------------------------------------------------------------
  428.  
  429. seltable        STRUC                   ;@S10
  430. selt_size       dw      0               ;size of this structure           ;@D549
  431. selt_bvscb      dw      0               ;Master BVSCB selector ;@S10
  432. selt_flags      dw      0               ;Active config flags ;@S10
  433. selt_envb       dw      0               ;First master ENVB selector ;@S10
  434. selt_lvb        dw      0               ;First master LVB selector ;@S10
  435. selt_nextenvb   dw      0               ;Next master ENVB selector, if any ;@S10
  436. selt_nextlvb    dw      0               ;Next master ENB selector, if any ;@S10
  437. seltable        ENDS                    ;@S10
  438.  
  439. ;-----------------------------------------------------------------------
  440. ; Instance data used by the BVH Device Handlers
  441. ;-----------------------------------------------------------------------
  442.  
  443. bvhidata        STRUC                                                   ;@T52
  444.  
  445. ; start of BVH instance data            ;BESURE ALL CHANGES ARE         ;@T52
  446.                                         ;  REFLECTED IN BVSMAIN ALSO    ;@T52
  447. bvhi_ScreenDD   dw      0               ;Screen DD handle               ;@T52
  448. bvhi_PVBAddrLo  dw      0               ;BVH physical address           ;@T52
  449. bvhi_PVBAddrHi  dw      0               ;                               ;@T52
  450. bvhi_PVBSizeLo  dw      0               ;PVB buffer size                ;@T52
  451. bvhi_PVBSizeHi  dw      0               ;                               ;@T52
  452. bvhi_PVBOffset  dw      0               ;PVB virtual address            ;@T52
  453. bvhi_PVBSel     dw      0               ;                               ;@T52
  454.  
  455. ; start of WDH instance data            ;BESURE ALL CHANGES ARE         ;@T52
  456.                                         ;  REFLECTED IN BVSMAIN ALSO    ;@T52
  457. LastBaseSG      dw      0               ;to hold (MaxBaseSG_from_InfoSeg - 1)
  458. Scratch_Area1   dw      0               ;***keep together***      LastBaseSG)
  459. Scratch_Area2   dw      0               ;***keep together***
  460. save_viohandle  dw      0               ;needed when 'enterb' is used
  461. ppbvs_sema4     dw      0               ;0 = clear, 1 = set
  462. ppbvs_pssel     dw      0               ;PS selector for base vio
  463. cell_size       dw      2               ;2 or 4 dependent on defined num_attr
  464. attr1           dw      0               ;first attr word (lo=attr1, hi=attr2)
  465. attr2           dw      0               ;second attr word (lo=attr3, hi=0)
  466. addr_list       dw      129 dup (0)     ;list of Avio PS segments       ;@@SW
  467.  
  468. ppbvs_bvssel    dw      0               ;BVSCBsg Selector
  469. ppbvs_lvbsel    dw      0               ;LVBsg Selector
  470. ppbvs_gdtsel    dw      0               ;DOS Info GDT Selector
  471. ppbvs_ldtsel    dw      0               ;DOS Info LDT Selector
  472.  
  473. wdhi_wininits   db      32 dup (0)      ;Threads that called WinInitialize
  474.  
  475. wdhi_start_row  dw      0               ;start row lo word
  476.                 dw      0               ;start row hi word
  477. wdhi_start_col  dw      0               ;start col lo word
  478.                 dw      0               ;start col hi word
  479. wdhi_length_width dw    0               ;length or width lo word (RtCol-LeftCol)
  480.                 dw      0               ;length or width hi word
  481. wdhi_rect_height dw     0               ;height lo word          (BotRow-TopRow)
  482.                 dw      0               ;height hi word
  483. wdhi_horiz_count dw     0               ;left or right moves lo word
  484.                 dw      0               ;left or right moves hi word
  485. wdhi_vert_count dw      0               ;up or down moves lo word
  486.                 dw      0               ;up or down moves hi word
  487. wdhi_fill_cell_off dw   0               ;filler cell offset
  488. wdhi_fill_cell_sel dw   0               ;filler cell selector
  489.  
  490. wdhi_Scratch    dd      0               ;Scratch area
  491.  
  492. ;avio_entry     dd      0               ;Address to call AVIO
  493. ;avio_filler    dw      54h dup (0)     ;Filler to make it match
  494.  
  495. cmn_bvscbsize   dw      0FFFEh AND (1+SIZE bvscb) ;Size of the BVSCB
  496. cmn_SISsel      dw      0               ;System InfoSeg selelector
  497. cmn_LISsel      dw      0               ;Local InfoSeg sel   ;MUST BE   ;@T52
  498. bvsi_bvs        dw      0               ;WDH needs this      ; KEPT     ;@T52
  499. bvsi_env        dw      0               ;                    ; TOGETHER ;@T52
  500. bvsi_lvb        dw      0               ;                    ; !!!!!!!! ;@T52
  501.  
  502. bvhidata        ENDS                                                    ;@T52
  503.  
  504. wdhi_GreDat     equ     wdhi_start_row  ;Start of GreDat sub-structure
  505.  
  506. wdhi_sema4      equ     ppbvs_sema4     ;0 = clear, 1 = set
  507. wdhi_pssel      equ     ppbvs_pssel     ;PS selector save area
  508.  
  509. ;-----------------------------------------------------------------------
  510. ; The following items are for AVIO compatibility only.
  511. ;-----------------------------------------------------------------------
  512.  
  513. bvs_f_backgrnd  equ     0               ;Dummy background flag
  514. bvs_length      equ     bvs_scratch     ;Dummy length field
  515.  
  516. ;*********  MUST MATCH portion of Parmlist Struc in BVSPARMS.INC   ************
  517. oldstackframe   STRUC                   ;Parameter Stack Area
  518.  
  519. regfs           dw      ?               ;Reg FS save area                ;D549
  520. reges           dw      ?               ;Reg ES save area
  521. regds           dw      ?               ;Reg DS save area
  522. regdi           dw      ?               ;Reg DI save area
  523. regsi           dw      ?               ;Reg SI save area
  524. regbp           dw      ?               ;Reg BP save area
  525. regspworkarea   dw      ?               ;Reg SP save area
  526. regbx           dw      ?               ;Reg BX save area
  527. regdx           dw      ?               ;Reg DX save area
  528. regcx           dw      ?               ;Reg CX save area
  529. regax           dw      ?               ;Reg AX save area
  530. regfl           dw      ?               ;Reg FL save area                ;D549
  531. vioroutip       dw      ?               ;VIOROUT return offset
  532. vioroutcs       dw      ?               ;VIOROUT return selector
  533. vioroutds       dw      ?               ;VIOROUT data selector
  534. vioip           dw      ?               ;VIOxxx return offset
  535. viofunc         dw      ?               ;VIOxxx Function code
  536. userip          dw      ?               ;User return offset
  537. usercs          dw      ?               ;User return segment
  538. viohandle       dw      ?               ;Vio Device Handle
  539. parmn           dw      ?               ;Nth parameter
  540. parmnm1         dw      ?               ;(N-1)st parameter
  541. parmnm2         dw      ?               ;(N-2)nd parameter
  542. parmnm3         dw      ?               ;(N-3)rd parameter
  543. parmnm4         dw      ?               ;(N-4)th parameter
  544. parmnm5         dw      ?               ;(N-5)th parameter
  545. parmnm6         dw      ?               ;(N-6)th parameter
  546. parmnm7         dw      ?               ;(N-7)th parameter
  547. parmnm8         dw      ?               ;(N-8)th parameter
  548. parmnm9         dw      ?               ;(N-9)th parameter
  549.  
  550. oldstackframe   ENDS
  551.  
  552. GreStruc        STRUC
  553.  
  554. start_row       dw      0               ;start row lo word
  555.                 dw      0               ;start row hi word
  556. start_col       dw      0               ;start col lo word
  557.                 dw      0               ;start col hi word
  558. length_width    dw      0               ;length or width lo word (RtCol-LeftCol)
  559.                 dw      0               ;length or width hi word
  560. rect_height     dw      0               ;height lo word          (BotRow-TopRow)
  561.                 dw      0               ;height hi word
  562. horiz_count     dw      0               ;left or right moves lo word
  563.                 dw      0               ;left or right moves hi word
  564. vert_count      dw      0               ;up or down moves lo word
  565.                 dw      0               ;up or down moves hi word
  566. fill_cell_off   dw      0               ;filler cell offset
  567. fill_cell_sel   dw      0               ;filler cell selector
  568.  
  569. GreStruc        ENDS
  570.  
  571. ;-----------------------------------------------------------------------
  572. ; Macro definitions
  573. ;-----------------------------------------------------------------------
  574. ;STJFMT,                                ;Formatting parms for STJFMT
  575.  
  576.         .286p                           ;Generate 386 Protect Mode Instructions @D549
  577.  
  578. break   macro                           ;Dummy macro to avoid DOSMACS.INC
  579.         endm
  580.  
  581. bvsfunc macro   bvsfuncnum,argn,vpflags ;@P1;@S22
  582.  
  583.         ifndef  CallTbl                 ;@P1
  584.             extrn   CallTbl:NEAR        ;@P1
  585.         endif                           ;@P1
  586.  
  587.         push    bp                      ;@P1
  588.         push    es                      ;@P1
  589.         sub     sp,p_viohandle-4        ;@P1
  590.  
  591.         mov     ax,BVSISEG              ;@P1
  592.         mov     es,ax                   ;@P1
  593.  
  594.         mov     ax,[bp].p_regax         ;Get registration bit mask      ;@T46
  595.         mov     bp,sp                   ;@P1
  596.         mov     [bp].p_regax,ax         ;Pass on registration info      ;@T46
  597.  
  598.         mov     [bp].vp_parmlength,8    ;Set default Parm block length ;@C20
  599.         ifb     <vpflags>               ;@S22
  600.             mov     [bp].vp_flags,bx    ;@P1
  601.         else                            ;@S22
  602.             mov     [bp].vp_flags,&vpflags ;@S22
  603.         endif                           ;@S22
  604.  
  605.         mov     [bp].p_regdx,dx         ;@P1
  606.         mov     [bp].p_regcx,cx         ;@P1
  607.         mov     [bp].p_regdi,di         ;@P1
  608.         mov     [bp].p_regsi,si         ;@P1
  609.  
  610.         mov     si,bvsfuncnum * 6       ;@P1
  611.         .if     <[bx].bvs_CA_pid eq bx> ; No CAs are active ;@P1
  612.             Call    CS:CallTbl[si].func_sbcs ;Call the BVS routine ;@P1
  613.         .else                           ;@P1
  614.             mov     ax,ERROR_VIO_INVALID_PARMS ;D198
  615.             .if     <BIT es:[bx].bvsi_flags nand bvsi_f_caproc> or ;@P1;D198
  616.             .if     <BIT CS:CallTbl[si].func_flags and call_f_allowCA> ;@P1;D198;@T31
  617.                 Call    CS:CallTbl[si].func_dbcs ;Call the BVS routine
  618.             .endif                      ;@P1
  619.         .endif                          ;@P1
  620.  
  621.         mov     dx,[bp].p_regdx         ;@P1
  622.         mov     cx,[bp].p_regcx         ;@P1
  623.         mov     di,[bp].p_regdi         ;@P1
  624.         mov     si,[bp].p_regsi         ;@P1
  625.  
  626.         add     sp,p_viohandle-4        ;@P1
  627.         pop     es                      ;@P1
  628.         pop     bp                      ;@P1
  629.         add     sp,argn*2               ;@P1
  630.  
  631.         endm                            ;@P1
  632.  
  633. ;@@A  = 12/02/88 STJ, Save shell's config number for windows, P2813
  634. ;@P1  = 03/25/89  PL, DCR 132 changes
  635. ;@T25 = 04/04/89 TPL, Sizzle work, B701685
  636. ;D198 = 04/06/89 STJ, Install BvsPrtSc and BvsWrtTTY as default VDH routines
  637. ;D261 = 04/21/89 STJ, Combine BVSSSEG with BVSGSEG along with DCR0261
  638. ;@C20 = 05/10/89 CJJ, Set up default parameter length, B702273
  639. ;@S10 = 05/11/89 STJ, Retain separate ENVB/LVB for each config, B701174
  640. ;@T31 = 05/18/89 TPL, PhilipL suggested changes for DCR 132, B783850
  641. ;@S22 = 08/15/89 STJ, Pass registration info to WrtTTY and IBM-J fix, B785244
  642. ;@T46 = 09/05/89 TPL, Use the compress registration mask from VIO, PTR B707524
  643. ;@T48 = 09/13/89 TPL, Load VDH after a popup, fix to PTR B707495, PTR B707542
  644. ;@D549 = 11/02/89 CJJ, Seltable changes due to rangeless sessions, DCR 549
  645. ;@D663 = 01/02/90 TLB, Put name of print screen print job in spool queue, DCR 663
  646. ;@T52  = 01/18/90 TPL, DCR 704 work
  647. ;@B43  = 02/19/90 WKB, Increased CAMAX to 16, B788133
  648. ;@T73  = 07/27/90 TPL, Code/data reduction/optimization and swap tune
  649. ;@C39  = 01/15/91 CJJ, MVDM transparent popup changes, PTR SM84577
  650. ;@B719871 = 01/28/91 WKB, Increase prt-sc buffer for 132 col modes
  651. ;@@SW  = 03/03/92 TPL  Increase # of PS from 32 to 128 (62978)
  652.