
/*--------------------------------------------------------------------*/
/*                                                                    */
/*                                                                    */
/*                                                                    */
/*                                                                    */
/*                                                                    */
/*                                                                    */
/*                                                                    */
/*                                                                    */
/*--------------------------------------------------------------------*/

/*--------------------------*/
/*                          */
/*                          */
/*--------------------------*/

typedef struct _DDB     *PDDB;

typedef struct _TRKTBL                 /* track layout table entry       */
{
  USHORT    SecNum;                    /* sector number                  */
  USHORT    SecSize;                   /* size of sector in bytes        */

} TRKTBL;

#pragma pack(1)
typedef struct _IOPKT                  /* parameter packet format for     */
{                                      /* category 8 or 9 IOCTLs          */
  UCHAR       Cmd;                     /* bit 0 = 1 track layout starts   */
                                       /*           with sector 1 and     */
                                       /*           contains only         */
                                       /*           consecutive sectors   */
                                       /*       = 0 track layout contains */
                                       /*           non-consecutive sec   */
                                       /*           or does not start     */
                                       /*           with sector 1         */
                                       /* bit 7-1 must be 0               */
  USHORT      Head;
  USHORT      Cyl;
  USHORT      FirstSec;
  USHORT      NumSec;                  /* number of sectors specified in  */
                                       /* the track layout table          */
                                       /* note: auto head advance is not  */
                                       /*       is not supported          */
  TRKTBL      TrkTbl[255];             /* Track Layout Table              */

} IOPKT;
#pragma pack()

typedef struct _DDB                    /* Device Driver control Block     */
{
  ULONG         hDevice;               /* device handle DD_OpenDisk       */
  IOPKT         IOPkt;                 /* DD IOCTL parameter packet       */

} DDB;

#define IOCTL_PHYS_DISK         0x09   /* physical disk IOCTL category    */
#define IOCTL_LOG_DISK          0x08   /* logical disk IOCTL category     */
#define IOCTL_GET_DISK_PARMS    0x63   /* query physical device parameter */
#define IOCTL_READ_TRACK        0x64   /* IOCTL track read                */
#define IOCTL_WRITE_TRACK       0x44   /* IOCTL track write               */
