.xlist
include osconst.inc
include dosseg.inc
include basemaca.inc
include osmaca.inc
include dossymc.inc
include devsym.inc
include except.inc
include sft.inc
include sigdef.inc
include vpb.inc
include protmode.inc
include seldesc.inc
include proc.inc
include pgexport.inc
include vmexport.inc
.list
include tkexport.inc
.xlist
include infoseg.inc
include sem.inc
include screen.inc
include curdir.inc
include dirent.inc
include harderr.inc
include find.inc
.list

TKCSEGTIB	EQU	4                
TKPTDAEXTSIG	EQU	'B'             
TASKDATA	SEGMENT
        PUBLIC  ptda_start
ptda_start      label   BYTE

	PUBLIC  pPTDAParent
pPTDAParent	DD	?
	PUBLIC  pPTDASelf
pPTDASelf	DD	?
	PUBLIC  pPTDAFirstChild
pPTDAFirstChild	DD	?
	PUBLIC  pPTDAExecChild
pPTDAExecChild	DD	?
        PUBLIC  pPTDANextZombie
        pPTDANextZombie label   DWORD

	PUBLIC  pPTDANextSibling
pPTDANextSibling	DD	?
        PUBLIC  pPTDAPrevZombie
        pPTDAPrevZombie label   DWORD

	PUBLIC  pPTDAPrevSibling
pPTDAPrevSibling	DD	?
        ReferFlat       SysInitProc,BYTE 

	PUBLIC  ptda_pszproc
ptda_pszproc	DD	offset FLAT:SysInitProc
	PUBLIC  ptda_pTCBHole
ptda_pTCBHole	DD	?
        PUBLIC  ptda_pTCB1
        ptda_pTCB1 label DWORD          

	PUBLIC  ptda_pTCBHead
ptda_pTCBHead	DD	?
	PUBLIC  ptda_cTCB
ptda_cTCB	DW	1
	PUBLIC  ptda_ctib
ptda_ctib	DW	?
	PUBLIC  ptda_avatib
ptda_avatib	DD	TKCSEGTIB DUP (-1)
        PUBLIC  ptda_flDbgEnabled
ptda_flDbgEnabled label DWORD           

ptda_pdcb	DD	?
	PUBLIC  ptda_flDbg
ptda_flDbg	DD	?
ptda_ah	DB	SIZE VMAH DUP (?)
	PUBLIC  ptda_pgdata
ptda_pgdata	DB	SIZE pgdatafake_s DUP (?)
	PUBLIC  ptda_environ
ptda_environ	DW	?
	PUBLIC  ptda_pBeginLIBPATH
ptda_pBeginLIBPATH	DD	?
ptda_pEndLIBPATH	DD	?
	PUBLIC  ptda_pgpc
ptda_pgpc	DB	SIZE pgpcfake_s DUP (?)
	PUBLIC  ptda_pPVDBPrc
ptda_pPVDBPrc	DD	?
	PUBLIC  ptda_pSGSList
ptda_pSGSList	DD	?
	PUBLIC  ptda_pexllist
ptda_pexllist	DD	?
ptda_cdllterm	DD	?
	PUBLIC  CDS_Handle
CDS_Handle	DW	26 DUP (?)
	PUBLIC  OEMPtr
OEMPtr	DW	?
	PUBLIC  VerFlg
VerFlg	DB	?
	PUBLIC  LCurDrv
LCurDrv	DB	?
	PUBLIC  PCurDrv
PCurDrv	DB	?
	PUBLIC  Fgnd
Fgnd	DB	?
	PUBLIC  FgndOnly
FgndOnly	DB	?
ptda_pad1	DB	?
	PUBLIC  ptda_pTCBCritSec
ptda_pTCBCritSec	DD	?
	PUBLIC  ptda_pTCBPriQCritSec
ptda_pTCBPriQCritSec	DD	?
	PUBLIC  ptda_cCritSec
ptda_cCritSec	DW	?
	PUBLIC  CurrentPDB
CurrentPDB	DW	?
	PUBLIC  seltss
seltss	DW	?
	PUBLIC  ProcFlag
ProcFlag	DW	?
	PUBLIC  ptda_ForcedActions
ptda_ForcedActions	DD	?
	PUBLIC  ptda_ulExitCode
ptda_ulExitCode	DD	?
	PUBLIC  ptda_ulExitType
ptda_ulExitType	DD	?
	PUBLIC  ptda_ulExitTID
