home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / warptlk3.zip / TOOLKIT / H / BSEDEV.H < prev    next >
C/C++ Source or Header  |  1995-08-30  |  28KB  |  774 lines

  1. /*static char *SCCSID = "@(#)bsedev.h   6.10 92/03/15";*/
  2. /**************************************************************************\
  3. *                                                                         *
  4. * Module Name: BSEDEV.H                                                   *
  5. *                                                                         *
  6. * OS/2 Structures and constants for use with DosDevIOCtl                  *
  7. *                                                                         *
  8. * Copyright (c) 1987-1992, IBM Corporation                                *
  9. *                                                                         *
  10. \**************************************************************************/
  11.  
  12. #if __IBMC__ || __IBMCPP__
  13. #pragma info( none )
  14.    #ifndef __CHKHDR__
  15.       #pragma info( none )
  16.    #endif
  17. #pragma info( restore )
  18. #endif
  19. #ifdef __cplusplus
  20.       extern "C" {
  21. #endif
  22.  
  23. #ifndef __BSEDEV__
  24. #define __BSEDEV__
  25.  
  26. #define BSEDEV_INCLUDED
  27.  
  28. /* Input and Output Control Categories */
  29.  
  30. #define IOCTL_ASYNC                        0x0001
  31. #define IOCTL_SCR_AND_PTRDRAW              0x0003
  32. #define IOCTL_KEYBOARD                     0x0004
  33. #define IOCTL_PRINTER                      0x0005
  34. #define IOCTL_LIGHTPEN                     0x0006
  35. #define IOCTL_POINTINGDEVICE               0x0007
  36. #define IOCTL_DISK                         0x0008
  37. #define IOCTL_PHYSICALDISK                 0x0009
  38. #define IOCTL_MONITOR                      0x000A
  39. #define IOCTL_GENERAL                      0x000B
  40. #define IOCTL_POWER                        0x000C
  41. #define IOCTL_OEMHLP                       0x0080
  42. #define IOCTL_TESTCFG_SYS                  0x0080
  43. #define IOCTL_CDROMDISK                    0x0080
  44. #define IOCTL_CDROMAUDIO                   0x0081
  45. #define IOCTL_TOUCH_DEVDEP                 0x0081
  46. #define IOCTL_TOUCH_DEVINDEP               0x0081
  47.  
  48. /* Serial-Device Control */
  49.  
  50. #define ASYNC_SETBAUDRATE                  0x0041
  51. #define ASYNC_SETLINECTRL                  0x0042
  52. #define ASYNC_EXTSETBAUDRATE               0x0043
  53. #define ASYNC_TRANSMITIMM                  0x0044
  54. #define ASYNC_SETBREAKOFF                  0x0045
  55. #define ASYNC_SETMODEMCTRL                 0x0046
  56. #define ASYNC_SETBREAKON                   0x004B
  57. #define ASYNC_STOPTRANSMIT                 0x0047
  58. #define ASYNC_STARTTRANSMIT                0x0048
  59. #define ASYNC_SETDCBINFO                   0x0053
  60. #define ASYNC_SETENHANCEDMODEPARMS         0x0054
  61. #define ASYNC_GETBAUDRATE                  0x0061
  62. #define ASYNC_GETLINECTRL                  0x0062
  63. #define ASYNC_EXTGETBAUDRATE               0X0063
  64. #define ASYNC_GETCOMMSTATUS                0x0064
  65. #define ASYNC_GETLINESTATUS                0x0065
  66. #define ASYNC_GETMODEMOUTPUT               0x0066
  67. #define ASYNC_GETMODEMINPUT                0x0067
  68. #define ASYNC_GETINQUECOUNT                0x0068
  69. #define ASYNC_GETOUTQUECOUNT               0x0069
  70. #define ASYNC_GETCOMMERROR                 0x006D
  71. #define ASYNC_GETCOMMEVENT                 0x0072
  72. #define ASYNC_GETDCBINFO                   0x0073
  73. #define ASYNC_GETENHANCEDMODEPARMS         0x0074
  74.  
  75. /* Screen/Pointer-Draw Control */
  76.  
  77. #define SCR_ALLOCLDT                       0x0070
  78. #define SCR_DEALLOCLDT                     0x0071
  79. #define PTR_GETPTRDRAWADDRESS              0x0072
  80. #define VID_INITCALLVECTOR                 0X0073
  81. #define SCR_ABIOSPASSTHRU                  0X0074
  82. #define SCR_ALLOCLDTOFF                    0x0075
  83. #define SCR_ALLOCLDTBGVAL                  0X0076
  84. #define SCR_ALLOCVIDEOBUFFER               0X007E
  85. #define SCR_GETROMFONTADDR                 0X007F
  86.  
  87. /* Keyboard Control */
  88.  
  89. #define KBD_SETTRANSTABLE                  0x0050
  90. #define KBD_SETINPUTMODE                   0x0051
  91. #define KBD_SETINTERIMFLAG                 0x0052
  92. #define KBD_SETSHIFTSTATE                  0x0053
  93. #define KBD_SETTYPAMATICRATE               0x0054
  94. #define KBD_SETFGNDSCREENGRP               0x0055
  95. #define KBD_SETSESMGRHOTKEY                0x0056
  96. #define KBD_SETFOCUS                       0x0057
  97. #define KBD_SETKCB                         0x0058
  98. #define KBD_SETREADNOTIFICATION            0X0059
  99. #define KBD_ALTERKBDLED                    0X005A
  100. #define KBD_SETNLS                         0x005C
  101. #define KBD_CREATE                         0x005D
  102. #define KBD_DESTROY                        0x005E
  103. #define KBD_GETINPUTMODE                   0x0071
  104. #define KBD_GETINTERIMFLAG                 0x0072
  105. #define KBD_GETSHIFTSTATE                  0x0073
  106. #define KBD_READCHAR                       0x0074
  107. #define KBD_PEEKCHAR                       0x0075
  108. #define KBD_GETSESMGRHOTKEY                0x0076
  109. #define KBD_GETKEYBDTYPE                   0x0077
  110. #define KBD_GETCODEPAGEID                  0x0078
  111. #define KBD_XLATESCAN                      0x0079
  112. #define KBD_QUERYKBDHARDWAREID             0X007A
  113. #define KBD_QUERYKBDCODEPAGESUPPORT        0X007B
  114.  
  115. /* Printer Control */
  116.  
  117. #define PRT_QUERYJOBHANDLE                 0x0021
  118. #define PRT_SETFRAMECTL                    0x0042
  119. #define PRT_SETINFINITERETRY               0x0044
  120. #define PRT_INITPRINTER                    0x0046
  121. #define PRT_ACTIVATEFONT                   0x0048
  122. #define PRT_SETPRINTJOBTITLE               0X004D
  123. #define PRT_SETIRQTIMEOUT                  0X004E
  124. #define PRT_GETFRAMECTL                    0x0062
  125. #define PRT_GETINFINITERETRY               0x0064
  126. #define PRT_GETPRINTERSTATUS               0x0066
  127. #define PRT_QUERYACTIVEFONT                0x0069
  128. #define PRT_VERIFYFONT                     0x006A
  129. #define PRT_QUERYIRQTIMEOUT                0X006E
  130.  
  131. /* Pointing-Device (Mouse) Control */
  132.  
  133. #define MOU_ALLOWPTRDRAW                   0x0050
  134. #define MOU_UPDATEDISPLAYMODE              0x0051
  135. #define MOU_SCREENSWITCH                   0x0052
  136. #define MOU_SETSCALEFACTORS                0x0053
  137. #define MOU_SETEVENTMASK                   0x0054
  138. #define MOU_SETHOTKEYBUTTON                0x0055
  139. #define MOU_REASSIGNTHRESHOLDVALUES        0X0055
  140. #define MOU_SETPTRSHAPE                    0x0056
  141. #define MOU_DRAWPTR                        0x0057
  142. #define MOU_UNMARKCOLLISIONAREA            0X0057
  143. #define MOU_REMOVEPTR                      0x0058
  144. #define MOU_MARKCOLLISIONAREA              0X0058
  145. #define MOU_SETPTRPOS                      0x0059
  146. #define MOU_SETPROTDRAWADDRESS             0x005A
  147. #define MOU_SETREALDRAWADDRESS             0x005B
  148. #define MOU_SETMOUSTATUS                   0x005C
  149. #define MOU_DISPLAYMODECHANGE              0x005D
  150. #define MOU_GETBUTTONCOUNT                 0x0060
  151. #define MOU_GETMICKEYCOUNT                 0x0061
  152. #define MOU_GETMOUSTATUS                   0x0062
  153. #define MOU_READEVENTQUE                   0x0063
  154. #define MOU_GETQUESTATUS                   0x0064
  155. #define MOU_GETEVENTMASK                   0x0065
  156. #define MOU_GETSCALEFACTORS                0x0066
  157. #define MOU_GETPTRPOS                      0x0067
  158. #define MOU_GETPTRSHAPE                    0x0068
  159. #define MOU_GETHOTKEYBUTTON                0x0069
  160. #define MOU_QUERYTHRESHOLDVALUES           0x0069
  161. #define MOU_VER                            0x006A
  162. #define MOU_QUERYPOINTERID                 0X006B
  163.  
  164. /* Disk/Diskette Control */
  165.  
  166. #define DSK_LOCKDRIVE                      0x0000
  167. #define DSK_UNLOCKDRIVE                    0x0001
  168. #define DSK_REDETERMINEMEDIA               0x0002
  169. #define DSK_SETLOGICALMAP                  0x0003
  170. #define DSK_BEGINFORMAT                    0X0004
  171. #define DSK_BLOCKREMOVABLE                 0x0020
  172. #define DSK_GETLOGICALMAP                  0x0021
  173. #define DSK_UNLOCKEJECTMEDIA               0X0040
  174. #define DSK_SETDEVICEPARAMS                0x0043
  175. #define DSK_WRITETRACK                     0x0044
  176. #define DSK_FORMATVERIFY                   0x0045
  177. #define DSK_DISKETTECONTROL                0X005D
  178. #define DSK_QUERYMEDIASENSE                0X0060
  179. #define DSK_GETDEVICEPARAMS                0x0063
  180. #define DSK_READTRACK                      0x0064
  181. #define DSK_VERIFYTRACK                    0x0065
  182. #define DSK_GETLOCKSTATUS                  0X0066
  183.  
  184. /* Physical-Disk Control */
  185.  
  186. #define PDSK_LOCKPHYSDRIVE                 0x0000
  187. #define PDSK_UNLOCKPHYSDRIVE               0x0001
  188. #define PDSK_WRITEPHYSTRACK                0x0044
  189. #define PDSK_GETPHYSDEVICEPARAMS           0x0063
  190. #define PDSK_READPHYSTRACK                 0x0064
  191. #define PDSK_VERIFYPHYSTRACK               0x0065
  192.  
  193. /* Character-Monitor Control */
  194. #define MON_REGISTERMONITOR                0x0040
  195.  
  196. /* General Device Control */
  197.  
  198. #define DEV_FLUSHINPUT                     0x0001
  199. #define DEV_FLUSHOUTPUT                    0x0002
  200. #define DEV_SYSTEMNOTIFYPDD                0X0041
  201. #define DEV_QUERYMONSUPPORT                0x0060
  202.  
  203. /* Advanced Power Management */
  204.  
  205. #define POWER_SENDPOWEREVENT               0X0040
  206. #define POWER_SETPOWEREVENTRES             0X0041
  207. #define POWER_GETPOWERSTATUS               0X0060
  208. #define POWER_GETPOWEREVENT                0X0061
  209. #define POWER_GETPOWERINFO                 0X0062
  210.  
  211. /* OEMHlp */
  212.  
  213. #define OEMHLP_GETOEMADAPTIONINFO          0X0000
  214. #define OEMHLP_GETMACHINEINFO              0X0001
  215. #define OEMHLP_GETDISPLAYCOMBCODE          0X0002
  216. #define OEMHLP_GETVIDEOFONTS               0X0003
  217. #define OEMHLP_READEISACONFIGINFO          0X0004
  218. #define OEMHLP_GETROMBIOSINFO              0X0005
  219. #define OEMHLP_GETMISCVIDEOINFO            0X0006
  220. #define OEMHLP_GETVIDEOADAPTER             0X0007
  221. #define OEMHLP_GETSVGAINFO                 0X0008
  222. #define OEMHLP_GETMEMINFO                  0X0009
  223. #define OEMHLP_GETDMQSINFO                 0X000A
  224. #define OEMHLP_PCI                         0x000B
  225.  
  226.  /* Test System Config */
  227.  
  228. #define TESTCFG_SYS_GETBIOSADAPTER         0x0040
  229. #define TESTCFG_SYS_ISSUEINIOINSTR         0x0041
  230. #define TESTCFG_SYS_ISSUEOUTIOINSTR        0x0042
  231. #define TESTCFG_SYS_GETBUSARCH             0x0060
  232. #define TESTCFG_SYS_GETALLPOSIDS           0x0061
  233. #define TESTCFG_SYS_GETALLEISAIDS          0x0062
  234.  
  235. /* CDROM Drive and Disk */
  236.  
  237. #define CDROMDISK_RESETDRIVE               0X0040
  238. #define CDROMDISK_EJECTDISK                0X0044
  239. #define CDROMDISK_LOCKUNLOCKDOOR           0X0046
  240. #define CDROMDISK_SEEK                     0X0050
  241. #define CDROMDISK_DEVICESTATUS             0X0060
  242. #define CDROMDISK_GETDRIVER                0X0061
  243. #define CDROMDISK_GETSECTORSIZE            0X0063
  244. #define CDROMDISK_GETHEADLOC               0X0070
  245. #define CDROMDISK_READLONG                 0X0072
  246. #define CDROMDISK_GETVOLUMESIZE            0X0078
  247. #define CDROMDISK_GETUPC                   0X0079
  248.  
  249. /* CDROM Audio */
  250.  
  251. #define CDROMAUDIO_SETCHANNELCTRL          0X0040
  252. #define CDROMAUDIO_PLAYAUDIO               0X0050
  253. #define CDROMAUDIO_STOPAUDIO               0X0051
  254. #define CDROMAUDIO_RESUMEAUDIO             0X0052
  255. #define CDROMAUDIO_GETCHANNEL              0X0060
  256. #define CDROMAUDIO_GETAUDIODISK            0X0061
  257. #define CDROMAUDIO_GETAUDIOTRACK           0X0062
  258. #define CDROMAUDIO_GETSUBCHANNELQ          0X0063
  259. #define CDROMAUDIO_GETAUDIOSTATUS          0X0065
  260.  
  261. /* Touch device-dependent IOCtls */
  262.  
  263. #define TOUCH_DEVDEP_SETCALIBCONST         0X0052
  264. #define TOUCH_DEVDEP_READDATA              0X0053
  265. #define TOUCH_DEVDEP_SETDATAMODE           0X0054
  266. #define TOUCH_DEVDEP_SETCLICKLOCK          0X0055
  267. #define TOUCH_DEVDEP_SETTOUCHTHRESHOLD     0X0056
  268. #define TOUCH_DEVDEP_SETEMULXY             0X0057
  269. #define TOUCH_DEVDEP_SETDATAREPORTRATE     0X0058
  270. #define TOUCH_DEVDEP_SETLOWPASSFILTER      0X0059
  271. #define TOUCH_DEVDEP_WRITEMEMLOC           0X005A
  272. #define TOUCH_DEVDEP_GETCALIBCONST         0X0060
  273. #define TOUCH_DEVDEP_GETDATAMODE           0X0061
  274. #define TOUCH_DEVDEP_GETCLICKLOCK          0X0062
  275. #define TOUCH_DEVDEP_GETTOUCHTHRESHOLD     0X0063
  276. #define TOUCH_DEVDEP_GETEMULXY             0X0064
  277. #define TOUCH_DEVDEP_GETDATAREPORTRATE     0X0065
  278. #define TOUCH_DEVDEP_GETLOWPASSFILTER      0X0066
  279. #define TOUCH_DEVDEP_READMEMLOC            0X0067
  280.  
  281. /* Touch device-INdependent IOCtls */
  282.  
  283. #define TOUCH_DEVINDEP_SETCOORDSYS         0X0050
  284. #define TOUCH_DEVINDEP_SETSELECTMECH       0X0052
  285. #define TOUCH_DEVINDEP_SETEVENTMASK        0X0053
  286. #define TOUCH_DEVINDEP_SETQUEUESIZE        0X0054
  287. #define TOUCH_DEVINDEP_SETEMULSTATE        0X0055
  288. #define TOUCH_DEVINDEP_GETCOORDSYS         0X0060
  289. #define TOUCH_DEVINDEP_GETSELECTMECH       0X0062
  290. #define TOUCH_DEVINDEP_GETEVENTMASK        0X0063
  291. #define TOUCH_DEVINDEP_GETQUEUESIZE        0X0064
  292. #define TOUCH_DEVINDEP_GETEMULSTATE        0X0065
  293. #define TOUCH_DEVINDEP_GETREADEVENTQUEUE   0X0066
  294.  
  295. /* ASYNC_GETCOMMERROR, ASYNC_SETBREAKOFF, ASYNC_SETBREAKON,
  296.  * ASYNC_SETMODEMCTRL
  297.  */
  298.  
  299. #define RX_QUE_OVERRUN                     0x0001
  300. #define RX_HARDWARE_OVERRUN                0x0002
  301. #define PARITY_ERROR                       0x0004
  302. #define FRAMING_ERROR                      0x0008
  303.  
  304. /* ASYNC_GETCOMMEVENT */
  305. #define CHAR_RECEIVED                      0x0001
  306. #define LAST_CHAR_SENT                     0x0004
  307. #define CTS_CHANGED                        0x0008
  308. #define DSR_CHANGED                        0x0010
  309. #define DCD_CHANGED                        0x0020
  310. #define BREAK_DETECTED                     0x0040
  311. #define ERROR_OCCURRED                     0x0080
  312. #define RI_DETECTED                        0x0100
  313.  
  314. /* ASYNC_GETCOMMSTATUS */
  315. #define TX_WAITING_FOR_CTS                 0x0001
  316. #define TX_WAITING_FOR_DSR                 0x0002
  317. #define TX_WAITING_FOR_DCD                 0x0004
  318. #define TX_WAITING_FOR_XON                 0x0008
  319. #define TX_WAITING_TO_SEND_XON             0x0010
  320. #define TX_WAITING_WHILE_BREAK_ON          0x0020
  321. #define TX_WAITING_TO_SEND_IMM             0x0040
  322. #define RX_WAITING_FOR_DSR                 0x0080
  323.  
  324. /* ASYNC_GETLINESTATUS */
  325. #define WRITE_REQUEST_QUEUED               0x0001
  326. #define DATA_IN_TX_QUE                     0x0002
  327. #define HARDWARE_TRANSMITTING              0x0004
  328. #define CHAR_READY_TO_SEND_IMM             0x0008
  329. #define WAITING_TO_SEND_XON                0x0010
  330. #define WAITING_TO_SEND_XOFF               0x0020
  331.  
  332. /* ASYNC_GETMODEMINPUT */
  333. #define CTS_ON                             0x10
  334. #define DSR_ON                             0x20
  335. #define RI_ON                              0x40
  336. #define DCD_ON                             0x80
  337.  
  338. /* DSK_SETDEVICEPARAMS */
  339. #define BUILD_BPB_FROM_MEDIUM              0x00
  340. #define REPLACE_BPB_FOR_DEVICE             0x01
  341. #define REPLACE_BPB_FOR_MEDIUM             0x02
  342.  
  343. /* KBD_GETINPUTMODE, KBD_PEEKCHAR, KBD_SETINPUTMODE*/
  344. #define ASCII_MODE                         0x00
  345. #define BINARY_MODE                        0x80
  346.  
  347. /* KBD_GETINTERIMFLAG */
  348. #define CONVERSION_REQUEST                 0x20
  349. #define INTERIM_CHAR                       0x80
  350.  
  351. /* KBD_GETSESMGRHOTKEY */
  352. #define HOTKEY_MAX_COUNT                   0x0000
  353. #define HOTKEY_CURRENT_COUNT               0x0001
  354.  
  355. /* KBD_PEEKCHAR */
  356. #define KBD_DATA_RECEIVED                  0x0001
  357. #define KBD_DATA_BINARY                    0x8000
  358.  
  359. /* KBD_READCHAR */
  360. #define KBD_READ_WAIT                      0x0000
  361. #define KBD_READ_NOWAIT                    0x8000
  362.  
  363. /* KBD_SETINPUTMODE */
  364. #define SHIFT_REPORT_MODE                  0x01
  365.  
  366. #ifndef INCL_MOU
  367.  
  368.    #define MOUSE_MOTION                    0x0001
  369.    #define MOUSE_MOTION_WITH_BN1_DOWN      0x0002
  370.    #define MOUSE_BN1_DOWN                  0x0004
  371.    #define MOUSE_MOTION_WITH_BN2_DOWN      0x0008
  372.    #define MOUSE_BN2_DOWN                  0x0010
  373.    #define MOUSE_MOTION_WITH_BN3_DOWN      0x0020
  374.    #define MOUSE_BN3_DOWN                  0x0040
  375.  
  376.    #define MHK_BUTTON1                     0x0001
  377.    #define MHK_BUTTON2                     0x0002
  378.    #define MHK_BUTTON3                     0x0004
  379.  
  380.    #define MOU_NOWAIT                      0x0000
  381.    #define MOU_WAIT                        0x0001
  382.  
  383. #endif /* #ifndef INCL_MOU */
  384.  
  385. /* MOU_GETHOTKEYBUTTON, MOU_SETHOTKEYBUTTON */
  386. #define MHK_NO_HOTKEY                      0x0000
  387.  
  388. /* MOU_GETMOUSTATUS */
  389. #define MOUSE_QUEUEBUSY                    0x0001
  390. #define MOUSE_BLOCKREAD                    0x0002
  391. #define MOUSE_FLUSH                        0x0004
  392. #define MOUSE_UNSUPPORTED_MODE             0x0008
  393. #define MOUSE_DISABLED                     0x0100
  394. #define MOUSE_MICKEYS                      0x0200
  395.  
  396. /* PRT_GETPRINTERSTATUS */
  397. #define PRINTER_TIMEOUT                    0x0001
  398. #define PRINTER_IO_ERROR                   0x0008
  399. #define PRINTER_SELECTED                   0x0010
  400. #define PRINTER_OUT_OF_PAPER               0x0020
  401. #define PRINTER_ACKNOWLEDGED               0x0040
  402. #define PRINTER_NOT_BUSY                   0x0080
  403.  
  404. /* fbCtlHndShake */
  405. #define MODE_DTR_CONTROL                   0x01
  406. #define MODE_DTR_HANDSHAKE                 0x02
  407. #define MODE_CTS_HANDSHAKE                 0x08
  408. #define MODE_DSR_HANDSHAKE                 0x10
  409. #define MODE_DCD_HANDSHAKE                 0x20
  410. #define MODE_DSR_SENSITIVITY               0x40
  411.  
  412. /* fbFlowReplace */
  413. #define MODE_AUTO_TRANSMIT                 0x01
  414. #define MODE_AUTO_RECEIVE                  0x02
  415. #define MODE_ERROR_CHAR                    0x04
  416. #define MODE_NULL_STRIPPING                0x08
  417. #define MODE_BREAK_CHAR                    0x10
  418. #define MODE_RTS_CONTROL                   0x40
  419. #define MODE_RTS_HANDSHAKE                 0x80
  420. #define MODE_TRANSMIT_TOGGLE               0xC0
  421.  
  422. /* fbTimeout */
  423. #define MODE_NO_WRITE_TIMEOUT              0x01
  424. #define MODE_READ_TIMEOUT                  0x02
  425. #define MODE_WAIT_READ_TIMEOUT             0x04
  426. #define MODE_NOWAIT_READ_TIMEOUT           0x06
  427.  
  428. typedef struct _DCBINFO         /* dcbinf */
  429.         {
  430.         USHORT usWriteTimeout;
  431.         USHORT usReadTimeout;
  432.         BYTE   fbCtlHndShake;
  433.         BYTE   fbFlowReplace;
  434.         BYTE   fbTimeout;
  435.         BYTE   bErrorReplacementChar;
  436.         BYTE   bBreakReplacementChar;
  437.         BYTE   bXONChar;
  438.         BYTE   bXOFFChar;
  439.         } DCBINFO, *PDCBINFO;
  440.  
  441. #pragma pack(1)
  442.  
  443. typedef struct _TRACKLAYOUT     /* trckl */
  444.         {
  445.         BYTE   bCommand;
  446.         USHORT usHead;
  447.         USHORT usCylinder;
  448.         USHORT usFirstSector;
  449.         USHORT cSectors;
  450.         struct {
  451.                USHORT usSectorNumber;
  452.                USHORT usSectorSize;
  453.                } TrackTable[1];
  454.         } TRACKLAYOUT, *PTRACKLAYOUT;
  455.  
  456.  
  457. #define DEVTYPE_48TPI                      0x0000
  458. #define DEVTYPE_96TPI                      0x0001
  459. #define DEVTYPE_35                         0x0002
  460. #define DEVTYPE_8SD                        0x0003
  461. #define DEVTYPE_8DD                        0x0004
  462. #define DEVTYPE_FIXED                      0x0005
  463. #define DEVTYPE_TAPE                       0x0006
  464. #define DEVTYPE_UNKNOWN                    0x0007
  465.  
  466.  
  467. #pragma pack(1)
  468.  
  469. typedef struct _BIOSPARAMETERBLOCK      /* bspblk */
  470.         {
  471.         USHORT usBytesPerSector;
  472.         BYTE   bSectorsPerCluster;
  473.         USHORT usReservedSectors;
  474.         BYTE   cFATs;
  475.         USHORT cRootEntries;
  476.         USHORT cSectors;
  477.         BYTE   bMedia;
  478.         USHORT usSectorsPerFAT;
  479.         USHORT usSectorsPerTrack;
  480.         USHORT cHeads;
  481.         ULONG  cHiddenSectors;
  482.         ULONG  cLargeSectors;
  483.         BYTE   abReserved[6];
  484.         USHORT cCylinders;
  485.         BYTE   bDeviceType;
  486.         USHORT fsDeviceAttr;
  487.         } BIOSPARAMETERBLOCK;
  488. typedef BIOSPARAMETERBLOCK *PBIOSPARAMETERBLOCK;
  489.  
  490. typedef struct _SCREENGROUP     /* scrgrp */
  491.         {
  492.         USHORT idScreenGrp;
  493.         USHORT fTerminate;
  494.         } SCREENGROUP;
  495. typedef  SCREENGROUP *PSCREENGROUP;
  496.  
  497. typedef struct _FRAME           /* frm */
  498.         {
  499.         BYTE bCharsPerLine;
  500.         BYTE bLinesPerInch;
  501.         } FRAME;
  502. typedef FRAME *PFRAME;
  503.  
  504. typedef struct _KBDTYPE         /* kbdtyp */
  505.         {
  506.         USHORT usType;
  507.         USHORT reserved1;
  508.         USHORT reserved2;
  509.         } KBDTYPE;
  510. typedef KBDTYPE *PKBDTYPE;
  511.  
  512. typedef struct _LINECONTROL     /* lnctl */
  513.         {
  514.         BYTE bDataBits;
  515.         BYTE bParity;
  516.         BYTE bStopBits;
  517.         BYTE fTransBreak;
  518.         } LINECONTROL;
  519. typedef LINECONTROL *PLINECONTROL;
  520.  
  521. /* MODEMSTATUS.fbModemOn, ASYNC_GETMODEMOUTPUT */
  522. #define DTR_ON                             0x01
  523. #define RTS_ON                             0x02
  524.  
  525. /* MODEMSTATUS.fbModemOff */
  526. #define DTR_OFF                            0xFE
  527. #define RTS_OFF                            0xFD
  528.  
  529. typedef struct _MODEMSTATUS     /* mdmst */
  530.         {
  531.         BYTE fbModemOn;
  532.         BYTE fbModemOff;
  533.         } MODEMSTATUS;
  534. typedef MODEMSTATUS *PMODEMSTATUS;
  535.  
  536. #pragma pack(1)
  537.  
  538. typedef struct _TRACKFORMAT     /* trckfmt */
  539.         {
  540.         BYTE bCommand;
  541.         USHORT usHead;
  542.         USHORT usCylinder;
  543.         USHORT usReserved;
  544.         USHORT cSectors;
  545.         struct {
  546.                BYTE bCylinder;
  547.                BYTE bHead;
  548.                BYTE idSector;
  549.                BYTE bBytesSector;
  550.                } FormatTable[1];
  551.         } TRACKFORMAT;
  552.  
  553. typedef TRACKFORMAT *PTRACKFORMAT;
  554.  
  555. typedef struct _RXQUEUE         /* rxq */
  556.         {
  557.         USHORT cch;
  558.         USHORT cb;
  559.         } RXQUEUE;
  560. typedef RXQUEUE *PRXQUEUE;
  561.  
  562. typedef struct _DEVICEPARAMETERBLOCK    /* dvpblck */
  563.         {
  564.         USHORT reserved1;
  565.         USHORT cCylinders;
  566.         USHORT cHeads;
  567.         USHORT cSectorsPerTrack;
  568.         USHORT reserved2;
  569.         USHORT reserved3;
  570.         USHORT reserved4;
  571.         USHORT reserved5;
  572.         } DEVICEPARAMETERBLOCK;
  573.  
  574. typedef DEVICEPARAMETERBLOCK     *PDEVICEPARAMETERBLOCK;
  575.  
  576. /* The following must be packed on 2 bytes boundary */
  577. #pragma pack(2)
  578.  
  579. typedef struct _PTRDRAWFUNCTION         /* ptrdfnc */
  580.         {
  581.         USHORT usReturnCode;
  582.         PFN pfnDraw;
  583.         PCH pchDataSeg;
  584.         } PTRDRAWFUNCTION;
  585.  
  586. typedef PTRDRAWFUNCTION *PPTRDRAWFUNCTION;
  587.  
  588. typedef struct _PTRDRAWADDRESS          /* ptrdaddr */
  589.         {
  590.         USHORT reserved;
  591.         PTRDRAWFUNCTION ptrdfnc;
  592.         } PTRDRAWADDRESS;
  593.  
  594. typedef PTRDRAWADDRESS  *PPTRDRAWADDRESS;
  595.  
  596. typedef struct _SHIFTSTATE      /* shftst */
  597.         {
  598.         USHORT fsState;
  599.         BYTE   fNLS;
  600.         } SHIFTSTATE;
  601.  
  602. typedef SHIFTSTATE  *PSHIFTSTATE;
  603.  
  604.  
  605.  
  606. /* HOTKEY.fsHotKey/SHIFTSTATE.fsState */
  607. #define RIGHTSHIFT                         0x0001
  608. #define LEFTSHIFT                          0x0002
  609. #define CONTROL                            0x0004
  610. #define ALT                                0x0008
  611. #define SCROLLLOCK_ON                      0x0010
  612. #define NUMLOCK_ON                         0x0020
  613. #define CAPSLOCK_ON                        0x0040
  614. #define INSERT_ON                          0x0080
  615. #define LEFTCONTROL                        0x0100
  616. #define LEFTALT                            0x0200
  617. #define RIGHTCONTROL                       0x0400
  618. #define RIGHTALT                           0x0800
  619. #define SCROLLLOCK                         0x1000
  620. #define NUMLOCK                            0x2000
  621. #define CAPSLOCK                           0x4000
  622. #define SYSREQ                             0x8000
  623.  
  624. typedef struct _HOTKEY          /* htky */
  625.         {
  626.         USHORT fsHotKey;
  627.         UCHAR  uchScancodeMake;
  628.         UCHAR  uchScancodeBreak;
  629.         USHORT idHotKey;
  630.         } HOTKEY;
  631.  
  632. typedef HOTKEY *PHOTKEY;
  633.  
  634. typedef struct _MONITORPOSITION         /* mnpos */
  635.         {
  636.         USHORT fPosition;
  637.         USHORT index;
  638.         ULONG  pbInBuf;
  639.         USHORT offOutBuf;
  640.         } MONITORPOSITION;
  641.  
  642. typedef MONITORPOSITION  *PMONITORPOSITION;
  643.  
  644. typedef struct _RATEDELAY       /* rtdly */
  645.         {
  646.         USHORT usDelay;
  647.         USHORT usRate;
  648.         } RATEDELAY;
  649. typedef RATEDELAY  *PRATEDELAY;
  650.  
  651. typedef struct _CODEPAGEINFO    /* cpi */
  652.         {
  653.         PBYTE pbTransTable;
  654.         USHORT idCodePage;
  655.         USHORT idTable;
  656.         } CODEPAGEINFO;
  657. typedef *PCODEPAGEINFO;
  658.  
  659. typedef struct _CPID    /* cpid */
  660.         {
  661.         USHORT idCodePage;
  662.         USHORT Reserved;
  663.         } CPID;
  664. typedef CPID *PCPID;
  665.  
  666. typedef struct _LDTADDRINFO     /* ldtaddr */
  667.         {
  668.         PULONG pulPhysAddr;
  669.         USHORT cb;
  670.         } LDTADDRINFO;
  671.  
  672. typedef LDTADDRINFO *PLDTADDRINFO;
  673.  
  674. typedef struct _PTRDRAWDATA     /* ptrdd */
  675.         {
  676.         USHORT cb;
  677.         USHORT usConfig;
  678.         USHORT usFlag;
  679.         } PTRDRAWDATA;
  680. #pragma pack()                           /*restore default packing */
  681.  
  682. typedef PTRDRAWDATA *PPTRDRAWDATA;
  683.  
  684.  
  685. /*
  686.  * SCREENDD IOCTL definitions
  687.  */
  688. #define SCREENDD_GETCURRENTBANK         0x00    /* Get current bank */
  689. #define SCREENDD_SETCURRENTBANK         0x01    /* Set current bank */
  690. #define SCREENDD_SVGA_ID                0x08    /* Get SVGA info IOCTL */
  691. #define SCREENDD_SVGA_OEM               0x09    /* Get OEM info IOCTL */
  692. #define SCREENDD_UPDATEMEMORY           0x0A    /* Update Memory    IOCTl   */
  693. #define SCREENDD_GETLINEARACCESS        0x0B    /* GetLinearAccess  IOCTl   */
  694. #define SCREENDD_GETGLOBALACCESS        0x0C    /* GetGlobalAccess  IOCTl   */
  695. #define SCREENDD_FREEGLOBALACCESS       0x0D    /* FreeGlobalAccess IOCTl   */
  696. #define SCREENDD_REGISTER_RING0_CALLER  0x0E    /* Register VVID as Ring0 PMI caller */
  697. #define SCREENDD_WAIT_ON_RING0_CALLER   0x0F    /* Wait for RING0 caller to register */
  698. #define SCREENDD_CATEGORY               0x80
  699. #define SCREENDD_NAME                   "SCREEN$"
  700.  
  701. #define GETLINEAR_FLAG_MAPPHYSICAL      0x00000010L
  702. #define GETLINEAR_FLAG_MAPPROCESS       0x00000020L
  703. #define GETLINEAR_FLAG_MAPSHARED        0x00000400L
  704. #define GETLINEAR_FLAG_MAPATTACH        0x80000000L
  705.  
  706. #define EGA_BIT         4                /* EGA */
  707. #define VGA_BIT         8                /* VGA */
  708. #define EGAVGA_BIT      (EGA_BIT+VGA_BIT)/* EGA/VGA */
  709.  
  710.                                        /* SCREENDD_GETLINEARACCESS */
  711. typedef struct _GETLINIOCTLDATA {  /* */
  712.         ULONG   PacketLength;
  713.         ULONG   PhysicalAddress;
  714.         ULONG   ApertureSize;
  715.         PBYTE   LinearAddress;
  716.         ULONG   LinearFlags;
  717. } GETLINIOCTLDATA;
  718. typedef GETLINIOCTLDATA *PGETLINIOCTLDATA;
  719.  
  720.                                 /*  SCREENDD_SETCURRENTBANK/GETCURRENTBANK */
  721. typedef struct _BANKINFO {     /* */
  722.         ULONG  ulBankLength;
  723.         USHORT usBank;
  724.         USHORT usVideoModeType;
  725.         USHORT usReadWriteMode;
  726. } BANKINFO;
  727.  
  728. #define READ_BANK    0
  729. #define WRITE_BANK   1
  730. #define MODE_TEXT    0
  731. #define MODE_PLANAR  1
  732. #define MODE_LINEAR  2
  733.  
  734.                                  /* SCREENDD_GETGLOBALACCESS */
  735. typedef struct _GLOBALIOCTLDATA {   /* */
  736.         ULONG   ProcessAddress;
  737.         ULONG   AddressLength;
  738.         ULONG   GlobalAddress;
  739. } GLOBALIOCTLDATA;
  740.                                            /* data packet for SCREENDD_SVGA_ID */
  741. typedef struct _OEMSVGAINFO { /* */
  742.         USHORT AdapterType;
  743.         USHORT ChipType;
  744.         ULONG  Memory;
  745. } OEMSVGAINFO;
  746.                                            /* data packet for SCREENDD_SVGA_OEM */
  747. /* OEM data packet format must contain total length in bytes as its first word. */
  748. /* The rest of it can be in manufacturer/adapter specific format. */
  749.  
  750. typedef struct _OEMINFO {    /* */
  751.         ULONG  OEMLength;
  752.         USHORT Manufacturer;
  753.         ULONG  ManufacturerData;
  754. } OEMINFO;
  755.                                           /* paramter packet for GETGLOBALACCESS */
  756. typedef struct _GETGLOBALPACKET {  /* */
  757.         ULONG   GlobalPktLength;
  758.         GLOBALIOCTLDATA GlobalPktData[1];
  759. } GETGLOBALPACKET;
  760.  
  761.  
  762. #endif /* __BSEDEV__ */
  763.  
  764. #ifdef __cplusplus
  765.         }
  766. #endif
  767. #if __IBMC__ || __IBMCPP__
  768. #pragma info( none )
  769.    #ifndef __CHKHDR__
  770.       #pragma info( restore )
  771.    #endif
  772. #pragma info( restore )
  773. #endif
  774.