
/***	MVDMGLBL.H
 *
 * Version: 1.2 , for src/dos/mvdm/mvdmglbl.h, vdmm, mer.krnl, 960610.1
 *
 *	Title:
 *
 * MVDM Kernel Global Reference Data Initialization Header File
 *
 *	Description:
 *
 *	Contains the MVDM Global Reference structure
 *
 * History:
 *      03/01/96 Ron Emerick New source file.
 */

/***    PROPERTY - property record (duplicate of vdmprop.c)
 *
 *      Records all relevant information for a registered VDD property.
 *
 *      Note:
 *      property type def is declared in vdmprop.c
 *      since we cant include vdmprop.c duplicate declaration here
*/

/* property type def is declared in vdmprop.c                 */
/* since we cant include vdmprop.c duplicate declaration here */
typedef struct prop { // prop
    char *      pszName;            // asciiz property name
    char *      pszHelp;            // asciiz help file name
    ULONG       idHelp;             // help id
    VPTYPE      vptype;             // property type
    VPORD       vpord;              // property ordinal
    ULONG       ulFlags;            // property flags
    int         cbValid;            // size of pvValid
    void *      pvValid;            // validation information
    int         cbValue;            // size of value (for VDDPROP_ENUM/STRING)
    void *      pvValue;            // default value
    PFNVDHRP    pfnvdhrp;           // set/validate function
    struct prop *pprop;             // next property in list
    BOOL        fScan;              // bit for scanning
} PROPERTY;
 typedef PROPERTY *PPROPERTY; // pprop


/***    GLDDREF - Global Data Reference Structure
 *
 *      Structure of pointers to MVDM global data
 */
struct mvdmglbl_s {

   // DOS emulation data (dem.c)
   CHAR                *pDemStartSession_CDS;  // current directory structure
   CHAR                *pszAutoexec;           // DOS autoexec
   CHAR                *pszFakeVersion;        // dem fakeout DOS version
   CHAR                *pszLastDrive;          // DOS Last drive
   CHAR                *pszDOSFiles;           // DOS files
   VPBOUND             *pvpboundDOSFiles;      // Validation data VDHRegister Property
   PFAKEVERINFO        *ppVerInfoHeadGlobal;   // fake version info structure
   SZ                  *pszRealTime;           // Property name
   SZ                  *pszVPICName;           // VPIC's filename
   HVDD                *phvddVPIC;             // vpic hndle
   PFN                 *ppfnSlaveRequest;      // pointer to slave request function
   DEMSTARTDATA        *pdemStartSession_data; // dem start session structure
   CHAR                *pszAutoexecSpec;       // path name autoexec
   ULONG               *pdemSS_next;           // DEM start session next
   ULONG               *pdemSS_curr;           // DEM start session current

   // em86 data (em86.c)
   IOP                 *piopDefault;           // default I/O hook entry
   IOP                 *piopIgnore;            // I/O hook entry for ports to ignore
   PBYTE               *ppvdmArpl;             // linear address of VDM BP ARPL instruction
   VPVOID              *pvpvdmIRet;            // VDM IRET instruction V86 address

   // em86 create/end dpmi data (em86vpm.c)
   BOOL        		  *pfVpmInitOK;           // VDM IRET instruction V86 address
   PFNDPMRTE   		  *ppfndpmInt31Rte;       // DPM VDD entry point INT 31h router
   PFNDPMSTART   	     *ppfndpmCreateTask;     // DPM VDD entry point DPMI task creation
   PFNDPMEND   		  *ppfndpmEndTask;        // DPM VDD entry point DPMI task termination

   // em86 dpmi routines data (em86vpmx.c)
   PDHD   				  *ppdhdBeforeHWInt;      // DPMI host data block

   // Initialize/Service for Mini-VDM for INT 13 DASD I/O (vdmint13.c)
   PVDMINT13           *ppVDMInt13;            // DiskDD Int 13 communication area.

   // VDM Manager data vdmm.c
   // MVDM state flags
   BOOL          		  *pfIsMVDMPresent;       // MVDM Present flag
   BOOL                *pfIsInitTime;          // Boot Time flag