ptda_ulExitTID	DD	?
	PUBLIC  ThisCDS
ThisCDS	DD	?
	PUBLIC  ptda_pCDS
ptda_pCDS	DW	0
	PUBLIC  CDSsize
CDSsize	DW	?
	PUBLIC  sPCB
sPCB	DW	0
ptda_pad5	DB	2 DUP (?)
	PUBLIC  ptda_pPCB
ptda_pPCB	DD	0
	PUBLIC  JFN_Max
JFN_Max	DW	?
	PUBLIC  NextSrchH
NextSrchH	DW	1
	PUBLIC  SrchRmp
SrchRmp	DD	?
	PUBLIC  FNotifyLocal_First
FNotifyLocal_First	DW	?
	PUBLIC  FNotifyLocal_Count
FNotifyLocal_Count	DW	?
	PUBLIC  Sig_ignf
Sig_ignf	DW	?
	PUBLIC  Sig_hndf
Sig_hndf	DW	?
	PUBLIC  Sig_errf
Sig_errf	DW	?
	PUBLIC  Sig_attempted
Sig_attempted	DW	?
	PUBLIC  Sig_arg
Sig_arg	DW	NSIG DUP (?)
Sig_termtid	DW	?
	PUBLIC  HoldSigCnt
HoldSigCnt	DW	?
SigFocusCnt	DW	?
	PUBLIC  JFN_Table
JFN_Table	DW	FILPERPROC DUP (SFN_NULL)
	PUBLIC  JFN_Flags
JFN_Flags	DB	FILPERPROC DUP (?)
	PUBLIC  ptda_rasflag
ptda_rasflag	DW	?
	PUBLIC  SysSemPTDATbl
SysSemPTDATbl	DB	SIZE SysSemPTDAStruc DUP (?)
	PUBLIC  SavedHardErr
SavedHardErr	DD	?
	PUBLIC  ptda_ptdasem
ptda_ptdasem	DB	SIZE KSEMMTX DUP (?)
	PUBLIC  ptda_DLMsem
ptda_DLMsem	DB	SIZE KSEMMTX DUP (?)
ptda_lidt	DW	3 DUP (?)
	PUBLIC  Csid
Csid	DW	?
	PUBLIC  Behav_bit
Behav_bit	DW	?
	PUBLIC  MSW
MSW	DW	?
	PUBLIC  ptda_rsrclist
ptda_rsrclist	DD	?
	PUBLIC  ptda_pldrdldHead
ptda_pldrdldHead	DD	?
	PUBLIC  pPrSemTbl
pPrSemTbl	DD	?
	PUBLIC  ulPrTblSize
ulPrTblSize	DD	?
	PUBLIC  ulPrTotUsed
ulPrTotUsed	DD	?
	PUBLIC  ulPrNextFree
ulPrNextFree	DD	?
	PUBLIC  hksPrTbl
hksPrTbl	DD	?
	PUBLIC  pShSemBmp
pShSemBmp	DD	?
	PUBLIC  ulShBmpSize
ulShBmpSize	DD	?
	PUBLIC  hksShBmp
hksShBmp	DD	?
	PUBLIC  ulMtxOwned
ulMtxOwned	DD	?
ptda_TLMA	DD	?
ptda_TLMABM	DB	TLMA_MAX_BME DUP (?)
ptda_TLMASizeMap	DB	TLMA_MAX_VARS DUP (?)
	PUBLIC  Cons_Loc
Cons_Loc	DB	SIZE Cons_Locus DUP (?)
	PUBLIC  SysCallSfcn
SysCallSfcn	DB	?
	PUBLIC  SysCall
SysCall	DB	?
	PUBLIC  KBD_Mode
KBD_Mode	DB	?
	PUBLIC  ptda_NewFiles
ptda_NewFiles	DB	TCBNEWFILES or TCBKNOWEAS
	PUBLIC  AutoFail
AutoFail	DB	?
	PUBLIC  CP_Flgs
CP_Flgs	DB	fCP_DBCS
	PUBLIC  Sig_vec
Sig_vec	DD	NSIG DUP (?)
	PUBLIC  Exc_vec
Exc_vec	DD	EXCUSR DUP (?)
ptda_timerhead  DD       ?
	PUBLIC  ptda_extsig
ptda_extsig	DB	TKPTDAEXTSIG
ptda_pad6	DB	3 DUP (?)
pPvwDataBlk	DD	?
	PUBLIC  ptda_lanman_sec
