home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c034 / 7.ddi / INC11 / BSEDEV.H$ / BSEDEV.bin
Encoding:
Text File  |  1990-01-09  |  13.2 KB  |  494 lines

  1. /**************************************************************************\
  2. *
  3. * Module Name: BSEDEV.H
  4. *
  5. * OS/2 Structures and constants for use with DosDevIOCtl
  6. *
  7. * Copyright (c) 1989-1990, Microsoft Corporation. All rights reserved.
  8. *
  9. \**************************************************************************/
  10.  
  11. /* Input and Output Control Categories */
  12.  
  13. #define IOCTL_ASYNC            0x0001
  14. #define IOCTL_SCR_AND_PTRDRAW  0x0003
  15. #define IOCTL_KEYBOARD         0x0004
  16. #define IOCTL_PRINTER          0x0005
  17. #define IOCTL_LIGHTPEN         0x0006
  18. #define IOCTL_POINTINGDEVICE   0x0007
  19. #define IOCTL_DISK             0x0008
  20. #define IOCTL_PHYSICALDISK     0x0009
  21. #define IOCTL_MONITOR          0x000A
  22. #define IOCTL_GENERAL          0x000B
  23.  
  24. /* Serial-Device Control */
  25.  
  26. #define ASYNC_SETBAUDRATE     0x0041
  27. #define ASYNC_SETLINECTRL     0x0042
  28. #define ASYNC_TRANSMITIMM     0x0044
  29. #define ASYNC_SETBREAKOFF     0x0045
  30. #define ASYNC_SETMODEMCTRL    0x0046
  31. #define ASYNC_SETBREAKON      0x004B
  32. #define ASYNC_STOPTRANSMIT    0x0047
  33. #define ASYNC_STARTTRANSMIT   0x0048
  34. #define ASYNC_SETDCBINFO      0x0053
  35. #define ASYNC_GETBAUDRATE     0x0061
  36. #define ASYNC_GETLINECTRL     0x0062
  37. #define ASYNC_GETCOMMSTATUS   0x0064
  38. #define ASYNC_GETLINESTATUS   0x0065
  39. #define ASYNC_GETMODEMOUTPUT  0x0066
  40. #define ASYNC_GETMODEMINPUT   0x0067
  41. #define ASYNC_GETINQUECOUNT   0x0068
  42. #define ASYNC_GETOUTQUECOUNT  0x0069
  43. #define ASYNC_GETCOMMERROR    0x006D
  44. #define ASYNC_GETCOMMEVENT    0x0072
  45. #define ASYNC_GETDCBINFO      0x0073
  46.  
  47. /* Screen/Pointer-Draw Control */
  48.  
  49. #define   PTR_GETPTRDRAWADDRESS  0x0072
  50.  
  51. /* Keyboard Control */
  52.  
  53. #define KBD_SETTRANSTABLE     0x0050
  54. #define KBD_SETINPUTMODE      0x0051
  55. #define KBD_SETINTERIMFLAG    0x0052
  56. #define KBD_SETSHIFTSTATE     0x0053
  57. #define KBD_SETTYPAMATICRATE  0x0054
  58. #define KBD_SETFGNDSCREENGRP  0x0055
  59. #define KBD_SETSESMGRHOTKEY   0x0056
  60. #define KBD_SETFOCUS          0x0057
  61. #define KBD_SETKCB            0x0058
  62. #define KBD_SETNLS            0x005C
  63. #define KBD_CREATE            0x005D
  64. #define KBD_DESTROY           0x005E
  65. #define KBD_GETINPUTMODE      0x0071
  66. #define KBD_GETINTERIMFLAG    0x0072
  67. #define KBD_GETSHIFTSTATE     0x0073
  68. #define KBD_READCHAR          0x0074
  69. #define KBD_PEEKCHAR          0x0075
  70. #define KBD_GETSESMGRHOTKEY   0x0076
  71. #define KBD_GETKEYBDTYPE      0x0077
  72. #define KBD_GETCODEPAGEID     0x0078
  73. #define KBD_XLATESCAN         0x0079
  74.  
  75. /* Printer Control */
  76.  
  77. #define PRT_SETFRAMECTL       0x0042
  78. #define PRT_SETINFINITERETRY  0x0044
  79. #define PRT_INITPRINTER       0x0046
  80. #define PRT_ACTIVATEFONT      0x0048
  81. #define PRT_GETFRAMECTL       0x0062
  82. #define PRT_GETINFINITERETRY  0x0064
  83. #define PRT_GETPRINTERSTATUS  0x0066
  84. #define PRT_QUTRYACTIVEFONT   0x0069
  85. #define PRT_VERIFYFONT        0x006A
  86.  
  87. /* Pointing-Device (Mouse) Control */
  88.  
  89. #define MOU_ALLOWPTRDRAW        0x0050
  90. #define MOU_UPDATEDISPLAYMODE   0x0051
  91. #define MOU_SCREENSWITCH        0x0052
  92. #define MOU_SETSCALEFACTORS     0x0053
  93. #define MOU_SETEVENTMASK        0x0054
  94. #define MOU_SETHOTKEYBUTTON     0x0055
  95. #define MOU_SETPTRSHAPE         0x0056
  96. #define MOU_DRAWPTR             0x0057
  97. #define MOU_REMOVEPTR           0x0058
  98. #define MOU_SETPTRPOS           0x0059
  99. #define MOU_SETPROTDRAWADDRESS  0x005A
  100. #define MOU_SETREALDRAWADDRESS  0x005B
  101. #define MOU_SETMOUSTATUS        0x005C
  102. #define MOU_GETBUTTONCOUNT      0x0060
  103. #define MOU_GETMICKEYCOUNT      0x0061
  104. #define MOU_GETMOUSTATUS        0x0062
  105. #define MOU_READEVENTQUE        0x0063
  106. #define MOU_GETQUESTATUS        0x0064
  107. #define MOU_GETEVENTMASK        0x0065
  108. #define MOU_GETSCALEFACTORS     0x0066
  109. #define MOU_GETPTRPOS           0x0067
  110. #define MOU_GETPTRSHAPE         0x0068
  111. #define MOU_GETHOTKEYBUTTON     0x0069
  112.  
  113. /* Disk/Diskette Control */
  114.  
  115. #define DSK_LOCKDRIVE         0x0000
  116. #define DSK_UNLOCKDRIVE       0x0001
  117. #define DSK_REDETERMINEMEDIA  0x0002
  118. #define DSK_SETLOGICALMAP     0x0003
  119. #define DSK_BLOCKREMOVABLE    0x0020
  120. #define DSK_GETLOGICALMAP     0x0021
  121. #define DSK_SETDEVICEPARAMS   0x0043
  122. #define DSK_WRITETRACK        0x0044
  123. #define DSK_FORMATVERIFY      0x0045
  124. #define DSK_GETDEVICEPARAMS   0x0063
  125. #define DSK_READTRACK         0x0064
  126. #define DSK_VERIFYTRACK       0x0065
  127.  
  128. /* Physical-Disk Control */
  129.  
  130. #define PDSK_LOCKPHYSDRIVE        0x0000
  131. #define PDSK_UNLOCKPHYSDRIVE      0x0001
  132. #define PDSK_WRITEPHYSTRACK       0x0044
  133. #define PDSK_GETPHYSDEVICEPARAMS  0x0063
  134. #define PDSK_READPHYSTRACK        0x0064
  135. #define PDSK_VERIFYPHYSTRACK      0x0065
  136.  
  137. /* Character-Monitor Control */
  138.  
  139. #define MON_REGISTERMONITOR   0x0040
  140.  
  141. /* General Device Control */
  142.  
  143. #define DEV_FLUSHINPUT       0x0001
  144. #define DEV_FLUSHOUTPUT      0x0002
  145. #define DEV_QUERYMONSUPPORT  0x0060
  146.  
  147.  
  148. /* ASYNC_GETCOMMERROR, ASYNC_SETBREAKOFF, ASYNC_SETBREAKON,
  149.  * ASYNC_SETMODEMCTRL
  150.  */
  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.     USHORT cCylinders;
  347.     BYTE   bDeviceType;
  348.     USHORT fsDeviceAttr;
  349. } BIOSPARAMETERBLOCK;
  350. typedef BIOSPARAMETERBLOCK FAR *PBIOSPARAMETERBLOCK;
  351.  
  352. typedef struct _SCREENGROUP {    /* scrgrp */
  353.     USHORT idScreenGrp;
  354.     USHORT fTerminate;
  355. } SCREENGROUP;
  356. typedef SCREENGROUP FAR *PSCREENGROUP;
  357.  
  358. typedef struct _FRAME {    /* frm */
  359.     BYTE bCharsPerLine;
  360.     BYTE bLinesPerInch;
  361. } FRAME;
  362. typedef FRAME FAR *PFRAME;
  363.  
  364. typedef struct _KBDTYPE {    /* kbdtyp */
  365.     USHORT usType;
  366.     USHORT reserved1;
  367.     USHORT reserved2;
  368. } KBDTYPE;
  369. typedef KBDTYPE FAR *PKBDTYPE;
  370.  
  371. typedef struct _LINECONTROL {    /* lnctl */
  372.     BYTE bDataBits;
  373.     BYTE bParity;
  374.     BYTE bStopBits;
  375.     BYTE fTransBreak;
  376. } LINECONTROL;
  377. typedef LINECONTROL FAR *PLINECONTROL;
  378.  
  379. /* MODEMSTATUS.fbModemOn, ASYNC_GETMODEMOUTPUT */
  380.  
  381. #define DTR_ON  0x01
  382. #define RTS_ON  0x02
  383.  
  384. /* MODEMSTATUS.fbModemOff */
  385.  
  386. #define DTR_OFF  0xFE
  387. #define RTS_OFF  0xFD
  388.  
  389. typedef struct _MODEMSTATUS {    /* mdmst */
  390.     BYTE fbModemOn;
  391.     BYTE fbModemOff;
  392. } MODEMSTATUS;
  393. typedef MODEMSTATUS FAR *PMODEMSTATUS;
  394.  
  395. typedef struct _TRACKFORMAT {    /* trckfmt */
  396.     BYTE bCommand;
  397.     USHORT usHead;
  398.     USHORT usCylinder;
  399.     USHORT usReserved;
  400.     USHORT cSectors;
  401.     struct {
  402.         BYTE bCylinder;
  403.         BYTE bHead;
  404.         BYTE idSector;
  405.         BYTE bBytesSector;
  406.     } FormatTable[1];
  407. } TRACKFORMAT;
  408. typedef TRACKFORMAT FAR *PTRACKFORMAT;
  409.  
  410. typedef struct _RXQUEUE {    /* rxq */
  411.     USHORT cch;
  412.     USHORT cb;
  413. } RXQUEUE;
  414. typedef RXQUEUE FAR *PRXQUEUE;
  415.  
  416. typedef struct _DEVICEPARAMETERBLOCK {    /* dvpblck */
  417.     USHORT reserved1;
  418.     USHORT cCylinders;
  419.     USHORT cHeads;
  420.     USHORT cSectorsPerTrack;
  421.     USHORT reserved2;
  422.     USHORT reserved3;
  423.     USHORT reserved4;
  424.     USHORT reserved5;
  425. } DEVICEPARAMETERBLOCK;
  426. typedef DEVICEPARAMETERBLOCK FAR *PDEVICEPARAMETERBLOCK;
  427.  
  428. typedef struct _PTRDRAWFUNCTION {    /* ptrdfnc */
  429.     USHORT usReturnCode;
  430.     PFN pfnDraw;
  431.     PCH pchDataSeg;
  432. } PTRDRAWFUNCTION;
  433. typedef PTRDRAWFUNCTION FAR *PPTRDRAWFUNCTION;
  434.  
  435. typedef struct _SHIFTSTATE {    /* shftst */
  436.     USHORT fsState;
  437.     BYTE   fNLS;
  438. } SHIFTSTATE;
  439. typedef SHIFTSTATE FAR *PSHIFTSTATE;
  440.  
  441. /* HOTKEY.fsHotKey/SHIFTSTATE.fsState */
  442.  
  443. #define RIGHTSHIFT     0x0001
  444. #define LEFTSHIFT      0x0002
  445. #define CONTROL        0x0004
  446. #define ALT            0x0008
  447. #define SCROLLLOCK_ON  0x0010
  448. #define NUMLOCK_ON     0x0020
  449. #define CAPSLOCK_ON    0x0040
  450. #define INSERT_ON      0x0080
  451. #define LEFTCONTROL    0x0100
  452. #define LEFTALT        0x0200
  453. #define RIGHTCONTROL   0x0400
  454. #define RIGHTALT       0x0800
  455. #define SCROLLLOCK     0x1000
  456. #define NUMLOCK        0x2000
  457. #define CAPSLOCK       0x4000
  458. #define SYSREQ         0x8000
  459.  
  460. typedef struct _HOTKEY {    /* htky */
  461.     USHORT fsHotKey;
  462.     UCHAR  uchScancodeMake;
  463.     UCHAR  uchScancodeBreak;
  464.     USHORT idHotKey;
  465. } HOTKEY;
  466. typedef HOTKEY FAR *PHOTKEY;
  467.  
  468. typedef struct _MONITORPOSITION {    /* mnpos */
  469.     USHORT fPosition;
  470.     USHORT index;
  471.     ULONG  pbInBuf;
  472.     USHORT offOutBuf;
  473. } MONITORPOSITION;
  474. typedef MONITORPOSITION FAR *PMONITORPOSITION;
  475.  
  476. typedef struct _RATEDELAY {    /* rtdly */
  477.     USHORT usDelay;
  478.     USHORT usRate;
  479. } RATEDELAY;
  480. typedef RATEDELAY FAR *PRATEDELAY;
  481.  
  482. typedef struct _CODEPAGEINFO {    /* cpi */
  483.     PBYTE pbTransTable;
  484.     USHORT idCodePage;
  485.     USHORT idTable;
  486. } CODEPAGEINFO;
  487. typedef FAR *PCODEPAGEINFO;
  488.  
  489. typedef struct _CPID {    /* cpid */
  490.     USHORT idCodePage;
  491.     USHORT Reserved;
  492. } CPID;
  493. typedef FAR *PCPID;
  494.