/*static char *SCCSID = "@(#)smrsgcb.h  6.4 92/01/26";*/
/****************************************************************************/
/*                                                                          */
/*                       IBM/Microsoft Confidential                         */
/*                                                                          */
/*                 Copyright (c) IBM Corporation  1987, 1990                */
/*                 Copyright (c) Microsoft Corp.  1987, 1990                */
/*                           All Rights Reserved                            */
/*                                                                          */
/****************************************************************************/

/*****************************************************************************/
/*******   C H A N G E       H I S T O R Y   *********************************/
/*****************************************************************************/
/*                                                                          */
/* @T14  - 03/28/90 - Move KBD_REG_OWNER from KBDSTRUC.INC here             */
/* @GDW  - 08/29/91 - PTR B726157 - Combine KIO and MIO into MKIO router    */
/* @GDW  - 10/19/91 - PTR B728410 - Registered Subsystem address needs to   */
/*                                  have DosLoadModule and DosGetProcAddr   */
/*                                  API's called for each process.          */
/* @GDW  - 03/03/93 - DEF 063131  - Clean up unused variables.              */
/* Malchak 05/04/93 - PTR 65349   - Module name has to reflect a fully      */
/*                                  Qualified Path name                     */

struct SGCB{                        /* Session Manager data area            */
   USHORT   Reserved;               /* Reserves for Session Manger use      */
   ULONG    SGCB_Next;              /* Next active screen group address     */
   ULONG    SGCB_Previous;          /* Previous active screen group CB      */
   USHORT   SGCB_ID;                /* Screen group number                  */
   USHORT   SGCB_PID;               /* Process id                           */
   USHORT   SGCB_Reserved;          /* zeroed from exec                     */
   USHORT   SGCB_Type;              /* FS, VIO, PM, FS-VDM, Windowed-VDM    */
   USHORT   SGCB_Bound;             /* Child screen group bound             */
   USHORT   SGCB_Flags;             /* Screen group flags                   */
   USHORT   SGCB_FirstChild;        /* First child SG Number                */
   USHORT   SGCB_Relative;          /* Next child or parent screen group #  */
   USHORT   SGCB_BackRelative;      /* Previous child or 0 screen group #   */
   USHORT   SGCB_ParentSID;         /* Parent screen group number           */
   USHORT   SGCB_ParentPID;         /* Session's parent process ID          */
   USHORT   SGCB_ParentTermQ;       /* Parent's termination queue handle    */
   USHORT   SGCB_ParentExit;        /* Parent's exit list in progress       */
   USHORT   SGCB_SelectStatus;      /* Selectability status                 */
   USHORT   SGCB_FamilyType;        /* Independent/child/parent             */
   USHORT   SGCB_CWaitThread;       /* Dedicated thread ID                  */
   USHORT   SGCB_CWaitStack;        /* Dedicated thread stack               */
   USHORT   SGCB_DebuggerSID;       /* If debugger is being used            */
   USHORT   SGCB_DebuggerPID;       /* If debugger is being used            */
   USHORT   SGCB_Title;             /* Screen group title offset            */

   /* Screen Switcher data area */

   USHORT   KBD_Owner;
/* ULONG    SSW_CB;    */           /* pointer to SSW SGCB                  */

   /* Base video router data area */

