Device Request 13H: Generic IOCTL Request

Blk► Chr► Gen► 
 This tells the driver to process an "generic IOCTL" request.  These have a
 variety of uses, ranging from setting up code page fonts to formatting a
 hard disk.

  Offset Size Contents
  ▀▀▀▀▀▀ ▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
   +0      1  bLen         17H (length of this request packet)
   +1      1  bUnitNo      unit number (block drivers only)
   +2      1  bCmd         13H (command code)
   +3      2  rStatus      OUTPUT: Device Status Word must fill before exit
   +5H     8  res          (reserved)
  +0dH     1  bCategory    INPUT: device category
  +0eH     1  bMinorCode   INPUT: minor code
  +0fH     4  lRes         (reserved)
  +13H     4  pfIoctlData  addr of IOCTL data structure to process
          23               size of this structure

     rStatus  On exit, the driver must place a DevStatusWord here.  Always
              set the Done bit (bit 8).  On an error, set the Done bit and
              the Error bit (bit 15) and put a Device Error Code in the low

   bCategory  is the device category as passed in CH from DOS 440cH or 440dH
              (Generic IOCTL fns):
                01H=COMn (DOS 3.3+)
                03H=console (screen + keyboard) (DOS 3.3+)
                05H=parallel printer (DOS 3.2+)

  bMinorCode  is a subfn code, as passed in CL from DOS 440cH (Generic IOCTL
              for Character Devices):
                45H (set iteration count)             3.3+
                4aH (select a prepared code page)     3.3+
                4cH (begin preparing a code page)     3.3+
                4dH (done preparing a code page)      3.3+
                5fH (set display information)         4.0+
                65H (query retry iteration count)     3.3+
                6aH (query active code page)          3.3+
                6bH (get list of prepared code pages) 3.3+
                7fH (query display information)       4.0+

              or a subfn code, as passed in CL from DOS 440dH (Generic IOCTL
              for Block Devices):
                40H (set device parameters)           3.2+
                41H (write track)                     3.2+
                42H (format and verify track)         3.2+
                46H (set media ID)                    4.0+
                47H (set disk access flag)            4.0 only
                60H (get device parameters)           3.2+
                61H (read track)                      3.2+
                62H (verify track)                    3.2+
                66H (query media ID)                  4.0+
                67H (query disk access flag)          4.0 only
                68H (sense media type)                5.0+

 pfIoctlData  is the address of structure containing the data you'll need to
              process the request.  See:

                Generic IOCTL Data Packets

   Notes: ■ Only device drivers capable of handling generic IOCTL requests
            need support this request (see Device Attribute bit 6).

          ■ The driver must interpret the bCategory and bMinorCode fields
            in order to understand the request and the layout of the data
            (if any) at pfIoctlData.

          ■ Drivers may support a subset of the generic IOCTL services.
            See DvRq 19H and DOS fn 4410H and 4411H (query IOCTL support).

See Also: Device Requests
          Installable Device Drivers