/*static char *SCCSID = "@(#)fsdata.h   6.2 91/01/14";*/
/*      SCCSID = "@(#)fsdata.h  6.2 91/01/14"
 *
 *      IBM/Microsoft Confidential
 *
 *      Copyright (c) IBM Corporation 1987, 1989
 *      Copyright (c) Microsoft Corporation 1987, 1989
 *
 *      All Rights Reserved
 *
 */

/*
 *  FSDATA.H
 *
 *    DESCRIPTION
 *
 *      FSD global variable includes.
 *
 *
 *    FUNCTIONS DEFINED
 *
 *      None
 *
 *
 *  REVISION HISTORY (in reverse chronological order)
 *  -----------------------------------------------------------------------
 *  9/26/92     Frank Schroeder Added raw directory record (prdrGlobalRDR and
 *                              sRawDirRec) support for MSCDEX function.
 *
 *  5/15/90     Brian Andrew    Added boolean for quiet initialization.
 *
 *  4/19/90     Brian Andrew    Added semaphore and global variable for
 *                              list of semaphore structures.
 *
 *  4/9/90      Brian Andrew    Remove global filename buffers.
 *
 *  4/8/90      Brian Andrew    Added global semaphores.
 *
 *  4/4/90      Brian Andrew    Cosmetic cleanup from code review.
 *
 *  3/19/90     Brian Andrew    Added extern for clearing the cache.
 *
 *  3/12/90     Brian Andrew    Added extern declarations for messages.
 *
 *  2/2/90      Brian Andrew    Added globals for messages.
 *
 *  1/29/90     Brian Andrew    Added globals for cache and file reads.
 *
 *  12/19/89    Brian Andrew    Added globals for use in comparing strings.
 *
 *  12/4/89     Brian Andrew    Added global for use with FS_FSCTL to
 *                                  blind the FSD.
 *  11/16/89    Brian Andrew    Added global for FFRST_PARAMS to reduce
 *                                  stack usage.
 *  11/16/89    Brian Andrew    Added global for MOUNT_PARAMS to reduce
 *                                  stack usage.
 *  11/15/89    Brian Andrew    Added global for FIND_BUF_LOC to eliminate
 *                                  local stack usage in FindBuf ().
 *  11/15/89    Brian Andrew    Added global for RAW_PATH_ISO to reduce
 *                                  stack usage in RecoverPathTable.
 *  11/14/89    Brian Andrew    Added variables for supplemental
 *                                  volume descriptors escape sequence and
 *                                  boolean indicating which descriptor to
 *                                  use.
 *  10/4/89     Brian Andrew    Added global array for FS_PROCESSNAME.
 *  8/15/89     Brian Andrew    Memory management variables.
 *  8/4/89      Brian Andrew    Initial Blank Template.
 *
 *
 *  TO DO
 *  -------------------------------------------------------------------------
 */

/*
 *  Mandatory FSD variables to export.
 */

extern ULONG _FS_ATTRIBUTE;
extern CHAR _FS_NAME [];

/*
 *  Global variables which point to the free lists of memory chunks
 *
 */

extern  PBUF         pbFreeSec;


/*
 *  The following point to the start and end of sectors in memory.
 *  These lists contain the sectors used for all volumes managed by
 *  FSD.
 */

extern  PBUF     pbFirstPT;      /* start of PATH TABLE list */
extern  PBUF     pbLastPT;       /* last sector in PATH TABLE */
extern  PBUF     pbFirstSec;     /* first sector list */
extern  PBUF     pbLastSec;      /* last sector in list */

/*
 ** Flag indicating that initialization of memory has not
 *  taken place.
 *
 *      fNoMemInit      -   Indicates whether initial memory allocation
 *                          is complete.
 *
 *      cInitDone       -   Semaphore controlling access to initialization
 *                          routines.
 *
 */

extern BOOL             fNoMemInit;
extern UCHAR        cInitDone;

/*
 ***    The following identify ISO and HSG volumes
 *
 *
 */

extern UCHAR ISO_VOL_ID [];
extern UCHAR HSG_VOL_ID [];

/*
 *  The following are used to identify the self and parent directory strings
 *
 */

extern UCHAR szSelf [];
extern UCHAR szParent [];


#ifdef STATS_H
/*
 *  The following is used to store statistics.
 */

extern CDSTATS  CurSt;
#endif

/*
 *  The following is the pointer to the start of the HEAP list.
 */

extern  PHEAP   phHeapStart;

/*
 *  The following are the start of the linked lists for different chunks
 */

extern PBUF_LIST        pblGlobalBL;
extern PBUF             pbGlobalBuf;
extern PPATH_ENTRY      ppeGlobalPE;
extern PPATH_TABLE      pptGlobalPT;
extern PDIR_ENTRY       pdeGlobalDE;
extern PRAW_DIR_REC     prdrGlobalRDR;
extern PVOL_DESC        pvdGlobalVD;
extern PSEARCH_STRING   pssGlobalSS;
extern PRAW_PATH_ISO    prpiGlobalRPI;
extern PFIND_BUF_LOC    pfblGlobalFBL;
extern PMOUNT_PARAMS    pmpGlobalMP;
extern PFFRST_PARAMS    pffpGlobalFFP;
extern PSTRING_BUF      psbGlobalSB;
extern PLIST_SEM_BLK    plsbGlobalLSB;

