home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddkx86v1.zip / DDKX86 / IBMH / BSEDEV.H < prev    next >
C/C++ Source or Header  |  1995-04-14  |  29KB  |  778 lines

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