   // VDM global memory and mapping list
   LA                  *plaGlobalMap;          // Linear Arena For VDM Global Memory Map
   HMAPID              *phmapid;               // Pid/SGid to HVDM Mapping List Head
   ULONG               *paErrorCode;           // error codes for VDHGetError

   // VPL Idle detection service addresses
   NPFN                *panpfnVPL;             // VPL Idle detection service addresses
   PSZ                 *ppszVpl;               // VPL NAME

   // PIC Mask state
   ULONG               *pulPICMaskState;       // Initial state of PIC Mask ports

   // VDM Events data table
   EH                  *paeh;                  // VDM Events data table

   // POS register values
   POSREGS             *pPS2POSRegs;           // POS register value
   PPOSREGS            *ppPS2POSRegs;          // POS register value pointer


   // System Configuration Table
   SYS_CONFIG_TABLE    *pSystem_config_table;  // System Configuration Table
   PSYS_CONFIG_TABLE   *ppSystem_config_table; // System Configuration Table pointer

   // VDM event Counts
   ULONG               *pnevents;              // Count of VDM events
   ULONG               *pnVDMCreated;          // Number of VDMs in the system

   // MISC globals
   ULONG               *pulMachineType;        // Machine Type for VDHQuerySysValue
   PVOID               *ppBlackHole;           // Black hole start address
   ULONG               *pcbBlackHole;          // size of blackhole


   // Addresses and sizes for VDD instance data and MVDM kernel instance data
   // heaps.
   ULONG               *pcbKrnlInstance;       // MVDM kernel instance data size(Fixed)
   ULONG               *pcbKrnlInstSwap;       // MVDM kernel instance data size(Swap)
   PVOID               *ppKrnlInstance;        // Global add of kernel inst. data (Fixed)
   PVOID               *ppKrnlInstSwap;        // Global add of kernel inst. data (Swap)
   PVOID               *ppVDDFixedInstStart;   // VDD instance data (fixed) start address
   PVOID               *ppVDDSwapInstStart;    // VDD instance data (swap)  start address
   PVOID               *ppKrnlFixed;           // VDD instance data (fixed) start address
   PVOID               *ppKrnlSwap;            // VDD instance data (swap)  start address

   // Lock handles returned by VDHLockMem
   LOCKENTRYHEAD       *plockentryhead;        // Head of lock entries
   PLOCKENTRYHEAD      *pplockentryhead;       // Head of lock entries pointer

   // VDD handles returned with DOSOpenVDD API
   PHDLVDD             *pphdlVddHead;          // VDD Handle list head

   // VDD entry point list heads
   PVDDEP              *ppvddepHead;           // Head of VDD entry points

   // Block Pools list head
   PBPH                *ppbphHead;             // Block Pools Head

   // Mutex Semaphore Handle for VDM Manager
   HKSEM               *phksemHVDD;            // VDD handles mutex
   HKSEM               *phksemHFault;          // Fault handlers mutex
   HKSEM               *phksemHLock;           // Lock entries mutex
   GSYSVAL             *paGSV;                 // Global system values for VDHQuerySysValue

   // VDM creation api data (vdmmcrt.c)
   HPROPINST           *phprinCreateVDM;       // Create VDM property instance
   PSZ                 *ppszDemCurrDir;        // dem current directory
   PSZ                 *ppszProgCreateVDM;     // program name
   PSZ                 *ppszArgsCreateVDM;     // program arguments
   CHAR                *pszFailureCause;       // failure cause
   SZ                  *pszEMSLowMem;          // EMS low memory

   // VDM heap data (vdmmheap.c)
   HEAP                *pahp;                  // VDD EXE object heaps

   // VDM properties engine data (vdmprop.c)
   HKSEM               *phksemPropertyBits;    // serialize property scan bits
   PPROPERTY           *pppropList;            // list of properties

   // VDH timer services data (vdmtime.c)
   TIMH                *ptimhTail;             // dummy tail timer node
   HOOKHEAD            *phookheadTIMH;         // head of armed timer list
   BOOL                *pfIsMarkOn;            // timer hook semaphore

};

 typedef struct mvdmglbl_s GBLDREF;