   USHORT   VIO_Maskloest;          /* quad word AVS fnction mask   must    */
   USHORT   VIO_Masklo;             /*                              be      */
   USHORT   VIO_Maskhi;             /*                              1st 4   */
   USHORT   VIO_Maskhiest;          /*                              words   */
   USHORT   VIO_BVS_Mask;           /* Compressed mask for BVS              */
   ULONG    VIO_Avscbptr;           /* Pointer to AVS data                  */
   USHORT   VIO_SG_Init;            /* Session initialization flag          */
   USHORT   VIO_Times;              /* inc'd each VIOREGISTER/VIODEREGISTER */
   CHAR     VIO_Filler_1;           /* keep data word aligned               */
   CHAR     VIO_Paused;             /* 0=no pause, 1=pause                  */
   ULONG    VIO_Pause_Sem;          /* sem for SESMGR (CTRL-NUMLOCK/CTRL-S) */
   USHORT   VIO_SrwPID;             /* VIOSAVREDRAWWAIT thread's PID and TID*/
   USHORT   VIO_SrwtID;             /*                                      */
   USHORT   VIO_SmwPID;             /* VIOMODEWAIT thread's PID and TID     */
   USHORT   VIO_SmwtID;             /*                                      */
   ULONG    VIO_ShieldRAMSem;       /* RAMsem to protect shieldPID          */
   USHORT   VIO_ShieldPID;          /* owner of SHIELD functions            */
   USHORT   VIO_CodePageID;         /* Current CodePage                     */
   USHORT   VIO_DBCSFlag;           /* set to 1 if VIOSETCP is called       */
   CHAR     VIO_DBCSRangeBuf[10];   /* data area for call to DOSGETDBCSEV   */
   CHAR     VIO_FSRAMSem[14];       /* per screen group FS RAM sem. structur*/
   CHAR     VIO_FSRAMSGInit[14];    /* per screen group init FS RAM sem.    */

   /* Keyboard router data area */

   ULONG    KBD_Mask;               /* Indicates APIs that are registered   */
   USHORT   KBD_FGND_PID;           /* PID that has the foreground boost    */
   USHORT   KBD_FocusHandle;        /* KbdGetFocus/KbdFreeFocus Handle      */
   USHORT   KBD_FocusPID;           /* KbdGetFocus/KbdFreeFocus PID         */
   DOSFSRSEM KBD_SynchSem;          /* KbdSynch semaphore                   */
   struct ALTCB FAR *KBD_AKSCB;     /* Pointer to Alt Keyboard Subsys data  */

   /* Mouse router data area */

   ULONG    MOU_Mask;               /* Registration mask                    */
   DOSFSRSEM MOU_SynchSem;          /* MouSynch semaphore                   */
   struct ALTCB FAR *MOU_AMSCB;     /* Pointer to Alt Mouse SubSys data     */

   /* Mouse subsystem data area */

   CHAR     BMS_AppPtrDrawName[8];  /* App-specified ptr draw routine       */
   USHORT   BMS_InitFlag;           /* BMS Session Init Flag                */
   USHORT   BMS_OwnerPID;           /* Owner PID                            */
   USHORT   BMS_OwnerHandle;        /* Owner mouse DD handle                */
   USHORT   BMS_BvsMouHandle;       /* BVS Mouse DD Handle                  */
   struct TextCB FAR *BMS_TextCB;   /* Pointer to Text Window structure     */
   DOSFSRSEM BMS_OpenCloseFSSem;    /* Open/close FS RAM semaphore          */

   USHORT    ROUT_InitFlag;         /* MKIOCALL Session Init Flag   @GDW    */
};

typedef struct ALTCB{
   USHORT AMSCB_reserved;           /* Reserved for Session Manager use     */
   USHORT PID;                      /* Pid that registered Alt SubSystem    */
   USHORT Handle;                   /* Alt SubSystem Handle                 */
   CHAR   EntryPoint[33];           /* Alt SubSystem Entry Point            */
/* CHAR   ModuleName[9];  old way =9   Alt SubSystem Module Name (DLL)      */
/*                        Malchak - PTR 65349 Fix follows.  Length=256+4    */
   CHAR   ModuleName[CCHMAXPATH];   /* Alt SubSystem Module Name (DLL)      */
};

typedef struct TextCB{
  USHORT   TextCB_reserved;         /* Reserved for Session Manager use     */
  USHORT   PtrBuffer[2];            /* default pointer bit image            */
  USHORT   PtrDefRec[5];            /* default pointer shape record         */
  USHORT   Threshold[5];            /* Threshold Calc. Array                */
};

#define CBSIZE sizeof(struct ALTCB) /* Size of the Alt Mouse Subsys CB      */
#define TEXTCBSIZE sizeof(struct TextCB) /*Size of the Base Mouse Subsys CB */

