/*static char *SCCSID = "@(#)pdb.h      6.5 92/03/01";*/

/*
 *      DOS Program Data Block
 *
 *      Process data block definitions (a.k.a. program header,
 *      PSP).  The process data block is the 256-byte magic area
 *      which prepends all .COM and .EXE files.  It dates back from
 *      the CP/M days and is described in the DOS manuals.
 */

/* XLATOFF */
#pragma title("Program Data Block")
/* XLATON  */

typedef struct Process_data_block {
ushort_t PDB_Exit_Call;      //0000 INT int_abort system terminate
ushort_t PDB_block_len;      //0002 size of execution block
uchar_t  PDB_Version_count;  //0004 [os/2] Fake DOS version count      *CAVEAT*
uchar_t  PDB_CPM_Call[5];    //0005 ancient call to system
ulong_t  PDB_Exit;           //000A pointer to exit routine
ulong_t  PDB_Ctrl_C;         //000E pointer to ^C routine
ulong_t  PDB_Fatal_abort;    //0012 pointer to fatal error
ushort_t PDB_Parent_PID;     //0016 PID of parent (terminate PID)      *CAVEAT*
uchar_t  PDB_JFN_Table[20];  //0018 indices into system table          *CAVEAT*
ushort_t PDB_environ;        //002C seg addr of environment
ulong_t  PDB_User_stack;     //002E stack of self during system calls  *CAVEAT*
ushort_t PDB_JFN_Length;     //0032 number of handles allowed          *CAVEAT*
ulong_t  PDB_JFN_Pointer;    //0034 pointer to JFN table               *CAVEAT*
ulong_t  PDB_Next_PDB;       //0038 pointer to nested PDB's            *CAVEAT*
uchar_t  PDB_InterCon;       //003C [dos4] ? accept interim char from console *CAVEAT*
uchar_t  PDB_Append;         //003D [dos4] ?                                  *CAVEAT*
ushort_t PDB_flags;          //003E [os/2] Info about EAs              *CAVEAT*
ushort_t PDB_Version;        //0040 [dos5] version returned int21, 30h *CAVEAT*
ushort_t PDB_Chain;          //0042 [windows]                          *CAVEAT*
ushort_t PDB_Partition;      //0044 [windows]                          *CAVEAT*
ushort_t PDB_NextPDB;        //0046 [windows]                          *CAVEAT*
ulong_t  PDB_GlobalHeap;     //0048 [windows]                          *CAVEAT*
ulong_t  PDB_Entry_stack;    //004C [windows]                          *CAVEAT*
uchar_t  PDB_Call_system[5]; //0050 portable method of system call
uchar_t  PDB_PAD2[7];        //0055 [dos5] reserved for extended-FCB1  *CAVEAT*
uchar_t  PDB_FCB1[16];       //005C only drive+name+ext (10 chars) are defined
uchar_t  PDB_FCB2[16];       //006C only drive+name+ext (10 chars) are defined
uchar_t  PDB_PAD3[4];        //007C
uchar_t  PDB_CmdLine[128];   //0080 Users command line (dos5 == PDB_TAIL)
} PDB;

typedef PDB *PPDB;

#define PDB_Novell_Used PDB_flags       //003E [dos5] Novell shell (redir) uses
#define PDB_TAIL        PDB_CmdLine     //0080 [dos5]
#define PDB_DEF_DTA     PDB_CmdLine     //0080 [windows]
#define PDB_5C_FCB      PDB_FCB1        //005C [windows]
#define PDB_6C_FCB      PDB_FCB2        //006C [windows]