/*
 *  The following are used to indicate which volume descriptor to use
 *  and what escape sequence to use with the supplemental volume
 *  descriptor.
 *
 *      fUsePrimaryVD   -   When TRUE, the primary is the default (and only)
 *                          volume descriptor used.  When FALSE, a valid
 *                          secondary volume descriptor is the first choice
 *                          and the primary is used if the secondary isn't
 *                          found.
 *
 *      pszVolEscSeq    -   Pointer to the escape sequence used to
 *                          recognize the secondary volume descriptor.
 */

extern  BOOL        fUsePrimaryVD;
extern  PCHAR       pszVolEscSeq;

/*
 *  The following are used to be able to blind the FSD.  The global
 *  'fMountEnabled' indicates whether the FSD will mount a volume.
 *  The string 'szResMount' is used in conjuction with a reserved
 *  function code when modifying the state of 'fMountEnabled'.
 *
 *      fMountEnabled   -   Flag indicating whether the FSD is to attempt
 *                          to mount any volumes.
 *
 *      szResMount      -   String used when disabling the FSD to check
 *                          for valid FSCTL command.
 *
 */
extern  BOOL    fMountEnabled;
extern  UCHAR   szResMount [];

#define LEN_RES_MOUNT       3


/*
 *  The following are used to be able to blind the FSD.  The global
 *  'fMountEnabled' indicates whether the FSD will mount a volume.
 *  The string 'szResMount' is used in conjuction with a reserved
 *  function code when modifying the state of 'fMountEnabled'.
 */
extern UCHAR   szResMount [];
extern USHORT  fMountEnabled;

#define LEN_RES_MOUNT       3

/*
 *  The following is used to clear the sector cache.
 */
extern UCHAR   szResCacheClear [];

#define LEN_RES_CACHE_CLEAR 6

/*
 *  The following are used to determine the number of segments to
 *  use for sector caching and to determine the maximum number of
 *  sectors to read at a time.
 */

extern USHORT cBufSegs;
extern USHORT cFileSectors;

/*
 *  The following are used to get messages from the message file
 */

extern  UCHAR   acUnknownMsg[];
extern  USHORT  cbUnknownMsg;

extern  UCHAR   acMsgBuffer[];
extern  UCHAR   acParm[];

/*
 *  The following are the MESSAGEs in msg.inc.
 */

extern MESSAGE _TXT_MSG_CDFS_BAD_OS_VERSION;
extern MESSAGE _TXT_MSG_CDFS_DEB_STAT_SIGNON;
extern MESSAGE _TXT_MSG_CDFS_DEB_SIGNON;
extern MESSAGE _TXT_MSG_CDFS_STAT_SIGNON;
extern MESSAGE _TXT_MSG_CDFS_SIGNON;
extern MESSAGE _TXT_MSG_CDFS_UNKNOWN_ERR_CODE;
extern MESSAGE _TXT_MSG_CDFS_BAD_PARM;
extern MESSAGE _TXT_MSG_CDFS_MIN_SECTORS;
extern MESSAGE _TXT_MSG_CDFS_DEBUG;
extern MESSAGE _TXT_MSG_CDFS_MAX_SECTORS;
extern MESSAGE _TXT_MSG_CDFS_MIN_FILE_SECT;
extern MESSAGE _TXT_MSG_CDFS_MAX_FILE_SECT;
extern MESSAGE _TXT_MSG_CDFS_PRIMARY_VD;
extern MESSAGE _TXT_MSG_CDFS_SECONDARY_VD;
extern MESSAGE _TXT_MSG_CDFS_SECTOR_CACHE;
extern MESSAGE _TXT_MSG_CDFS_SECTORS_READ;
extern MESSAGE _TXT_MSG_CDFS_INIT_FAIL;
extern MESSAGE _TXT_MSG_CDFS_MEM_INIT_FAIL;
extern MESSAGE _TXT_MSG_CDFS_PARTIAL_MEM_FAIL;
extern MESSAGE _TXT_MSG_CDFS_NO_INFOSEG;

/*
 *  The following semaphores control access to the global lists of
 *  structures.
 */
extern SEM sBuf;
extern SEM sSearchArray;
extern SEM sBufList;
extern SEM sPathEntry;
extern SEM sVolDesc;
extern SEM sDirEntry;
extern SEM sRawDirRec;
extern SEM sPathTable;
extern SEM sRawPathISO;
extern SEM sFindBufLoc;
extern SEM sMountParams;
extern SEM sFFrstParams;
extern SEM sHeap;
extern SEM sStringBuf;
extern SEM sFreeSec;
extern SEM sBLSec;
extern SEM sPTSec;
extern SEM sSemBlk;

/*
 *  The following flag indicates if initialization is silent.
 */
extern  BOOL    fSilentInit;


