/* CURRDIR.H */

#define NETWORK     (1 << 15)
#define PHYSICAL    (1 << 14)
#define JOIN        (1 << 13)
#define SUBST       (1 << 12)

typedef unsigned char BYTE;
typedef unsigned WORD;
typedef unsigned long DWORD;
typedef BYTE far *DPB;      // provide actual DPB struct if needed

#pragma pack(1)

typedef struct {
    BYTE current_path[67];  // current path
    WORD flags;             // NETWORK, PHYSICAL, JOIN, SUBST
    DPB  far *dpb;          // pointer to Drive Parameter Block
    union {
        struct {
            WORD start_cluster; // root: 0000; never accessed: FFFFh
            DWORD unknown;
            } LOCAL;        // if (! (cds[drive].flags & NETWORK))
        struct {
            DWORD redirifs_record_ptr;
            WORD parameter;
            } NET;          // if (cds[drive].flags & NETWORK)
        } u;
    WORD backslash_offset;  // offset in current_path of '\'
    // DOS4 fields for IFS
    // 7 extra bytes...
    } CDS;

CDS far *currdir(unsigned drive);
