home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / BSEDEVH.ZIP / BSEDEV.H
C/C++ Source or Header  |  1989-06-15  |  13KB  |  482 lines

  1. /***************************************************************************\
  2. *
  3. * Module Name: BSEDEV.H
  4. *
  5. * OS/2 Structures and constants for use with DosDevIOCtl
  6. *
  7. * Copyright (c) 1989  Microsoft Corporation
  8. *
  9. * modified 6/14/89: corrected BIOBPARAMETERBLOCK structure definition -- LJF
  10. *
  11. \***************************************************************************/
  12.  
  13. /* Input and Output Control Categories */
  14.  
  15. #define IOCTL_ASYNC            0x0001
  16. #define IOCTL_SCR_AND_PTRDRAW  0x0003
  17. #define IOCTL_KEYBOARD         0x0004
  18. #define IOCTL_PRINTER          0x0005
  19. #define IOCTL_LIGHTPEN         0x0006
  20. #define IOCTL_POINTINGDEVICE   0x0007
  21. #define IOCTL_DISK             0x0008
  22. #define IOCTL_PHYSICALDISK     0x0009
  23. #define IOCTL_MONITOR          0x000A
  24. #define IOCTL_GENERAL          0x000B
  25.  
  26. /* Serial-Device Control */
  27.  
  28. #define ASYNC_SETBAUDRATE     0x0041
  29. #define ASYNC_SETLINECTRL     0x0042
  30. #define ASYNC_TRANSMITIMM     0x0044
  31. #define ASYNC_SETBREAKOFF     0x0045
  32. #define ASYNC_SETMODEMCTRL    0x0046
  33. #define ASYNC_SETBREAKON      0x004B
  34. #define ASYNC_STOPTRANSMIT    0x0047
  35. #define ASYNC_STARTTRANSMIT   0x0048
  36. #define ASYNC_SETDCBINFO      0x0053
  37. #define ASYNC_GETBAUDRATE     0x0061
  38. #define ASYNC_GETLINECTRL     0x0062
  39. #define ASYNC_GETCOMMSTATUS   0x0064
  40. #define ASYNC_GETLINESTATUS   0x0065
  41. #define ASYNC_GETMODEMOUTPUT  0x0066
  42. #define ASYNC_GETMODEMINPUT   0x0067
  43. #define ASYNC_GETINQUECOUNT   0x0068
  44. #define ASYNC_GETOUTQUECOUNT  0x0069
  45. #define ASYNC_GETCOMMERROR    0x006D
  46. #define ASYNC_GETCOMMEVENT    0x0072
  47. #define ASYNC_GETDCBINFO      0x0073
  48.  
  49. /* Screen/Pointer-Draw Control */
  50.  
  51. #define   PTR_GETPTRDRAWADDRESS  0x0072
  52.  
  53. /* Keyboard Control */
  54.  
  55. #define KBD_SETTRANSTABLE     0x0050
  56. #define KBD_SETINPUTMODE      0x0051
  57. #define KBD_SETINTERIMFLAG    0x0052
  58. #define KBD_SETSHIFTSTATE     0x0053
  59. #define KBD_SETTYPAMATICRATE  0x0054
  60. #define KBD_SETFGNDSCREENGRP  0x0055
  61. #define KBD_SETSESMGRHOTKEY   0x0056
  62. #define KBD_SETFOCUS          0x0057
  63. #define KBD_SETKCB            0x0058
  64. #define KBD_SETNLS            0x005C
  65. #define KBD_CREATE            0x005D
  66. #define KBD_DESTROY           0x005E
  67. #define KBD_GETINPUTMODE      0x0071
  68. #define KBD_GETINTERIMFLAG    0x0072
  69. #define KBD_GETSHIFTSTATE     0x0073
  70. #define KBD_READCHAR          0x0074
  71. #define KBD_PEEKCHAR          0x0075
  72. #define KBD_GETSESMGRHOTKEY   0x0076
  73. #define KBD_GETKEYBDTYPE      0x0077
  74. #define KBD_GETCODEPAGEID     0x0078
  75. #define KBD_XLATESCAN         0x0079
  76.  
  77. /* Printer Control */
  78.  
  79. #define PRT_SETFRAMECTL       0x0042
  80. #define PRT_SETINFINITERETRY  0x0044
  81. #define PRT_INITPRINTER       0x0046
  82. #define PRT_ACTIVATEFONT      0x0048
  83. #define PRT_GETFRAMECTL       0x0062
  84. #define PRT_GETINFINITERETRY  0x0064
  85. #define PRT_GETPRINTERSTATUS  0x0066
  86. #define PRT_QUTRYACTIVEFONT   0x0069
  87. #define PRT_VERIFYFONT        0x006A
  88.  
  89. /* Pointing-Device (Mouse) Control */
  90.  
  91. #define MOU_ALLOWPTRDRAW        0x0050
  92. #define MOU_UPDATEDISPLAYMODE   0x0051
  93. #define MOU_SCREENSWITCH        0x0052
  94. #define MOU_SETSCALEFACTORS     0x0053
  95. #define MOU_SETEVENTMASK        0x0054
  96. #define MOU_SETHOTKEYBUTTON     0x0055
  97. #define MOU_SETPTRSHAPE         0x0056
  98. #define MOU_DRAWPTR             0x0057
  99. #define MOU_REMOVEPTR           0x0058
  100. #define MOU_SETPTRPOS           0x0059
  101. #define MOU_SETPROTDRAWADDRESS  0x005A
  102. #define MOU_SETREALDRAWADDRESS  0x005B
  103. #define MOU_SETMOUSTATUS        0x005C
  104. #define MOU_GETBUTTONCOUNT      0x0060
  105. #define MOU_GETMICKEYCOUNT      0x0061
  106. #define MOU_GETMOUSTATUS        0x0062
  107. #define MOU_READEVENTQUE        0x0063
  108. #define MOU_GETQUESTATUS        0x0064
  109. #define MOU_GETEVENTMASK        0x0065
  110. #define MOU_GETSCALEFACTORS     0x0066
  111. #define MOU_GETPTRPOS           0x0067
  112. #define MOU_GETPTRSHAPE         0x0068
  113. #define MOU_GETHOTKEYBUTTON     0x0069
  114.  
  115. /* Disk/Diskette Control */
  116.  
  117. #define DSK_LOCKDRIVE         0x0000
  118. #define DSK_UNLOCKDRIVE       0x0001
  119. #define DSK_REDETERMINEMEDIA  0x0002
  120. #define DSK_SETLOGICALMAP     0x0003
  121. #define DSK_BLOCKREMOVABLE    0x0020
  122. #define DSK_GETLOGICALMAP     0x0021
  123. #define DSK_SETDEVICEPARAMS   0x0043
  124. #define DSK_WRITETRACK        0x0044
  125. #define DSK_FORMATVERIFY      0x0045
  126. #define DSK_GETDEVICEPARAMS   0x0063
  127. #define DSK_READTRACK         0x0064
  128. #define DSK_VERIFYTRACK       0x0065
  129.  
  130. /* Physical-Disk Control */
  131.  
  132. #define PDSK_LOCKPHYSDRIVE        0x0000
  133. #define PDSK_UNLOCKPHYSDRIVE      0x0001
  134. #define PDSK_WRITEPHYSTRACK       0x0044
  135. #define PDSK_GETPHYSDEVICEPARAMS  0x0063
  136. #define PDSK_READPHYSTRACK        0x0064
  137. #define PDSK_VERIFYPHYSTRACK      0x0065
  138.  
  139. /* Character-Monitor Control */
  140.  
  141. #define MON_REGISTERMONITOR   0x0040
  142.  
  143. /* General Device Control */
  144.  
  145. #define DEV_FLUSHINPUT       0x0001
  146. #define DEV_FLUSHOUTPUT      0x0002
  147. #define DEV_QUERYMONSUPPORT  0x0060
  148.  
  149.  
  150. /* ASYNC_GETCOMMERROR, ASYNC_SETBREAKOFF, ASYNC_SETBREAKON, ASYNC_SETMODEMCTRL */
  151.  
  152. #define RX_QUE_OVERRUN       0x0001
  153. #define RX_HARDWARE_OVERRUN  0x0002
  154. #define PARITY_ERROR         0x0004
  155. #define FRAMING_ERROR        0x0008
  156.  
  157. /* ASYNC_GETCOMMEVENT */
  158.  
  159. #define CHAR_RECEIVED   0x0001
  160. #define LAST_CHAR_SENT  0x0004
  161. #define CTS_CHANGED     0x0008
  162. #define DSR_CHANGED     0x0010
  163. #define DCD_CHANGED     0x0020
  164. #define BREAK_DETECTED  0x0040
  165. #define ERROR_OCCURRED  0x0080
  166. #define RI_DETECTED     0x0100
  167.  
  168. /* ASYNC_GETCOMMSTATUS */
  169.  
  170. #define TX_WAITING_FOR_CTS       0x0001
  171. #define TX_WAITING_FOR_DSR       0x0002
  172. #define TX_WAITING_FOR_DCD       0x0004
  173. #define TX_WAITING_FOR_XON       0x0008
  174. #define TX_WAITING_TO_SEND_XON       0x0010
  175. #define TX_WAITING_WHILE_BREAK_ON  0x0020
  176. #define TX_WAITING_TO_SEND_IMM       0x0040
  177. #define RX_WAITING_FOR_DSR       0x0080
  178.  
  179. /* ASYNC_GETLINESTATUS */
  180.  
  181. #define WRITE_REQUEST_QUEUED    0x0001
  182. #define DATA_IN_TX_QUE        0x0002
  183. #define HARDWARE_TRANSMITTING    0x0004
  184. #define CHAR_READY_TO_SEND_IMM    0x0008
  185. #define WAITING_TO_SEND_XON    0x0010
  186. #define WAITING_TO_SEND_XOFF    0x0020
  187.  
  188. /* ASYNC_GETMODEMINPUT */
  189.  
  190. #define CTS_ON    0x10
  191. #define DSR_ON    0x20
  192. #define RI_ON    0x40
  193. #define DCD_ON    0x80
  194.  
  195. /* DSK_SETDEVICEPARAMS */
  196.  
  197. #define BUILD_BPB_FROM_MEDIUM    0x00
  198. #define REPLACE_BPB_FOR_DEVICE    0x01
  199. #define REPLACE_BPB_FOR_MEDIUM    0x02
  200.  
  201. /* KBD_GETINPUTMODE, KBD_PEEKCHAR, KBD_SETINPUTMODE*/
  202.  
  203. #define ASCII_MODE  0x00
  204. #define BINARY_MODE 0x80
  205.  
  206. /* KBD_GETINTERIMFLAG */
  207.  
  208. #define CONVERSION_REQUEST  0x20
  209. #define INTERIM_CHAR        0x80
  210.  
  211. /* KBD_GETSESMGRHOTKEY */
  212.  
  213. #define HOTKEY_MAX_COUNT      0x0000
  214. #define HOTKEY_CURRENT_COUNT  0x0001
  215.  
  216. /* KBD_PEEKCHAR */
  217.  
  218. #define KBD_DATA_RECEIVED  0x0001
  219. #define KBD_DATA_BINARY    0x8000
  220.  
  221. /* KBD_READCHAR */
  222.  
  223. #define KBD_READ_WAIT    0x0000
  224. #define KBD_READ_NOWAIT  0x8000
  225.  
  226. /* KBD_SETINPUTMODE */
  227.  
  228. #define SHIFT_REPORT_MODE  0x01
  229.  
  230. #ifndef INCL_MOU
  231.  
  232. #define MOUSE_MOTION                0x0001
  233. #define MOUSE_MOTION_WITH_BN1_DOWN  0x0002
  234. #define MOUSE_BN1_DOWN              0x0004
  235. #define MOUSE_MOTION_WITH_BN2_DOWN  0x0008
  236. #define MOUSE_BN2_DOWN              0x0010
  237. #define MOUSE_MOTION_WITH_BN3_DOWN  0x0020
  238. #define MOUSE_BN3_DOWN              0x0040
  239.  
  240. #define MHK_BUTTON1    0x0001
  241. #define MHK_BUTTON2    0x0002
  242. #define MHK_BUTTON3    0x0004
  243.  
  244. #define MOU_NOWAIT  0x0000
  245. #define MOU_WAIT    0x0001
  246.  
  247. #endif /* #ifndef INCL_MOU */
  248.  
  249. /* MOU_GETHOTKEYBUTTON, MOU_SETHOTKEYBUTTON */
  250.  
  251. #define MHK_NO_HOTKEY  0x0000
  252.  
  253. /* MOU_GETMOUSTATUS */
  254.  
  255. #define MOUSE_QUEUEBUSY         0x0001
  256. #define MOUSE_BLOCKREAD         0x0002
  257. #define MOUSE_FLUSH             0x0004
  258. #define MOUSE_UNSUPPORTED_MODE  0x0008
  259. #define MOUSE_DISABLED          0x0100
  260. #define MOUSE_MICKEYS           0x0200
  261.  
  262. /* PRT_GETPRINTERSTATUS */
  263.  
  264. #define PRINTER_TIMEOUT       0x0001
  265. #define PRINTER_IO_ERROR      0x0008
  266. #define PRINTER_SELECTED      0x0010
  267. #define PRINTER_OUT_OF_PAPER  0x0020
  268. #define PRINTER_ACKNOWLEDGED  0x0040
  269. #define PRINTER_NOT_BUSY      0x0080
  270.  
  271. /* fbCtlHndShake */
  272.  
  273. #define MODE_DTR_CONTROL      0x01
  274. #define MODE_DTR_HANDSHAKE    0x02
  275. #define MODE_CTS_HANDSHAKE    0x08
  276. #define MODE_DSR_HANDSHAKE    0x10
  277. #define MODE_DCD_HANDSHAKE    0x20
  278. #define MODE_DSR_SENSITIVITY  0x40
  279.  
  280. /* fbFlowReplace */
  281.  
  282. #define MODE_AUTO_TRANSMIT    0x01
  283. #define MODE_AUTO_RECEIVE     0x02
  284. #define MODE_ERROR_CHAR       0x04
  285. #define MODE_NULL_STRIPPING   0x08
  286. #define MODE_BREAK_CHAR       0x10
  287. #define MODE_RTS_CONTROL      0x40
  288. #define MODE_RTS_HANDSHAKE    0x80
  289. #define MODE_TRANSMIT_TOGGLE  0xC0
  290.  
  291. /* fbTimeout */
  292.  
  293. #define MODE_NO_WRITE_TIMEOUT     0x01
  294. #define MODE_READ_TIMEOUT         0x02
  295. #define MODE_WAIT_READ_TIMEOUT    0x04
  296. #define MODE_NOWAIT_READ_TIMEOUT  0x06
  297.  
  298. typedef struct _DCBINFO {    /* dcbinf */
  299.     USHORT usWriteTimeout;
  300.     USHORT usReadTimeout;
  301.     BYTE   fbCtlHndShake;
  302.     BYTE   fbFlowReplace;
  303.     BYTE   fbTimeout;
  304.     BYTE   bErrorReplacementChar;
  305.     BYTE   bBreakReplacementChar;
  306.     BYTE   bXONChar;
  307.     BYTE   bXOFFChar;
  308. } DCBINFO;
  309. typedef DCBINFO FAR *PDCBINFO;
  310.  
  311. typedef struct _TRACKLAYOUT {    /* trckl */
  312.     BYTE   bCommand;
  313.     USHORT usHead;
  314.     USHORT usCylinder;
  315.     USHORT usFirstSector;
  316.     USHORT cSectors;
  317.     struct {
  318.         USHORT usSectorNumber;
  319.         USHORT usSectorSize;
  320.     } TrackTable[1];
  321. } TRACKLAYOUT;
  322. typedef TRACKLAYOUT FAR *PTRACKLAYOUT;
  323.  
  324. #define DEVTYPE_48TPI    0x0000
  325. #define DEVTYPE_96TPI    0x0001
  326. #define DEVTYPE_35       0x0002
  327. #define DEVTYPE_8SD      0x0003
  328. #define DEVTYPE_8DD      0x0004
  329. #define DEVTYPE_FIXED    0x0005
  330. #define DEVTYPE_TAPE     0x0006
  331. #define DEVTYPE_UNKNOWN  0x0007
  332.  
  333. typedef struct _BIOSPARAMETERBLOCK {    /* bspblk */
  334.     USHORT usBytesPerSector;
  335.     BYTE   bSectorsPerCluster;
  336.     USHORT usReservedSectors;
  337.     BYTE   cFATs;
  338.     USHORT cRootEntries;
  339.     USHORT cSectors;
  340.     BYTE   bMedia;
  341.     USHORT usSectorsPerFAT;
  342.     USHORT usSectorsPerTrack;
  343.     USHORT cHeads;
  344.     ULONG  cHiddenSectors;
  345.     ULONG  cLargeSectors;
  346.     BYTE   abReserved[6];
  347.     USHORT cCylinders;
  348.     BYTE   bDeviceType;
  349.     USHORT fsDeviceAttr;
  350. } BIOSPARAMETERBLOCK;
  351. typedef BIOSPARAMETERBLOCK FAR *PBIOSPARAMETERBLOCK;
  352.  
  353. typedef struct _SCREENGROUP {    /* scrgrp */
  354.     USHORT idScreenGrp;
  355.     USHORT fTerminate;
  356. } SCREENGROUP;
  357. typedef SCREENGROUP FAR *PSCREENGROUP;
  358.  
  359. typedef struct _FRAME {    /* frm */
  360.     BYTE bCharsPerLine;
  361.     BYTE bLinesPerInch;
  362. } FRAME;
  363. typedef FRAME FAR *PFRAME;
  364.  
  365. typedef struct _KBDTYPE {    /* kbdtyp */
  366.     USHORT usType;
  367.     USHORT reserved1;
  368.     USHORT reserved2;
  369. } KBDTYPE;
  370. typedef KBDTYPE FAR *PKBDTYPE;
  371.  
  372. typedef struct _LINECONTROL {    /* lnctl */
  373.     BYTE bDataBits;
  374.     BYTE bParity;
  375.     BYTE bStopBits;
  376.     BYTE fTransBreak;
  377. } LINECONTROL;
  378. typedef LINECONTROL FAR *PLINECONTROL;
  379.  
  380. /* MODEMSTATUS.fbModemOn, ASYNC_GETMODEMOUTPUT */
  381.  
  382. #define DTR_ON  0x01
  383. #define RTS_ON  0x02
  384.  
  385. /* MODEMSTATUS.fbModemOff */
  386.  
  387. #define DTR_OFF  0xFE
  388. #define RTS_OFF  0xFD
  389.  
  390. typedef struct _MODEMSTATUS {    /* mdmst */
  391.     BYTE fbModemOn;
  392.     BYTE fbModemOff;
  393. } MODEMSTATUS;
  394. typedef MODEMSTATUS FAR *PMODEMSTATUS;
  395.  
  396. typedef struct _TRACKFORMAT {    /* trckfmt */
  397.     BYTE bCommand;
  398.     USHORT usHead;
  399.     USHORT usCylinder;
  400.     USHORT usReserved;
  401.     USHORT cSectors;
  402.     struct {
  403.         BYTE bCylinder;
  404.         BYTE bHead;
  405.         BYTE idSector;
  406.         BYTE bBytesSector;
  407.     } FormatTable[1];
  408. } TRACKFORMAT;
  409. typedef TRACKFORMAT FAR *PTRACKFORMAT;
  410.  
  411. typedef struct _RXQUEUE {    /* rxq */
  412.     USHORT cch;
  413.     USHORT cb;
  414. } RXQUEUE;
  415. typedef RXQUEUE FAR *PRXQUEUE;
  416.  
  417. typedef struct _DEVICEPARAMETERBLOCK {    /* dvpblck */
  418.     USHORT reserved1;
  419.     USHORT cCylinders;
  420.     USHORT cHeads;
  421.     USHORT cSectorsPerTrack;
  422.     USHORT reserved2;
  423.     USHORT reserved3;
  424.     USHORT reserved4;
  425.     USHORT reserved5;
  426. } DEVICEPARAMETERBLOCK;
  427. typedef DEVICEPARAMETERBLOCK FAR *PDEVICEPARAMETERBLOCK;
  428.  
  429. typedef struct _PTRDRAWFUNCTION {    /* ptrdfnc */
  430.     USHORT usReturnCode;
  431.     PFN pfnDraw;
  432.     PCH pchDataSeg;
  433. } PTRDRAWFUNCTION;
  434. typedef PTRDRAWFUNCTION FAR *PPTRDRAWFUNCTION;
  435.  
  436. typedef struct _SHIFTSTATE {    /* shftst */
  437.     USHORT fsState;
  438.     BYTE   fNLS;
  439. } SHIFTSTATE;
  440. typedef SHIFTSTATE FAR *PSHIFTSTATE;
  441.  
  442. /* HOTKEY.fsHotKey/SHIFTSTATE.fsState */
  443.  
  444. #define RIGHTSHIFT     0x0001
  445. #define LEFTSHIFT      0x0002
  446. #define CONTROL        0x0004
  447. #define ALT            0x0008
  448. #define SCROLLLOCK_ON  0x0010
  449. #define NUMLOCK_ON     0x0020
  450. #define CAPSLOCK_ON    0x0040
  451. #define INSERT_ON      0x0080
  452. #define LEFTCONTROL    0x0100
  453. #define LEFTALT        0x0200
  454. #define RIGHTCONTROL   0x0400
  455. #define RIGHTALT       0x0800
  456. #define SCROLLLOCK     0x1000
  457. #define NUMLOCK        0x2000
  458. #define CAPSLOCK       0x4000
  459. #define SYSREQ         0x8000
  460.  
  461. typedef struct _HOTKEY {    /* htky */
  462.     USHORT fsHotKey;
  463.     UCHAR  uchScancodeMake;
  464.     UCHAR  uchScancodeBreak;
  465.     USHORT idHotKey;
  466. } HOTKEY;
  467. typedef HOTKEY FAR *PHOTKEY;
  468.  
  469. typedef struct _MONITORPOSITION {    /* mnpos */
  470.     USHORT fPosition;
  471.     USHORT index;
  472.     ULONG  pbInBuf;
  473.     USHORT offOutBuf;
  474. } MONITORPOSITION;
  475. typedef MONITORPOSITION FAR *PMONITORPOSITION;
  476.  
  477. typedef struct _RATEDELAY {    /* rtdly */
  478.     USHORT usDelay;
  479.     USHORT usRate;
  480. } RATEDELAY;
  481. typedef RATEDELAY FAR *PRATEDELAY;
  482.