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