PT_16BIT	EQU	0 
PT_32BIT	EQU	1 

ldrmi_s	STRUC
ldrmi_ldtype	DW	?
ldrmi_attrib	DW	?
ldrmi_startaddr	DB	SIZE ptr_t DUP (?)
ldrmi_stackptr	DB	SIZE ptr_t DUP (?)
ldrmi_stackbase	DD	?
ldrmi_heap	DW	?
ldrmi_autods	DW	?
ldrmi_phaddr	DB	SIZE ptr_t DUP (?)
ldrmi_phflag	DW	?
ldrmi_s	ENDS

ldrmi_t struc
db size ldrmi_s dup(?)
ldrmi_t ends


LDRGetSem macro
ifndef  _KSEMRequestMutex
        EXTRN32 _KSEMRequestMutex
endif
ifndef  _KSEMQueryMutex
        EXTRN32 _KSEMQueryMutex
endif
ifndef  _KSEMReleaseMutex
        EXTRN32 _KSEMReleaseMutex
endif
ifndef  _LdrSem
        ReferFlat       _LdrSem,DWORD
endif
        CCALL32 _KSEMRequestMutex, <<offset FLAT:_LdrSem>, -1>
        endm

 
LDR_16bit	EQU	0                
LDR_32bit	EQU	1                
LDR_PORTHOLE	EQU	2                
LDRPROGRAM	EQU	1H    
LDRLIBRARY	EQU	2H    
LDRDEVICE	EQU	4H    
LDRFSD	EQU	8H    
LDRLIBINIT	EQU	10H   
LDRGLOBALSETUP	EQU	20H   
LDRDLLTERM	EQU	40H   
LDRGLOBALDONE	EQU	80H   
QAT_DYNLINK	EQU	00000010H 
QAT_DOSEXE	EQU	00000020H 
QAT_PDD	EQU	00000040H 
QAT_VDD	EQU	00000080H 
QAT_PROTDYNLINK	EQU	00000100H 
QAT_WINDOWS_REAL	EQU	00000200H       
QAT_WINDOWS_PROT	EQU	00000400H       
QAT_WINDOWS_PROT31	EQU	00001000H       
QAT_BOUNDEXE	EQU	00000800H 
QAT_32BIT	EQU	00004000H 
QAT_NOPMW	EQU	0100H           
QAT_PMW	EQU	0200H           
QAT_PMAPI	EQU	0300H           
QAT_EXETYPE	EQU	0700H 
QAT_EXETYPE_VDD	EQU	QAT_VDD
QAT_MASK	EQU	( QAT_EXETYPE  OR  QAT_BOUNDEXE )
QAT_EXETYPE_MASK	EQU	( QAT_MASK   SHR  8  )
QAT_EXETYPE_PMAPI	EQU	( QAT_PMAPI  SHR  8  )
QAT_EXETYPE_PMW	EQU	( QAT_PMW    SHR  8  )  
QAT_EXETYPE_NOPMW	EQU	( QAT_NOPMW  SHR  8  )  

ldrrei_s	STRUC
ei_startaddr	DB	SIZE ptr_t DUP (?)
ei_stackaddr	DB	SIZE ptr_t DUP (?)
ei_pstackmax	DB	SIZE ptr_t DUP (?)
ei_ds	DW	?
ei_stacksize	DW	?
ei_heapsize	DW	?
ei_loadtype	DW	?
ldrrei_s	ENDS

ldrrei_t struc
db size ldrrei_s dup(?)
ldrrei_t ends


ldrlf_s	STRUC
lf_pallocbuf	DD	?
lf_faultaddr	DD	?
lf_sallocbuf	DD	?
lf_objaddr	DD	?
lf_bno	DD	?
lf_hMTE	DW	?
ldrlf_s	ENDS

ldrlf_t struc
db size ldrlf_s dup(?)
ldrlf_t ends


ldroi_s	STRUC
oi_size	DD	?
oi_base	DD	?
oi_flags	DD	?
oi_pagemap	DD	?
ldroi_s	ENDS

ldroi_t struc
db size ldroi_s dup(?)
ldroi_t ends


ldrpi_s	STRUC
pi_attrib	DB	?
ldrpi_s	ENDS

ldrpi_t struc
db size ldrpi_s dup(?)
ldrpi_t ends

ZEROHNDL	EQU	1                
ZEROSEL	EQU	2                

adce_s	STRUC
adce_ring0	DW	?
adce_ring3	DW	?
adce_s	ENDS

AUXORD_DOSGETINFOSEG	EQU	0 
AUXORD_DOSLOCALINFO	EQU	1 
AUXORD_DOSGLOBALINFO	EQU	2 
AUXORD_DOSFLATDS	EQU	3 
AUXORD_DOSFLATCS	EQU	4 
AUXORD_DOSTIB	EQU	5 
LDRDWFIRSTCMD	EQU	1      
LDRDWDDIFSDONE	EQU	1      
LDRDWSYIDONE	EQU	2      
LDRDWLASTCMD	EQU	2      
