/*static char *SCCSID = "@(#)dem.h      6.7 92/01/06";*/
/***EM  dem.h - DOS Emulation Component Header
 *
 *      SCCSID = @(#)dem.h      6.7 92/01/06
 *
 *      SUMMARY
 *
 *      NOTES
 *
 *      REVISIONS
 *
 *   -  001     2/22/91   Mark Rogalski,   IBM
 *      CP20 DCR 1329  Add DOS=UMB  support
 *
 *   -  002     4/19/91   Mark Rogalski,   IBM
 *      CP20 DCR 1360  Add DOS=HIGH support
 *
 *      BN003   6/13/91   HARE, IBM
 *      CP20 PTR B722301  Added LASTDRIVE advanced properties
 *
 *   -  BN004   1/03/92   Mark Rogalski,   IBM
 *      CP20 PTR B731046  Allow a stringz size of 3 for LASTDRIVE property.
 *
 *      115120  3/30/95   ChgTeam
 *      Changed struct v86i_s' v86i_ausStack[] from 128 to 400 words of
 *      Init time stack space.  Some device drivers use more than 180 bytes of
 *      stack space so the original 128 words were not enough to satisfy its
 *      requirements thus the session would not start.
 */

#define MAXSHELLARGS    128     // Maximum number of shell arg chars

/***LT+ v86i - V86 Mode Initialization Stack Definition
 *
 *  This structure defines the variables passed to the V86 kernel
 *  on its initial stack.
 *
 */

struct v86i_s {
    USHORT v86i_segArenaHead;   // Base of the arena
    USHORT v86i_cParaArena;     // # of paragraphs in the arena
    USHORT v86i_cParaHigh;      // # of paragraphs in use at high arena
    USHORT v86i_fBreak;         // Value of CONFIG.SYS "BREAK" command
    USHORT v86i_Dos_Flag;       // Value of CONFIG.SYS "DOS=" statement  BC002
    SZZ *v86i_pszzDOSDDs;       // Pointer to DOS DD string
    SZ *v86i_pszShellSpec;      // Program Shell Specification
    SZ *v86i_pabShellArgs;      // SHELL arguments
    DOSDDTYPE *v86i_pSpecDD;    // Address of list of special DOS DD's
    UCHAR v86i_ubCurDrive;      // Current drive
    UCHAR v86i_ubBootDrv;       // Boot drive
    UCHAR v86i_ubLastDrive;     // Last Drive Parameter
    UCHAR v86i_filler;          // WORD Align Stack
//    USHORT v86i_ausStack[128];  // V86 mode init time stack  // 115120
    USHORT v86i_ausStack[400];  // V86 mode init time stack    // 115120
    } ;

/*end*/


typedef struct fakeverinfo_s {
    CHAR    szAppName[16];          // App name in 8.3 format with NULL
    UCHAR   cbAppNameLen;           // Length of the app for quick matches
    UCHAR   uchMajorVer;            // Major Fake Version
    UCHAR   uchMinorVer;            // Minor Fake Version
    UCHAR   uchFakeCount;           // Fake Count
    struct  fakeverinfo_s   *next;  // Next entry
}FAKEVERINFO;

typedef FAKEVERINFO *PFAKEVERINFO;

/***LK+ CSELDEMTEMP - Count of Temporary GDT Selectors used
 *
 *  This is the number of Temporary GDT selectors used for each
 *  VDM for converting pointers between 0:32 and 16:16.
 *
 */

#define CSELDEMTEMP     5       // In general, one for DS, and one for ES
                                // The third is reserved for the DTAddress

/*end*/

#define ISELDEMTEMP     0       // Temp selector
#define ISELDEMDS       1       // DS selector
#define ISELDEMES       2       // ES selector
#define ISELDEMDTA      3       // DTA Selector
#define ISELDEMFS       4       // Scratch to call filesys with instance object

/*** Equates for last drive validation ***/         /* BN003 */
                                                    /* BN003 */
#define VALIDDRIVE              0                   /* BN003 */
#define INVALIDDRIVE            1                   /* BN003 */
#define PROPERTY_MAX_DRIVE_STR  3                   /* BC004 */

/* XLATOFF */

/*
 *  C Macros
 */


#ifdef  DEMSTRICT
#define demassert(f) _assert(f)
#else
#define demassert(f)
#endif


/*
 *  Function prototypes
 */

ULONG   EXPENTRY  ValidateLastDrive(ULONG op, HVDM hvdm, ULONG cb, CHAR *pch);        /* BN003 */

/* Assembly routines called from C.  Internal to DOS Emulation.
 *
 */
INT PASCAL demOpenFile(PSZ, HFILE *, PULONG);
INT PASCAL demReadFile(HFILE, PVOID, ULONG, PULONG);
INT PASCAL demSeekFile(HFILE, ULONG, ULONG, PULONG);
INT PASCAL demCloseFile(HFILE);
INT PASCAL DEMInit(VOID);
/* XLATON */