ptda_lanman_sec	DD	?
	PUBLIC  SigFTerm
SigFTerm	DW	?
	PUBLIC  ptda_ppgdata
ptda_ppgdata	DW	offset ptda_pgdata
	PUBLIC  ptda_child
ptda_child	DW	?
	PUBLIC  ptda_childalias
ptda_childalias	DW	?
	PUBLIC  ptda_handle
ptda_handle	DW	?
	PUBLIC  ptda_module
ptda_module	DW	?
	PUBLIC  ptda_ldthandle
ptda_ldthandle	DW	?
	PUBLIC  ptda_ldtpgmap
ptda_ldtpgmap	DW	?
	PUBLIC  ptda_ldtaddr
ptda_ldtaddr	DD	?
	PUBLIC  CP_CaseMapTbl
CP_CaseMapTbl	DD	?
	PUBLIC  codepage_tag
codepage_tag	DW	?
	PUBLIC  JFN_Length
JFN_Length	DW	FILPERPROC
	PUBLIC  JFN_pTable
JFN_pTable	DD	?
	PUBLIC  JFN_Flg_Ptr
JFN_Flg_Ptr	DD	?
ptda_pad	DB	1 DUP (?)
	PUBLIC  ExtErr_Locus
ExtErr_Locus	DB	?
	PUBLIC  ExtErr
ExtErr	DW	?
	PUBLIC  ExtErr_Action
ExtErr_Action	DB	?
	PUBLIC  ExtErr_Class
ExtErr_Class	DB	?
        PUBLIC  Pid
        PUBLIC  Ppid
        PUBLIC  ProcType
        PUBLIC  ProcStatus
        PUBLIC  ptda_infoseg
ptda_infoseg    label   BYTE
                .errnz  ($ - ptda_infoseg) - LIS_CurProcID
Pid             DW      ?       
                .errnz  ($ - ptda_infoseg) - LIS_ParProcID
Ppid            DW      ?       
                DW      ?       
                DW      ?       
                DW      ?       
ProcStatus      DB      ?       
                DB      ?       
                DW      ?       
                .errnz  ($ - ptda_infoseg) - LIS_ProcType
ProcType        DB      ?       
                DB      SIZE InfoSegLDT - ($ - ptda_infoseg) DUP (?)

	PUBLIC  ptda_vme
ptda_vme	DB	0
ptda_pad3	DB	?
	PUBLIC  CurrTCB
CurrTCB	DW	?
	PUBLIC  CurrTSD
CurrTSD	DW	?
	PUBLIC  ThisPTDA
ThisPTDA	DW	?
	PUBLIC  ptda_NPX_em_cs
ptda_NPX_em_cs	DW	?
	PUBLIC  ptda_NPX_em_eip
ptda_NPX_em_eip	DD	?
ptda_pad4	DW	?
	PUBLIC  ptda_signature
ptda_signature	DB	"TD"
	.ERRNZ  ($-ptda_signature) - (2 * 1)
ptda_size equ   ($ - ptda_start)
TASKDATA	ENDS

ifdef ptda_s
CBPTDA	EQU	SIZE          ptda_s 
TKOPTDA	EQU	(64 *1024  - CBPTDA)
TKOTCB1	EQU	(TKOPTDA - SIZE          tcb_s )
ifdef PAGEMASK
TKOTSD	EQU	((TKOTCB1 - SIZE          tsd_s )  AND   NOT PAGEMASK)
   endif
   else
        CBPTDA  equ     ptda_size
   endif
   .errnz (CBPTDA and 3)
   .errnz (CBPTDA GT 2000h) 


TCBcount	EQU	ptda_cTCB
ptda_ppib       equ     (dword ptr ptda_avatib)
ptda_Pid        equ     (word ptr ptda_infoseg.LIS_CurProcID)
ptda_Ppid       equ     (word ptr ptda_infoseg.LIS_ParProcID)
ptda_ProcType   equ     (byte ptr ptda_infoseg.LIS_ProcType)
ptda_ProcStatus equ     (byte ptr ptda_infoseg.LIS_ProcStatus)
ptda_CurScrnGrp equ     (word ptr ptda_infoseg.LIS_CurScrnGrp)

TASKDUMMY SEGMENT

        db      (64*1024 - ((ptda_size + 3) AND 0FFFCh)) dup(?)

TASKDUMMY ENDS

END
