/*static char *SCCSID = "@(#)dpb.h      6.3 91/04/29";*/
/*      Drive Parameter Block
 *
 * SCCSID = @(#)dpb.h   6.3 91/04/29
 *
 * Vital information about the format of a disk drive.
 *
 *---+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
 *           C  A  V  E  A  T     P  R  O  G  R  A  M  M  E  R             ;
 *
 */

struct dpb {
    BYTE        dpb_drive;      // Logical drive # assoc with DPB (A=0,B=1,...)
    BYTE        dpb_unit;       // Driver unit number of DPB
    ULONG       dpb_driver_addr;// Pointer to driver
    struct dpb *dpb_next_dpb;   // Pointer to next Drive parameter block
    USHORT      dpb_cbSector;   // sector size (for volume checking)
    USHORT      dpb_first_FAT;  // sector of 1st FAT (for ancient dev drivers)
    ULONG       dpb_toggle_time;// time of last drive toggle
    USHORT      dpb_hVPB;       // handle of volume currently in drive
    BYTE        dpb_media;      // most recent media that was in drive
    BYTE        dpb_flags;      // synchronization flags (see below)
    USHORT      dpb_drive_lock; // Contains pid if drive locked by process
    ULONG       (*dpb_strategy2)(void); // strategy2 addr (or 00000000)
};

#define DPBCHECK        0x10    // disk in drive is being removed/checked for VPB

#define DPBNONREMOV     0x20    // 1 => drive supports non-removable media
#define DPBVCRAMDISK    0x40    // Ram Disk Driver

/*  dpb3x - DOS 3.2 version of DPB
 *
 *  This structure is used to fill in a static DPB, whose address is returned
 *  by the $Get_DPB calls.
 */

struct dpb3x {
    BYTE        dpb3x_drive;            // Logical drive # assoc with DPB (A=0,B=1,...)
    BYTE        dpb3x_UNIT;             // Driver unit number of DPB
    USHORT      dpb3x_sector_size;      // Size of physical sector in bytes
    BYTE        dpb3x_cluster_mask;     // Sectors/cluster - 1
    BYTE        dpb3x_cluster_shift;    // Log2 of sectors/cluster
    USHORT      dpb3x_first_FAT;        // Starting record of FATs
    BYTE        dpb3x_FAT_count;        // Number of FATs for this drive
    USHORT      dpb3x_root_entries;     // Number of directory entries
    USHORT      dpb3x_first_sector;     // First sector of first cluster
    USHORT      dpb3x_max_cluster;      // Number of clusters on drive + 1
    BYTE        dpb3x_FAT_size;         // Number of records occupied by FAT
    USHORT      dpb3x_dir_sector;       // Starting record of directory
    ULONG       (*dpb3x_driver_addr)(void); // Pointer to driver
    BYTE        dpb3x_media;            // Media byte
    BYTE        dpb3x_first_access;     // This is initialized to -1 to force a media
                                        // check the first time this DPB is used
    struct dpb *dpb3x_next_dpb;         // Pointer to next Drive parameter block
    USHORT      dpb3x_next_free;        // Cluster # of last allocated cluster
    USHORT      dpb3x_free_cnt;         // Count of free clusters, -1 if unknown
};


/*  dpb4x - DOS 4.0 and 5.0 version of DPB
 *
 *  This structure is used to fill in a static DPB, whose address is returned
 *  by the $Get_DPB calls.
 */

struct dpb4x {
    BYTE        dpb4x_drive;            // Logical drive # assoc with DPB (A=0,B=1,...)
    BYTE        dpb4x_UNIT;             // Driver unit number of DPB
    USHORT      dpb4x_sector_size;      // Size of physical sector in bytes
    BYTE        dpb4x_cluster_mask;     // Sectors/cluster - 1
    BYTE        dpb4x_cluster_shift;    // Log2 of sectors/cluster
    USHORT      dpb4x_first_FAT;        // Starting record of FATs
    BYTE        dpb4x_FAT_count;        // Number of FATs for this drive
    USHORT      dpb4x_root_entries;     // Number of directory entries
    USHORT      dpb4x_first_sector;     // First sector of first cluster
    USHORT      dpb4x_max_cluster;      // Number of clusters on drive + 1
    USHORT      dpb4x_FAT_size;         // Number of records occupied by FAT
    USHORT      dpb4x_dir_sector;       // Starting record of directory
    ULONG       (*dpb4x_driver_addr)(void); // Pointer to driver
    BYTE        dpb4x_media;            // Media byte
    BYTE        dpb4x_first_access;     // This is initialized to -1 to force a media
                                        // check the first time this DPB is used
    struct dpb *dpb4x_next_dpb;         // Pointer to next Drive parameter block
    USHORT      dpb4x_next_free;        // Cluster # of last allocated cluster
    USHORT      dpb4x_free_cnt;         // Count of free clusters, -1 if unknown
};

#define DSKSIZ  dpb4x_max_cluster       // 60492
/*                                                                         ;
 *           C  A  V  E  A  T     P  R  O  G  R  A  M  M  E  R             ;
 *---+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
 */
