home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / sp15demo.zip / libsrc.zip / LIBSRC / BSEDEV.PAS next >
Pascal/Delphi Source File  |  1994-12-16  |  19KB  |  517 lines

  1. UNIT BseDev;
  2.  
  3. {**************************************************************************
  4. *                                                                         *
  5. * Module Name: BSEDEV.PAS                                                 *
  6. *                                                                         *
  7. * OS/2 Structures and constants for use with DosDevIOCtl                  *
  8. *                                                                         *
  9. *                                                                         *
  10. ***************************************************************************}
  11.  
  12. INTERFACE
  13.  
  14. USES Os2Def;
  15.  
  16. { Input and Output Control Categories }
  17.  
  18. CONST
  19.  
  20.        IOCTL_ASYNC                        =$0001;
  21.        IOCTL_SCR_AND_PTRDRAW              =$0003;
  22.        IOCTL_KEYBOARD                     =$0004;
  23.        IOCTL_PRINTER                      =$0005;
  24.        IOCTL_LIGHTPEN                     =$0006;
  25.        IOCTL_POINTINGDEVICE               =$0007;
  26.        IOCTL_DISK                         =$0008;
  27.        IOCTL_PHYSICALDISK                 =$0009;
  28.        IOCTL_MONITOR                      =$000A;
  29.        IOCTL_GENERAL                      =$000B;
  30.  
  31. { Serial-Device Control }
  32.  
  33.        ASYNC_SETBAUDRATE                  =$0041;
  34.        ASYNC_SETLINECTRL                  =$0042;
  35.        ASYNC_TRANSMITIMM                  =$0044;
  36.        ASYNC_SETBREAKOFF                  =$0045;
  37.        ASYNC_SETMODEMCTRL                 =$0046;
  38.        ASYNC_SETBREAKON                   =$004B;
  39.        ASYNC_STOPTRANSMIT                 =$0047;
  40.        ASYNC_STARTTRANSMIT                =$0048;
  41.        ASYNC_SETDCBINFO                   =$0053;
  42.        ASYNC_GETBAUDRATE                  =$0061;
  43.        ASYNC_GETLINECTRL                  =$0062;
  44.        ASYNC_GETCOMMSTATUS                =$0064;
  45.        ASYNC_GETLINESTATUS                =$0065;
  46.        ASYNC_GETMODEMOUTPUT               =$0066;
  47.        ASYNC_GETMODEMINPUT                =$0067;
  48.        ASYNC_GETINQUECOUNT                =$0068;
  49.        ASYNC_GETOUTQUECOUNT               =$0069;
  50.        ASYNC_GETCOMMERROR                 =$006D;
  51.        ASYNC_GETCOMMEVENT                 =$0072;
  52.        ASYNC_GETDCBINFO                   =$0073;
  53.  
  54. { Screen/Pointer-Draw Control }
  55.  
  56.        SCR_ALLOCLDT                       =$0070;
  57.        SCR_DEALLOCLDT                     =$0071;
  58.        PTR_GETPTRDRAWADDRESS              =$0072;
  59.        SCR_ALLOCLDTOFF                    =$0075;
  60.  
  61. { Keyboard Control }
  62.  
  63.        KBD_SETTRANSTABLE                  =$0050;
  64.        KBD_SETINPUTMODE                   =$0051;
  65.        KBD_SETINTERIMFLAG                 =$0052;
  66.        KBD_SETSHIFTSTATE                  =$0053;
  67.        KBD_SETTYPAMATICRATE               =$0054;
  68.        KBD_SETFGNDSCREENGRP               =$0055;
  69.        KBD_SETSESMGRHOTKEY                =$0056;
  70.        KBD_SETFOCUS                       =$0057;
  71.        KBD_SETKCB                         =$0058;
  72.        KBD_SETNLS                         =$005C;
  73.        KBD_CREATE                         =$005D;
  74.        KBD_DESTROY                        =$005E;
  75.        KBD_GETINPUTMODE                   =$0071;
  76.        KBD_GETINTERIMFLAG                 =$0072;
  77.        KBD_GETSHIFTSTATE                  =$0073;
  78.        KBD_READCHAR                       =$0074;
  79.        KBD_PEEKCHAR                       =$0075;
  80.        KBD_GETSESMGRHOTKEY                =$0076;
  81.        KBD_GETKEYBDTYPE                   =$0077;
  82.        KBD_GETCODEPAGEID                  =$0078;
  83.        KBD_XLATESCAN                      =$0079;
  84.  
  85. { Printer Control }
  86.  
  87.        PRT_QUERYJOBHANDLE                 =$0021;
  88.        PRT_SETFRAMECTL                    =$0042;
  89.        PRT_SETINFINITERETRY               =$0044;
  90.        PRT_INITPRINTER                    =$0046;
  91.        PRT_ACTIVATEFONT                   =$0048;
  92.        PRT_GETFRAMECTL                    =$0062;
  93.        PRT_GETINFINITERETRY               =$0064;
  94.        PRT_GETPRINTERSTATUS               =$0066;
  95.        PRT_QUERYACTIVEFONT                =$0069;
  96.        PRT_VERIFYFONT                     =$006A;
  97.  
  98. { Pointing-Device (Mouse) Control }
  99.  
  100.        MOU_ALLOWPTRDRAW                   =$0050;
  101.        MOU_UPDATEDISPLAYMODE              =$0051;
  102.        MOU_SCREENSWITCH                   =$0052;
  103.        MOU_SETSCALEFACTORS                =$0053;
  104.        MOU_SETEVENTMASK                   =$0054;
  105.        MOU_SETHOTKEYBUTTON                =$0055;
  106.        MOU_SETPTRSHAPE                    =$0056;
  107.        MOU_DRAWPTR                        =$0057;
  108.        MOU_REMOVEPTR                      =$0058;
  109.        MOU_SETPTRPOS                      =$0059;
  110.        MOU_SETPROTDRAWADDRESS             =$005A;
  111.        MOU_SETREALDRAWADDRESS             =$005B;
  112.        MOU_SETMOUSTATUS                   =$005C;
  113.        MOU_DISPLAYMODECHANGE              =$005D;
  114.        MOU_GETBUTTONCOUNT                 =$0060;
  115.        MOU_GETMICKEYCOUNT                 =$0061;
  116.        MOU_GETMOUSTATUS                   =$0062;
  117.        MOU_READEVENTQUE                   =$0063;
  118.        MOU_GETQUESTATUS                   =$0064;
  119.        MOU_GETEVENTMASK                   =$0065;
  120.        MOU_GETSCALEFACTORS                =$0066;
  121.        MOU_GETPTRPOS                      =$0067;
  122.        MOU_GETPTRSHAPE                    =$0068;
  123.        MOU_GETHOTKEYBUTTON                =$0069;
  124.        MOU_VER                            =$006A;
  125.  
  126. { Disk/Diskette Control }
  127.  
  128.        DSK_LOCKDRIVE                      =$0000;
  129.        DSK_UNLOCKDRIVE                    =$0001;
  130.        DSK_REDETERMINEMEDIA               =$0002;
  131.        DSK_SETLOGICALMAP                  =$0003;
  132.        DSK_BLOCKREMOVABLE                 =$0020;
  133.        DSK_GETLOGICALMAP                  =$0021;
  134.        DSK_SETDEVICEPARAMS                =$0043;
  135.        DSK_WRITETRACK                     =$0044;
  136.        DSK_FORMATVERIFY                   =$0045;
  137.        DSK_GETDEVICEPARAMS                =$0063;
  138.        DSK_READTRACK                      =$0064;
  139.        DSK_VERIFYTRACK                    =$0065;
  140.  
  141. { Physical-Disk Control }
  142.  
  143.        PDSK_LOCKPHYSDRIVE                 =$0000;
  144.        PDSK_UNLOCKPHYSDRIVE               =$0001;
  145.        PDSK_WRITEPHYSTRACK                =$0044;
  146.        PDSK_GETPHYSDEVICEPARAMS           =$0063;
  147.        PDSK_READPHYSTRACK                 =$0064;
  148.        PDSK_VERIFYPHYSTRACK               =$0065;
  149.  
  150. { Character-Monitor Control }
  151.        MON_REGISTERMONITOR                =$0040;
  152.  
  153. { General Device Control }
  154.        DEV_FLUSHINPUT                     =$0001;
  155.        DEV_FLUSHOUTPUT                    =$0002;
  156.        DEV_QUERYMONSUPPORT                =$0060;
  157.  
  158.  
  159. { ASYNC_GETCOMMERROR, ASYNC_SETBREAKOFF, ASYNC_SETBREAKON,
  160.  * ASYNC_SETMODEMCTRL
  161.  }
  162.  
  163.        RX_QUE_OVERRUN                     =$0001;
  164.        RX_HARDWARE_OVERRUN                =$0002;
  165.        PARITY_ERROR                       =$0004;
  166.        FRAMING_ERROR                      =$0008;
  167.  
  168. { ASYNC_GETCOMMEVENT }
  169.        CHAR_RECEIVED                      =$0001;
  170.        LAST_CHAR_SENT                     =$0004;
  171.        CTS_CHANGED                        =$0008;
  172.        DSR_CHANGED                        =$0010;
  173.        DCD_CHANGED                        =$0020;
  174.        BREAK_DETECTED                     =$0040;
  175.        ERROR_OCCURRED                     =$0080;
  176.        RI_DETECTED                        =$0100;
  177.  
  178. { ASYNC_GETCOMMSTATUS }
  179.        TX_WAITING_FOR_CTS                 =$0001;
  180.        TX_WAITING_FOR_DSR                 =$0002;
  181.        TX_WAITING_FOR_DCD                 =$0004;
  182.        TX_WAITING_FOR_XON                 =$0008;
  183.        TX_WAITING_TO_SEND_XON             =$0010;
  184.        TX_WAITING_WHILE_BREAK_ON          =$0020;
  185.        TX_WAITING_TO_SEND_IMM             =$0040;
  186.        RX_WAITING_FOR_DSR                 =$0080;
  187.  
  188. { ASYNC_GETLINESTATUS }
  189.        WRITE_REQUEST_QUEUED               =$0001;
  190.        DATA_IN_TX_QUE                     =$0002;
  191.        HARDWARE_TRANSMITTING              =$0004;
  192.        CHAR_READY_TO_SEND_IMM             =$0008;
  193.        WAITING_TO_SEND_XON                =$0010;
  194.        WAITING_TO_SEND_XOFF               =$0020;
  195.  
  196. { ASYNC_GETMODEMINPUT }
  197.        CTS_ON                             =$10;
  198.        DSR_ON                             =$20;
  199.        RI_ON                              =$40;
  200.        DCD_ON                             =$80;
  201.  
  202. { DSK_SETDEVICEPARAMS }
  203.        BUILD_BPB_FROM_MEDIUM              =$00;
  204.        REPLACE_BPB_FOR_DEVICE             =$01;
  205.        REPLACE_BPB_FOR_MEDIUM             =$02;
  206.  
  207. { KBD_GETINPUTMODE, KBD_PEEKCHAR, KBD_SETINPUTMODE}
  208.        ASCII_MODE                         =$00;
  209.        BINARY_MODE                        =$80;
  210.  
  211. { KBD_GETINTERIMFLAG }
  212.        CONVERSION_REQUEST                 =$20;
  213.        INTERIM_CHAR                       =$80;
  214.  
  215. { KBD_GETSESMGRHOTKEY }
  216.        HOTKEY_MAX_COUNT                   =$0000;
  217.        HOTKEY_CURRENT_COUNT               =$0001;
  218.  
  219. { KBD_PEEKCHAR }
  220.        KBD_DATA_RECEIVED                  =$0001;
  221.        KBD_DATA_BINARY                    =$8000;
  222.  
  223. { KBD_READCHAR }
  224.        KBD_READ_WAIT                      =$0000;
  225.        KBD_READ_NOWAIT                    =$8000;
  226.  
  227. { KBD_SETINPUTMODE }
  228.        SHIFT_REPORT_MODE                  =$01;
  229.  
  230.        MOUSE_MOTION                    =$0001;
  231.        MOUSE_MOTION_WITH_BN1_DOWN      =$0002;
  232.        MOUSE_BN1_DOWN                  =$0004;
  233.        MOUSE_MOTION_WITH_BN2_DOWN      =$0008;
  234.        MOUSE_BN2_DOWN                  =$0010;
  235.        MOUSE_MOTION_WITH_BN3_DOWN      =$0020;
  236.        MOUSE_BN3_DOWN                  =$0040;
  237.  
  238.        MHK_BUTTON1                     =$0001;
  239.        MHK_BUTTON2                     =$0002;
  240.        MHK_BUTTON3                     =$0004;
  241.  
  242.        MOU_NOWAIT                      =$0000;
  243.        MOU_WAIT                        =$0001;
  244.  
  245.  
  246. { MOU_GETHOTKEYBUTTON, MOU_SETHOTKEYBUTTON }
  247.        MHK_NO_HOTKEY                      =$0000;
  248.  
  249. { MOU_GETMOUSTATUS }
  250.        MOUSE_QUEUEBUSY                    =$0001;
  251.        MOUSE_BLOCKREAD                    =$0002;
  252.        MOUSE_FLUSH                        =$0004;
  253.        MOUSE_UNSUPPORTED_MODE             =$0008;
  254.        MOUSE_DISABLED                     =$0100;
  255.        MOUSE_MICKEYS                      =$0200;
  256.  
  257. { PRT_GETPRINTERSTATUS }
  258.        PRINTER_TIMEOUT                    =$0001;
  259.        PRINTER_IO_ERROR                   =$0008;
  260.        PRINTER_SELECTED                   =$0010;
  261.        PRINTER_OUT_OF_PAPER               =$0020;
  262.        PRINTER_ACKNOWLEDGED               =$0040;
  263.        PRINTER_NOT_BUSY                   =$0080;
  264.  
  265. { fbCtlHndShake }
  266.        MODE_DTR_CONTROL                   =$01;
  267.        MODE_DTR_HANDSHAKE                 =$02;
  268.        MODE_CTS_HANDSHAKE                 =$08;
  269.        MODE_DSR_HANDSHAKE                 =$10;
  270.        MODE_DCD_HANDSHAKE                 =$20;
  271.        MODE_DSR_SENSITIVITY               =$40;
  272.  
  273. { fbFlowReplace }
  274.        MODE_AUTO_TRANSMIT                 =$01;
  275.        MODE_AUTO_RECEIVE                  =$02;
  276.        MODE_ERROR_CHAR                    =$04;
  277.        MODE_NULL_STRIPPING                =$08;
  278.        MODE_BREAK_CHAR                    =$10;
  279.        MODE_RTS_CONTROL                   =$40;
  280.        MODE_RTS_HANDSHAKE                 =$80;
  281.        MODE_TRANSMIT_TOGGLE               =$C0;
  282.  
  283. { fbTimeout }
  284.        MODE_NO_WRITE_TIMEOUT              =$01;
  285.        MODE_READ_TIMEOUT                  =$02;
  286.        MODE_WAIT_READ_TIMEOUT             =$04;
  287.        MODE_NOWAIT_READ_TIMEOUT           =$06;
  288.  
  289. TYPE
  290.     PDCBINFO=^DCBINFO;
  291.     DCBINFO=RECORD
  292.                  usWriteTimeout:USHORT;
  293.                  usReadTimeout:USHORT;
  294.                  fbCtlHndShake:BYTE;
  295.                  fbFlowReplace:BYTE;
  296.                  fbTimeout:BYTE;
  297.                  bErrorReplacementChar:BYTE;
  298.                  bBreakReplacementChar:BYTE;
  299.                  bXONChar:BYTE;
  300.                  bXOFFChar:BYTE;
  301.            END;
  302.  
  303.     PTRACKLAYOUT=^TRACKLAYOUT;
  304.     TRACKLAYOUT=RECORD {pack 1}
  305.                     bCommand:BYTE;
  306.                     usHead:USHORT;
  307.                     usCylinder:USHORT;
  308.                     usFirstSector:USHORT;
  309.                     cSectors:USHORT;
  310.                     TrackTable:RECORD
  311.                                     usSectorNumber:USHORT;
  312.                                     usSectorSize:USHORT;
  313.                                END;
  314.                 END;
  315.  
  316. CONST
  317.        DEVTYPE_48TPI                      =$0000;
  318.        DEVTYPE_96TPI                      =$0001;
  319.        DEVTYPE_35                         =$0002;
  320.        DEVTYPE_8SD                        =$0003;
  321.        DEVTYPE_8DD                        =$0004;
  322.        DEVTYPE_FIXED                      =$0005;
  323.        DEVTYPE_TAPE                       =$0006;
  324.        DEVTYPE_UNKNOWN                    =$0007;
  325.  
  326.  
  327. TYPE
  328.     PBIOSPARAMETERBLOCK=^BIOSPARAMETERBLOCK;
  329.     BIOSPARAMETERBLOCK=RECORD {pack 1}
  330.                             usBytesPerSector:USHORT;
  331.                             bSectorsPerCluster:BYTE;
  332.                             usReservedSectors:USHORT;
  333.                             cFATs:BYTE;
  334.                             cRootEntries:USHORT;
  335.                             cSectors:USHORT;
  336.                             bMedia:BYTE;
  337.                             usSectorsPerFAT:USHORT;
  338.                             usSectorsPerTrack:USHORT;
  339.                             cHeads:USHORT;
  340.                             cHiddenSectors:ULONG;
  341.                             cLargeSectors:ULONG;
  342.                             abReserved:ARRAY[0..5] OF BYTE;
  343.                             cCylinders:USHORT;
  344.                             bDeviceType:BYTE;
  345.                             fsDeviceAttr:USHORT;
  346.                 END;
  347.  
  348.     PSCREEGROUP=^SCREENGROUP;
  349.     SCREENGROUP=RECORD {pack 1}
  350.                       idScreenGrp:USHORT;
  351.                       fTerminate:USHORT;
  352.                 END;
  353.  
  354.     PFRAME=^FRAME;
  355.     FRAME=RECORD {pack 1}
  356.                 bCharsPerLine:BYTE;
  357.                 bLinesPerInch:BYTE;
  358.           END;
  359.  
  360.     PKBDTYPE=^KBDTYPE;
  361.     KBDTYPE=RECORD {pack 1}
  362.                   usType:USHORT;
  363.                   reserved1:USHORT;
  364.                   reserved2:USHORT;
  365.             END;
  366.  
  367.     PLINECONTROL=^LINECONTROL;
  368.     LINECONTROL=RECORD {pack 1}
  369.                      bDataBits:BYTE;
  370.                      bParity:BYTE;
  371.                      bStopBits:BYTE;
  372.                      fTransBreak:BYTE;
  373.                 END;
  374.  
  375. { MODEMSTATUS.fbModemOn, ASYNC_GETMODEMOUTPUT }
  376. CONST
  377.        DTR_ON                             =$01;
  378.        RTS_ON                             =$02;
  379.  
  380. { MODEMSTATUS.fbModemOff }
  381.        DTR_OFF                            =$FE;
  382.        RTS_OFF                            =$FD;
  383.  
  384. TYPE
  385.     PMODEMSTATUS=^MODEMSTATUS;
  386.     MODEMSTATUS=RECORD {pack 1}
  387.                      fbModemOn:BYTE;
  388.                      fbModemOff:BYTE;
  389.                 END;
  390.  
  391.     PTRACKFROMAT=^TRACKFORMAT;
  392.     TRACKFORMAT=RECORD {pack 1}
  393.                      bCommand:BYTE;
  394.                      usHead:USHORT;
  395.                      usCylinder:USHORT;
  396.                      usReserved:USHORT;
  397.                      cSectors:USHORT;
  398.                      FormatTable:RECORD
  399.                                       bCylinder:BYTE;
  400.                                       bHead:BYTE;
  401.                                       idSector:BYTE;
  402.                                       bBytesSector:BYTE;
  403.                                  END;
  404.                END;
  405.  
  406.     PRXQUEUE=^RXQUEUE;
  407.     RXQUEUE=RECORD {pack 1}
  408.                   cch:USHORT;
  409.                   cb:USHORT;
  410.             END;
  411.  
  412.     PDEVICEPARAMETERBLOCK=^DEVICEPARAMETERBLOCK;
  413.     DEVICEPARAMETERBLOCK=RECORD   { pack 1 }
  414.                               reserved1:USHORT;
  415.                               cCylinders:USHORT;
  416.                               cHeads:USHORT;
  417.                               cSectorsPerTrack:USHORT;
  418.                               reserved2:USHORT;
  419.                               reserved3:USHORT;
  420.                               reserved4:USHORT;
  421.                               reserved5:USHORT;
  422.                          END;
  423.  
  424.  
  425.    PPTRDRAWFUNCTION=^PTRDRAWFUNCTION;
  426.    PTRDRAWFUNCTION=RECORD {pack 2}
  427.                          usReturnCode:USHORT;
  428.                          pfnDraw:POINTER;
  429.                          pchDataSeg:PCH;
  430.                    END;
  431.  
  432.    PPTRDRAWADDRESS=^PTRDRAWADDRESS;
  433.    PTRDRAWADDRESS=RECORD {pack 2}
  434.                         reserved:USHORT;
  435.                         ptrdfnc:PTRDRAWFUNCTION;
  436.                   END;
  437.  
  438.    PSHIFTSTATE=^SHIFTSTATE;
  439.    SHIFTSTATE=RECORD {pack 2}
  440.                   fsState:USHORT;
  441.                   fNLS:BYTE;
  442.               END;
  443.  
  444.  
  445.  
  446. { HOTKEY.fsHotKey/SHIFTSTATE.fsState }
  447. CONST
  448.        RIGHTSHIFT                         =$0001;
  449.        LEFTSHIFT                          =$0002;
  450.        CONTROL                            =$0004;
  451.        ALT                                =$0008;
  452.        SCROLLLOCK_ON                      =$0010;
  453.        NUMLOCK_ON                         =$0020;
  454.        CAPSLOCK_ON                        =$0040;
  455.        INSERT_ON                          =$0080;
  456.        LEFTCONTROL                        =$0100;
  457.        LEFTALT                            =$0200;
  458.        RIGHTCONTROL                       =$0400;
  459.        RIGHTALT                           =$0800;
  460.        SCROLLLOCK                         =$1000;
  461.        NUMLOCK                            =$2000;
  462.        CAPSLOCK                           =$4000;
  463.        SYSREQ                             =$8000;
  464.  
  465. TYPE
  466.     PHOTKEY=^HOTKEY;
  467.     HOTKEY=RECORD {pack 2}
  468.                 fsHotKey:USHORT;
  469.                 uchScancodeMake:UCHAR;
  470.                 uchScancodeBreak:UCHAR;
  471.                 idHotKey:USHORT;
  472.            END;
  473.  
  474.    PMONITORPOSITION=^MONITORPOSITION;
  475.    MONITORPOSITION=RECORD { pack 2 }
  476.                         fPosition:USHORT;
  477.                         index:USHORT;
  478.                         pbInBuf:ULONG;
  479.                         offOutBuf:USHORT;
  480.                    END;
  481.  
  482.     PRATEDELAY=^RATEDELAY;
  483.     RATEDELAY=RECORD {pack 2}
  484.                     usDelay:USHORT;
  485.                     usRate:USHORT;
  486.               END;
  487.  
  488.     PCODEPAGEINFO=^CODEPAGEINFO;
  489.     CODEPAGEINFO=RECORD { pack 2}
  490.                       pbTransTable:PBYTE;
  491.                       idCodePage:USHORT;
  492.                       idTable:USHORT;
  493.                  END;
  494.  
  495.     PCPID=^CPID;
  496.     CPID=RECORD { pack 2}
  497.                idCodePage:USHORT;
  498.                Reserved:USHORT;
  499.          END;
  500.  
  501.     PLDTADDRINFO=^LDTADDRINFO;
  502.     LDTADDRINFO=RECORD { pack 2 }
  503.                      pulPhysAddr:PULONG;
  504.                      cb:USHORT;
  505.                 END;
  506.  
  507.     PPTRDRAWDATA=^PTRDRAWDATA;
  508.     PTRDRAWDATA=RECORD { pack 2 }
  509.                      cb:USHORT;
  510.                      usConfig:USHORT;
  511.                      usFlag:USHORT;
  512.                 END;
  513.  
  514. IMPLEMENTATION
  515.  
  516. BEGIN
  517. END.