DefaultDynamic	EQU	1        
DefaultMaxWait	EQU	3        
DefaultMaxSlice	EQU	32       
DefaultMinSlice	EQU	32       
DefaultMaxThreads	EQU	64       
STATE_VOID	EQU	0        
STATE_READY	EQU	1        
STATE_BLOCKED	EQU	2        
STATE_SUSPENDED	EQU	3        
STATE_CRITSEC	EQU	4        
STATE_RUNNING	EQU	5        
STATE_READYBOOST	EQU	6        
STATE_TSD	EQU	7        
STATE_DELAYED	EQU	8        
STATE_FROZEN	EQU	9        
STATE_GETSTACK	EQU	10        
STATE_BADSTACK	EQU	11        
STATE_MAX	EQU	12        
RESCHED_PREEMPT	EQU	01H     
RESCHED_RELINQUISH	EQU	02H     
RESCHED_TIMESLICE	EQU	04H     
RESCHED_CRITSLICE	EQU	08H     
SCH_PROTECTED_PRI	EQU	0001H   
SCH_WINDOWBOOST_LOCK	EQU	0002H   
SCH_MINSLICE	EQU	0004H   
SCH_PAGE_FAULT	EQU	0008H   
SCH_PAGE_FAULT_BIT	EQU	03H     
SPFLAGS_PM_EVENT	EQU	0008H   
PM_EVENT_RESET	EQU	 NOT SPFLAGS_PM_EVENT 
SPFLAGS_FGND_DISKIO	EQU	0080H   
SPFLAGS_XTIME_SLICE	EQU	0040H   
SPFLAGS_PGFAULT	EQU	0010H   
SCOPE_PROCESS	EQU	0 
SCOPE_FAMILY	EQU	1 
SCOPE_THREAD	EQU	2 
SCOPE_SCREENGROUP	EQU	3 
SCOPE_GIVEMSG	EQU	8 
SCOPE_TAKEMSG	EQU	9 
SCOPE_SLOTNUM	EQU	10 
CLASSMOD_KEYBOARD	EQU	04H     
CLASSMOD_STARVED	EQU	08H     
CLASSMOD_DEVICE	EQU	10H     
CLASSMOD_FOREGROUND	EQU	20H     
CLASSMOD_WINDOW	EQU	40H     
CLASSMOD_VDM_INTERRUPT	EQU	80H     
CLASS_NOCHANGE	EQU	00H     
CLASS_IDLE_TIME	EQU	01H     
CLASS_REGULAR	EQU	02H     
CLASS_TIME_CRITICAL	EQU	03H     
CLASS_SERVER	EQU	04H     
LEVEL_MIN	EQU	0 
LEVEL_MAX	EQU	31 
DELTA_NOCHANGE	EQU	0 
DELTA_MAX	EQU	LEVEL_MAX
DELTA_MIN	EQU	-LEVEL_MAX



















SlotToTCB       macro   slot,ptcb
        movzx   ptcb,slot
        lea     ptcb,[ptcb*4]
        add     ptcb,[_papTCBSlots]
        mov     ptcb,[ptcb]
        endm
























MapZeroSlot     macro   slot,ptcb
        local   mzs1
        cmp     slot,0
        jne     short mzs1

        mov     ptcb,[_pTCBCur]
        mov     slot,[ptcb].TCBNumber   
mzs1:
        endm

