Changeset 4164 for trunk/src/win32k


Ignore:
Timestamp:
Sep 2, 2000, 11:08:23 PM (25 years ago)
Author:
bird
Message:

Merged in the Grace branch. New Win32k!

Location:
trunk/src/win32k
Files:
21 added
5 deleted
77 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/win32k/Makefile

    r3605 r4164  
    11################################################################################
    2 # $Id: Makefile,v 1.43 2000-05-25 22:12:49 bird Exp $
     2# $Id: Makefile,v 1.44 2000-09-02 21:07:52 bird Exp $
    33#
    44# Win32k makefile.
     
    4040CC          = icc
    4141!if "$(CCENV)" == "VAC36"
    42 ILIB        = ilib /nofree
     42ILIB        = ilib /nofree /nobackup /nologo
    4343!else
    44 ILIB        = ilib
     44ILIB        = ilib /nobackup /nologo
    4545!endif
    4646LD          = ilink
     
    4848
    4949CFLAGS      = -q -Ge -Gs- -Gr+ -Rn -Ss+ -Mp -Wall+ppt-ppc-inl-cnv-gnr-vft-gen-uni-ext-
    50 CFLAGS16    = -c -W4 -Asfw /NTCODE16 /NDDATA16 -G2s -Zp -Zl -nologo -Fo$@ -Fa
     50CFLAGS16    = -c -W3 -Asfw /NTCODE16 /NDDATA16 -G2s -Zp -Zl -nologo
    5151CPPFLAGS    = -q -Ge -Gs- -Gr+ -Rn -Ss+ -Mp -Gx -Wall+ppt-ppc-inl-cnv-gnr-vft-
    5252ASFLAGS     = -Sv:ALP -Mb -Li
    53 LFLAGS      = /nologo /MAP /NOI /NOE /NOD /A:16
    54 CDEFINES    = -DWIN32K -DRING0 -D__WIN32OS2__ -D__WINE__
    55 CDEFINES16  = -DRING0
    56 ADEFINES    = -D:WIN32K
     53LFLAGS      = /nologo /MAP /NOI /NOE /NOD /A:16 /PACKCODE /PACKDATA
     54CDEFINESB   = -DWIN32K -DRING0 -D__WIN32OS2__ -D__WINE__
     55CDEFINESB16 = -DRING0
     56ASDEFINES   = -D:WIN32K
     57
     58!if "$(CCENV)" == "VAC36"
     59VACLIB      = $(VACPATH)\lib\cpprni36.lib
     60!else
     61VACLIB      = $(VACPATH)\lib\cppon30.lib
     62!endif
    5763
    5864
     
    6470CFLAGS16    = $(CFLAGS16)   -Ogeitln -Gs
    6571CPPFLAGS    = $(CPPFLAGS)   -G5 -O+
    66 LFLAGS      = $(LFLAGS)     /EXEPACK:2 /NODEBUG /PACKC /PACKD
    67 CDEFINES    = $(CDEFINES)   -DRELEASE
    68 CDEFINES16  = $(CDEFINES16) -DRELEASE
     72LFLAGS      = $(LFLAGS)     /EXEPACK:2 /NODEBUG
     73CDEFINES    = $(CDEFINESB)  -DRELEASE
     74CDEFINES16  = $(CDEFINESB16) -DRELEASE
    6975ASDEFINES   = $(ASDEFINES)  -D:RELEASE
    7076
     
    7278
    7379# DEBUG
    74 CFLAGS      = $(CFLAGS)     -O- -Ti+
     80CFLAGS      = $(CFLAGS)     -O+ -Os- -Ti+
    7581CFLAGS16    = $(CFLAGS16)   -Zi -Od
    76 CPPFLAGS    = $(CPPFLAGS)   -O- -Ti+
    77 LFLAGS      = $(LFLAGS)     /NOEXEPACK /DEBUG  /NODEB
     82CPPFLAGS    = $(CPPFLAGS)   -O+ -Os- -Ti+
     83LFLAGS      = $(LFLAGS)     /NOEXEPACK /DEBUG
    7884ASFLAGS     = $(ASFLAGS)    -Od+
    79 CDEFINES    = $(CDEFINES)   -DDEBUG
    80 CDEFINES16  = $(CDEFINES16) -DDEBUG
     85CDEFINES    = $(CDEFINESB)  -DDEBUG
     86CDEFINES16  = $(CDEFINESB16) -DDEBUG
    8187ASDEFINES   = $(ASDEFINES)  -D:DEBUG
    8288!endif
    8389
    8490!ifdef NODEBUGINFO
    85 LFLAGS      = $(LFLAGS)     /NODEB /EXEPACK:2 /PACKD /PACKC
     91LFLAGS      = $(LFLAGS)     /NODEB /EXEPACK:2
    8692CFLAGS16    = $(CFLAGS16)   -Owis
    87 CFLAGS      = $(CFLAGS)     -O+ -Oi-
    88 CPPFLAGS    = $(CPPFLAGS)   -O+ -Oi-
    89 !endif
     93CFLAGS      = $(CFLAGS)     -O+ -Os- -Oi-
     94CPPFLAGS    = $(CPPFLAGS)   -O+ -Os- -Oi-
     95!endif
     96
     97CDEFINES_TST    = $(CDEFINES)   -DR3TST
     98CDEFINES16_TST  = $(CDEFINES16) -DR3TST
     99
    90100
    91101################################################################################
     
    101111             -I$(PDWIN32_INCLUDE)\win
    102112
    103 CINCLUDES16= -I$(WIN32KINCLUDE) \
    104              -I. \
    105              -I$(DDKPATH)\h \
    106              -I$(MSCPATH)\include \
    107              -I$(PDWIN32_INCLUDE)
     113CINCLUDES16= -I$(WIN32KINCLUDE) -I. -I$(DDKPATH)\h -I$(MSCPATH)\include -I$(PDWIN32_INCLUDE)
    108114
    109115
     
    117123.SUFFIXES: .obj .cpp .c .asm
    118124
    119 {dev16}.c{$(WIN32KOBJ)}.obj:
     125{dev16}.c.obj:
     126    @$(ECHO) compiling 16bit: $< ($@)
     127    $(CC16) -c $(CFLAGS16) $(CDEFINES16) $(CINCLUDES16) -Fo$(WIN32KOBJ)\$(*B).obj -Fa$(WIN32KLIST)\$(*B).s $<
     128
     129{dev16}.c.obj_init:
     130    @$(ECHO) compiling 16bit: $< ($@)
     131    $(CC16) -c $(CFLAGS16) $(CDEFINES16) $(CINCLUDES16) /NTCODE16_INIT /NDDATA16_INIT -Fo$(WIN32KOBJ)\$(*B).obj_init -Fa$(WIN32KLIST)\$(*B).s $<
     132    $(CP) $@ $@.obj
     133
     134{dev16}.c.obj_tst:
    120135    @$(ECHO) compiling 16bit: $<
    121     @$(CC16) $(CFLAGS16) $(CDEFINES16) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES16) $<
    122 {dev16}.c.obj:
     136    $(CC16) -c $(CFLAGS16) $(CDEFINES16_TST) $(CINCLUDES16) -Fa$(WIN32KLIST)\$(*B).s -Fo$(WIN32KOBJ)\$(@B).obj_tst $<
     137    $(CP) $@ $@.obj
     138{dev16}.c.obj_tst_init:
    123139    @$(ECHO) compiling 16bit: $<
    124     @$(CC16) $(CFLAGS16) $(CDEFINES16) -Fa$(WIN32KLIST)\$(*B).s -Fo$(WIN32KOBJ)\$(@F) $(CINCLUDES16) $<
     140    $(CC16) -c $(CFLAGS16) $(CDEFINES16_TST) $(CINCLUDES16) /NDDATA16_INIT /NTCODE16_INIT -Fa$(WIN32KLIST)\$(*B).s -Fo$(WIN32KOBJ)\$(@B).obj_tst_init $<
     141    $(CP) $@ $@.obj
    125142
    126143
     
    139156    @$(CC) -c $(CFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$(WIN32KOBJ)\$(@F) $(CINCLUDES) $<
    140157
     158{dev32}.c{$(WIN32KOBJ)}.obj_tst:
     159    @$(ECHO) compiling 32bit: $<
     160    @$(CC) -c $(CFLAGS) $(CDEFINES_TST) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $<
     161    @$(CP) $@ $@.obj
     162{dev32}.c.obj_tst:
     163    @$(ECHO) compiling 32bit: $<
     164    @$(CC) -c $(CFLAGS) $(CDEFINES_TST) -Fa$(WIN32KLIST)\$(*B).s -Fo$(WIN32KOBJ)\$(@F) $(CINCLUDES) $<
     165    @$(CP) $@ $@.obj
     166
    141167{dev32}.cpp{$(WIN32KOBJ)}.obj:
    142168    @$(ECHO) compiling 32bit: $<
     
    147173
    148174
     175{test}.asm{$(WIN32KOBJ)}.obj:
     176    @$(ECHO) assembling:      $<
     177    @$(AS) $(ASFLAGS) $(ADEFINES) $(AINCLUDES) $< -Fo:$@ -Fl:$(WIN32KLIST)\$(*B).lst
     178{test}.asm.obj:
     179    @$(ECHO) assembling:      $<
     180    @$(AS) $(ASFLAGS) $(ADEFINES) $(AINCLUDES) $< -Fo:$(WIN32KOBJ)\$(@F) -Fl:$(WIN32KLIST)\$(*B).lst
     181
     182{test}.c{$(WIN32KOBJ)}.obj:
     183    @$(ECHO) compiling 32bit: $<
     184    @$(CC) -c $(CFLAGS) -O- -Ge+ $(CDEFINES_TST) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $<
     185{test}.c.obj:
     186    @$(ECHO) compiling 32bit: $<
     187    @$(CC) -c $(CFLAGS) -O- -Ge+ $(CDEFINES_TST) -Fa$(WIN32KLIST)\$(*B).s -Fo$(WIN32KOBJ)\$(@F) $(CINCLUDES) $<
     188
     189{test}.cpp{$(WIN32KOBJ)}.obj:
     190    @$(ECHO) compiling 32bit: $<
     191    @$(CC) -c $(CPPFLAGS) -O- -Ge+ $(CDEFINES_TST) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $<
     192{test}.cpp.obj:
     193    @$(ECHO) compiling 32bit: $<
     194    @$(CC) -c $(CPPFLAGS) -O- -Ge+ $(CDEFINES_TST) -Fa$(WIN32KLIST)\$(*B).s -Fo$(WIN32KOBJ)\$(@F) $(CINCLUDES) $<
     195
     196
    149197{k32}.asm{$(WIN32KOBJ)}.obj:
    150198    @$(ECHO) assembling:      $<
     
    204252    @$(ECHO) compiling 32bit: $<
    205253    @$(CC) -c $(CFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$(WIN32KOBJ)\$(@F) $(CINCLUDES) $<
     254
     255{misc}.c{$(WIN32KOBJ)}.obj_tst:
     256    @$(ECHO) compiling 32bit: $<
     257    $(CC) -c $(CFLAGS) $(CDEFINES_TST) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $<
     258    @$(CP) $@ $@.obj
     259{misc}.c.obj_tst:
     260    @$(ECHO) compiling 32bit: $<
     261    $(CC) -c $(CFLAGS) $(CDEFINES_TST) -Fa$(WIN32KLIST)\$(*B).s -Fo$(WIN32KOBJ)\$(@F) $(CINCLUDES) $<
     262    @$(CP) $@ $@.obj
    206263
    207264{misc}.cpp{$(WIN32KOBJ)}.obj:
     
    251308all: pe2lx.exe
    252309!else
    253 all: $(WIN32KBIN)\$(NAME).sys pe2lx.exe
     310all: $(WIN32KBIN)\$(NAME).sys pe2lx.exe kRx.exe lib Win32kCC.exe
    254311!endif
    255312
     
    258315# OBJECTS and LIBRARIES - Don't mess with the order or objects and libraries!
    259316################################################################################
    260 OBJS  = $(WIN32KOBJ)\devfirst.obj \
    261         $(WIN32KOBJ)\d16strat.obj \
    262         $(WIN32KOBJ)\d32hlp.obj \
    263         $(WIN32KOBJ)\d32globals.obj \
    264         $(WIN32KOBJ)\d16globl.obj \
    265         $(WIN32KOBJ)\asmutils.obj \
    266         $(WIN32KOBJ)\calltab.obj \
    267         $(WIN32KOBJ)\malloc.obj \
    268         $(WIN32KOBJ)\smalloc_avl.obj \
    269         $(WIN32KOBJ)\avl.obj \
    270         $(WIN32KOBJ)\rmalloc_avl.obj \
    271         $(WIN32KOBJ)\new.obj \
    272         $(WIN32KOBJ)\stricmp.obj \
    273         $(WIN32KOBJ)\yield.obj \
    274         $(WIN32KOBJ)\vsprintf.obj \
    275         $(WIN32KOBJ)\vprintf.obj \
    276         $(WIN32KOBJ)\ldr.obj \
    277         $(WIN32KOBJ)\myldrClose.obj \
    278         $(WIN32KOBJ)\myldrOpen.obj \
    279         $(WIN32KOBJ)\myldrRead.obj \
    280         $(WIN32KOBJ)\myLDRQAppType.obj \
    281         $(WIN32KOBJ)\myldrEnum32bitRelRecs.obj \
    282         $(WIN32KOBJ)\pe2lx.obj \
    283         $(WIN32KOBJ)\ModuleBase.obj \
    284         $(WIN32KOBJ)\d32ElfIOCtl.obj \
    285         $(WIN32KOBJ)\d32Win32kIOCtl.obj \
    286         $(WIN32KOBJ)\k32AllocMemEx.obj \
    287         $(WIN32KOBJ)\buffer.obj \
    288         $(WIN32KOBJ)\mytkExecPgm.obj
    289 
    290 
    291 OBJSINIT = \
    292         $(WIN32KOBJ)\d16init.obj \
    293         $(WIN32KOBJ)\d32init.obj \
    294         $(WIN32KOBJ)\ProbKrnl.obj \
    295         $(WIN32KOBJ)\SymDB.obj \
    296         $(WIN32KOBJ)\vprntf16.obj
    297 
    298 LIBS = \
    299 !if "$(CCENV)" == "VAC36"
    300         $(VACPATH)\lib\cpprni36.lib \
    301 !else
    302         $(VACPATH)\lib\cppon30.lib  \
    303 !endif
    304         $(DDKPATH)\lib\os2286.lib
    305 
    306 LIBSINIT = \
    307         $(WIN32KOBJ)\devhelp.lib \
    308         $(WIN32KOBJ)\clib.lib
     317OBJS  =\
     318    $(WIN32KOBJ)\devfirst.obj \
     319    $(WIN32KOBJ)\d16strat.obj \
     320    $(WIN32KOBJ)\d32hlp.obj \
     321    $(WIN32KOBJ)\d32globals.obj \
     322    $(WIN32KOBJ)\d16globl.obj \
     323    $(WIN32KOBJ)\asmutils.obj \
     324    $(WIN32KOBJ)\calltab.obj \
     325    $(WIN32KOBJ)\malloc.obj \
     326    $(WIN32KOBJ)\smalloc_avl.obj \
     327    $(WIN32KOBJ)\avl.obj \
     328    $(WIN32KOBJ)\rmalloc_avl.obj \
     329    $(WIN32KOBJ)\new.obj \
     330    $(WIN32KOBJ)\env.obj \
     331    $(WIN32KOBJ)\stricmp.obj \
     332    $(WIN32KOBJ)\yield.obj \
     333    $(WIN32KOBJ)\vsprintf.obj \
     334    $(WIN32KOBJ)\vprintf.obj \
     335    $(WIN32KOBJ)\ldr.obj \
     336    $(WIN32KOBJ)\myldrClose.obj \
     337    $(WIN32KOBJ)\myldrOpen.obj \
     338    $(WIN32KOBJ)\myldrRead.obj \
     339    $(WIN32KOBJ)\myLDRQAppType.obj \
     340    $(WIN32KOBJ)\myldrEnum32bitRelRecs.obj \
     341    $(WIN32KOBJ)\myldrOpenPath.obj \
     342    $(WIN32KOBJ)\OS2KTCB.obj \
     343    $(WIN32KOBJ)\OS2KPTDA.obj \
     344    $(WIN32KOBJ)\pe2lx.obj \
     345    $(WIN32KOBJ)\ModuleBase.obj \
     346    $(WIN32KOBJ)\d32ElfIOCtl.obj \
     347    $(WIN32KOBJ)\d32Win32kIOCtl.obj \
     348    $(WIN32KOBJ)\k32AllocMemEx.obj \
     349    $(WIN32KOBJ)\k32QueryOTEs.obj \
     350    $(WIN32KOBJ)\k32QueryOptionsStatus.obj \
     351    $(WIN32KOBJ)\k32SetOptions.obj \
     352    $(WIN32KOBJ)\mytkExecPgm.obj \
     353    $(WIN32KOBJ)\mytkStartProcess.obj \
     354    $(WIN32KOBJ)\vprntf16.obj \
     355    $(WIN32KOBJ)\d32init.obj \
     356    $(WIN32KOBJ)\SymDB.obj \
     357    $(WIN32KOBJ)\d16init.obj_init \
     358    $(WIN32KOBJ)\ProbKrnl.obj_init
     359
     360LASTOBJ =\
     361    $(WIN32KOBJ)\devlast.obj
     362
     363LIBS =\
     364    $(VACLIB) \
     365    $(DDKPATH)\lib\os2386.lib \
     366    $(WIN32KOBJ)\devhelp.lib \
     367    $(WIN32KOBJ)\clib.lib
     368
     369#
     370# Win32ktst.exe object configuration
     371#
     372TSTOBJS =\
     373    $(WIN32KOBJ)\devfirst.obj \
     374    $(WIN32KOBJ)\$(NAME)tst.obj \
     375    $(WIN32KOBJ)\dh.obj \
     376    $(WIN32KOBJ)\dos.obj \
     377    $(WIN32KOBJ)\dosa.obj \
     378    $(WIN32KOBJ)\init.obj \
     379    $(WIN32KOBJ)\fake.obj \
     380    $(WIN32KOBJ)\fakea.obj \
     381    $(WIN32KOBJ)\d16strat.obj \
     382    $(WIN32KOBJ)\d32hlp.obj \
     383    $(WIN32KOBJ)\d32globals.obj \
     384    $(WIN32KOBJ)\d16globl.obj \
     385    $(WIN32KOBJ)\asmutils.obj \
     386    $(WIN32KOBJ)\calltab.obj \
     387    $(WIN32KOBJ)\malloc.obj_tst \
     388    $(WIN32KOBJ)\smalloc_avl.obj \
     389    $(WIN32KOBJ)\avl.obj \
     390    $(WIN32KOBJ)\rmalloc_avl.obj \
     391    $(WIN32KOBJ)\new.obj \
     392    $(WIN32KOBJ)\env.obj \
     393    $(WIN32KOBJ)\stricmp.obj \
     394    $(WIN32KOBJ)\yield.obj \
     395    $(WIN32KOBJ)\vsprintf.obj \
     396    $(WIN32KOBJ)\vprintf.obj_tst \
     397    $(WIN32KOBJ)\ldr.obj \
     398    $(WIN32KOBJ)\myldrClose.obj \
     399    $(WIN32KOBJ)\myldrOpen.obj \
     400    $(WIN32KOBJ)\myldrRead.obj \
     401    $(WIN32KOBJ)\myLDRQAppType.obj \
     402    $(WIN32KOBJ)\myldrEnum32bitRelRecs.obj \
     403    $(WIN32KOBJ)\myldrOpenPath.obj \
     404    $(WIN32KOBJ)\OS2KTCB.obj \
     405    $(WIN32KOBJ)\OS2KPTDA.obj \
     406    $(WIN32KOBJ)\pe2lx.obj \
     407    $(WIN32KOBJ)\ModuleBase.obj \
     408    $(WIN32KOBJ)\d32ElfIOCtl.obj \
     409    $(WIN32KOBJ)\d32Win32kIOCtl.obj \
     410    $(WIN32KOBJ)\k32AllocMemEx.obj \
     411    $(WIN32KOBJ)\k32QueryOTEs.obj \
     412    $(WIN32KOBJ)\k32QueryOptionsStatus.obj \
     413    $(WIN32KOBJ)\k32SetOptions.obj \
     414    $(WIN32KOBJ)\mytkExecPgm.obj \
     415    $(WIN32KOBJ)\mytkStartProcess.obj \
     416    $(WIN32KOBJ)\vprntf16.obj_tst \
     417    $(WIN32KOBJ)\d32init.obj_tst \
     418    $(WIN32KOBJ)\SymDB.obj \
     419    $(WIN32KOBJ)\d16init.obj_tst_init \
     420    $(WIN32KOBJ)\ProbKrnl.obj_tst_init
     421
     422TSTLASTOBJ = $(LASTOBJ)
     423
     424TSTLIBS = $(LIBS)
     425
     426
    309427
    310428
     
    313431################################################################################
    314432Probkrnl.exe: $(WIN32KBIN)\ProbKrnl.exe
     433    $(CP) $** $@
    315434$(WIN32KBIN)\ProbKrnl.exe: dev16\ProbKrnl.c dev16\symdb.c dev16\vprntf16.c \
    316435              $(WIN32KINCLUDE)\sym.h \
    317436              $(WIN32KINCLUDE)\probKrnl.h
    318     $(CC16) -c -W4 -Asfw -G2s -Zp -Zl -nologo -Fa -Zi -Od -Lp \
     437    $(CC16) -c -W3 -Asfw -G2s -Zp -Zl -nologo -Fa -Zi -Od -Lp \
    319438        -DDEBUG -DDEBUGR3 -Fa$(WIN32KLIST)\$(*B)_p.s     \
    320439        -Fo$(WIN32KOBJ)\probkrnl_p.obj $(CINCLUDES16) dev16\probkrnl.c
    321     $(CC16) -c -W4 -Asfw -G2s -Zp -Zl -nologo -Fa -Zi -Od -Lp \
     440    $(CC16) -c -W3 -Asfw -G2s -Zp -Zl -nologo -Fa -Zi -Od -Lp \
    322441        -DDEBUG -DDEBUGR3 -Fa$(WIN32KLIST)\$(*B)_p.s     \
    323442        -Fo$(WIN32KOBJ)\symdb_p.obj $(CINCLUDES16) dev16\symdb.c
    324     $(CC16) -c -W4 -Asfw -G2s -Zp -Zl -nologo -Fa -Zi -Od -Lp \
     443    $(CC16) -c -W3 -Asfw -G2s -Zp -Zl -nologo -Fa -Zi -Od -Lp \
    325444        -DDEBUG -DDEBUGR3 -Fa$(WIN32KLIST)\$(*B)_p.s     \
    326445        -Fo$(WIN32KOBJ)\vprntf16_p.obj $(CINCLUDES16) dev16\vprntf16.c
     
    329448        $@, $(WIN32KBIN)\probkrnl.map, \
    330449        $(TOOLKIT)\lib\os2286.lib + $(MSCPATH)\lib\clibcep.lib;
    331     $(CP) $@
    332450
    333451extract.exe: $(WIN32KBIN)\extract.exe
     452    $(CP) $** $@
    334453$(WIN32KBIN)\extract.exe: dev16\ProbKrnl.c dev16\vprntf16.c \
    335454             $(WIN32KINCLUDE)\sym.h \
    336455             $(WIN32KINCLUDE)\probKrnl.h
    337     $(CC16) -c -W4 -Asfw -G2s -Zp -Zl -nologo -Fo$@ -Fa -Zi -Od -Lp \
     456    $(CC16) -c -W3 -Asfw -G2s -Zp -Zl -nologo -Fo$@ -Fa -Zi -Od -Lp \
    338457        -DDEBUG -DEXTRACT -Fa$(WIN32KLIST)\$(*B)_e.s     \
    339458        -Fo$(WIN32KOBJ)\probkrnl_e.obj $(CINCLUDES16) dev16\probkrnl.c
    340     $(CC16) -c -W4 -Asfw -G2s -Zp -Zl -nologo -Fo$@ -Fa -Zi -Od -Lp \
     459    $(CC16) -c -W3 -Asfw -G2s -Zp -Zl -nologo -Fo$@ -Fa -Zi -Od -Lp \
    341460        -DDEBUG -DEXTRACT -Fa$(WIN32KLIST)\$(*B)_e.s     \
    342461        -Fo$(WIN32KOBJ)\vprntf16_e.obj $(CINCLUDES16) dev16\vprntf16.c
     462    $(CC16) -c -W3 -Asfw -G2s -Zp -Zl -nologo -Fo$@ -Fa -Zi -Od -Lp \
     463        -DDEBUG -DEXTRACT -Fa$(WIN32KLIST)\$(*B)_e.s     \
     464        -Fo$(WIN32KOBJ)\d16globl_e.obj $(CINCLUDES16) dev16\d16globl.c
    343465    link /NOD /MAP:FULL /CO /pmtype:vio \
    344         $(WIN32KOBJ)\probkrnl_e.obj + $(WIN32KOBJ)\vprntf16_e.obj, \
     466        $(WIN32KOBJ)\probkrnl_e.obj + $(WIN32KOBJ)\vprntf16_e.obj + $(WIN32KOBJ)\d16globl_e.obj, \
    345467        $@, $(WIN32KBIN)\$(*B).map, \
    346468        $(TOOLKIT)\lib\os2286.lib + $(MSCPATH)\lib\clibcep.lib;
    347     $(CP) $@
    348 
    349 d32init.exe: $(WIN32KBIN)\d32init.exe
    350 $(WIN32KBIN)\d32init.exe: dev32\d32init.c
    351     icc -Ti+ -Ss /Gr+ $(CINCLUDES) -DRING3 -DDEBUGR3 -DDEBUG \
    352         -Fo$(WIN32KOBJ)\$(*B).r3obj -Fe$@ -Fm$(WIN32KBIN)\$(*B).map \
    353         dev32\$(*B).c
    354     $(CP) $@
    355469
    356470
     
    360474################################################################################
    361475$(NAME).sys: $(WIN32KBIN)\$(NAME).sys
    362 $(WIN32KBIN)\$(NAME).sys: $(OBJS) $(LIBS) $(NAME).def \
    363             $(WIN32KOBJ)\last.lib \
    364             $(WIN32KOBJ)\init.lib \
    365             $(LIBSINIT)
     476$(WIN32KBIN)\$(NAME).sys: $(OBJS) $(LIBS) $(NAME).def $(LASTOBJ) $(LIBSINIT) makefile
    366477    -@$(ECHO) linking: $@
    367     $(LD) $(LFLAGS) @<<ole
     478    -4 $(LD) $(LFLAGS) @<<$(WIN32KOBJ)\$(@B).lnk
    368479/OUT:$@
    369480/MAP:$(WIN32KBIN)\$(@B).map
    370 $(OBJS)
    371 $(LIBS)
    372 $(WIN32KOBJ)\last.lib
    373 $(WIN32KOBJ)\init.lib
    374 /IG $(LIBSINIT)
     481$(OBJS:  =^
     482)
     483/IG
     484$(LIBS:  =^
     485)
     486$(LASTOBJ)
    375487$(NAME).def
    376 <<keep
     488<<KEEP
    377489    cd $(WIN32KBIN)
    378490    @mapsym $(*B).map > nul
     
    384496
    385497################################################################################
     498# Win32ktst.exe rule.
     499################################################################################
     500$(NAME)tst.exe: $(WIN32KBIN)\$(NAME)tst.exe
     501    $(CP) $(WIN32KBIN)\$@ $@
     502
     503$(WIN32KBIN)\$(NAME)tst.exe: $(NAME)tst.def $(TSTOBJS) $(TSTLIBS) $(LASTOBJS) makefile
     504    -@$(ECHO) linking: $@
     505    -4 $(LD) $(LFLAGS) @<<$(WIN32KOBJ)\$(@B).lnk
     506/DEBUG
     507/OUT:$@
     508/MAP:$(WIN32KBIN)\$(@B).map
     509$(TSTOBJS:  =^
     510)
     511/IG
     512$(TSTLIBS:  =^
     513)
     514$(LASTOBJ)
     515$(NAME)tst.def
     516<<KEEP
     517
     518
     519################################################################################
    386520# Pe2Lx.exe rule
    387521################################################################################
     
    400534
    401535################################################################################
     536# Win32k Control Center Rule.
     537################################################################################
     538Win32kCC.exe:
     539    cd utils
     540    $(MAKE_CMD)
     541    cd ..
     542
     543################################################################################
     544# kRx.EXE - Pure Rexx interpreter
     545################################################################################
     546kRx.exe:
     547    cd rexx
     548    $(MAKE_CMD)
     549    cd ..
     550
     551################################################################################
    402552# Libraries - segments are renamed for the 16-bit libraries.
    403553################################################################################
    404 $(WIN32KOBJ)\devhelp.lib: $(DDKPATH)\lib\dhcalls.lib $(WIN32KBIN)\libconv.exe
    405     $(WIN32KBIN)\libconv $(DDKPATH)\lib\dhcalls.lib $@
    406     $(ILIB) /nologo /nobackup /convformat $@;
    407 
    408 $(WIN32KOBJ)\clib.lib: $(MSCPATH)\lib\clibcep.lib $(WIN32KBIN)\libconv.exe
    409     $(WIN32KBIN)\libconv $(MSCPATH)\lib\clibcep.lib $@ > nul
    410     $(ILIB) /nologo /nobackup /convformat $@;
     554DHLPOBJS =  +$(WIN32KOBJ)\dhcall5b.obj +$(WIN32KOBJ)\dhcal11a.obj \
     555            +$(WIN32KOBJ)\dhcal11g.obj +$(WIN32KOBJ)\dhret.obj
     556
     557$(WIN32KOBJ)\devhelp.lib: $(DDKPATH)\lib\dhcalls.lib $(WIN32KBIN)\libconv.exe $(DHLPOBJS:+=)
     558#!if "$(CCENV)" == "VAC36"
     559    @$(RM) $@
     560    @cd $(WIN32KOBJ)
     561    $(DDKPATH)\tools\lib /nologo $@ $(DHLPOBJS);
     562    @cd $(MAKEDIR)
     563#!else
     564#    $(WIN32KBIN)\libconv  $(DDKPATH)\lib\dhcalls.lib $@
     565#!endif
     566
     567$(WIN32KOBJ)\devhelp_.lib: $(DDKPATH)\lib\dhcalls.lib
     568    $(WIN32KBIN)\libconv $** $@
     569
     570$(DHLPOBJS:+=): $(WIN32KOBJ)\devhelp_.lib
     571    @cd $(WIN32KOBJ)
     572    $(DDKPATH)\tools\lib /nologo $** *$@;
     573    @cd $(MAKEDIR)
     574
     575
     576CLIBOBJS =  +$(WIN32KOBJ)\inp.obj       +$(WIN32KOBJ)\outp.obj \
     577            +$(WIN32KOBJ)\anfalmul.obj  +$(WIN32KOBJ)\anfaldiv.obj \
     578            +$(WIN32KOBJ)\anfalrem.obj  +$(WIN32KOBJ)\anfauldi.obj \
     579            +$(WIN32KOBJ)\anuldiv.obj   +$(WIN32KOBJ)\fmemcpy.obj \
     580            +$(WIN32KOBJ)\anulrem.obj   +$(WIN32KOBJ)\anlmul.obj \
     581            +$(WIN32KOBJ)\__AHINCR.obj
     582
     583$(WIN32KOBJ)\clib.lib: $(MSCPATH)\lib\clibcep.lib $(WIN32KBIN)\libconv.exe $(CLIBOBJS:+=)
     584    @$(RM) $@
     585    @cd $(WIN32KOBJ)
     586    $(DDKPATH)\tools\lib /nologo $@ $(CLIBOBJS);
     587    @cd $(MAKEDIR)
     588
     589$(WIN32KOBJ)\clib_.lib: $(MSCPATH)\lib\clibcep.lib
     590    $(WIN32KBIN)\libconv $** $@ > nul
     591
     592$(CLIBOBJS:+=): $(WIN32KOBJ)\clib_.lib
     593    @cd $(WIN32KOBJ)
     594    $(ILIB) $** *$@;
     595    @cd $(MAKEDIR)
     596
    411597
    412598$(WIN32KOBJ)\last.lib: $(WIN32KOBJ)\devlast.obj
    413599    -@$(RM) $@ > nul 2> nul
    414     $(ILIB) /nologo /nobackup $@ $**;
    415 
    416 $(WIN32KOBJ)\init.lib: $(OBJSINIT)
    417     -@$(RM) $@ > nul 2> nul
    418     $(ILIB) /nologo /nobackup $@ $**;
     600    $(ILIB) $@ $**;
    419601
    420602$(WIN32KBIN)\libconv.exe: libconv.c
    421     icc -Q+ -Fe$@ -Fo$(WIN32KOBJ)\$(*B).obj libconv.c
     603    icc -Q+ -Ti+ -Fe$@ -Fo$(WIN32KOBJ)\$(*B).obj libconv.c
    422604
    423605
     
    426608################################################################################
    427609lxdoc:
    428    exp cpp2sds -o DocsA\ -i include\lx.h pe2lx\lx*.cpp
    429    cd Docs
    430    exp sds2doc -ai *.sds
     610    cpp2sds -o DocsA\ -i include\modulebase.h include\pe2lx.h ldr\modulebase.cpp \
     611        pe2lx\pe2lx.cpp
     612    cd DocsA
     613    exp sds2doc -ai *.sds
    431614
    432615fulldoc:
    433    exp cpp2sds -o DocsA\ -i include\*.h *.cpp ldr\*.cpp misc\*.cpp pe2lx\*.cpp
    434    cd Docs
    435    exp sds2doc -ai *.sds
     616    exp cpp2sds -o DocsA\ -i include\*.h *.cpp ldr\*.cpp misc\*.cpp pe2lx\*.cpp
     617    cd DocsA
     618    exp sds2doc -ai *.sds
    436619
    437620#################################################################################
     
    454637!endif
    455638!if "$(WIN32KOBJ)" != ""
    456     $(RM) $(WIN32KOBJ)\*obj $(WIN32KOBJ)\*lib $(WIN32KOBJ)\*pch
     639    $(RM) $(WIN32KOBJ)\*obj $(WIN32KOBJ)\*lib $(WIN32KOBJ)\*pch \
     640        $(WIN32KOBJ)\*.obj_tst
    457641!endif
    458642!if "$(WIN32KLIST)" != ""
     
    472656dep:
    473657    $(PDWIN32_TOOLS)\fastdep -o$$(WIN32KOBJ) $(CINCLUDES) misc\*.c* ldr\*.c* \
    474         dev32\*.c* pe2lx\*.c* k32\*.c* lib\*.c elf2lx\*.c* \
     658        dev32\*.c* pe2lx\*.c* k32\*.c* lib\*.c elf2lx\*.c* test\*.c* \
    475659        $(WIN32KINCLUDE)\*.h
     660    $(PDWIN32_TOOLS)\fastdep -a+ -objobj_tst -o$$(WIN32KOBJ) $(CINCLUDES) misc\*.c* ldr\*.c* \
     661        dev32\*.c* pe2lx\*.c* k32\*.c* lib\*.c elf2lx\*.c* test\*.c*
    476662    $(PDWIN32_TOOLS)\fastdep -a+ -o$$(WIN32KOBJ) $(CINCLUDES16) dev16\*.c*
    477663    $(PDWIN32_TOOLS)\fastdep -a+ -o$$(WIN32KOBJ) -I$(WIN32KINCLUDE) \
    478         -I$(DDKPATH)\inc dev32\*.asm ldr\*.asm misc\*.asm include\*.inc
     664        -I$(DDKPATH)\inc dev32\*.asm ldr\*.asm misc\*.asm test\*.asm include\*.inc
    479665    cd pe2lx
    480666    $(MAKE_CMD) dep
     
    494680!endif
    495681
    496 
    497 ################################################################################
    498 # Create output directories.
    499 ################################################################################
    500 !if [mkdir bin > nul 2>&1]
    501 !endif
    502 !if [mkdir $(WIN32KBIN) > nul 2>&1]
    503 !endif
    504 !if [mkdir list > nul 2>&1]
    505 !endif
    506 !if [mkdir $(WIN32KLIST) > nul 2>&1]
    507 !endif
    508 !if [mkdir object > nul 2>&1]
    509 !endif
    510 !if [mkdir $(WIN32KOBJ) > nul 2>&1]
    511 !endif
    512 
    513 
  • trunk/src/win32k/configure.cmd

    r3041 r4164  
    1 /* $Id: configure.cmd,v 1.10 2000-03-08 09:23:04 bird Exp $
     1/* $Id: configure.cmd,v 1.11 2000-09-02 21:07:53 bird Exp $
    22 *
    33 * Configuration script.
     
    105105        call stream sIncFile, 'c', 'close';
    106106
     107        /*
     108         * Create output directories.
     109         */
     110        'mkdir Bin > nul 2> nul'
     111        'mkdir Bin\Release > nul 2> nul'
     112        'mkdir Bin\Debug > nul 2> nul'
     113
     114        'mkdir List > nul 2> nul'
     115        'mkdir List\Release > nul 2> nul'
     116        'mkdir List\Debug > nul 2> nul'
     117
     118        'mkdir Object > nul 2> nul'
     119        'mkdir Object\Debug > nul 2> nul'
     120        'mkdir Object\Release > nul 2> nul'
     121
     122        /*
     123         * Display output.
     124         */
    107125        if (fInteractive = 1) then
    108126        do
  • trunk/src/win32k/dev16/SymDB.c

    r3321 r4164  
    1 /* $Id: SymDB.c,v 1.3 2000-04-05 18:40:37 bird Exp $
     1/* $Id: SymDB.c,v 1.4 2000-09-02 21:07:54 bird Exp $
    22*
    33* Autogenerated kernel symbol database.
     
    1212#define INCL_NOBASEAPI
    1313#include <os2.h>
     14#include "devSegDf.h"
    1415#include "probkrnl.h"
    15 KRNLDBENTRY aKrnlSymDB[] =
     16#include "options.h"
     17
     18KRNLDBENTRY DATA16_INIT aKrnlSymDB[] =
    1619{
     20#ifdef ALLKERNELS
     21    { /* 14039AS.SYM */
     22        14039, KF_SMP | KF_ALLSTRICT, 17,
     23        {
     24            {16, 0x0000a0b8}, /* _ldrRead */
     25            {16, 0x00075c40}, /* _ldrOpen */
     26            {16, 0x00077130}, /* _ldrClose */
     27            {16, 0x00077215}, /* _LDRQAppType */
     28            {16, 0x00072c10}, /* _ldrEnum32bitRelRecs */
     29            {16, 0x00006188}, /* _IOSftOpen */
     30            {16, 0x00006a90}, /* _IOSftClose */
     31            {16, 0x00006b8c}, /* _IOSftTransPath */
     32            {16, 0x0000666c}, /* _IOSftReadAt */
     33            {16, 0x00006673}, /* _IOSftWriteAt */
     34            {16, 0x00006cc4}, /* _SftFileSize */
     35            {16, 0x00070a40}, /* _VMAllocMem */
     36            {16, 0x0005e4b3}, /* _VMGetOwner */
     37            {16, 0x000824c0}, /* g_tkExecPgm */
     38            {16, 0x0007ad58}, /* _tkStartProcess */
     39            {13, 0x0000aca8}, /* f_FuStrLenZ */
     40            {13, 0x0000ac28}, /* f_FuStrLen */
     41            {13, 0x0000ae74}, /* f_FuBuff */
     42            {16, 0x00058490}, /* _VMObjHandleInfo */
     43            {16, 0x00083510}, /* _ldrASMpMTEFromHandle */
     44            {16, 0x00075fc0}, /* _ldrOpenPath */
     45            {16, 0x000701d0}, /* _LDRClearSem */
     46            {16, 0x0007b7f3}, /* _ldrFindModule */
     47            {16, 0x0000e470}, /* _KSEMRequestMutex */
     48            {16, 0x0000e584}, /* _KSEMReleaseMutex */
     49            {16, 0x0000e5e4}, /* _KSEMQueryMutex */
     50            {16, 0x0000e968}, /* _KSEMInit */
     51            {11, 0x0002c940}, /* _LdrSem */
     52            {11, 0x0002c9d4}, /* _LDRLibPath */
     53            {16, 0x00067924}, /* _TKSuBuff */
     54            {16, 0x00041620}, /* _TKFuBuff */
     55            {16, 0x00041371}, /* _TKFuBufLen */
     56            {16, 0x000701a0}, /* _ldrValidateMteHandle */
     57            {0 , 0x00000aa4}, /* _pTCBCur */
     58            {0 , 0x00000aa0}, /* _pPTDACur */
     59            {5 , 0x0000f884}, /* ptda_start */
     60            {5 , 0x0000f99e}, /* ptda_environ */
     61            {5 , 0x0000fea8}, /* ptda_ptdasem */
     62            {5 , 0x0000ffa2}, /* ptda_module */
     63            {5 , 0x0000f9a0}, /* ptda_pBeginLIBPATH */
     64            {11, 0x0002e80c}, /* _ldrpFileNameBuf */
     65            {16, 0x0006d6c0}, /* SecPathFromSFN */
     66        }
     67    },
     68#endif
     69#ifdef ALLKERNELS
     70    { /* 14039AU.SYM */
     71        14039, KF_UNI | KF_ALLSTRICT, 16,
     72        {
     73            {15, 0x000087a8}, /* _ldrRead */
     74            {15, 0x0006a810}, /* _ldrOpen */
     75            {15, 0x0006bc40}, /* _ldrClose */
     76            {15, 0x0006bd25}, /* _LDRQAppType */
     77            {15, 0x00067ae0}, /* _ldrEnum32bitRelRecs */
     78            {15, 0x00005158}, /* _IOSftOpen */
     79            {15, 0x000059c4}, /* _IOSftClose */
     80            {15, 0x00005aa0}, /* _IOSftTransPath */
     81            {15, 0x000055f8}, /* _IOSftReadAt */
     82            {15, 0x000055ff}, /* _IOSftWriteAt */
     83            {15, 0x00005bc8}, /* _SftFileSize */
     84            {15, 0x00065af0}, /* _VMAllocMem */
     85            {15, 0x00052ef3}, /* _VMGetOwner */
     86            {15, 0x00076140}, /* g_tkExecPgm */
     87            {15, 0x0006f250}, /* _tkStartProcess */
     88            {11, 0x0000f838}, /* f_FuStrLenZ */
     89            {11, 0x0000f7ec}, /* f_FuStrLen */
     90            {11, 0x0000f954}, /* f_FuBuff */
     91            {15, 0x0004d127}, /* _VMObjHandleInfo */
     92            {15, 0x00076fe0}, /* _ldrASMpMTEFromHandle */
     93            {15, 0x0006ab90}, /* _ldrOpenPath */
     94            {15, 0x000652f0}, /* _LDRClearSem */
     95            {15, 0x0006fc83}, /* _ldrFindModule */
     96            {15, 0x0000c20c}, /* _KSEMRequestMutex */
     97            {15, 0x0000c320}, /* _KSEMReleaseMutex */
     98            {15, 0x0000c380}, /* _KSEMQueryMutex */
     99            {15, 0x0000c704}, /* _KSEMInit */
     100            {10, 0x0002c63c}, /* _LdrSem */
     101            {10, 0x0002c6d0}, /* _LDRLibPath */
     102            {15, 0x0005d6d4}, /* _TKSuBuff */
     103            {15, 0x00037c71}, /* _TKFuBuff */
     104            {15, 0x00037a10}, /* _TKFuBufLen */
     105            {15, 0x000652c0}, /* _ldrValidateMteHandle */
     106            {10, 0x0002bf90}, /* _pTCBCur */
     107            {10, 0x0002bf8c}, /* _pPTDACur */
     108            {4 , 0x0000f89c}, /* ptda_start */
     109            {4 , 0x0000f9b6}, /* ptda_environ */
     110            {4 , 0x0000fec0}, /* ptda_ptdasem */
     111            {4 , 0x0000ffaa}, /* ptda_module */
     112            {4 , 0x0000f9b8}, /* ptda_pBeginLIBPATH */
     113            {10, 0x0002e62c}, /* _ldrpFileNameBuf */
     114            {15, 0x00062c40}, /* SecPathFromSFN */
     115        }
     116    },
     117#endif
     118#ifdef ALLKERNELS
     119    { /* 14039HS.SYM */
     120        14039, KF_SMP | KF_HALFSTRICT, 17,
     121        {
     122            {16, 0x00008fd8}, /* _ldrRead */
     123            {16, 0x00063a80}, /* _ldrOpen */
     124            {16, 0x00064e20}, /* _ldrClose */
     125            {16, 0x00064f05}, /* _LDRQAppType */
     126            {16, 0x00061030}, /* _ldrEnum32bitRelRecs */
     127            {16, 0x00005308}, /* _IOSftOpen */
     128            {16, 0x00005c01}, /* _IOSftClose */
     129            {16, 0x00005cfc}, /* _IOSftTransPath */
     130            {16, 0x000057e0}, /* _IOSftReadAt */
     131            {16, 0x000057e7}, /* _IOSftWriteAt */
     132            {16, 0x00005e26}, /* _SftFileSize */
     133            {16, 0x0005f410}, /* _VMAllocMem */
     134            {16, 0x0004f30b}, /* _VMGetOwner */
     135            {16, 0x0006efde}, /* g_tkExecPgm */
     136            {16, 0x00068511}, /* _tkStartProcess */
     137            {13, 0x00009ef0}, /* f_FuStrLenZ */
     138            {13, 0x00009e70}, /* f_FuStrLen */
     139            {13, 0x0000a099}, /* f_FuBuff */
     140            {16, 0x0004b024}, /* _VMObjHandleInfo */
     141            {16, 0x0006fec0}, /* _ldrASMpMTEFromHandle */
     142            {16, 0x00063dc0}, /* _ldrOpenPath */
     143            {16, 0x0005ee60}, /* _LDRClearSem */
     144            {16, 0x00068f53}, /* _ldrFindModule */
     145            {16, 0x0000cf60}, /* _KSEMRequestMutex */
     146            {16, 0x0000d037}, /* _KSEMReleaseMutex */
     147            {16, 0x0000d062}, /* _KSEMQueryMutex */
     148            {16, 0x0000d302}, /* _KSEMInit */
     149            {11, 0x0001d838}, /* _LdrSem */
     150            {11, 0x0001d8c0}, /* _LDRLibPath */
     151            {16, 0x00057427}, /* _TKSuBuff */
     152            {16, 0x00038a10}, /* _TKFuBuff */
     153            {16, 0x000387a1}, /* _TKFuBufLen */
     154            {16, 0x0005ee30}, /* _ldrValidateMteHandle */
     155            {0 , 0x00000aa4}, /* _pTCBCur */
     156            {0 , 0x00000aa0}, /* _pPTDACur */
     157            {5 , 0x0000f890}, /* ptda_start */
     158            {5 , 0x0000f9aa}, /* ptda_environ */
     159            {5 , 0x0000feb4}, /* ptda_ptdasem */
     160            {5 , 0x0000ffa2}, /* ptda_module */
     161            {5 , 0x0000f9ac}, /* ptda_pBeginLIBPATH */
     162            {11, 0x0001ed44}, /* _ldrpFileNameBuf */
     163            {16, 0x0005c980}, /* SecPathFromSFN */
     164        }
     165    },
     166#endif
     167#ifdef ALLKERNELS
     168    { /* 14039HU.SYM */
     169        14039, KF_UNI | KF_HALFSTRICT, 16,
     170        {
     171            {15, 0x00007a54}, /* _ldrRead */
     172            {15, 0x00059380}, /* _ldrOpen */
     173            {15, 0x0005a650}, /* _ldrClose */
     174            {15, 0x0005a735}, /* _LDRQAppType */
     175            {15, 0x00056c10}, /* _ldrEnum32bitRelRecs */
     176            {15, 0x00004618}, /* _IOSftOpen */
     177            {15, 0x00004e74}, /* _IOSftClose */
     178            {15, 0x00004f4d}, /* _IOSftTransPath */
     179            {15, 0x00004aac}, /* _IOSftReadAt */
     180            {15, 0x00004ab3}, /* _IOSftWriteAt */
     181            {15, 0x00005066}, /* _SftFileSize */
     182            {15, 0x000551d0}, /* _VMAllocMem */
     183            {15, 0x000448eb}, /* _VMGetOwner */
     184            {15, 0x000639be}, /* g_tkExecPgm */
     185            {15, 0x0005d76b}, /* _tkStartProcess */
     186            {11, 0x0000e640}, /* f_FuStrLenZ */
     187            {11, 0x0000e5f6}, /* f_FuStrLen */
     188            {11, 0x0000e738}, /* f_FuBuff */
     189            {15, 0x00040813}, /* _VMObjHandleInfo */
     190            {15, 0x00064710}, /* _ldrASMpMTEFromHandle */
     191            {15, 0x000596c0}, /* _ldrOpenPath */
     192            {15, 0x00054c80}, /* _LDRClearSem */
     193            {15, 0x0005e143}, /* _ldrFindModule */
     194            {15, 0x0000b178}, /* _KSEMRequestMutex */
     195            {15, 0x0000b24f}, /* _KSEMReleaseMutex */
     196            {15, 0x0000b27a}, /* _KSEMQueryMutex */
     197            {15, 0x0000b51a}, /* _KSEMInit */
     198            {10, 0x0001e2ac}, /* _LdrSem */
     199            {10, 0x0001e334}, /* _LDRLibPath */
     200            {15, 0x0004dee9}, /* _TKSuBuff */
     201            {15, 0x0002fa00}, /* _TKFuBuff */
     202            {15, 0x0002f7e0}, /* _TKFuBufLen */
     203            {15, 0x00054c50}, /* _ldrValidateMteHandle */
     204            {10, 0x0001dca4}, /* _pTCBCur */
     205            {10, 0x0001dca0}, /* _pPTDACur */
     206            {4 , 0x0000f8a4}, /* ptda_start */
     207            {4 , 0x0000f9be}, /* ptda_environ */
     208            {4 , 0x0000fec8}, /* ptda_ptdasem */
     209            {4 , 0x0000ffaa}, /* ptda_module */
     210            {4 , 0x0000f9c0}, /* ptda_pBeginLIBPATH */
     211            {10, 0x0001f7c4}, /* _ldrpFileNameBuf */
     212            {15, 0x00052bb0}, /* SecPathFromSFN */
     213        }
     214    },
     215#endif
    17216    { /* 14039RS.SYM */
    18         14039, 'R', TYPE_SMP, 15,
     217        14039, KF_SMP, 15,
    19218        {
    20219            {14, 0x00008390}, /* _ldrRead */
     
    32231            {14, 0x0004ce4b}, /* _VMGetOwner */
    33232            {14, 0x0006ca7e}, /* g_tkExecPgm */
     233            {14, 0x00065fc1}, /* _tkStartProcess */
    34234            {11, 0x00009e10}, /* f_FuStrLenZ */
    35235            {11, 0x00009d90}, /* f_FuStrLen */
    36236            {11, 0x00009fb9}, /* f_FuBuff */
     237            {14, 0x00048b64}, /* _VMObjHandleInfo */
     238            {14, 0x0006d960}, /* _ldrASMpMTEFromHandle */
     239            {14, 0x00061870}, /* _ldrOpenPath */
     240            {14, 0x0005c910}, /* _LDRClearSem */
     241            {14, 0x000669f3}, /* _ldrFindModule */
     242            {14, 0x0000c20c}, /* _KSEMRequestMutex */
     243            {14, 0x0000c29f}, /* _KSEMReleaseMutex */
     244            {14, 0x0000c2ca}, /* _KSEMQueryMutex */
     245            {14, 0x0000c4df}, /* _KSEMInit */
     246            {9 , 0x0000d298}, /* _LdrSem */
     247            {9 , 0x0000d320}, /* _LDRLibPath */
     248            {14, 0x00054ed3}, /* _TKSuBuff */
     249            {14, 0x00036680}, /* _TKFuBuff */
     250            {14, 0x00036411}, /* _TKFuBufLen */
     251            {14, 0x0005c8e0}, /* _ldrValidateMteHandle */
     252            {0 , 0x00000aa4}, /* _pTCBCur */
     253            {0 , 0x00000aa0}, /* _pPTDACur */
     254            {3 , 0x0000f890}, /* ptda_start */
     255            {3 , 0x0000f9aa}, /* ptda_environ */
     256            {3 , 0x0000feb4}, /* ptda_ptdasem */
     257            {3 , 0x0000ffa2}, /* ptda_module */
     258            {3 , 0x0000f9ac}, /* ptda_pBeginLIBPATH */
     259            {9 , 0x0000e794}, /* _ldrpFileNameBuf */
     260            {14, 0x0005a430}, /* SecPathFromSFN */
    37261        }
    38262    },
    39263    { /* 14039RU.SYM */
    40         14039, 'R', TYPE_UNI, 14,
     264        14039, KF_UNI, 14,
    41265        {
    42266            {13, 0x000070e4}, /* _ldrRead */
     
    54278            {13, 0x00042dcb}, /* _VMGetOwner */
    55279            {13, 0x00061dde}, /* g_tkExecPgm */
    56             {9, 0x0000e640}, /* f_FuStrLenZ */
    57             {9, 0x0000e5f6}, /* f_FuStrLen */
    58             {9, 0x0000e738}, /* f_FuBuff */
    59         }
    60     },
     280            {13, 0x0005bbab}, /* _tkStartProcess */
     281            {9 , 0x0000e640}, /* f_FuStrLenZ */
     282            {9 , 0x0000e5f6}, /* f_FuStrLen */
     283            {9 , 0x0000e738}, /* f_FuBuff */
     284            {13, 0x0003ecf3}, /* _VMObjHandleInfo */
     285            {13, 0x00062b30}, /* _ldrASMpMTEFromHandle */
     286            {13, 0x00057b10}, /* _ldrOpenPath */
     287            {13, 0x000530d0}, /* _LDRClearSem */
     288            {13, 0x0005c563}, /* _ldrFindModule */
     289            {13, 0x0000a760}, /* _KSEMRequestMutex */
     290            {13, 0x0000a7f3}, /* _KSEMReleaseMutex */
     291            {13, 0x0000a81e}, /* _KSEMQueryMutex */
     292            {13, 0x0000aa33}, /* _KSEMInit */
     293            {8 , 0x0000dd20}, /* _LdrSem */
     294            {8 , 0x0000dda8}, /* _LDRLibPath */
     295            {13, 0x0004c335}, /* _TKSuBuff */
     296            {13, 0x0002e010}, /* _TKFuBuff */
     297            {13, 0x0002ddf0}, /* _TKFuBufLen */
     298            {13, 0x000530a0}, /* _ldrValidateMteHandle */
     299            {8 , 0x0000d714}, /* _pTCBCur */
     300            {8 , 0x0000d710}, /* _pPTDACur */
     301            {2 , 0x0000f8a4}, /* ptda_start */
     302            {2 , 0x0000f9be}, /* ptda_environ */
     303            {2 , 0x0000fec8}, /* ptda_ptdasem */
     304            {2 , 0x0000ffaa}, /* ptda_module */
     305            {2 , 0x0000f9c0}, /* ptda_pBeginLIBPATH */
     306            {8 , 0x0000f228}, /* _ldrpFileNameBuf */
     307            {13, 0x00051000}, /* SecPathFromSFN */
     308        }
     309    },
     310#ifdef ALLKERNELS
     311    { /* 14040A4.SYM */
     312        14040, KF_UNI | KF_W4 | KF_ALLSTRICT, 16,
     313        {
     314            {15, 0x00008744}, /* _ldrRead */
     315            {15, 0x0006a6d0}, /* _ldrOpen */
     316            {15, 0x0006bb00}, /* _ldrClose */
     317            {15, 0x0006bbe5}, /* _LDRQAppType */
     318            {15, 0x000679a0}, /* _ldrEnum32bitRelRecs */
     319            {15, 0x00005158}, /* _IOSftOpen */
     320            {15, 0x000059c4}, /* _IOSftClose */
     321            {15, 0x00005aa0}, /* _IOSftTransPath */
     322            {15, 0x000055f8}, /* _IOSftReadAt */
     323            {15, 0x000055ff}, /* _IOSftWriteAt */
     324            {15, 0x00005bc8}, /* _SftFileSize */
     325            {15, 0x000659d0}, /* _VMAllocMem */
     326            {15, 0x00052ee3}, /* _VMGetOwner */
     327            {15, 0x00076050}, /* g_tkExecPgm */
     328            {15, 0x0006f100}, /* _tkStartProcess */
     329            {11, 0x0000f938}, /* f_FuStrLenZ */
     330            {11, 0x0000f8ec}, /* f_FuStrLen */
     331            {11, 0x0000fa54}, /* f_FuBuff */
     332            {15, 0x0004d0d7}, /* _VMObjHandleInfo */
     333            {15, 0x00076ef0}, /* _ldrASMpMTEFromHandle */
     334            {15, 0x0006aa50}, /* _ldrOpenPath */
     335            {15, 0x000651d0}, /* _LDRClearSem */
     336            {15, 0x0006fb33}, /* _ldrFindModule */
     337            {15, 0x0000c31c}, /* _KSEMRequestMutex */
     338            {15, 0x0000c430}, /* _KSEMReleaseMutex */
     339            {15, 0x0000c490}, /* _KSEMQueryMutex */
     340            {15, 0x0000c814}, /* _KSEMInit */
     341            {10, 0x0002b654}, /* _LdrSem */
     342            {10, 0x0002b6e8}, /* _LDRLibPath */
     343            {15, 0x0005d6f4}, /* _TKSuBuff */
     344            {15, 0x00037c91}, /* _TKFuBuff */
     345            {15, 0x00037a30}, /* _TKFuBufLen */
     346            {15, 0x000651a0}, /* _ldrValidateMteHandle */
     347            {10, 0x0002afa8}, /* _pTCBCur */
     348            {10, 0x0002afa4}, /* _pPTDACur */
     349            {4 , 0x0000f898}, /* ptda_start */
     350            {4 , 0x0000f9b6}, /* ptda_environ */
     351            {4 , 0x0000fec0}, /* ptda_ptdasem */
     352            {4 , 0x0000ffaa}, /* ptda_module */
     353            {4 , 0x0000f9b8}, /* ptda_pBeginLIBPATH */
     354            {10, 0x0002d614}, /* _ldrpFileNameBuf */
     355            {15, 0x00062b20}, /* SecPathFromSFN */
     356        }
     357    },
     358#endif
     359#ifdef ALLKERNELS
     360    { /* 14040AS.SYM */
     361        14040, KF_SMP | KF_ALLSTRICT, 17,
     362        {
     363            {16, 0x0000a054}, /* _ldrRead */
     364            {16, 0x00075c00}, /* _ldrOpen */
     365            {16, 0x000770f0}, /* _ldrClose */
     366            {16, 0x000771d5}, /* _LDRQAppType */
     367            {16, 0x00072be0}, /* _ldrEnum32bitRelRecs */
     368            {16, 0x00006188}, /* _IOSftOpen */
     369            {16, 0x00006a90}, /* _IOSftClose */
     370            {16, 0x00006b8c}, /* _IOSftTransPath */
     371            {16, 0x0000666c}, /* _IOSftReadAt */
     372            {16, 0x00006673}, /* _IOSftWriteAt */
     373            {16, 0x00006cc4}, /* _SftFileSize */
     374            {16, 0x00070a30}, /* _VMAllocMem */
     375            {16, 0x0005e583}, /* _VMGetOwner */
     376            {16, 0x000824c0}, /* g_tkExecPgm */
     377            {16, 0x0007ad08}, /* _tkStartProcess */
     378            {13, 0x0000aca0}, /* f_FuStrLenZ */
     379            {13, 0x0000ac20}, /* f_FuStrLen */
     380            {13, 0x0000ae6c}, /* f_FuBuff */
     381            {16, 0x000584f0}, /* _VMObjHandleInfo */
     382            {16, 0x00083510}, /* _ldrASMpMTEFromHandle */
     383            {16, 0x00075f80}, /* _ldrOpenPath */
     384            {16, 0x000701c0}, /* _LDRClearSem */
     385            {16, 0x0007b7a3}, /* _ldrFindModule */
     386            {16, 0x0000e580}, /* _KSEMRequestMutex */
     387            {16, 0x0000e694}, /* _KSEMReleaseMutex */
     388            {16, 0x0000e6f4}, /* _KSEMQueryMutex */
     389            {16, 0x0000ea78}, /* _KSEMInit */
     390            {11, 0x0002b9b0}, /* _LdrSem */
     391            {11, 0x0002ba44}, /* _LDRLibPath */
     392            {16, 0x00067a44}, /* _TKSuBuff */
     393            {16, 0x00041710}, /* _TKFuBuff */
     394            {16, 0x00041461}, /* _TKFuBufLen */
     395            {16, 0x00070190}, /* _ldrValidateMteHandle */
     396            {0 , 0x00000aa4}, /* _pTCBCur */
     397            {0 , 0x00000aa0}, /* _pPTDACur */
     398            {5 , 0x0000f880}, /* ptda_start */
     399            {5 , 0x0000f99e}, /* ptda_environ */
     400            {5 , 0x0000fea8}, /* ptda_ptdasem */
     401            {5 , 0x0000ffa2}, /* ptda_module */
     402            {5 , 0x0000f9a0}, /* ptda_pBeginLIBPATH */
     403            {11, 0x0002d854}, /* _ldrpFileNameBuf */
     404            {16, 0x0006d6c0}, /* SecPathFromSFN */
     405        }
     406    },
     407#endif
     408#ifdef ALLKERNELS
     409    { /* 14040AU.SYM */
     410        14040, KF_UNI | KF_ALLSTRICT, 16,
     411        {
     412            {15, 0x00008744}, /* _ldrRead */
     413            {15, 0x0006a740}, /* _ldrOpen */
     414            {15, 0x0006bb70}, /* _ldrClose */
     415            {15, 0x0006bc55}, /* _LDRQAppType */
     416            {15, 0x00067a10}, /* _ldrEnum32bitRelRecs */
     417            {15, 0x00005158}, /* _IOSftOpen */
     418            {15, 0x000059c4}, /* _IOSftClose */
     419            {15, 0x00005aa0}, /* _IOSftTransPath */
     420            {15, 0x000055f8}, /* _IOSftReadAt */
     421            {15, 0x000055ff}, /* _IOSftWriteAt */
     422            {15, 0x00005bc8}, /* _SftFileSize */
     423            {15, 0x00065a40}, /* _VMAllocMem */
     424            {15, 0x00052f53}, /* _VMGetOwner */
     425            {15, 0x000760c0}, /* g_tkExecPgm */
     426            {15, 0x0006f170}, /* _tkStartProcess */
     427            {11, 0x0000f938}, /* f_FuStrLenZ */
     428            {11, 0x0000f8ec}, /* f_FuStrLen */
     429            {11, 0x0000fa54}, /* f_FuBuff */
     430            {15, 0x0004d147}, /* _VMObjHandleInfo */
     431            {15, 0x00076f60}, /* _ldrASMpMTEFromHandle */
     432            {15, 0x0006aac0}, /* _ldrOpenPath */
     433            {15, 0x00065240}, /* _LDRClearSem */
     434            {15, 0x0006fba3}, /* _ldrFindModule */
     435            {15, 0x0000c31c}, /* _KSEMRequestMutex */
     436            {15, 0x0000c430}, /* _KSEMReleaseMutex */
     437            {15, 0x0000c490}, /* _KSEMQueryMutex */
     438            {15, 0x0000c814}, /* _KSEMInit */
     439            {10, 0x0002b68c}, /* _LdrSem */
     440            {10, 0x0002b720}, /* _LDRLibPath */
     441            {15, 0x0005d764}, /* _TKSuBuff */
     442            {15, 0x00037d01}, /* _TKFuBuff */
     443            {15, 0x00037aa0}, /* _TKFuBufLen */
     444            {15, 0x00065210}, /* _ldrValidateMteHandle */
     445            {10, 0x0002afe0}, /* _pTCBCur */
     446            {10, 0x0002afdc}, /* _pPTDACur */
     447            {4 , 0x0000f898}, /* ptda_start */
     448            {4 , 0x0000f9b6}, /* ptda_environ */
     449            {4 , 0x0000fec0}, /* ptda_ptdasem */
     450            {4 , 0x0000ffaa}, /* ptda_module */
     451            {4 , 0x0000f9b8}, /* ptda_pBeginLIBPATH */
     452            {10, 0x0002d64c}, /* _ldrpFileNameBuf */
     453            {15, 0x00062b90}, /* SecPathFromSFN */
     454        }
     455    },
     456#endif
     457#ifdef ALLKERNELS
     458    { /* 14040H4.SYM */
     459        14040, KF_UNI | KF_W4 | KF_HALFSTRICT, 16,
     460        {
     461            {15, 0x00007a4c}, /* _ldrRead */
     462            {15, 0x00059260}, /* _ldrOpen */
     463            {15, 0x0005a530}, /* _ldrClose */
     464            {15, 0x0005a615}, /* _LDRQAppType */
     465            {15, 0x00056af0}, /* _ldrEnum32bitRelRecs */
     466            {15, 0x00004618}, /* _IOSftOpen */
     467            {15, 0x00004e74}, /* _IOSftClose */
     468            {15, 0x00004f4d}, /* _IOSftTransPath */
     469            {15, 0x00004aac}, /* _IOSftReadAt */
     470            {15, 0x00004ab3}, /* _IOSftWriteAt */
     471            {15, 0x00005066}, /* _SftFileSize */
     472            {15, 0x000550d0}, /* _VMAllocMem */
     473            {15, 0x0004491b}, /* _VMGetOwner */
     474            {15, 0x000638ee}, /* g_tkExecPgm */
     475            {15, 0x0005d63b}, /* _tkStartProcess */
     476            {11, 0x0000e74c}, /* f_FuStrLenZ */
     477            {11, 0x0000e702}, /* f_FuStrLen */
     478            {11, 0x0000e845}, /* f_FuBuff */
     479            {15, 0x00040823}, /* _VMObjHandleInfo */
     480            {15, 0x00064640}, /* _ldrASMpMTEFromHandle */
     481            {15, 0x000595a0}, /* _ldrOpenPath */
     482            {15, 0x00054b80}, /* _LDRClearSem */
     483            {15, 0x0005e013}, /* _ldrFindModule */
     484            {15, 0x0000b2ec}, /* _KSEMRequestMutex */
     485            {15, 0x0000b3c3}, /* _KSEMReleaseMutex */
     486            {15, 0x0000b3ee}, /* _KSEMQueryMutex */
     487            {15, 0x0000b68e}, /* _KSEMInit */
     488            {10, 0x0001e348}, /* _LdrSem */
     489            {10, 0x0001e3d0}, /* _LDRLibPath */
     490            {15, 0x0004df49}, /* _TKSuBuff */
     491            {15, 0x0002fab0}, /* _TKFuBuff */
     492            {15, 0x0002f890}, /* _TKFuBufLen */
     493            {15, 0x00054b50}, /* _ldrValidateMteHandle */
     494            {10, 0x0001dd40}, /* _pTCBCur */
     495            {10, 0x0001dd3c}, /* _pPTDACur */
     496            {4 , 0x0000f8a0}, /* ptda_start */
     497            {4 , 0x0000f9be}, /* ptda_environ */
     498            {4 , 0x0000fec8}, /* ptda_ptdasem */
     499            {4 , 0x0000ffaa}, /* ptda_module */
     500            {4 , 0x0000f9c0}, /* ptda_pBeginLIBPATH */
     501            {10, 0x0001f838}, /* _ldrpFileNameBuf */
     502            {15, 0x00052ab0}, /* SecPathFromSFN */
     503        }
     504    },
     505#endif
     506#ifdef ALLKERNELS
     507    { /* 14040HS.SYM */
     508        14040, KF_SMP | KF_HALFSTRICT, 17,
     509        {
     510            {16, 0x00008fd4}, /* _ldrRead */
     511            {16, 0x00063af0}, /* _ldrOpen */
     512            {16, 0x00064e90}, /* _ldrClose */
     513            {16, 0x00064f75}, /* _LDRQAppType */
     514            {16, 0x000610a0}, /* _ldrEnum32bitRelRecs */
     515            {16, 0x00005308}, /* _IOSftOpen */
     516            {16, 0x00005c01}, /* _IOSftClose */
     517            {16, 0x00005cfc}, /* _IOSftTransPath */
     518            {16, 0x000057e0}, /* _IOSftReadAt */
     519            {16, 0x000057e7}, /* _IOSftWriteAt */
     520            {16, 0x00005e26}, /* _SftFileSize */
     521            {16, 0x0005f4a0}, /* _VMAllocMem */
     522            {16, 0x0004f44b}, /* _VMGetOwner */
     523            {16, 0x0006f08e}, /* g_tkExecPgm */
     524            {16, 0x00068571}, /* _tkStartProcess */
     525            {13, 0x00009eec}, /* f_FuStrLenZ */
     526            {13, 0x00009e6c}, /* f_FuStrLen */
     527            {13, 0x0000a096}, /* f_FuBuff */
     528            {16, 0x0004b104}, /* _VMObjHandleInfo */
     529            {16, 0x0006ff70}, /* _ldrASMpMTEFromHandle */
     530            {16, 0x00063e30}, /* _ldrOpenPath */
     531            {16, 0x0005eef0}, /* _LDRClearSem */
     532            {16, 0x00068fb3}, /* _ldrFindModule */
     533            {16, 0x0000d0d8}, /* _KSEMRequestMutex */
     534            {16, 0x0000d1af}, /* _KSEMReleaseMutex */
     535            {16, 0x0000d1da}, /* _KSEMQueryMutex */
     536            {16, 0x0000d47a}, /* _KSEMInit */
     537            {11, 0x0001d8d4}, /* _LdrSem */
     538            {11, 0x0001d95c}, /* _LDRLibPath */
     539            {16, 0x000575b7}, /* _TKSuBuff */
     540            {16, 0x00038b90}, /* _TKFuBuff */
     541            {16, 0x00038921}, /* _TKFuBufLen */
     542            {16, 0x0005eec0}, /* _ldrValidateMteHandle */
     543            {0 , 0x00000aa4}, /* _pTCBCur */
     544            {0 , 0x00000aa0}, /* _pPTDACur */
     545            {5 , 0x0000f88c}, /* ptda_start */
     546            {5 , 0x0000f9aa}, /* ptda_environ */
     547            {5 , 0x0000feb4}, /* ptda_ptdasem */
     548            {5 , 0x0000ffa2}, /* ptda_module */
     549            {5 , 0x0000f9ac}, /* ptda_pBeginLIBPATH */
     550            {11, 0x0001edb8}, /* _ldrpFileNameBuf */
     551            {16, 0x0005ca00}, /* SecPathFromSFN */
     552        }
     553    },
     554#endif
     555#ifdef ALLKERNELS
     556    { /* 14040HU.SYM */
     557        14040, KF_UNI | KF_HALFSTRICT, 16,
     558        {
     559            {15, 0x00007a4c}, /* _ldrRead */
     560            {15, 0x000592d0}, /* _ldrOpen */
     561            {15, 0x0005a5a0}, /* _ldrClose */
     562            {15, 0x0005a685}, /* _LDRQAppType */
     563            {15, 0x00056b60}, /* _ldrEnum32bitRelRecs */
     564            {15, 0x00004618}, /* _IOSftOpen */
     565            {15, 0x00004e74}, /* _IOSftClose */
     566            {15, 0x00004f4d}, /* _IOSftTransPath */
     567            {15, 0x00004aac}, /* _IOSftReadAt */
     568            {15, 0x00004ab3}, /* _IOSftWriteAt */
     569            {15, 0x00005066}, /* _SftFileSize */
     570            {15, 0x00055140}, /* _VMAllocMem */
     571            {15, 0x0004498b}, /* _VMGetOwner */
     572            {15, 0x0006395e}, /* g_tkExecPgm */
     573            {15, 0x0005d6ab}, /* _tkStartProcess */
     574            {11, 0x0000e74c}, /* f_FuStrLenZ */
     575            {11, 0x0000e702}, /* f_FuStrLen */
     576            {11, 0x0000e845}, /* f_FuBuff */
     577            {15, 0x00040893}, /* _VMObjHandleInfo */
     578            {15, 0x000646b0}, /* _ldrASMpMTEFromHandle */
     579            {15, 0x00059610}, /* _ldrOpenPath */
     580            {15, 0x00054bf0}, /* _LDRClearSem */
     581            {15, 0x0005e083}, /* _ldrFindModule */
     582            {15, 0x0000b2ec}, /* _KSEMRequestMutex */
     583            {15, 0x0000b3c3}, /* _KSEMReleaseMutex */
     584            {15, 0x0000b3ee}, /* _KSEMQueryMutex */
     585            {15, 0x0000b68e}, /* _KSEMInit */
     586            {10, 0x0001e348}, /* _LdrSem */
     587            {10, 0x0001e3d0}, /* _LDRLibPath */
     588            {15, 0x0004dfb9}, /* _TKSuBuff */
     589            {15, 0x0002fb20}, /* _TKFuBuff */
     590            {15, 0x0002f900}, /* _TKFuBufLen */
     591            {15, 0x00054bc0}, /* _ldrValidateMteHandle */
     592            {10, 0x0001dd40}, /* _pTCBCur */
     593            {10, 0x0001dd3c}, /* _pPTDACur */
     594            {4 , 0x0000f8a0}, /* ptda_start */
     595            {4 , 0x0000f9be}, /* ptda_environ */
     596            {4 , 0x0000fec8}, /* ptda_ptdasem */
     597            {4 , 0x0000ffaa}, /* ptda_module */
     598            {4 , 0x0000f9c0}, /* ptda_pBeginLIBPATH */
     599            {10, 0x0001f838}, /* _ldrpFileNameBuf */
     600            {15, 0x00052b20}, /* SecPathFromSFN */
     601        }
     602    },
     603#endif
    61604    { /* 14040R4.SYM */
    62         14040, 'R', TYPE_W4, 14,
     605        14040, KF_UNI | KF_W4, 14,
    63606        {
    64607            {13, 0x000070dc}, /* _ldrRead */
     
    76619            {13, 0x00042ecb}, /* _VMGetOwner */
    77620            {13, 0x00061dde}, /* g_tkExecPgm */
    78             {9, 0x0000e74c}, /* f_FuStrLenZ */
    79             {9, 0x0000e702}, /* f_FuStrLen */
    80             {9, 0x0000e845}, /* f_FuBuff */
     621            {13, 0x0005bb4b}, /* _tkStartProcess */
     622            {9 , 0x0000e74c}, /* f_FuStrLenZ */
     623            {9 , 0x0000e702}, /* f_FuStrLen */
     624            {9 , 0x0000e845}, /* f_FuBuff */
     625            {13, 0x0003edd3}, /* _VMObjHandleInfo */
     626            {13, 0x00062b30}, /* _ldrASMpMTEFromHandle */
     627            {13, 0x00057ac0}, /* _ldrOpenPath */
     628            {13, 0x000530a0}, /* _LDRClearSem */
     629            {13, 0x0005c503}, /* _ldrFindModule */
     630            {13, 0x0000a8d4}, /* _KSEMRequestMutex */
     631            {13, 0x0000a967}, /* _KSEMReleaseMutex */
     632            {13, 0x0000a992}, /* _KSEMQueryMutex */
     633            {13, 0x0000aba7}, /* _KSEMInit */
     634            {8 , 0x0000dd2c}, /* _LdrSem */
     635            {8 , 0x0000ddb4}, /* _LDRLibPath */
     636            {13, 0x0004c465}, /* _TKSuBuff */
     637            {13, 0x0002e190}, /* _TKFuBuff */
     638            {13, 0x0002df70}, /* _TKFuBufLen */
     639            {13, 0x00053070}, /* _ldrValidateMteHandle */
     640            {8 , 0x0000d720}, /* _pTCBCur */
     641            {8 , 0x0000d71c}, /* _pPTDACur */
     642            {2 , 0x0000f8a0}, /* ptda_start */
     643            {2 , 0x0000f9be}, /* ptda_environ */
     644            {2 , 0x0000fec8}, /* ptda_ptdasem */
     645            {2 , 0x0000ffaa}, /* ptda_module */
     646            {2 , 0x0000f9c0}, /* ptda_pBeginLIBPATH */
     647            {8 , 0x0000f1fc}, /* _ldrpFileNameBuf */
     648            {13, 0x00050fd0}, /* SecPathFromSFN */
     649        }
     650    },
     651    { /* 14040RS.SYM */
     652        14040, KF_SMP, 15,
     653        {
     654            {14, 0x0000838c}, /* _ldrRead */
     655            {14, 0x00061650}, /* _ldrOpen */
     656            {14, 0x000629f0}, /* _ldrClose */
     657            {14, 0x00062ad5}, /* _LDRQAppType */
     658            {14, 0x0005ec00}, /* _ldrEnum32bitRelRecs */
     659            {14, 0x00005268}, /* _IOSftOpen */
     660            {14, 0x00005b61}, /* _IOSftClose */
     661            {14, 0x00005c5c}, /* _IOSftTransPath */
     662            {14, 0x00005740}, /* _IOSftReadAt */
     663            {14, 0x00005747}, /* _IOSftWriteAt */
     664            {14, 0x00005d86}, /* _SftFileSize */
     665            {14, 0x0005d000}, /* _VMAllocMem */
     666            {14, 0x0004d03b}, /* _VMGetOwner */
     667            {14, 0x0006cbde}, /* g_tkExecPgm */
     668            {14, 0x000660d1}, /* _tkStartProcess */
     669            {11, 0x00009e0c}, /* f_FuStrLenZ */
     670            {11, 0x00009d8c}, /* f_FuStrLen */
     671            {11, 0x00009fb6}, /* f_FuBuff */
     672            {14, 0x00048cf4}, /* _VMObjHandleInfo */
     673            {14, 0x0006dac0}, /* _ldrASMpMTEFromHandle */
     674            {14, 0x00061990}, /* _ldrOpenPath */
     675            {14, 0x0005ca50}, /* _LDRClearSem */
     676            {14, 0x00066b03}, /* _ldrFindModule */
     677            {14, 0x0000c384}, /* _KSEMRequestMutex */
     678            {14, 0x0000c417}, /* _KSEMReleaseMutex */
     679            {14, 0x0000c442}, /* _KSEMQueryMutex */
     680            {14, 0x0000c657}, /* _KSEMInit */
     681            {9 , 0x0000d2a4}, /* _LdrSem */
     682            {9 , 0x0000d32c}, /* _LDRLibPath */
     683            {14, 0x00055113}, /* _TKSuBuff */
     684            {14, 0x000368b0}, /* _TKFuBuff */
     685            {14, 0x00036641}, /* _TKFuBufLen */
     686            {14, 0x0005ca20}, /* _ldrValidateMteHandle */
     687            {0 , 0x00000aa4}, /* _pTCBCur */
     688            {0 , 0x00000aa0}, /* _pPTDACur */
     689            {3 , 0x0000f88c}, /* ptda_start */
     690            {3 , 0x0000f9aa}, /* ptda_environ */
     691            {3 , 0x0000feb4}, /* ptda_ptdasem */
     692            {3 , 0x0000ffa2}, /* ptda_module */
     693            {3 , 0x0000f9ac}, /* ptda_pBeginLIBPATH */
     694            {9 , 0x0000e768}, /* _ldrpFileNameBuf */
     695            {14, 0x0005a560}, /* SecPathFromSFN */
     696        }
     697    },
     698    { /* 14040RU.SYM */
     699        14040, KF_UNI, 14,
     700        {
     701            {13, 0x000070dc}, /* _ldrRead */
     702            {13, 0x000577f0}, /* _ldrOpen */
     703            {13, 0x00058ac0}, /* _ldrClose */
     704            {13, 0x00058ba5}, /* _LDRQAppType */
     705            {13, 0x00055080}, /* _ldrEnum32bitRelRecs */
     706            {13, 0x00004598}, /* _IOSftOpen */
     707            {13, 0x00004df4}, /* _IOSftClose */
     708            {13, 0x00004ecd}, /* _IOSftTransPath */
     709            {13, 0x00004a2c}, /* _IOSftReadAt */
     710            {13, 0x00004a33}, /* _IOSftWriteAt */
     711            {13, 0x00004fe6}, /* _SftFileSize */
     712            {13, 0x00053660}, /* _VMAllocMem */
     713            {13, 0x00042f3b}, /* _VMGetOwner */
     714            {13, 0x00061e4e}, /* g_tkExecPgm */
     715            {13, 0x0005bbbb}, /* _tkStartProcess */
     716            {9 , 0x0000e74c}, /* f_FuStrLenZ */
     717            {9 , 0x0000e702}, /* f_FuStrLen */
     718            {9 , 0x0000e845}, /* f_FuBuff */
     719            {13, 0x0003ee43}, /* _VMObjHandleInfo */
     720            {13, 0x00062ba0}, /* _ldrASMpMTEFromHandle */
     721            {13, 0x00057b30}, /* _ldrOpenPath */
     722            {13, 0x00053110}, /* _LDRClearSem */
     723            {13, 0x0005c573}, /* _ldrFindModule */
     724            {13, 0x0000a8d4}, /* _KSEMRequestMutex */
     725            {13, 0x0000a967}, /* _KSEMReleaseMutex */
     726            {13, 0x0000a992}, /* _KSEMQueryMutex */
     727            {13, 0x0000aba7}, /* _KSEMInit */
     728            {8 , 0x0000dd2c}, /* _LdrSem */
     729            {8 , 0x0000ddb4}, /* _LDRLibPath */
     730            {13, 0x0004c4d5}, /* _TKSuBuff */
     731            {13, 0x0002e200}, /* _TKFuBuff */
     732            {13, 0x0002dfe0}, /* _TKFuBufLen */
     733            {13, 0x000530e0}, /* _ldrValidateMteHandle */
     734            {8 , 0x0000d720}, /* _pTCBCur */
     735            {8 , 0x0000d71c}, /* _pPTDACur */
     736            {2 , 0x0000f8a0}, /* ptda_start */
     737            {2 , 0x0000f9be}, /* ptda_environ */
     738            {2 , 0x0000fec8}, /* ptda_ptdasem */
     739            {2 , 0x0000ffaa}, /* ptda_module */
     740            {2 , 0x0000f9c0}, /* ptda_pBeginLIBPATH */
     741            {8 , 0x0000f1fc}, /* _ldrpFileNameBuf */
     742            {13, 0x00051040}, /* SecPathFromSFN */
     743        }
     744    },
     745#ifdef ALLKERNELS
     746    { /* 14044HU.SYM */
     747        14044, KF_UNI | KF_HALFSTRICT, 16,
     748        {
     749            {15, 0x0000873c}, /* _ldrRead */
     750            {15, 0x0006a010}, /* _ldrOpen */
     751            {15, 0x0006b440}, /* _ldrClose */
     752            {15, 0x0006b525}, /* _LDRQAppType */
     753            {15, 0x00067640}, /* _ldrEnum32bitRelRecs */
     754            {15, 0x00005138}, /* _IOSftOpen */
     755            {15, 0x000059a4}, /* _IOSftClose */
     756            {15, 0x00005a80}, /* _IOSftTransPath */
     757            {15, 0x000055d8}, /* _IOSftReadAt */
     758            {15, 0x000055df}, /* _IOSftWriteAt */
     759            {15, 0x00005ba8}, /* _SftFileSize */
     760            {15, 0x000657a0}, /* _VMAllocMem */
     761            {15, 0x00052d33}, /* _VMGetOwner */
     762            {15, 0x00075710}, /* g_tkExecPgm */
     763            {15, 0x0006ea50}, /* _tkStartProcess */
     764            {11, 0x0000f938}, /* f_FuStrLenZ */
     765            {11, 0x0000f8ec}, /* f_FuStrLen */
     766            {11, 0x0000fa54}, /* f_FuBuff */
     767            {15, 0x0004cf27}, /* _VMObjHandleInfo */
     768            {15, 0x000765b0}, /* _ldrASMpMTEFromHandle */
     769            {15, 0x0006a390}, /* _ldrOpenPath */
     770            {15, 0x00064fa0}, /* _LDRClearSem */
     771            {15, 0x0006f483}, /* _ldrFindModule */
     772            {15, 0x0000bc7c}, /* _KSEMRequestMutex */
     773            {15, 0x0000bd90}, /* _KSEMReleaseMutex */
     774            {15, 0x0000bdf0}, /* _KSEMQueryMutex */
     775            {15, 0x0000c174}, /* _KSEMInit */
     776            {10, 0x0002b8f8}, /* _LdrSem */
     777            {10, 0x0002b98c}, /* _LDRLibPath */
     778            {15, 0x0005d548}, /* _TKSuBuff */
     779            {15, 0x00037cf1}, /* _TKFuBuff */
     780            {15, 0x00037a90}, /* _TKFuBufLen */
     781            {15, 0x00064f70}, /* _ldrValidateMteHandle */
     782            {10, 0x0002b24c}, /* _pTCBCur */
     783            {10, 0x0002b248}, /* _pPTDACur */
     784            {4 , 0x0000f898}, /* ptda_start */
     785            {4 , 0x0000f9b6}, /* ptda_environ */
     786            {4 , 0x0000fec0}, /* ptda_ptdasem */
     787            {4 , 0x0000ffaa}, /* ptda_module */
     788            {4 , 0x0000f9b8}, /* ptda_pBeginLIBPATH */
     789            {10, 0x0002d8b8}, /* _ldrpFileNameBuf */
     790            {15, 0x00062930}, /* SecPathFromSFN */
     791        }
     792    },
     793#endif
     794    { /* 14044R4.SYM */
     795        14044, KF_UNI | KF_W4, 14,
     796        {
     797            {13, 0x000070e0}, /* _ldrRead */
     798            {13, 0x00056f40}, /* _ldrOpen */
     799            {13, 0x00058210}, /* _ldrClose */
     800            {13, 0x000582f5}, /* _LDRQAppType */
     801            {13, 0x00054aa0}, /* _ldrEnum32bitRelRecs */
     802            {13, 0x00004588}, /* _IOSftOpen */
     803            {13, 0x00004de4}, /* _IOSftClose */
     804            {13, 0x00004ebd}, /* _IOSftTransPath */
     805            {13, 0x00004a1c}, /* _IOSftReadAt */
     806            {13, 0x00004a23}, /* _IOSftWriteAt */
     807            {13, 0x00004fd6}, /* _SftFileSize */
     808            {13, 0x000531e0}, /* _VMAllocMem */
     809            {13, 0x00042b3b}, /* _VMGetOwner */
     810            {13, 0x0006132e}, /* g_tkExecPgm */
     811            {13, 0x0005b2fb}, /* _tkStartProcess */
     812            {9 , 0x0000e74c}, /* f_FuStrLenZ */
     813            {9 , 0x0000e702}, /* f_FuStrLen */
     814            {9 , 0x0000e845}, /* f_FuBuff */
     815            {13, 0x0003ea43}, /* _VMObjHandleInfo */
     816            {13, 0x00062080}, /* _ldrASMpMTEFromHandle */
     817            {13, 0x00057280}, /* _ldrOpenPath */
     818            {13, 0x00052c90}, /* _LDRClearSem */
     819            {13, 0x0005bcb3}, /* _ldrFindModule */
     820            {13, 0x0000a128}, /* _KSEMRequestMutex */
     821            {13, 0x0000a1bb}, /* _KSEMReleaseMutex */
     822            {13, 0x0000a1e6}, /* _KSEMQueryMutex */
     823            {13, 0x0000a3fb}, /* _KSEMInit */
     824            {8 , 0x0000dd28}, /* _LdrSem */
     825            {8 , 0x0000ddb0}, /* _LDRLibPath */
     826            {13, 0x0004c0d5}, /* _TKSuBuff */
     827            {13, 0x0002dfb0}, /* _TKFuBuff */
     828            {13, 0x0002dd90}, /* _TKFuBufLen */
     829            {13, 0x00052c60}, /* _ldrValidateMteHandle */
     830            {8 , 0x0000d71c}, /* _pTCBCur */
     831            {8 , 0x0000d718}, /* _pPTDACur */
     832            {2 , 0x0000f8a0}, /* ptda_start */
     833            {2 , 0x0000f9be}, /* ptda_environ */
     834            {2 , 0x0000fec8}, /* ptda_ptdasem */
     835            {2 , 0x0000ffaa}, /* ptda_module */
     836            {2 , 0x0000f9c0}, /* ptda_pBeginLIBPATH */
     837            {8 , 0x0000f1f8}, /* _ldrpFileNameBuf */
     838            {13, 0x00050c00}, /* SecPathFromSFN */
     839        }
     840    },
     841    { /* 14045R4.SYM */
     842        14045, KF_UNI | KF_W4, 14,
     843        {
     844            {13, 0x000070ec}, /* _ldrRead */
     845            {13, 0x00056f60}, /* _ldrOpen */
     846            {13, 0x00058230}, /* _ldrClose */
     847            {13, 0x00058315}, /* _LDRQAppType */
     848            {13, 0x00054ac0}, /* _ldrEnum32bitRelRecs */
     849            {13, 0x00004588}, /* _IOSftOpen */
     850            {13, 0x00004de4}, /* _IOSftClose */
     851            {13, 0x00004ebd}, /* _IOSftTransPath */
     852            {13, 0x00004a1c}, /* _IOSftReadAt */
     853            {13, 0x00004a23}, /* _IOSftWriteAt */
     854            {13, 0x00004fd6}, /* _SftFileSize */
     855            {13, 0x00053200}, /* _VMAllocMem */
     856            {13, 0x00042b5b}, /* _VMGetOwner */
     857            {13, 0x0006134e}, /* g_tkExecPgm */
     858            {13, 0x0005b31b}, /* _tkStartProcess */
     859            {9 , 0x0000e74c}, /* f_FuStrLenZ */
     860            {9 , 0x0000e702}, /* f_FuStrLen */
     861            {9 , 0x0000e845}, /* f_FuBuff */
     862            {13, 0x0003ea63}, /* _VMObjHandleInfo */
     863            {13, 0x000620a0}, /* _ldrASMpMTEFromHandle */
     864            {13, 0x000572a0}, /* _ldrOpenPath */
     865            {13, 0x00052cb0}, /* _LDRClearSem */
     866            {13, 0x0005bcd3}, /* _ldrFindModule */
     867            {13, 0x0000a140}, /* _KSEMRequestMutex */
     868            {13, 0x0000a1d3}, /* _KSEMReleaseMutex */
     869            {13, 0x0000a1fe}, /* _KSEMQueryMutex */
     870            {13, 0x0000a413}, /* _KSEMInit */
     871            {8 , 0x0000dd28}, /* _LdrSem */
     872            {8 , 0x0000ddb0}, /* _LDRLibPath */
     873            {13, 0x0004c0f5}, /* _TKSuBuff */
     874            {13, 0x0002dfd0}, /* _TKFuBuff */
     875            {13, 0x0002ddb0}, /* _TKFuBufLen */
     876            {13, 0x00052c80}, /* _ldrValidateMteHandle */
     877            {8 , 0x0000d71c}, /* _pTCBCur */
     878            {8 , 0x0000d718}, /* _pPTDACur */
     879            {2 , 0x0000f8a0}, /* ptda_start */
     880            {2 , 0x0000f9be}, /* ptda_environ */
     881            {2 , 0x0000fec8}, /* ptda_ptdasem */
     882            {2 , 0x0000ffaa}, /* ptda_module */
     883            {2 , 0x0000f9c0}, /* ptda_pBeginLIBPATH */
     884            {8 , 0x0000f1f8}, /* _ldrpFileNameBuf */
     885            {13, 0x00050c20}, /* SecPathFromSFN */
     886        }
     887    },
     888#ifdef ALLKERNELS
     889    { /* 14046A4.SYM */
     890        14046, KF_UNI | KF_W4 | KF_ALLSTRICT, 16,
     891        {
     892            {15, 0x00007a3c}, /* _ldrRead */
     893            {15, 0x00058a30}, /* _ldrOpen */
     894            {15, 0x00059d00}, /* _ldrClose */
     895            {15, 0x00059de5}, /* _LDRQAppType */
     896            {15, 0x00056590}, /* _ldrEnum32bitRelRecs */
     897            {15, 0x00004608}, /* _IOSftOpen */
     898            {15, 0x00004e64}, /* _IOSftClose */
     899            {15, 0x00004f3d}, /* _IOSftTransPath */
     900            {15, 0x00004a9c}, /* _IOSftReadAt */
     901            {15, 0x00004aa3}, /* _IOSftWriteAt */
     902            {15, 0x00005056}, /* _SftFileSize */
     903            {15, 0x00054cd0}, /* _VMAllocMem */
     904            {15, 0x0004459b}, /* _VMGetOwner */
     905            {15, 0x00062e4e}, /* g_tkExecPgm */
     906            {15, 0x0005cdfb}, /* _tkStartProcess */
     907            {11, 0x0000e74c}, /* f_FuStrLenZ */
     908            {11, 0x0000e702}, /* f_FuStrLen */
     909            {11, 0x0000e845}, /* f_FuBuff */
     910            {15, 0x000404a3}, /* _VMObjHandleInfo */
     911            {15, 0x00063ba0}, /* _ldrASMpMTEFromHandle */
     912            {15, 0x00058d70}, /* _ldrOpenPath */
     913            {15, 0x00054780}, /* _LDRClearSem */
     914            {15, 0x0005d7d3}, /* _ldrFindModule */
     915            {15, 0x0000ab1c}, /* _KSEMRequestMutex */
     916            {15, 0x0000abf3}, /* _KSEMReleaseMutex */
     917            {15, 0x0000ac1e}, /* _KSEMQueryMutex */
     918            {15, 0x0000aebe}, /* _KSEMInit */
     919            {10, 0x0001e344}, /* _LdrSem */
     920            {10, 0x0001e3cc}, /* _LDRLibPath */
     921            {15, 0x0004dbc9}, /* _TKSuBuff */
     922            {15, 0x0002f8c0}, /* _TKFuBuff */
     923            {15, 0x0002f6a0}, /* _TKFuBufLen */
     924            {15, 0x00054750}, /* _ldrValidateMteHandle */
     925            {10, 0x0001dd3c}, /* _pTCBCur */
     926            {10, 0x0001dd38}, /* _pPTDACur */
     927            {4 , 0x0000f8a0}, /* ptda_start */
     928            {4 , 0x0000f9be}, /* ptda_environ */
     929            {4 , 0x0000fec8}, /* ptda_ptdasem */
     930            {4 , 0x0000ffaa}, /* ptda_module */
     931            {4 , 0x0000f9c0}, /* ptda_pBeginLIBPATH */
     932            {10, 0x0001f834}, /* _ldrpFileNameBuf */
     933            {15, 0x000526f0}, /* SecPathFromSFN */
     934        }
     935    },
     936#endif
     937    { /* 14046R4.SYM */
     938        14046, KF_UNI | KF_W4, 14,
     939        {
     940            {13, 0x000070cc}, /* _ldrRead */
     941            {13, 0x00056f30}, /* _ldrOpen */
     942            {13, 0x00058200}, /* _ldrClose */
     943            {13, 0x000582e5}, /* _LDRQAppType */
     944            {13, 0x00054a90}, /* _ldrEnum32bitRelRecs */
     945            {13, 0x00004588}, /* _IOSftOpen */
     946            {13, 0x00004de4}, /* _IOSftClose */
     947            {13, 0x00004ebd}, /* _IOSftTransPath */
     948            {13, 0x00004a1c}, /* _IOSftReadAt */
     949            {13, 0x00004a23}, /* _IOSftWriteAt */
     950            {13, 0x00004fd6}, /* _SftFileSize */
     951            {13, 0x000531d0}, /* _VMAllocMem */
     952            {13, 0x00042b2b}, /* _VMGetOwner */
     953            {13, 0x0006131e}, /* g_tkExecPgm */
     954            {13, 0x0005b2eb}, /* _tkStartProcess */
     955            {9 , 0x0000e74c}, /* f_FuStrLenZ */
     956            {9 , 0x0000e702}, /* f_FuStrLen */
     957            {9 , 0x0000e845}, /* f_FuBuff */
     958            {13, 0x0003ea33}, /* _VMObjHandleInfo */
     959            {13, 0x00062070}, /* _ldrASMpMTEFromHandle */
     960            {13, 0x00057270}, /* _ldrOpenPath */
     961            {13, 0x00052c80}, /* _LDRClearSem */
     962            {13, 0x0005bca3}, /* _ldrFindModule */
     963            {13, 0x0000a100}, /* _KSEMRequestMutex */
     964            {13, 0x0000a193}, /* _KSEMReleaseMutex */
     965            {13, 0x0000a1be}, /* _KSEMQueryMutex */
     966            {13, 0x0000a3d3}, /* _KSEMInit */
     967            {8 , 0x0000dd28}, /* _LdrSem */
     968            {8 , 0x0000ddb0}, /* _LDRLibPath */
     969            {13, 0x0004c0c5}, /* _TKSuBuff */
     970            {13, 0x0002df80}, /* _TKFuBuff */
     971            {13, 0x0002dd60}, /* _TKFuBufLen */
     972            {13, 0x00052c50}, /* _ldrValidateMteHandle */
     973            {8 , 0x0000d71c}, /* _pTCBCur */
     974            {8 , 0x0000d718}, /* _pPTDACur */
     975            {2 , 0x0000f8a0}, /* ptda_start */
     976            {2 , 0x0000f9be}, /* ptda_environ */
     977            {2 , 0x0000fec8}, /* ptda_ptdasem */
     978            {2 , 0x0000ffaa}, /* ptda_module */
     979            {2 , 0x0000f9c0}, /* ptda_pBeginLIBPATH */
     980            {8 , 0x0000f1f8}, /* _ldrpFileNameBuf */
     981            {13, 0x00050bf0}, /* SecPathFromSFN */
     982        }
     983    },
     984    { /* 14048RS.SYM */
     985        14048, KF_SMP, 15,
     986        {
     987            {14, 0x0000836c}, /* _ldrRead */
     988            {14, 0x00060e10}, /* _ldrOpen */
     989            {14, 0x000621b0}, /* _ldrClose */
     990            {14, 0x00062295}, /* _LDRQAppType */
     991            {14, 0x0005e690}, /* _ldrEnum32bitRelRecs */
     992            {14, 0x00005248}, /* _IOSftOpen */
     993            {14, 0x00005b41}, /* _IOSftClose */
     994            {14, 0x00005c3c}, /* _IOSftTransPath */
     995            {14, 0x00005720}, /* _IOSftReadAt */
     996            {14, 0x00005727}, /* _IOSftWriteAt */
     997            {14, 0x00005d66}, /* _SftFileSize */
     998            {14, 0x0005cbd0}, /* _VMAllocMem */
     999            {14, 0x0004cc8b}, /* _VMGetOwner */
     1000            {14, 0x0006c13e}, /* g_tkExecPgm */
     1001            {14, 0x00065871}, /* _tkStartProcess */
     1002            {11, 0x00009e0c}, /* f_FuStrLenZ */
     1003            {11, 0x00009d8c}, /* f_FuStrLen */
     1004            {11, 0x00009fb6}, /* f_FuBuff */
     1005            {14, 0x00048944}, /* _VMObjHandleInfo */
     1006            {14, 0x0006d020}, /* _ldrASMpMTEFromHandle */
     1007            {14, 0x00061150}, /* _ldrOpenPath */
     1008            {14, 0x0005c620}, /* _LDRClearSem */
     1009            {14, 0x000662a3}, /* _ldrFindModule */
     1010            {14, 0x0000bb3c}, /* _KSEMRequestMutex */
     1011            {14, 0x0000bbcf}, /* _KSEMReleaseMutex */
     1012            {14, 0x0000bbfa}, /* _KSEMQueryMutex */
     1013            {14, 0x0000be0f}, /* _KSEMInit */
     1014            {9 , 0x0000d2a0}, /* _LdrSem */
     1015            {9 , 0x0000d328}, /* _LDRLibPath */
     1016            {14, 0x00054d63}, /* _TKSuBuff */
     1017            {14, 0x000366a0}, /* _TKFuBuff */
     1018            {14, 0x00036431}, /* _TKFuBufLen */
     1019            {14, 0x0005c5f0}, /* _ldrValidateMteHandle */
     1020            {0 , 0x00000aa4}, /* _pTCBCur */
     1021            {0 , 0x00000aa0}, /* _pPTDACur */
     1022            {3 , 0x0000f88c}, /* ptda_start */
     1023            {3 , 0x0000f9aa}, /* ptda_environ */
     1024            {3 , 0x0000feb4}, /* ptda_ptdasem */
     1025            {3 , 0x0000ffa2}, /* ptda_module */
     1026            {3 , 0x0000f9ac}, /* ptda_pBeginLIBPATH */
     1027            {9 , 0x0000e764}, /* _ldrpFileNameBuf */
     1028            {14, 0x0005a170}, /* SecPathFromSFN */
     1029        }
     1030    },
     1031    { /* 14048RU.SYM */
     1032        14048, KF_UNI, 14,
     1033        {
     1034            {13, 0x000070cc}, /* _ldrRead */
     1035            {13, 0x00056fa0}, /* _ldrOpen */
     1036            {13, 0x00058270}, /* _ldrClose */
     1037            {13, 0x00058355}, /* _LDRQAppType */
     1038            {13, 0x00054b00}, /* _ldrEnum32bitRelRecs */
     1039            {13, 0x00004588}, /* _IOSftOpen */
     1040            {13, 0x00004de4}, /* _IOSftClose */
     1041            {13, 0x00004ebd}, /* _IOSftTransPath */
     1042            {13, 0x00004a1c}, /* _IOSftReadAt */
     1043            {13, 0x00004a23}, /* _IOSftWriteAt */
     1044            {13, 0x00004fd6}, /* _SftFileSize */
     1045            {13, 0x00053240}, /* _VMAllocMem */
     1046            {13, 0x00042b9b}, /* _VMGetOwner */
     1047            {13, 0x0006138e}, /* g_tkExecPgm */
     1048            {13, 0x0005b35b}, /* _tkStartProcess */
     1049            {9 , 0x0000e74c}, /* f_FuStrLenZ */
     1050            {9 , 0x0000e702}, /* f_FuStrLen */
     1051            {9 , 0x0000e845}, /* f_FuBuff */
     1052            {13, 0x0003eaa3}, /* _VMObjHandleInfo */
     1053            {13, 0x000620e0}, /* _ldrASMpMTEFromHandle */
     1054            {13, 0x000572e0}, /* _ldrOpenPath */
     1055            {13, 0x00052cf0}, /* _LDRClearSem */
     1056            {13, 0x0005bd13}, /* _ldrFindModule */
     1057            {13, 0x0000a100}, /* _KSEMRequestMutex */
     1058            {13, 0x0000a193}, /* _KSEMReleaseMutex */
     1059            {13, 0x0000a1be}, /* _KSEMQueryMutex */
     1060            {13, 0x0000a3d3}, /* _KSEMInit */
     1061            {8 , 0x0000dd28}, /* _LdrSem */
     1062            {8 , 0x0000ddb0}, /* _LDRLibPath */
     1063            {13, 0x0004c135}, /* _TKSuBuff */
     1064            {13, 0x0002dff0}, /* _TKFuBuff */
     1065            {13, 0x0002ddd0}, /* _TKFuBufLen */
     1066            {13, 0x00052cc0}, /* _ldrValidateMteHandle */
     1067            {8 , 0x0000d71c}, /* _pTCBCur */
     1068            {8 , 0x0000d718}, /* _pPTDACur */
     1069            {2 , 0x0000f8a0}, /* ptda_start */
     1070            {2 , 0x0000f9be}, /* ptda_environ */
     1071            {2 , 0x0000fec8}, /* ptda_ptdasem */
     1072            {2 , 0x0000ffaa}, /* ptda_module */
     1073            {2 , 0x0000f9c0}, /* ptda_pBeginLIBPATH */
     1074            {8 , 0x0000f1f8}, /* _ldrpFileNameBuf */
     1075            {13, 0x00050c60}, /* SecPathFromSFN */
    811076        }
    821077    },
    831078    { /* 8255RS.SYM */
    84         8255, 'R', TYPE_SMP, 15,
     1079        8255, KF_SMP, 15,
    851080        {
    861081            {14, 0x0000b434}, /* _ldrRead */
     
    981093            {14, 0x00026624}, /* _VMGetOwner */
    991094            {14, 0x0004f84e}, /* g_tkExecPgm */
     1095            {14, 0x0004c099}, /* _tkStartProcess */
    1001096            {11, 0x0000a168}, /* f_FuStrLenZ */
    1011097            {11, 0x0000a0e8}, /* f_FuStrLen */
    1021098            {11, 0x0000a311}, /* f_FuBuff */
     1099            {14, 0x0002527b}, /* _VMObjHandleInfo */
     1100            {14, 0x00050240}, /* _ldrASMpMTEFromHandle */
     1101            {14, 0x00045aba}, /* _ldrOpenPath */
     1102            {14, 0x00042324}, /* _LDRClearSem */
     1103            {14, 0x0004b762}, /* _ldrFindModule */
     1104            {14, 0x0000ca44}, /* _KSEMRequestMutex */
     1105            {14, 0x0000cad7}, /* _KSEMReleaseMutex */
     1106            {14, 0x0000cb02}, /* _KSEMQueryMutex */
     1107            {14, 0x0000cd17}, /* _KSEMInit */
     1108            {9 , 0x0000d0b4}, /* _LdrSem */
     1109            {9 , 0x0000b64c}, /* _LDRLibPath */
     1110            {14, 0x0003242f}, /* _TKSuBuff */
     1111            {14, 0x00031fc4}, /* _TKFuBuff */
     1112            {14, 0x0003218e}, /* _TKFuBufLen */
     1113            {14, 0x00042370}, /* _ldrValidateMteHandle */
     1114            {0 , 0x00000b44}, /* _pTCBCur */
     1115            {0 , 0x00000b40}, /* _pPTDACur */
     1116            {3 , 0x0000f8cc}, /* ptda_start */
     1117            {3 , 0x0000f9da}, /* ptda_environ */
     1118            {3 , 0x0000fe94}, /* ptda_ptdasem */
     1119            {3 , 0x0000ffa2}, /* ptda_module */
     1120            {3 , 0x0000f9dc}, /* ptda_pBeginLIBPATH */
     1121            {9 , 0x0000ce7c}, /* _ldrpFileNameBuf */
     1122            {13, 0xffffffff}, /* SecPathFromSFN */
    1031123        }
    1041124    },
    1051125    { /* 8255RU.SYM */
    106         8255, 'R', TYPE_UNI, 13,
     1126        8255, KF_UNI, 13,
    1071127        {
    1081128            {12, 0x0000932c}, /* _ldrRead */
     
    1201140            {12, 0x0001ccde}, /* _VMGetOwner */
    1211141            {12, 0x0004265e}, /* g_tkExecPgm */
    122             {9, 0x0000e124}, /* f_FuStrLenZ */
    123             {9, 0x0000e0da}, /* f_FuStrLen */
    124             {9, 0x0000e218}, /* f_FuBuff */
    125         }
    126     },
     1142            {12, 0x0003e377}, /* _tkStartProcess */
     1143            {9 , 0x0000e124}, /* f_FuStrLenZ */
     1144            {9 , 0x0000e0da}, /* f_FuStrLen */
     1145            {9 , 0x0000e218}, /* f_FuBuff */
     1146            {12, 0x0001c048}, /* _VMObjHandleInfo */
     1147            {12, 0x00043010}, /* _ldrASMpMTEFromHandle */
     1148            {12, 0x0003a283}, /* _ldrOpenPath */
     1149            {12, 0x00036cc8}, /* _LDRClearSem */
     1150            {12, 0x0003ef41}, /* _ldrFindModule */
     1151            {12, 0x0000a6b0}, /* _KSEMRequestMutex */
     1152            {12, 0x0000a743}, /* _KSEMReleaseMutex */
     1153            {12, 0x0000a76e}, /* _KSEMQueryMutex */
     1154            {12, 0x0000a983}, /* _KSEMInit */
     1155            {8 , 0x0000c7dc}, /* _LdrSem */
     1156            {8 , 0x00009c60}, /* _LDRLibPath */
     1157            {12, 0x00027845}, /* _TKSuBuff */
     1158            {12, 0x0002747b}, /* _TKFuBuff */
     1159            {12, 0x00027605}, /* _TKFuBufLen */
     1160            {12, 0x00036d04}, /* _ldrValidateMteHandle */
     1161            {8 , 0x000070b8}, /* _pTCBCur */
     1162            {8 , 0x000070b4}, /* _pPTDACur */
     1163            {2 , 0x0000f9a8}, /* ptda_start */
     1164            {2 , 0x0000fa4e}, /* ptda_environ */
     1165            {2 , 0x0000fea8}, /* ptda_ptdasem */
     1166            {2 , 0x0000ffaa}, /* ptda_module */
     1167            {2 , 0x0000fa50}, /* ptda_pBeginLIBPATH */
     1168            {8 , 0x0000bb70}, /* _ldrpFileNameBuf */
     1169            {12, 0x00032ff3}, /* SecPathFromSFN */
     1170        }
     1171    },
     1172#ifdef ALLKERNELS
     1173    { /* 8256AS.SYM */
     1174        8256, KF_SMP | KF_ALLSTRICT, 17,
     1175        {
     1176            {16, 0x0000c628}, /* _ldrRead */
     1177            {16, 0x00057294}, /* _ldrOpen */
     1178            {16, 0x00057db0}, /* _ldrClose */
     1179            {16, 0x00057e00}, /* _LDRQAppType */
     1180            {16, 0x00055584}, /* _ldrEnum32bitRelRecs */
     1181            {16, 0x00005538}, /* _IOSftOpen */
     1182            {16, 0x00005ac4}, /* _IOSftClose */
     1183            {16, 0x00005b7c}, /* _IOSftTransPath */
     1184            {16, 0x00005808}, /* _IOSftReadAt */
     1185            {16, 0x000059d4}, /* _IOSftWriteAt */
     1186            {16, 0x00005cb4}, /* _SftFileSize */
     1187            {16, 0x000528e4}, /* _VMAllocMem */
     1188            {16, 0x0002e6c6}, /* _VMGetOwner */
     1189            {16, 0x00062590}, /* g_tkExecPgm */
     1190            {16, 0x0005e418}, /* _tkStartProcess */
     1191            {13, 0x0000a830}, /* f_FuStrLenZ */
     1192            {13, 0x0000a7b0}, /* f_FuStrLen */
     1193            {13, 0x0000a9fc}, /* f_FuBuff */
     1194            {16, 0x0002ceef}, /* _VMObjHandleInfo */
     1195            {16, 0x00063058}, /* _ldrASMpMTEFromHandle */
     1196            {16, 0x0005752e}, /* _ldrOpenPath */
     1197            {16, 0x0005357c}, /* _LDRClearSem */
     1198            {16, 0x0005da41}, /* _ldrFindModule */
     1199            {16, 0x0000e2e8}, /* _KSEMRequestMutex */
     1200            {16, 0x0000e3fc}, /* _KSEMReleaseMutex */
     1201            {16, 0x0000e45c}, /* _KSEMQueryMutex */
     1202            {16, 0x0000e7e0}, /* _KSEMInit */
     1203            {11, 0x0001ae5c}, /* _LdrSem */
     1204            {11, 0x00018880}, /* _LDRLibPath */
     1205            {16, 0x0003d458}, /* _TKSuBuff */
     1206            {16, 0x0003cfa7}, /* _TKFuBuff */
     1207            {16, 0x0003d1b3}, /* _TKFuBufLen */
     1208            {16, 0x00053614}, /* _ldrValidateMteHandle */
     1209            {0 , 0x00000b44}, /* _pTCBCur */
     1210            {0 , 0x00000b40}, /* _pPTDACur */
     1211            {5 , 0x0000f8c0}, /* ptda_start */
     1212            {5 , 0x0000f9ce}, /* ptda_environ */
     1213            {5 , 0x0000fe88}, /* ptda_ptdasem */
     1214            {5 , 0x0000ffa2}, /* ptda_module */
     1215            {5 , 0x0000f9d0}, /* ptda_pBeginLIBPATH */
     1216            {11, 0x0001aa4c}, /* _ldrpFileNameBuf */
     1217            {12, 0xffffffff}, /* SecPathFromSFN */
     1218        }
     1219    },
     1220#endif
     1221#ifdef ALLKERNELS
     1222    { /* 8256HS.SYM */
     1223        8256, KF_SMP | KF_HALFSTRICT, 17,
     1224        {
     1225            {16, 0x0000b50c}, /* _ldrRead */
     1226            {16, 0x00047adc}, /* _ldrOpen */
     1227            {16, 0x000484d8}, /* _ldrClose */
     1228            {16, 0x00048528}, /* _LDRQAppType */
     1229            {16, 0x00046018}, /* _ldrEnum32bitRelRecs */
     1230            {16, 0x00004a58}, /* _IOSftOpen */
     1231            {16, 0x00004fd6}, /* _IOSftClose */
     1232            {16, 0x0000508d}, /* _IOSftTransPath */
     1233            {16, 0x00004d1e}, /* _IOSftReadAt */
     1234            {16, 0x00004ee7}, /* _IOSftWriteAt */
     1235            {16, 0x000051b7}, /* _SftFileSize */
     1236            {16, 0x00043c0c}, /* _VMAllocMem */
     1237            {16, 0x00027cc4}, /* _VMGetOwner */
     1238            {16, 0x00051bca}, /* g_tkExecPgm */
     1239            {16, 0x0004e335}, /* _tkStartProcess */
     1240            {13, 0x0000a168}, /* f_FuStrLenZ */
     1241            {13, 0x0000a0e8}, /* f_FuStrLen */
     1242            {13, 0x0000a311}, /* f_FuBuff */
     1243            {16, 0x0002691b}, /* _VMObjHandleInfo */
     1244            {16, 0x000525bc}, /* _ldrASMpMTEFromHandle */
     1245            {16, 0x00047d5e}, /* _ldrOpenPath */
     1246            {16, 0x000445cc}, /* _LDRClearSem */
     1247            {16, 0x0004d9fe}, /* _ldrFindModule */
     1248            {16, 0x0000cc4c}, /* _KSEMRequestMutex */
     1249            {16, 0x0000cd23}, /* _KSEMReleaseMutex */
     1250            {16, 0x0000cd4e}, /* _KSEMQueryMutex */
     1251            {16, 0x0000cfee}, /* _KSEMInit */
     1252            {11, 0x0000d644}, /* _LdrSem */
     1253            {11, 0x0000bbd4}, /* _LDRLibPath */
     1254            {16, 0x00033acf}, /* _TKSuBuff */
     1255            {16, 0x00033664}, /* _TKFuBuff */
     1256            {16, 0x0003382e}, /* _TKFuBufLen */
     1257            {16, 0x00044618}, /* _ldrValidateMteHandle */
     1258            {0 , 0x00000b44}, /* _pTCBCur */
     1259            {0 , 0x00000b40}, /* _pPTDACur */
     1260            {5 , 0x0000f8cc}, /* ptda_start */
     1261            {5 , 0x0000f9da}, /* ptda_environ */
     1262            {5 , 0x0000fe94}, /* ptda_ptdasem */
     1263            {5 , 0x0000ffa2}, /* ptda_module */
     1264            {5 , 0x0000f9dc}, /* ptda_pBeginLIBPATH */
     1265            {11, 0x0000d40c}, /* _ldrpFileNameBuf */
     1266            {12, 0xffffffff}, /* SecPathFromSFN */
     1267        }
     1268    },
     1269#endif
    1271270    { /* 8256RS.SYM */
    128         8256, 'R', TYPE_SMP, 15,
     1271        8256, KF_SMP, 15,
     1272        {
     1273            {14, 0x0000b434}, /* _ldrRead */
     1274            {14, 0x00045838}, /* _ldrOpen */
     1275            {14, 0x00046234}, /* _ldrClose */
     1276            {14, 0x00046284}, /* _LDRQAppType */
     1277            {14, 0x00043d70}, /* _ldrEnum32bitRelRecs */
     1278            {14, 0x000049d4}, /* _IOSftOpen */
     1279            {14, 0x00004f52}, /* _IOSftClose */
     1280            {14, 0x00005009}, /* _IOSftTransPath */
     1281            {14, 0x00004c9a}, /* _IOSftReadAt */
     1282            {14, 0x00004e63}, /* _IOSftWriteAt */
     1283            {14, 0x00005133}, /* _SftFileSize */
     1284            {14, 0x00041964}, /* _VMAllocMem */
     1285            {14, 0x00026624}, /* _VMGetOwner */
     1286            {14, 0x0004f84e}, /* g_tkExecPgm */
     1287            {14, 0x0004c099}, /* _tkStartProcess */
     1288            {11, 0x0000a168}, /* f_FuStrLenZ */
     1289            {11, 0x0000a0e8}, /* f_FuStrLen */
     1290            {11, 0x0000a311}, /* f_FuBuff */
     1291            {14, 0x0002527b}, /* _VMObjHandleInfo */
     1292            {14, 0x00050240}, /* _ldrASMpMTEFromHandle */
     1293            {14, 0x00045aba}, /* _ldrOpenPath */
     1294            {14, 0x00042324}, /* _LDRClearSem */
     1295            {14, 0x0004b762}, /* _ldrFindModule */
     1296            {14, 0x0000ca44}, /* _KSEMRequestMutex */
     1297            {14, 0x0000cad7}, /* _KSEMReleaseMutex */
     1298            {14, 0x0000cb02}, /* _KSEMQueryMutex */
     1299            {14, 0x0000cd17}, /* _KSEMInit */
     1300            {9 , 0x0000d0b4}, /* _LdrSem */
     1301            {9 , 0x0000b64c}, /* _LDRLibPath */
     1302            {14, 0x0003242f}, /* _TKSuBuff */
     1303            {14, 0x00031fc4}, /* _TKFuBuff */
     1304            {14, 0x0003218e}, /* _TKFuBufLen */
     1305            {14, 0x00042370}, /* _ldrValidateMteHandle */
     1306            {0 , 0x00000b44}, /* _pTCBCur */
     1307            {0 , 0x00000b40}, /* _pPTDACur */
     1308            {3 , 0x0000f8cc}, /* ptda_start */
     1309            {3 , 0x0000f9da}, /* ptda_environ */
     1310            {3 , 0x0000fe94}, /* ptda_ptdasem */
     1311            {3 , 0x0000ffa2}, /* ptda_module */
     1312            {3 , 0x0000f9dc}, /* ptda_pBeginLIBPATH */
     1313            {9 , 0x0000ce7c}, /* _ldrpFileNameBuf */
     1314            {12, 0xffffffff}, /* SecPathFromSFN */
     1315        }
     1316    },
     1317#ifdef ALLKERNELS
     1318    { /* 8257AS.SYM */
     1319        8257, KF_SMP | KF_ALLSTRICT, 17,
     1320        {
     1321            {16, 0x0000c628}, /* _ldrRead */
     1322            {16, 0x000574b4}, /* _ldrOpen */
     1323            {16, 0x00057fd0}, /* _ldrClose */
     1324            {16, 0x00058020}, /* _LDRQAppType */
     1325            {16, 0x0005579c}, /* _ldrEnum32bitRelRecs */
     1326            {16, 0x00005538}, /* _IOSftOpen */
     1327            {16, 0x00005ac4}, /* _IOSftClose */
     1328            {16, 0x00005b7c}, /* _IOSftTransPath */
     1329            {16, 0x00005808}, /* _IOSftReadAt */
     1330            {16, 0x000059d4}, /* _IOSftWriteAt */
     1331            {16, 0x00005cb4}, /* _SftFileSize */
     1332            {16, 0x00052afc}, /* _VMAllocMem */
     1333            {16, 0x0002e896}, /* _VMGetOwner */
     1334            {16, 0x000628d4}, /* g_tkExecPgm */
     1335            {16, 0x0005e75c}, /* _tkStartProcess */
     1336            {13, 0x0000a830}, /* f_FuStrLenZ */
     1337            {13, 0x0000a7b0}, /* f_FuStrLen */
     1338            {13, 0x0000a9fc}, /* f_FuBuff */
     1339            {16, 0x0002d0bf}, /* _VMObjHandleInfo */
     1340            {16, 0x0006339c}, /* _ldrASMpMTEFromHandle */
     1341            {16, 0x0005774e}, /* _ldrOpenPath */
     1342            {16, 0x00053794}, /* _LDRClearSem */
     1343            {16, 0x0005dd85}, /* _ldrFindModule */
     1344            {16, 0x0000e3a8}, /* _KSEMRequestMutex */
     1345            {16, 0x0000e4bc}, /* _KSEMReleaseMutex */
     1346            {16, 0x0000e51c}, /* _KSEMQueryMutex */
     1347            {16, 0x0000e8a0}, /* _KSEMInit */
     1348            {11, 0x0001ae5c}, /* _LdrSem */
     1349            {11, 0x00018880}, /* _LDRLibPath */
     1350            {16, 0x0003d628}, /* _TKSuBuff */
     1351            {16, 0x0003d177}, /* _TKFuBuff */
     1352            {16, 0x0003d383}, /* _TKFuBufLen */
     1353            {16, 0x0005382c}, /* _ldrValidateMteHandle */
     1354            {0 , 0x00000b44}, /* _pTCBCur */
     1355            {0 , 0x00000b40}, /* _pPTDACur */
     1356            {5 , 0x0000f8c0}, /* ptda_start */
     1357            {5 , 0x0000f9ce}, /* ptda_environ */
     1358            {5 , 0x0000fe88}, /* ptda_ptdasem */
     1359            {5 , 0x0000ffa2}, /* ptda_module */
     1360            {5 , 0x0000f9d0}, /* ptda_pBeginLIBPATH */
     1361            {11, 0x0001aa4c}, /* _ldrpFileNameBuf */
     1362            {12, 0xffffffff}, /* SecPathFromSFN */
     1363        }
     1364    },
     1365#endif
     1366#ifdef ALLKERNELS
     1367    { /* 8257HS.SYM */
     1368        8257, KF_SMP | KF_HALFSTRICT, 17,
     1369        {
     1370            {16, 0x0000b50c}, /* _ldrRead */
     1371            {16, 0x00047cf4}, /* _ldrOpen */
     1372            {16, 0x000486f0}, /* _ldrClose */
     1373            {16, 0x00048740}, /* _LDRQAppType */
     1374            {16, 0x0004622c}, /* _ldrEnum32bitRelRecs */
     1375            {16, 0x00004a58}, /* _IOSftOpen */
     1376            {16, 0x00004fd6}, /* _IOSftClose */
     1377            {16, 0x0000508d}, /* _IOSftTransPath */
     1378            {16, 0x00004d1e}, /* _IOSftReadAt */
     1379            {16, 0x00004ee7}, /* _IOSftWriteAt */
     1380            {16, 0x000051b7}, /* _SftFileSize */
     1381            {16, 0x00043e20}, /* _VMAllocMem */
     1382            {16, 0x00027ea0}, /* _VMGetOwner */
     1383            {16, 0x00051eb6}, /* g_tkExecPgm */
     1384            {16, 0x0004e621}, /* _tkStartProcess */
     1385            {13, 0x0000a168}, /* f_FuStrLenZ */
     1386            {13, 0x0000a0e8}, /* f_FuStrLen */
     1387            {13, 0x0000a311}, /* f_FuBuff */
     1388            {16, 0x00026af7}, /* _VMObjHandleInfo */
     1389            {16, 0x000528a8}, /* _ldrASMpMTEFromHandle */
     1390            {16, 0x00047f76}, /* _ldrOpenPath */
     1391            {16, 0x000447e0}, /* _LDRClearSem */
     1392            {16, 0x0004dcea}, /* _ldrFindModule */
     1393            {16, 0x0000cd0c}, /* _KSEMRequestMutex */
     1394            {16, 0x0000cde3}, /* _KSEMReleaseMutex */
     1395            {16, 0x0000ce0e}, /* _KSEMQueryMutex */
     1396            {16, 0x0000d0ae}, /* _KSEMInit */
     1397            {11, 0x0000d644}, /* _LdrSem */
     1398            {11, 0x0000bbd4}, /* _LDRLibPath */
     1399            {16, 0x00033cab}, /* _TKSuBuff */
     1400            {16, 0x00033840}, /* _TKFuBuff */
     1401            {16, 0x00033a0a}, /* _TKFuBufLen */
     1402            {16, 0x0004482c}, /* _ldrValidateMteHandle */
     1403            {0 , 0x00000b44}, /* _pTCBCur */
     1404            {0 , 0x00000b40}, /* _pPTDACur */
     1405            {5 , 0x0000f8cc}, /* ptda_start */
     1406            {5 , 0x0000f9da}, /* ptda_environ */
     1407            {5 , 0x0000fe94}, /* ptda_ptdasem */
     1408            {5 , 0x0000ffa2}, /* ptda_module */
     1409            {5 , 0x0000f9dc}, /* ptda_pBeginLIBPATH */
     1410            {11, 0x0000d40c}, /* _ldrpFileNameBuf */
     1411            {12, 0xffffffff}, /* SecPathFromSFN */
     1412        }
     1413    },
     1414#endif
     1415    { /* 8257RS.SYM */
     1416        8257, KF_SMP, 15,
    1291417        {
    1301418            {14, 0x0000b434}, /* _ldrRead */
     
    1421430            {14, 0x00026800}, /* _VMGetOwner */
    1431431            {14, 0x0004fb4a}, /* g_tkExecPgm */
     1432            {14, 0x0004c395}, /* _tkStartProcess */
    1441433            {11, 0x0000a168}, /* f_FuStrLenZ */
    1451434            {11, 0x0000a0e8}, /* f_FuStrLen */
    1461435            {11, 0x0000a311}, /* f_FuBuff */
    147         }
    148     },
    149     { /* 8256RU.SYM */
    150         8256, 'R', TYPE_UNI, 13,
    151         {
    152             {12, 0x0000932c}, /* _ldrRead */
    153             {12, 0x00039ff8}, /* _ldrOpen */
    154             {12, 0x0003a87c}, /* _ldrClose */
    155             {12, 0x0003a8cc}, /* _LDRQAppType */
    156             {12, 0x00038218}, /* _ldrEnum32bitRelRecs */
    157             {12, 0x000034a0}, /* _IOSftOpen */
    158             {12, 0x0000390c}, /* _IOSftClose */
    159             {12, 0x000039a1}, /* _IOSftTransPath */
    160             {12, 0x0000375a}, /* _IOSftReadAt */
    161             {12, 0x00003761}, /* _IOSftWriteAt */
    162             {12, 0x00003aba}, /* _SftFileSize */
    163             {12, 0x00036574}, /* _VMAllocMem */
    164             {12, 0x0001ccde}, /* _VMGetOwner */
    165             {12, 0x00042632}, /* g_tkExecPgm */
    166             {9, 0x0000e124}, /* f_FuStrLenZ */
    167             {9, 0x0000e0da}, /* f_FuStrLen */
    168             {9, 0x0000e218}, /* f_FuBuff */
    169         }
    170     },
    171     { /* 8257RS.SYM */
    172         8257, 'R', TYPE_SMP, 15,
     1436            {14, 0x00025457}, /* _VMObjHandleInfo */
     1437            {14, 0x0005053c}, /* _ldrASMpMTEFromHandle */
     1438            {14, 0x00045cd2}, /* _ldrOpenPath */
     1439            {14, 0x00042538}, /* _LDRClearSem */
     1440            {14, 0x0004ba5e}, /* _ldrFindModule */
     1441            {14, 0x0000cb04}, /* _KSEMRequestMutex */
     1442            {14, 0x0000cb97}, /* _KSEMReleaseMutex */
     1443            {14, 0x0000cbc2}, /* _KSEMQueryMutex */
     1444            {14, 0x0000cdd7}, /* _KSEMInit */
     1445            {9 , 0x0000d0b4}, /* _LdrSem */
     1446            {9 , 0x0000b64c}, /* _LDRLibPath */
     1447            {14, 0x0003260b}, /* _TKSuBuff */
     1448            {14, 0x000321a0}, /* _TKFuBuff */
     1449            {14, 0x0003236a}, /* _TKFuBufLen */
     1450            {14, 0x00042584}, /* _ldrValidateMteHandle */
     1451            {0 , 0x00000b44}, /* _pTCBCur */
     1452            {0 , 0x00000b40}, /* _pPTDACur */
     1453            {3 , 0x0000f8cc}, /* ptda_start */
     1454            {3 , 0x0000f9da}, /* ptda_environ */
     1455            {3 , 0x0000fe94}, /* ptda_ptdasem */
     1456            {3 , 0x0000ffa2}, /* ptda_module */
     1457            {3 , 0x0000f9dc}, /* ptda_pBeginLIBPATH */
     1458            {9 , 0x0000ce7c}, /* _ldrpFileNameBuf */
     1459            {12, 0xffffffff}, /* SecPathFromSFN */
     1460        }
     1461    },
     1462#ifdef ALLKERNELS
     1463    { /* 8258AS.SYM */
     1464        8258, KF_SMP | KF_ALLSTRICT, 17,
     1465        {
     1466            {16, 0x0000c628}, /* _ldrRead */
     1467            {16, 0x00057510}, /* _ldrOpen */
     1468            {16, 0x0005802c}, /* _ldrClose */
     1469            {16, 0x0005807c}, /* _LDRQAppType */
     1470            {16, 0x000557f8}, /* _ldrEnum32bitRelRecs */
     1471            {16, 0x00005538}, /* _IOSftOpen */
     1472            {16, 0x00005ac4}, /* _IOSftClose */
     1473            {16, 0x00005b7c}, /* _IOSftTransPath */
     1474            {16, 0x00005808}, /* _IOSftReadAt */
     1475            {16, 0x000059d4}, /* _IOSftWriteAt */
     1476            {16, 0x00005cb4}, /* _SftFileSize */
     1477            {16, 0x00052b54}, /* _VMAllocMem */
     1478            {16, 0x0002e8b2}, /* _VMGetOwner */
     1479            {16, 0x000629a8}, /* g_tkExecPgm */
     1480            {16, 0x0005e7fc}, /* _tkStartProcess */
     1481            {13, 0x0000a830}, /* f_FuStrLenZ */
     1482            {13, 0x0000a7b0}, /* f_FuStrLen */
     1483            {13, 0x0000a9fc}, /* f_FuBuff */
     1484            {16, 0x0002d0db}, /* _VMObjHandleInfo */
     1485            {16, 0x00063470}, /* _ldrASMpMTEFromHandle */
     1486            {16, 0x000577aa}, /* _ldrOpenPath */
     1487            {16, 0x000537f0}, /* _LDRClearSem */
     1488            {16, 0x0005de29}, /* _ldrFindModule */
     1489            {16, 0x0000e3a8}, /* _KSEMRequestMutex */
     1490            {16, 0x0000e4bc}, /* _KSEMReleaseMutex */
     1491            {16, 0x0000e51c}, /* _KSEMQueryMutex */
     1492            {16, 0x0000e8a0}, /* _KSEMInit */
     1493            {11, 0x0001ae5c}, /* _LdrSem */
     1494            {11, 0x00018880}, /* _LDRLibPath */
     1495            {16, 0x0003d674}, /* _TKSuBuff */
     1496            {16, 0x0003d1c3}, /* _TKFuBuff */
     1497            {16, 0x0003d3cf}, /* _TKFuBufLen */
     1498            {16, 0x00053888}, /* _ldrValidateMteHandle */
     1499            {0 , 0x00000b44}, /* _pTCBCur */
     1500            {0 , 0x00000b40}, /* _pPTDACur */
     1501            {5 , 0x0000f8c0}, /* ptda_start */
     1502            {5 , 0x0000f9ce}, /* ptda_environ */
     1503            {5 , 0x0000fe88}, /* ptda_ptdasem */
     1504            {5 , 0x0000ffa2}, /* ptda_module */
     1505            {5 , 0x0000f9d0}, /* ptda_pBeginLIBPATH */
     1506            {11, 0x0001aa4c}, /* _ldrpFileNameBuf */
     1507            {12, 0xffffffff}, /* SecPathFromSFN */
     1508        }
     1509    },
     1510#endif
     1511#ifdef ALLKERNELS
     1512    { /* 8258AU.SYM */
     1513        8258, KF_UNI | KF_ALLSTRICT, 16,
     1514        {
     1515            {15, 0x0000a1fc}, /* _ldrRead */
     1516            {15, 0x0004a160}, /* _ldrOpen */
     1517            {15, 0x0004aaf8}, /* _ldrClose */
     1518            {15, 0x0004ab48}, /* _LDRQAppType */
     1519            {15, 0x00048088}, /* _ldrEnum32bitRelRecs */
     1520            {15, 0x000044a0}, /* _IOSftOpen */
     1521            {15, 0x00004918}, /* _IOSftClose */
     1522            {15, 0x000049b0}, /* _IOSftTransPath */
     1523            {15, 0x00004764}, /* _IOSftReadAt */
     1524            {15, 0x0000476b}, /* _IOSftWriteAt */
     1525            {15, 0x00004ad8}, /* _SftFileSize */
     1526            {15, 0x00045a08}, /* _VMAllocMem */
     1527            {15, 0x00023626}, /* _VMGetOwner */
     1528            {15, 0x00053a84}, /* g_tkExecPgm */
     1529            {15, 0x000501f4}, /* _tkStartProcess */
     1530            {11, 0x0000e9c8}, /* f_FuStrLenZ */
     1531            {11, 0x0000e97c}, /* f_FuStrLen */
     1532            {11, 0x0000eae0}, /* f_FuBuff */
     1533            {15, 0x00022570}, /* _VMObjHandleInfo */
     1534            {15, 0x0005451c}, /* _ldrASMpMTEFromHandle */
     1535            {15, 0x0004a3eb}, /* _ldrOpenPath */
     1536            {15, 0x000464bc}, /* _LDRClearSem */
     1537            {15, 0x0004f8f5}, /* _ldrFindModule */
     1538            {15, 0x0000bb6c}, /* _KSEMRequestMutex */
     1539            {15, 0x0000bc80}, /* _KSEMReleaseMutex */
     1540            {15, 0x0000bce0}, /* _KSEMQueryMutex */
     1541            {15, 0x0000c064}, /* _KSEMInit */
     1542            {10, 0x0002a1e8}, /* _LdrSem */
     1543            {10, 0x000269e4}, /* _LDRLibPath */
     1544            {15, 0x000315ac}, /* _TKSuBuff */
     1545            {15, 0x0003119e}, /* _TKFuBuff */
     1546            {15, 0x0003136a}, /* _TKFuBufLen */
     1547            {15, 0x00046544}, /* _ldrValidateMteHandle */
     1548            {10, 0x0000b758}, /* _pTCBCur */
     1549            {10, 0x0000b754}, /* _pPTDACur */
     1550            {4 , 0x0000f9a0}, /* ptda_start */
     1551            {4 , 0x0000fa46}, /* ptda_environ */
     1552            {4 , 0x0000fea0}, /* ptda_ptdasem */
     1553            {4 , 0x0000ffaa}, /* ptda_module */
     1554            {4 , 0x0000fa48}, /* ptda_pBeginLIBPATH */
     1555            {10, 0x000293a0}, /* _ldrpFileNameBuf */
     1556            {15, 0x000421eb}, /* SecPathFromSFN */
     1557        }
     1558    },
     1559#endif
     1560#ifdef ALLKERNELS
     1561    { /* 8258HS.SYM */
     1562        8258, KF_SMP | KF_HALFSTRICT, 17,
     1563        {
     1564            {16, 0x0000b50c}, /* _ldrRead */
     1565            {16, 0x00047c50}, /* _ldrOpen */
     1566            {16, 0x00048648}, /* _ldrClose */
     1567            {16, 0x00048698}, /* _LDRQAppType */
     1568            {16, 0x00046184}, /* _ldrEnum32bitRelRecs */
     1569            {16, 0x00004a58}, /* _IOSftOpen */
     1570            {16, 0x00004fd6}, /* _IOSftClose */
     1571            {16, 0x0000508d}, /* _IOSftTransPath */
     1572            {16, 0x00004d1e}, /* _IOSftReadAt */
     1573            {16, 0x00004ee7}, /* _IOSftWriteAt */
     1574            {16, 0x000051b7}, /* _SftFileSize */
     1575            {16, 0x00043d74}, /* _VMAllocMem */
     1576            {16, 0x00027da0}, /* _VMGetOwner */
     1577            {16, 0x00051e16}, /* g_tkExecPgm */
     1578            {16, 0x0004e591}, /* _tkStartProcess */
     1579            {13, 0x0000a168}, /* f_FuStrLenZ */
     1580            {13, 0x0000a0e8}, /* f_FuStrLen */
     1581            {13, 0x0000a311}, /* f_FuBuff */
     1582            {16, 0x000269fb}, /* _VMObjHandleInfo */
     1583            {16, 0x00052808}, /* _ldrASMpMTEFromHandle */
     1584            {16, 0x00047ed2}, /* _ldrOpenPath */
     1585            {16, 0x00044738}, /* _LDRClearSem */
     1586            {16, 0x0004dc5e}, /* _ldrFindModule */
     1587            {16, 0x0000cd0c}, /* _KSEMRequestMutex */
     1588            {16, 0x0000cde3}, /* _KSEMReleaseMutex */
     1589            {16, 0x0000ce0e}, /* _KSEMQueryMutex */
     1590            {16, 0x0000d0ae}, /* _KSEMInit */
     1591            {11, 0x0000d644}, /* _LdrSem */
     1592            {11, 0x0000bbd4}, /* _LDRLibPath */
     1593            {16, 0x00033bcb}, /* _TKSuBuff */
     1594            {16, 0x00033760}, /* _TKFuBuff */
     1595            {16, 0x0003392a}, /* _TKFuBufLen */
     1596            {16, 0x00044784}, /* _ldrValidateMteHandle */
     1597            {0 , 0x00000b44}, /* _pTCBCur */
     1598            {0 , 0x00000b40}, /* _pPTDACur */
     1599            {5 , 0x0000f8cc}, /* ptda_start */
     1600            {5 , 0x0000f9da}, /* ptda_environ */
     1601            {5 , 0x0000fe94}, /* ptda_ptdasem */
     1602            {5 , 0x0000ffa2}, /* ptda_module */
     1603            {5 , 0x0000f9dc}, /* ptda_pBeginLIBPATH */
     1604            {11, 0x0000d40c}, /* _ldrpFileNameBuf */
     1605            {15, 0xffffffff}, /* SecPathFromSFN */
     1606        }
     1607    },
     1608#endif
     1609#ifdef ALLKERNELS
     1610    { /* 8258HU.SYM */
     1611        8258, KF_UNI | KF_HALFSTRICT, 16,
     1612        {
     1613            {15, 0x00009238}, /* _ldrRead */
     1614            {15, 0x0003be78}, /* _ldrOpen */
     1615            {15, 0x0003c700}, /* _ldrClose */
     1616            {15, 0x0003c750}, /* _LDRQAppType */
     1617            {15, 0x0003a074}, /* _ldrEnum32bitRelRecs */
     1618            {15, 0x00003a24}, /* _IOSftOpen */
     1619            {15, 0x00003e90}, /* _IOSftClose */
     1620            {15, 0x00003f25}, /* _IOSftTransPath */
     1621            {15, 0x00003cde}, /* _IOSftReadAt */
     1622            {15, 0x00003ce5}, /* _IOSftWriteAt */
     1623            {15, 0x0000403e}, /* _SftFileSize */
     1624            {15, 0x00038340}, /* _VMAllocMem */
     1625            {15, 0x0001dfd2}, /* _VMGetOwner */
     1626            {15, 0x000445e6}, /* g_tkExecPgm */
     1627            {15, 0x000415b7}, /* _tkStartProcess */
     1628            {11, 0x0000d794}, /* f_FuStrLenZ */
     1629            {11, 0x0000d74a}, /* f_FuStrLen */
     1630            {11, 0x0000d888}, /* f_FuBuff */
     1631            {15, 0x0001d334}, /* _VMObjHandleInfo */
     1632            {15, 0x00044fac}, /* _ldrASMpMTEFromHandle */
     1633            {15, 0x0003c0ef}, /* _ldrOpenPath */
     1634            {15, 0x00038a88}, /* _LDRClearSem */
     1635            {15, 0x00040d59}, /* _ldrFindModule */
     1636            {15, 0x0000a6ac}, /* _KSEMRequestMutex */
     1637            {15, 0x0000a783}, /* _KSEMReleaseMutex */
     1638            {15, 0x0000a7ae}, /* _KSEMQueryMutex */
     1639            {15, 0x0000aa4e}, /* _KSEMInit */
     1640            {10, 0x0001c9ec}, /* _LdrSem */
     1641            {10, 0x00019e58}, /* _LDRLibPath */
     1642            {15, 0x00028c95}, /* _TKSuBuff */
     1643            {15, 0x000288cb}, /* _TKFuBuff */
     1644            {15, 0x00028a55}, /* _TKFuBufLen */
     1645            {15, 0x00038ac4}, /* _ldrValidateMteHandle */
     1646            {10, 0x000070bc}, /* _pTCBCur */
     1647            {10, 0x000070b8}, /* _pPTDACur */
     1648            {4 , 0x0000f9a8}, /* ptda_start */
     1649            {4 , 0x0000fa4e}, /* ptda_environ */
     1650            {4 , 0x0000fea8}, /* ptda_ptdasem */
     1651            {4 , 0x0000ffaa}, /* ptda_module */
     1652            {4 , 0x0000fa50}, /* ptda_pBeginLIBPATH */
     1653            {10, 0x0001bd7c}, /* _ldrpFileNameBuf */
     1654            {15, 0x000350e7}, /* SecPathFromSFN */
     1655        }
     1656    },
     1657#endif
     1658    { /* 8258RS.SYM */
     1659        8258, KF_SMP, 15,
    1731660        {
    1741661            {14, 0x0000b434}, /* _ldrRead */
     
    1861673            {14, 0x000266f8}, /* _VMGetOwner */
    1871674            {14, 0x0004fa96}, /* g_tkExecPgm */
     1675            {14, 0x0004c2f9}, /* _tkStartProcess */
    1881676            {11, 0x0000a168}, /* f_FuStrLenZ */
    1891677            {11, 0x0000a0e8}, /* f_FuStrLen */
    1901678            {11, 0x0000a311}, /* f_FuBuff */
    191         }
    192     },
    193     { /* 8257RU.SYM */
    194         8257, 'R', TYPE_UNI, 13,
    195         {
    196             {12, 0x0000932c}, /* _ldrRead */
    197             {12, 0x00039ff0}, /* _ldrOpen */
    198             {12, 0x0003a874}, /* _ldrClose */
    199             {12, 0x0003a8c4}, /* _LDRQAppType */
    200             {12, 0x00038210}, /* _ldrEnum32bitRelRecs */
    201             {12, 0x000034a0}, /* _IOSftOpen */
    202             {12, 0x0000390c}, /* _IOSftClose */
    203             {12, 0x000039a1}, /* _IOSftTransPath */
    204             {12, 0x0000375a}, /* _IOSftReadAt */
    205             {12, 0x00003761}, /* _IOSftWriteAt */
    206             {12, 0x00003aba}, /* _SftFileSize */
    207             {12, 0x00036564}, /* _VMAllocMem */
    208             {12, 0x0001ccd6}, /* _VMGetOwner */
    209             {12, 0x0004263e}, /* g_tkExecPgm */
    210             {9, 0x0000e124}, /* f_FuStrLenZ */
    211             {9, 0x0000e0da}, /* f_FuStrLen */
    212             {9, 0x0000e218}, /* f_FuBuff */
    213         }
    214     },
    215     { /* 8258RS.SYM */
    216         8258, 'R', TYPE_SMP, 15,
     1679            {14, 0x00025353}, /* _VMObjHandleInfo */
     1680            {14, 0x00050488}, /* _ldrASMpMTEFromHandle */
     1681            {14, 0x00045c22}, /* _ldrOpenPath */
     1682            {14, 0x00042488}, /* _LDRClearSem */
     1683            {14, 0x0004b9c6}, /* _ldrFindModule */
     1684            {14, 0x0000cb04}, /* _KSEMRequestMutex */
     1685            {14, 0x0000cb97}, /* _KSEMReleaseMutex */
     1686            {14, 0x0000cbc2}, /* _KSEMQueryMutex */
     1687            {14, 0x0000cdd7}, /* _KSEMInit */
     1688            {9 , 0x0000d0b4}, /* _LdrSem */
     1689            {9 , 0x0000b64c}, /* _LDRLibPath */
     1690            {14, 0x00032523}, /* _TKSuBuff */
     1691            {14, 0x000320b8}, /* _TKFuBuff */
     1692            {14, 0x00032282}, /* _TKFuBufLen */
     1693            {14, 0x000424d4}, /* _ldrValidateMteHandle */
     1694            {0 , 0x00000b44}, /* _pTCBCur */
     1695            {0 , 0x00000b40}, /* _pPTDACur */
     1696            {3 , 0x0000f8cc}, /* ptda_start */
     1697            {3 , 0x0000f9da}, /* ptda_environ */
     1698            {3 , 0x0000fe94}, /* ptda_ptdasem */
     1699            {3 , 0x0000ffa2}, /* ptda_module */
     1700            {3 , 0x0000f9dc}, /* ptda_pBeginLIBPATH */
     1701            {9 , 0x0000ce7c}, /* _ldrpFileNameBuf */
     1702            {15, 0xffffffff}, /* SecPathFromSFN */
     1703        }
     1704    },
     1705#ifdef ALLKERNELS
     1706    { /* 8259AS.SYM */
     1707        8259, KF_SMP | KF_ALLSTRICT, 17,
     1708        {
     1709            {16, 0x0000d370}, /* _ldrRead */
     1710            {16, 0x000583bc}, /* _ldrOpen */
     1711            {16, 0x00058edc}, /* _ldrClose */
     1712            {16, 0x00058f2c}, /* _LDRQAppType */
     1713            {16, 0x00056674}, /* _ldrEnum32bitRelRecs */
     1714            {16, 0x00006170}, /* _IOSftOpen */
     1715            {16, 0x000066fc}, /* _IOSftClose */
     1716            {16, 0x000067b4}, /* _IOSftTransPath */
     1717            {16, 0x00006440}, /* _IOSftReadAt */
     1718            {16, 0x0000660c}, /* _IOSftWriteAt */
     1719            {16, 0x000068ec}, /* _SftFileSize */
     1720            {16, 0x000539d4}, /* _VMAllocMem */
     1721            {16, 0x0002f6e6}, /* _VMGetOwner */
     1722            {16, 0x000637b8}, /* g_tkExecPgm */
     1723            {16, 0x0005f5e8}, /* _tkStartProcess */
     1724            {13, 0x0000a68c}, /* f_FuStrLenZ */
     1725            {13, 0x0000a60c}, /* f_FuStrLen */
     1726            {13, 0x0000a854}, /* f_FuBuff */
     1727            {16, 0x0002df0b}, /* _VMObjHandleInfo */
     1728            {16, 0x00064290}, /* _ldrASMpMTEFromHandle */
     1729            {16, 0x00058656}, /* _ldrOpenPath */
     1730            {16, 0x00054670}, /* _LDRClearSem */
     1731            {16, 0x0005ec21}, /* _ldrFindModule */
     1732            {16, 0x0000f060}, /* _KSEMRequestMutex */
     1733            {16, 0x0000f174}, /* _KSEMReleaseMutex */
     1734            {16, 0x0000f1d4}, /* _KSEMQueryMutex */
     1735            {16, 0x0000f558}, /* _KSEMInit */
     1736            {11, 0x0002c45c}, /* _LdrSem */
     1737            {11, 0x00029e68}, /* _LDRLibPath */
     1738            {16, 0x0003e460}, /* _TKSuBuff */
     1739            {16, 0x0003dfaf}, /* _TKFuBuff */
     1740            {16, 0x0003e1bb}, /* _TKFuBufLen */
     1741            {16, 0x00054708}, /* _ldrValidateMteHandle */
     1742            {0 , 0x00000b34}, /* _pTCBCur */
     1743            {0 , 0x00000b30}, /* _pPTDACur */
     1744            {5 , 0x0000f8c0}, /* ptda_start */
     1745            {5 , 0x0000f9ce}, /* ptda_environ */
     1746            {5 , 0x0000fe88}, /* ptda_ptdasem */
     1747            {5 , 0x0000ffa2}, /* ptda_module */
     1748            {5 , 0x0000f9d0}, /* ptda_pBeginLIBPATH */
     1749            {11, 0x0002c048}, /* _ldrpFileNameBuf */
     1750            {15, 0xffffffff}, /* SecPathFromSFN */
     1751        }
     1752    },
     1753#endif
     1754#ifdef ALLKERNELS
     1755    { /* 8259HS.SYM */
     1756        8259, KF_SMP | KF_HALFSTRICT, 17,
     1757        {
     1758            {16, 0x0000bee0}, /* _ldrRead */
     1759            {16, 0x000488dc}, /* _ldrOpen */
     1760            {16, 0x000492d8}, /* _ldrClose */
     1761            {16, 0x00049328}, /* _LDRQAppType */
     1762            {16, 0x00046dd4}, /* _ldrEnum32bitRelRecs */
     1763            {16, 0x00005310}, /* _IOSftOpen */
     1764            {16, 0x0000588e}, /* _IOSftClose */
     1765            {16, 0x00005945}, /* _IOSftTransPath */
     1766            {16, 0x000055d6}, /* _IOSftReadAt */
     1767            {16, 0x0000579f}, /* _IOSftWriteAt */
     1768            {16, 0x00005a6f}, /* _SftFileSize */
     1769            {16, 0x000449c4}, /* _VMAllocMem */
     1770            {16, 0x000289c2}, /* _VMGetOwner */
     1771            {16, 0x00052956}, /* g_tkExecPgm */
     1772            {16, 0x0004f1ad}, /* _tkStartProcess */
     1773            {13, 0x00009fdc}, /* f_FuStrLenZ */
     1774            {13, 0x00009f5c}, /* f_FuStrLen */
     1775            {13, 0x0000a185}, /* f_FuBuff */
     1776            {16, 0x0002761b}, /* _VMObjHandleInfo */
     1777            {16, 0x0005335c}, /* _ldrASMpMTEFromHandle */
     1778            {16, 0x00048b5e}, /* _ldrOpenPath */
     1779            {16, 0x00045388}, /* _LDRClearSem */
     1780            {16, 0x0004e886}, /* _ldrFindModule */
     1781            {16, 0x0000d650}, /* _KSEMRequestMutex */
     1782            {16, 0x0000d727}, /* _KSEMReleaseMutex */
     1783            {16, 0x0000d752}, /* _KSEMQueryMutex */
     1784            {16, 0x0000d9f2}, /* _KSEMInit */
     1785            {11, 0x0001d6c4}, /* _LdrSem */
     1786            {11, 0x0001bc40}, /* _LDRLibPath */
     1787            {16, 0x000347a7}, /* _TKSuBuff */
     1788            {16, 0x0003433c}, /* _TKFuBuff */
     1789            {16, 0x00034506}, /* _TKFuBufLen */
     1790            {16, 0x000453d4}, /* _ldrValidateMteHandle */
     1791            {0 , 0x00000b34}, /* _pTCBCur */
     1792            {0 , 0x00000b30}, /* _pPTDACur */
     1793            {5 , 0x0000f8cc}, /* ptda_start */
     1794            {5 , 0x0000f9da}, /* ptda_environ */
     1795            {5 , 0x0000fe94}, /* ptda_ptdasem */
     1796            {5 , 0x0000ffa2}, /* ptda_module */
     1797            {5 , 0x0000f9dc}, /* ptda_pBeginLIBPATH */
     1798            {11, 0x0001d488}, /* _ldrpFileNameBuf */
     1799            {15, 0xffffffff}, /* SecPathFromSFN */
     1800        }
     1801    },
     1802#endif
     1803#ifdef ALLKERNELS
     1804    { /* 8259HU.SYM */
     1805        8259, KF_UNI | KF_HALFSTRICT, 16,
     1806        {
     1807            {15, 0x000092c8}, /* _ldrRead */
     1808            {15, 0x0003bf00}, /* _ldrOpen */
     1809            {15, 0x0003c788}, /* _ldrClose */
     1810            {15, 0x0003c7d8}, /* _LDRQAppType */
     1811            {15, 0x0003a0fc}, /* _ldrEnum32bitRelRecs */
     1812            {15, 0x00003a24}, /* _IOSftOpen */
     1813            {15, 0x00003e90}, /* _IOSftClose */
     1814            {15, 0x00003f25}, /* _IOSftTransPath */
     1815            {15, 0x00003cde}, /* _IOSftReadAt */
     1816            {15, 0x00003ce5}, /* _IOSftWriteAt */
     1817            {15, 0x0000403e}, /* _SftFileSize */
     1818            {15, 0x000383c8}, /* _VMAllocMem */
     1819            {15, 0x0001e146}, /* _VMGetOwner */
     1820            {15, 0x0004466e}, /* g_tkExecPgm */
     1821            {15, 0x0004163f}, /* _tkStartProcess */
     1822            {11, 0x0000d7a4}, /* f_FuStrLenZ */
     1823            {11, 0x0000d75a}, /* f_FuStrLen */
     1824            {11, 0x0000d898}, /* f_FuBuff */
     1825            {15, 0x0001d4a8}, /* _VMObjHandleInfo */
     1826            {15, 0x00045034}, /* _ldrASMpMTEFromHandle */
     1827            {15, 0x0003c177}, /* _ldrOpenPath */
     1828            {15, 0x00038b10}, /* _LDRClearSem */
     1829            {15, 0x00040de1}, /* _ldrFindModule */
     1830            {15, 0x0000a73c}, /* _KSEMRequestMutex */
     1831            {15, 0x0000a813}, /* _KSEMReleaseMutex */
     1832            {15, 0x0000a83e}, /* _KSEMQueryMutex */
     1833            {15, 0x0000aade}, /* _KSEMInit */
     1834            {10, 0x0001c9ec}, /* _LdrSem */
     1835            {10, 0x00019e58}, /* _LDRLibPath */
     1836            {15, 0x00028e09}, /* _TKSuBuff */
     1837            {15, 0x00028a3f}, /* _TKFuBuff */
     1838            {15, 0x00028bc9}, /* _TKFuBufLen */
     1839            {15, 0x00038b4c}, /* _ldrValidateMteHandle */
     1840            {10, 0x000070bc}, /* _pTCBCur */
     1841            {10, 0x000070b8}, /* _pPTDACur */
     1842            {4 , 0x0000f9a8}, /* ptda_start */
     1843            {4 , 0x0000fa4e}, /* ptda_environ */
     1844            {4 , 0x0000fea8}, /* ptda_ptdasem */
     1845            {4 , 0x0000ffaa}, /* ptda_module */
     1846            {4 , 0x0000fa50}, /* ptda_pBeginLIBPATH */
     1847            {10, 0x0001bd7c}, /* _ldrpFileNameBuf */
     1848            {15, 0x0003525b}, /* SecPathFromSFN */
     1849        }
     1850    },
     1851#endif
     1852    { /* 8259RS.SYM */
     1853        8259, KF_SMP, 15,
    2171854        {
    2181855            {14, 0x0000bdd0}, /* _ldrRead */
     
    2301867            {14, 0x000271aa}, /* _VMGetOwner */
    2311868            {14, 0x0005065e}, /* g_tkExecPgm */
     1869            {14, 0x0004cdad}, /* _tkStartProcess */
    2321870            {11, 0x00009fdc}, /* f_FuStrLenZ */
    2331871            {11, 0x00009f5c}, /* f_FuStrLen */
    2341872            {11, 0x0000a185}, /* f_FuBuff */
    235         }
    236     },
    237     { /* 8258RU.SYM */
    238         8258, 'R', TYPE_UNI, 14,
    239         {
    240             {13, 0x000091a4}, /* _ldrRead */
    241             {13, 0x0003a580}, /* _ldrOpen */
    242             {13, 0x0003ae08}, /* _ldrClose */
    243             {13, 0x0003ae58}, /* _LDRQAppType */
    244             {13, 0x0003877c}, /* _ldrEnum32bitRelRecs */
    245             {13, 0x000039a4}, /* _IOSftOpen */
    246             {13, 0x00003e10}, /* _IOSftClose */
    247             {13, 0x00003ea5}, /* _IOSftTransPath */
    248             {13, 0x00003c5e}, /* _IOSftReadAt */
    249             {13, 0x00003c65}, /* _IOSftWriteAt */
    250             {13, 0x00003fbe}, /* _SftFileSize */
    251             {13, 0x00036a48}, /* _VMAllocMem */
    252             {13, 0x0001d16a}, /* _VMGetOwner */
    253             {13, 0x00042d56}, /* g_tkExecPgm */
    254             {9, 0x0000d794}, /* f_FuStrLenZ */
    255             {9, 0x0000d74a}, /* f_FuStrLen */
    256             {9, 0x0000d888}, /* f_FuBuff */
    257         }
    258     },
    259     { /* 8259RS.SYM */
    260         8259, 'R', TYPE_SMP, 15,
    261         {
    262             {14, 0x0000bdd0}, /* _ldrRead */
    263             {14, 0x000465c0}, /* _ldrOpen */
    264             {14, 0x00046fbc}, /* _ldrClose */
    265             {14, 0x0004700c}, /* _LDRQAppType */
    266             {14, 0x00044ab8}, /* _ldrEnum32bitRelRecs */
    267             {14, 0x0000526c}, /* _IOSftOpen */
    268             {14, 0x000057ea}, /* _IOSftClose */
    269             {14, 0x000058a1}, /* _IOSftTransPath */
    270             {14, 0x00005532}, /* _IOSftReadAt */
    271             {14, 0x000056fb}, /* _IOSftWriteAt */
    272             {14, 0x000059cb}, /* _SftFileSize */
    273             {14, 0x000426a8}, /* _VMAllocMem */
    274             {14, 0x000272ae}, /* _VMGetOwner */
    275             {14, 0x00050812}, /* g_tkExecPgm */
    276             {11, 0x00009fdc}, /* f_FuStrLenZ */
    277             {11, 0x00009f5c}, /* f_FuStrLen */
    278             {11, 0x0000a185}, /* f_FuBuff */
    279         }
    280     },
    281     { /* 8259RU.SYM */
    282         8259, 'R', TYPE_UNI, 14,
    283         {
    284             {13, 0x00009234}, /* _ldrRead */
    285             {13, 0x0003a608}, /* _ldrOpen */
    286             {13, 0x0003ae90}, /* _ldrClose */
    287             {13, 0x0003aee0}, /* _LDRQAppType */
    288             {13, 0x00038804}, /* _ldrEnum32bitRelRecs */
    289             {13, 0x000039a4}, /* _IOSftOpen */
    290             {13, 0x00003e10}, /* _IOSftClose */
    291             {13, 0x00003ea5}, /* _IOSftTransPath */
    292             {13, 0x00003c5e}, /* _IOSftReadAt */
    293             {13, 0x00003c65}, /* _IOSftWriteAt */
    294             {13, 0x00003fbe}, /* _SftFileSize */
    295             {13, 0x00036ad0}, /* _VMAllocMem */
    296             {13, 0x0001d2de}, /* _VMGetOwner */
    297             {13, 0x00042de2}, /* g_tkExecPgm */
    298             {9, 0x0000d7a4}, /* f_FuStrLenZ */
    299             {9, 0x0000d75a}, /* f_FuStrLen */
    300             {9, 0x0000d898}, /* f_FuBuff */
    301         }
    302     },
     1873            {14, 0x00025e03}, /* _VMObjHandleInfo */
     1874            {14, 0x00051064}, /* _ldrASMpMTEFromHandle */
     1875            {14, 0x0004673e}, /* _ldrOpenPath */
     1876            {14, 0x00042f68}, /* _LDRClearSem */
     1877            {14, 0x0004c486}, /* _ldrFindModule */
     1878            {14, 0x0000d410}, /* _KSEMRequestMutex */
     1879            {14, 0x0000d4a3}, /* _KSEMReleaseMutex */
     1880            {14, 0x0000d4ce}, /* _KSEMQueryMutex */
     1881            {14, 0x0000d6e3}, /* _KSEMInit */
     1882            {9 , 0x0000d12c}, /* _LdrSem */
     1883            {9 , 0x0000b6b0}, /* _LDRLibPath */
     1884            {14, 0x00032f8f}, /* _TKSuBuff */
     1885            {14, 0x00032b24}, /* _TKFuBuff */
     1886            {14, 0x00032cee}, /* _TKFuBufLen */
     1887            {14, 0x00042fb4}, /* _ldrValidateMteHandle */
     1888            {0 , 0x00000b34}, /* _pTCBCur */
     1889            {0 , 0x00000b30}, /* _pPTDACur */
     1890            {3 , 0x0000f8cc}, /* ptda_start */
     1891            {3 , 0x0000f9da}, /* ptda_environ */
     1892            {3 , 0x0000fe94}, /* ptda_ptdasem */
     1893            {3 , 0x0000ffa2}, /* ptda_module */
     1894            {3 , 0x0000f9dc}, /* ptda_pBeginLIBPATH */
     1895            {9 , 0x0000cef0}, /* _ldrpFileNameBuf */
     1896            {15, 0xffffffff}, /* SecPathFromSFN */
     1897        }
     1898    },
     1899#ifdef ALLKERNELS
     1900    { /* 8260AS.SYM */
     1901        8260, KF_SMP | KF_ALLSTRICT, 17,
     1902        {
     1903            {16, 0x0000d38c}, /* _ldrRead */
     1904            {16, 0x000587b0}, /* _ldrOpen */
     1905            {16, 0x000592d0}, /* _ldrClose */
     1906            {16, 0x00059320}, /* _LDRQAppType */
     1907            {16, 0x00056a68}, /* _ldrEnum32bitRelRecs */
     1908            {16, 0x00006180}, /* _IOSftOpen */
     1909            {16, 0x0000670c}, /* _IOSftClose */
     1910            {16, 0x000067c4}, /* _IOSftTransPath */
     1911            {16, 0x00006450}, /* _IOSftReadAt */
     1912            {16, 0x0000661c}, /* _IOSftWriteAt */
     1913            {16, 0x000068fc}, /* _SftFileSize */
     1914            {16, 0x00053dc8}, /* _VMAllocMem */
     1915            {16, 0x0002f9d2}, /* _VMGetOwner */
     1916            {16, 0x00063cf8}, /* g_tkExecPgm */
     1917            {16, 0x0005fb2c}, /* _tkStartProcess */
     1918            {13, 0x0000a618}, /* f_FuStrLenZ */
     1919            {13, 0x0000a598}, /* f_FuStrLen */
     1920            {13, 0x0000a7e0}, /* f_FuBuff */
     1921            {16, 0x0002e1f7}, /* _VMObjHandleInfo */
     1922            {16, 0x000647d0}, /* _ldrASMpMTEFromHandle */
     1923            {16, 0x00058a4a}, /* _ldrOpenPath */
     1924            {16, 0x00054a64}, /* _LDRClearSem */
     1925            {16, 0x0005f162}, /* _ldrFindModule */
     1926            {16, 0x0000f07c}, /* _KSEMRequestMutex */
     1927            {16, 0x0000f190}, /* _KSEMReleaseMutex */
     1928            {16, 0x0000f1f0}, /* _KSEMQueryMutex */
     1929            {16, 0x0000f574}, /* _KSEMInit */
     1930            {11, 0x0002c474}, /* _LdrSem */
     1931            {11, 0x00029e80}, /* _LDRLibPath */
     1932            {16, 0x0003e7cc}, /* _TKSuBuff */
     1933            {16, 0x0003e31b}, /* _TKFuBuff */
     1934            {16, 0x0003e527}, /* _TKFuBufLen */
     1935            {16, 0x00054afc}, /* _ldrValidateMteHandle */
     1936            {0 , 0x00000b34}, /* _pTCBCur */
     1937            {0 , 0x00000b30}, /* _pPTDACur */
     1938            {5 , 0x0000f8c0}, /* ptda_start */
     1939            {5 , 0x0000f9ce}, /* ptda_environ */
     1940            {5 , 0x0000fe88}, /* ptda_ptdasem */
     1941            {5 , 0x0000ffa2}, /* ptda_module */
     1942            {5 , 0x0000f9d0}, /* ptda_pBeginLIBPATH */
     1943            {11, 0x0002c060}, /* _ldrpFileNameBuf */
     1944            {15, 0xffffffff}, /* SecPathFromSFN */
     1945        }
     1946    },
     1947#endif
     1948#ifdef ALLKERNELS
     1949    { /* 8260AU.SYM */
     1950        8260, KF_UNI | KF_ALLSTRICT, 16,
     1951        {
     1952            {15, 0x0000a2a0}, /* _ldrRead */
     1953            {15, 0x0004a19c}, /* _ldrOpen */
     1954            {15, 0x0004ab34}, /* _ldrClose */
     1955            {15, 0x0004ab84}, /* _LDRQAppType */
     1956            {15, 0x000480c4}, /* _ldrEnum32bitRelRecs */
     1957            {15, 0x000044a0}, /* _IOSftOpen */
     1958            {15, 0x00004918}, /* _IOSftClose */
     1959            {15, 0x000049b0}, /* _IOSftTransPath */
     1960            {15, 0x00004764}, /* _IOSftReadAt */
     1961            {15, 0x0000476b}, /* _IOSftWriteAt */
     1962            {15, 0x00004ad8}, /* _SftFileSize */
     1963            {15, 0x00045a44}, /* _VMAllocMem */
     1964            {15, 0x0002376a}, /* _VMGetOwner */
     1965            {15, 0x00053b5c}, /* g_tkExecPgm */
     1966            {15, 0x000502d0}, /* _tkStartProcess */
     1967            {11, 0x0000e9d4}, /* f_FuStrLenZ */
     1968            {11, 0x0000e988}, /* f_FuStrLen */
     1969            {11, 0x0000eaec}, /* f_FuBuff */
     1970            {15, 0x000226b4}, /* _VMObjHandleInfo */
     1971            {15, 0x000545f4}, /* _ldrASMpMTEFromHandle */
     1972            {15, 0x0004a427}, /* _ldrOpenPath */
     1973            {15, 0x000464f8}, /* _LDRClearSem */
     1974            {15, 0x0004f9d0}, /* _ldrFindModule */
     1975            {15, 0x0000bbcc}, /* _KSEMRequestMutex */
     1976            {15, 0x0000bce0}, /* _KSEMReleaseMutex */
     1977            {15, 0x0000bd40}, /* _KSEMQueryMutex */
     1978            {15, 0x0000c0c4}, /* _KSEMInit */
     1979            {10, 0x0002a1d8}, /* _LdrSem */
     1980            {10, 0x000269d4}, /* _LDRLibPath */
     1981            {15, 0x000316d8}, /* _TKSuBuff */
     1982            {15, 0x000312ca}, /* _TKFuBuff */
     1983            {15, 0x00031496}, /* _TKFuBufLen */
     1984            {15, 0x00046580}, /* _ldrValidateMteHandle */
     1985            {10, 0x0000b740}, /* _pTCBCur */
     1986            {10, 0x0000b73c}, /* _pPTDACur */
     1987            {4 , 0x0000f9a0}, /* ptda_start */
     1988            {4 , 0x0000fa46}, /* ptda_environ */
     1989            {4 , 0x0000fea0}, /* ptda_ptdasem */
     1990            {4 , 0x0000ffaa}, /* ptda_module */
     1991            {4 , 0x0000fa48}, /* ptda_pBeginLIBPATH */
     1992            {10, 0x00029390}, /* _ldrpFileNameBuf */
     1993            {15, 0x0004231f}, /* SecPathFromSFN */
     1994        }
     1995    },
     1996#endif
     1997#ifdef ALLKERNELS
     1998    { /* 8260HS.SYM */
     1999        8260, KF_SMP | KF_HALFSTRICT, 17,
     2000        {
     2001            {16, 0x0000befc}, /* _ldrRead */
     2002            {16, 0x00048c8c}, /* _ldrOpen */
     2003            {16, 0x00049688}, /* _ldrClose */
     2004            {16, 0x000496d8}, /* _LDRQAppType */
     2005            {16, 0x00047184}, /* _ldrEnum32bitRelRecs */
     2006            {16, 0x0000531c}, /* _IOSftOpen */
     2007            {16, 0x0000589a}, /* _IOSftClose */
     2008            {16, 0x00005951}, /* _IOSftTransPath */
     2009            {16, 0x000055e2}, /* _IOSftReadAt */
     2010            {16, 0x000057ab}, /* _IOSftWriteAt */
     2011            {16, 0x00005a7b}, /* _SftFileSize */
     2012            {16, 0x00044d74}, /* _VMAllocMem */
     2013            {16, 0x00028c56}, /* _VMGetOwner */
     2014            {16, 0x00052e52}, /* g_tkExecPgm */
     2015            {16, 0x0004f6a9}, /* _tkStartProcess */
     2016            {13, 0x00009f7c}, /* f_FuStrLenZ */
     2017            {13, 0x00009efc}, /* f_FuStrLen */
     2018            {13, 0x0000a125}, /* f_FuBuff */
     2019            {16, 0x000278af}, /* _VMObjHandleInfo */
     2020            {16, 0x00053858}, /* _ldrASMpMTEFromHandle */
     2021            {16, 0x00048f0e}, /* _ldrOpenPath */
     2022            {16, 0x00045738}, /* _LDRClearSem */
     2023            {16, 0x0004ed83}, /* _ldrFindModule */
     2024            {16, 0x0000d66c}, /* _KSEMRequestMutex */
     2025            {16, 0x0000d743}, /* _KSEMReleaseMutex */
     2026            {16, 0x0000d76e}, /* _KSEMQueryMutex */
     2027            {16, 0x0000da0e}, /* _KSEMInit */
     2028            {11, 0x0001d6f0}, /* _LdrSem */
     2029            {11, 0x0001bc6c}, /* _LDRLibPath */
     2030            {16, 0x00034ad3}, /* _TKSuBuff */
     2031            {16, 0x00034668}, /* _TKFuBuff */
     2032            {16, 0x00034832}, /* _TKFuBufLen */
     2033            {16, 0x00045784}, /* _ldrValidateMteHandle */
     2034            {0 , 0x00000b34}, /* _pTCBCur */
     2035            {0 , 0x00000b30}, /* _pPTDACur */
     2036            {5 , 0x0000f8cc}, /* ptda_start */
     2037            {5 , 0x0000f9da}, /* ptda_environ */
     2038            {5 , 0x0000fe94}, /* ptda_ptdasem */
     2039            {5 , 0x0000ffa2}, /* ptda_module */
     2040            {5 , 0x0000f9dc}, /* ptda_pBeginLIBPATH */
     2041            {11, 0x0001d4b4}, /* _ldrpFileNameBuf */
     2042            {15, 0xffffffff}, /* SecPathFromSFN */
     2043        }
     2044    },
     2045#endif
     2046#ifdef ALLKERNELS
     2047    { /* 8260HU.SYM */
     2048        8260, KF_UNI | KF_HALFSTRICT, 16,
     2049        {
     2050            {15, 0x000092d8}, /* _ldrRead */
     2051            {15, 0x0003bf10}, /* _ldrOpen */
     2052            {15, 0x0003c798}, /* _ldrClose */
     2053            {15, 0x0003c7e8}, /* _LDRQAppType */
     2054            {15, 0x0003a10c}, /* _ldrEnum32bitRelRecs */
     2055            {15, 0x00003a24}, /* _IOSftOpen */
     2056            {15, 0x00003e90}, /* _IOSftClose */
     2057            {15, 0x00003f25}, /* _IOSftTransPath */
     2058            {15, 0x00003cde}, /* _IOSftReadAt */
     2059            {15, 0x00003ce5}, /* _IOSftWriteAt */
     2060            {15, 0x0000403e}, /* _SftFileSize */
     2061            {15, 0x000383d8}, /* _VMAllocMem */
     2062            {15, 0x0001e156}, /* _VMGetOwner */
     2063            {15, 0x00044716}, /* g_tkExecPgm */
     2064            {15, 0x000416e7}, /* _tkStartProcess */
     2065            {11, 0x0000d7a4}, /* f_FuStrLenZ */
     2066            {11, 0x0000d75a}, /* f_FuStrLen */
     2067            {11, 0x0000d898}, /* f_FuBuff */
     2068            {15, 0x0001d4b8}, /* _VMObjHandleInfo */
     2069            {15, 0x000450dc}, /* _ldrASMpMTEFromHandle */
     2070            {15, 0x0003c187}, /* _ldrOpenPath */
     2071            {15, 0x00038b20}, /* _LDRClearSem */
     2072            {15, 0x00040e88}, /* _ldrFindModule */
     2073            {15, 0x0000a74c}, /* _KSEMRequestMutex */
     2074            {15, 0x0000a823}, /* _KSEMReleaseMutex */
     2075            {15, 0x0000a84e}, /* _KSEMQueryMutex */
     2076            {15, 0x0000aaee}, /* _KSEMInit */
     2077            {10, 0x0001c9f4}, /* _LdrSem */
     2078            {10, 0x00019e60}, /* _LDRLibPath */
     2079            {15, 0x00028e15}, /* _TKSuBuff */
     2080            {15, 0x00028a4b}, /* _TKFuBuff */
     2081            {15, 0x00028bd5}, /* _TKFuBufLen */
     2082            {15, 0x00038b5c}, /* _ldrValidateMteHandle */
     2083            {10, 0x000070bc}, /* _pTCBCur */
     2084            {10, 0x000070b8}, /* _pPTDACur */
     2085            {4 , 0x0000f9a8}, /* ptda_start */
     2086            {4 , 0x0000fa4e}, /* ptda_environ */
     2087            {4 , 0x0000fea8}, /* ptda_ptdasem */
     2088            {4 , 0x0000ffaa}, /* ptda_module */
     2089            {4 , 0x0000fa50}, /* ptda_pBeginLIBPATH */
     2090            {10, 0x0001bd84}, /* _ldrpFileNameBuf */
     2091            {15, 0x0003526b}, /* SecPathFromSFN */
     2092        }
     2093    },
     2094#endif
    3032095    { /* 8260RS.SYM */
    304         8260, 'R', TYPE_SMP, 15,
     2096        8260, KF_SMP, 15,
    3052097        {
    3062098            {14, 0x0000bdec}, /* _ldrRead */
     
    3182110            {14, 0x0002743a}, /* _VMGetOwner */
    3192111            {14, 0x00050b4a}, /* g_tkExecPgm */
     2112            {14, 0x0004d299}, /* _tkStartProcess */
    3202113            {11, 0x00009f7c}, /* f_FuStrLenZ */
    3212114            {11, 0x00009efc}, /* f_FuStrLen */
    3222115            {11, 0x0000a125}, /* f_FuBuff */
     2116            {14, 0x00026093}, /* _VMObjHandleInfo */
     2117            {14, 0x00051550}, /* _ldrASMpMTEFromHandle */
     2118            {14, 0x00046ada}, /* _ldrOpenPath */
     2119            {14, 0x00043304}, /* _LDRClearSem */
     2120            {14, 0x0004c973}, /* _ldrFindModule */
     2121            {14, 0x0000d42c}, /* _KSEMRequestMutex */
     2122            {14, 0x0000d4bf}, /* _KSEMReleaseMutex */
     2123            {14, 0x0000d4ea}, /* _KSEMQueryMutex */
     2124            {14, 0x0000d6ff}, /* _KSEMInit */
     2125            {9 , 0x0000d158}, /* _LdrSem */
     2126            {9 , 0x0000b6dc}, /* _LDRLibPath */
     2127            {14, 0x000332b7}, /* _TKSuBuff */
     2128            {14, 0x00032e4c}, /* _TKFuBuff */
     2129            {14, 0x00033016}, /* _TKFuBufLen */
     2130            {14, 0x00043350}, /* _ldrValidateMteHandle */
     2131            {0 , 0x00000b34}, /* _pTCBCur */
     2132            {0 , 0x00000b30}, /* _pPTDACur */
     2133            {3 , 0x0000f8cc}, /* ptda_start */
     2134            {3 , 0x0000f9da}, /* ptda_environ */
     2135            {3 , 0x0000fe94}, /* ptda_ptdasem */
     2136            {3 , 0x0000ffa2}, /* ptda_module */
     2137            {3 , 0x0000f9dc}, /* ptda_pBeginLIBPATH */
     2138            {9 , 0x0000cf1c}, /* _ldrpFileNameBuf */
     2139            {15, 0xffffffff}, /* SecPathFromSFN */
    3232140        }
    3242141    },
    3252142    { /* 8260RU.SYM */
    326         8260, 'R', TYPE_UNI, 14,
     2143        8260, KF_UNI, 14,
    3272144        {
    3282145            {13, 0x00009244}, /* _ldrRead */
     
    3402157            {13, 0x0001d2ee}, /* _VMGetOwner */
    3412158            {13, 0x00042e8a}, /* g_tkExecPgm */
    342             {9, 0x0000d7a4}, /* f_FuStrLenZ */
    343             {9, 0x0000d75a}, /* f_FuStrLen */
    344             {9, 0x0000d898}, /* f_FuBuff */
    345         }
    346     },
     2159            {13, 0x0003fe7f}, /* _tkStartProcess */
     2160            {9 , 0x0000d7a4}, /* f_FuStrLenZ */
     2161            {9 , 0x0000d75a}, /* f_FuStrLen */
     2162            {9 , 0x0000d898}, /* f_FuBuff */
     2163            {13, 0x0001c650}, /* _VMObjHandleInfo */
     2164            {13, 0x00043850}, /* _ldrASMpMTEFromHandle */
     2165            {13, 0x0003a88f}, /* _ldrOpenPath */
     2166            {13, 0x00037228}, /* _LDRClearSem */
     2167            {13, 0x0003f620}, /* _ldrFindModule */
     2168            {13, 0x0000a590}, /* _KSEMRequestMutex */
     2169            {13, 0x0000a623}, /* _KSEMReleaseMutex */
     2170            {13, 0x0000a64e}, /* _KSEMQueryMutex */
     2171            {13, 0x0000a863}, /* _KSEMInit */
     2172            {8 , 0x0000c830}, /* _LdrSem */
     2173            {8 , 0x00009ca0}, /* _LDRLibPath */
     2174            {13, 0x00027fad}, /* _TKSuBuff */
     2175            {13, 0x00027be3}, /* _TKFuBuff */
     2176            {13, 0x00027d6d}, /* _TKFuBufLen */
     2177            {13, 0x00037264}, /* _ldrValidateMteHandle */
     2178            {8 , 0x000070bc}, /* _pTCBCur */
     2179            {8 , 0x000070b8}, /* _pPTDACur */
     2180            {2 , 0x0000f9a8}, /* ptda_start */
     2181            {2 , 0x0000fa4e}, /* ptda_environ */
     2182            {2 , 0x0000fea8}, /* ptda_ptdasem */
     2183            {2 , 0x0000ffaa}, /* ptda_module */
     2184            {2 , 0x0000fa50}, /* ptda_pBeginLIBPATH */
     2185            {8 , 0x0000bbc0}, /* _ldrpFileNameBuf */
     2186            {13, 0x00033973}, /* SecPathFromSFN */
     2187        }
     2188    },
     2189#ifdef ALLKERNELS
     2190    { /* 8261AS.SYM */
     2191        8261, KF_SMP | KF_ALLSTRICT, 17,
     2192        {
     2193            {16, 0x0000d7d8}, /* _ldrRead */
     2194            {16, 0x0005c3d0}, /* _ldrOpen */
     2195            {16, 0x0005cf18}, /* _ldrClose */
     2196            {16, 0x0005cf68}, /* _LDRQAppType */
     2197            {16, 0x0005a674}, /* _ldrEnum32bitRelRecs */
     2198            {16, 0x00006320}, /* _IOSftOpen */
     2199            {16, 0x00006808}, /* _IOSftClose */
     2200            {16, 0x000068c0}, /* _IOSftTransPath */
     2201            {16, 0x0000661c}, /* _IOSftReadAt */
     2202            {16, 0x00006623}, /* _IOSftWriteAt */
     2203            {16, 0x000069f8}, /* _SftFileSize */
     2204            {16, 0x000579d4}, /* _VMAllocMem */
     2205            {16, 0x0002fef6}, /* _VMGetOwner */
     2206            {16, 0x00067a48}, /* g_tkExecPgm */
     2207            {16, 0x00063818}, /* _tkStartProcess */
     2208            {13, 0x0000a824}, /* f_FuStrLenZ */
     2209            {13, 0x0000a7a4}, /* f_FuStrLen */
     2210            {13, 0x0000a9ec}, /* f_FuBuff */
     2211            {16, 0x0002e717}, /* _VMObjHandleInfo */
     2212            {16, 0x00068608}, /* _ldrASMpMTEFromHandle */
     2213            {16, 0x0005c68a}, /* _ldrOpenPath */
     2214            {16, 0x00058670}, /* _LDRClearSem */
     2215            {16, 0x00062e50}, /* _ldrFindModule */
     2216            {16, 0x0000f4fc}, /* _KSEMRequestMutex */
     2217            {16, 0x0000f610}, /* _KSEMReleaseMutex */
     2218            {16, 0x0000f670}, /* _KSEMQueryMutex */
     2219            {16, 0x0000f9f4}, /* _KSEMInit */
     2220            {11, 0x0002c800}, /* _LdrSem */
     2221            {11, 0x0002a20c}, /* _LDRLibPath */
     2222            {16, 0x0003f29c}, /* _TKSuBuff */
     2223            {16, 0x0003eded}, /* _TKFuBuff */
     2224            {16, 0x0003eff9}, /* _TKFuBufLen */
     2225            {16, 0x00058708}, /* _ldrValidateMteHandle */
     2226            {0 , 0x00000b34}, /* _pTCBCur */
     2227            {0 , 0x00000b30}, /* _pPTDACur */
     2228            {5 , 0x0000f8b4}, /* ptda_start */
     2229            {5 , 0x0000f9ce}, /* ptda_environ */
     2230            {5 , 0x0000fe88}, /* ptda_ptdasem */
     2231            {5 , 0x0000ffa2}, /* ptda_module */
     2232            {5 , 0x0000f9d0}, /* ptda_pBeginLIBPATH */
     2233            {11, 0x0002c3ec}, /* _ldrpFileNameBuf */
     2234            {16, 0x0005362a}, /* SecPathFromSFN */
     2235        }
     2236    },
     2237#endif
     2238#ifdef ALLKERNELS
     2239    { /* 8261AU.SYM */
     2240        8261, KF_UNI | KF_ALLSTRICT, 16,
     2241        {
     2242            {15, 0x0000a328}, /* _ldrRead */
     2243            {15, 0x0004a48c}, /* _ldrOpen */
     2244            {15, 0x0004ae2c}, /* _ldrClose */
     2245            {15, 0x0004ae7c}, /* _LDRQAppType */
     2246            {15, 0x00048394}, /* _ldrEnum32bitRelRecs */
     2247            {15, 0x00004520}, /* _IOSftOpen */
     2248            {15, 0x00004998}, /* _IOSftClose */
     2249            {15, 0x00004a30}, /* _IOSftTransPath */
     2250            {15, 0x000047e4}, /* _IOSftReadAt */
     2251            {15, 0x000047eb}, /* _IOSftWriteAt */
     2252            {15, 0x00004b58}, /* _SftFileSize */
     2253            {15, 0x00045d10}, /* _VMAllocMem */
     2254            {15, 0x0002384a}, /* _VMGetOwner */
     2255            {15, 0x00053f24}, /* g_tkExecPgm */
     2256            {15, 0x0005065c}, /* _tkStartProcess */
     2257            {11, 0x0000ea04}, /* f_FuStrLenZ */
     2258            {11, 0x0000e9b8}, /* f_FuStrLen */
     2259            {11, 0x0000eb1c}, /* f_FuBuff */
     2260            {15, 0x00022794}, /* _VMObjHandleInfo */
     2261            {15, 0x000549ec}, /* _ldrASMpMTEFromHandle */
     2262            {15, 0x0004a717}, /* _ldrOpenPath */
     2263            {15, 0x000467c4}, /* _LDRClearSem */
     2264            {15, 0x0004fd5c}, /* _ldrFindModule */
     2265            {15, 0x0000bc54}, /* _KSEMRequestMutex */
     2266            {15, 0x0000bd68}, /* _KSEMReleaseMutex */
     2267            {15, 0x0000bdc8}, /* _KSEMQueryMutex */
     2268            {15, 0x0000c14c}, /* _KSEMInit */
     2269            {10, 0x0002a394}, /* _LdrSem */
     2270            {10, 0x00026b90}, /* _LDRLibPath */
     2271            {15, 0x000317f0}, /* _TKSuBuff */
     2272            {15, 0x000313e0}, /* _TKFuBuff */
     2273            {15, 0x000315ac}, /* _TKFuBufLen */
     2274            {15, 0x0004684c}, /* _ldrValidateMteHandle */
     2275            {10, 0x0000b84c}, /* _pTCBCur */
     2276            {10, 0x0000b848}, /* _pPTDACur */
     2277            {4 , 0x0000f994}, /* ptda_start */
     2278            {4 , 0x0000fa46}, /* ptda_environ */
     2279            {4 , 0x0000fea0}, /* ptda_ptdasem */
     2280            {4 , 0x0000ffaa}, /* ptda_module */
     2281            {4 , 0x0000fa48}, /* ptda_pBeginLIBPATH */
     2282            {10, 0x0002954c}, /* _ldrpFileNameBuf */
     2283            {15, 0x000425d9}, /* SecPathFromSFN */
     2284        }
     2285    },
     2286#endif
     2287#ifdef ALLKERNELS
     2288    { /* 8261HS.SYM */
     2289        8261, KF_SMP | KF_HALFSTRICT, 17,
     2290        {
     2291            {16, 0x0000c2ec}, /* _ldrRead */
     2292            {16, 0x0004c87c}, /* _ldrOpen */
     2293            {16, 0x0004d2a4}, /* _ldrClose */
     2294            {16, 0x0004d2f4}, /* _LDRQAppType */
     2295            {16, 0x0004ad6c}, /* _ldrEnum32bitRelRecs */
     2296            {16, 0x0000547c}, /* _IOSftOpen */
     2297            {16, 0x00005955}, /* _IOSftClose */
     2298            {16, 0x00005a0c}, /* _IOSftTransPath */
     2299            {16, 0x0000576c}, /* _IOSftReadAt */
     2300            {16, 0x00005773}, /* _IOSftWriteAt */
     2301            {16, 0x00005b36}, /* _SftFileSize */
     2302            {16, 0x0004895c}, /* _VMAllocMem */
     2303            {16, 0x000292bc}, /* _VMGetOwner */
     2304            {16, 0x00056d3a}, /* g_tkExecPgm */
     2305            {16, 0x00053415}, /* _tkStartProcess */
     2306            {13, 0x0000a158}, /* f_FuStrLenZ */
     2307            {13, 0x0000a0d8}, /* f_FuStrLen */
     2308            {13, 0x0000a301}, /* f_FuBuff */
     2309            {16, 0x00027f13}, /* _VMObjHandleInfo */
     2310            {16, 0x00057824}, /* _ldrASMpMTEFromHandle */
     2311            {16, 0x0004cb22}, /* _ldrOpenPath */
     2312            {16, 0x00049320}, /* _LDRClearSem */
     2313            {16, 0x00052af1}, /* _ldrFindModule */
     2314            {16, 0x0000da8c}, /* _KSEMRequestMutex */
     2315            {16, 0x0000db63}, /* _KSEMReleaseMutex */
     2316            {16, 0x0000db8e}, /* _KSEMQueryMutex */
     2317            {16, 0x0000de2e}, /* _KSEMInit */
     2318            {11, 0x0001d780}, /* _LdrSem */
     2319            {11, 0x0001bcfc}, /* _LDRLibPath */
     2320            {16, 0x000356e7}, /* _TKSuBuff */
     2321            {16, 0x0003527a}, /* _TKFuBuff */
     2322            {16, 0x00035444}, /* _TKFuBufLen */
     2323            {16, 0x0004936c}, /* _ldrValidateMteHandle */
     2324            {0 , 0x00000b34}, /* _pTCBCur */
     2325            {0 , 0x00000b30}, /* _pPTDACur */
     2326            {5 , 0x0000f8c0}, /* ptda_start */
     2327            {5 , 0x0000f9da}, /* ptda_environ */
     2328            {5 , 0x0000fe94}, /* ptda_ptdasem */
     2329            {5 , 0x0000ffa2}, /* ptda_module */
     2330            {5 , 0x0000f9dc}, /* ptda_pBeginLIBPATH */
     2331            {11, 0x0001d544}, /* _ldrpFileNameBuf */
     2332            {16, 0x00044c8a}, /* SecPathFromSFN */
     2333        }
     2334    },
     2335#endif
     2336#ifdef ALLKERNELS
     2337    { /* 8261HU.SYM */
     2338        8261, KF_UNI | KF_HALFSTRICT, 16,
     2339        {
     2340            {15, 0x00009328}, /* _ldrRead */
     2341            {15, 0x0003c120}, /* _ldrOpen */
     2342            {15, 0x0003c9ac}, /* _ldrClose */
     2343            {15, 0x0003c9fc}, /* _LDRQAppType */
     2344            {15, 0x0003a308}, /* _ldrEnum32bitRelRecs */
     2345            {15, 0x00003a70}, /* _IOSftOpen */
     2346            {15, 0x00003edc}, /* _IOSftClose */
     2347            {15, 0x00003f71}, /* _IOSftTransPath */
     2348            {15, 0x00003d2a}, /* _IOSftReadAt */
     2349            {15, 0x00003d31}, /* _IOSftWriteAt */
     2350            {15, 0x0000408a}, /* _SftFileSize */
     2351            {15, 0x000385d4}, /* _VMAllocMem */
     2352            {15, 0x0001e156}, /* _VMGetOwner */
     2353            {15, 0x00044a9a}, /* g_tkExecPgm */
     2354            {15, 0x00041a0b}, /* _tkStartProcess */
     2355            {11, 0x0000d7d0}, /* f_FuStrLenZ */
     2356            {11, 0x0000d786}, /* f_FuStrLen */
     2357            {11, 0x0000d8c4}, /* f_FuBuff */
     2358            {15, 0x0001d4bc}, /* _VMObjHandleInfo */
     2359            {15, 0x00045490}, /* _ldrASMpMTEFromHandle */
     2360            {15, 0x0003c397}, /* _ldrOpenPath */
     2361            {15, 0x00038d1c}, /* _LDRClearSem */
     2362            {15, 0x000411ac}, /* _ldrFindModule */
     2363            {15, 0x0000a79c}, /* _KSEMRequestMutex */
     2364            {15, 0x0000a873}, /* _KSEMReleaseMutex */
     2365            {15, 0x0000a89e}, /* _KSEMQueryMutex */
     2366            {15, 0x0000ab3e}, /* _KSEMInit */
     2367            {10, 0x0001ca30}, /* _LdrSem */
     2368            {10, 0x00019e9c}, /* _LDRLibPath */
     2369            {15, 0x00028e31}, /* _TKSuBuff */
     2370            {15, 0x00028a67}, /* _TKFuBuff */
     2371            {15, 0x00028bf1}, /* _TKFuBufLen */
     2372            {15, 0x00038d58}, /* _ldrValidateMteHandle */
     2373            {10, 0x000070e4}, /* _pTCBCur */
     2374            {10, 0x000070e0}, /* _pPTDACur */
     2375            {4 , 0x0000f99c}, /* ptda_start */
     2376            {4 , 0x0000fa4e}, /* ptda_environ */
     2377            {4 , 0x0000fea8}, /* ptda_ptdasem */
     2378            {4 , 0x0000ffaa}, /* ptda_module */
     2379            {4 , 0x0000fa50}, /* ptda_pBeginLIBPATH */
     2380            {10, 0x0001bdc0}, /* _ldrpFileNameBuf */
     2381            {15, 0x00035455}, /* SecPathFromSFN */
     2382        }
     2383    },
     2384#endif
    3472385    { /* 8261RS.SYM */
    348         8261, 'R', TYPE_SMP, 15,
     2386        8261, KF_SMP, 15,
    3492387        {
    3502388            {14, 0x0000c1dc}, /* _ldrRead */
     
    3622400            {14, 0x00027aa0}, /* _VMGetOwner */
    3632401            {14, 0x000547fe}, /* g_tkExecPgm */
     2402            {14, 0x00050ff1}, /* _tkStartProcess */
    3642403            {11, 0x0000a158}, /* f_FuStrLenZ */
    3652404            {11, 0x0000a0d8}, /* f_FuStrLen */
    3662405            {11, 0x0000a301}, /* f_FuBuff */
     2406            {14, 0x000266f7}, /* _VMObjHandleInfo */
     2407            {14, 0x000552e8}, /* _ldrASMpMTEFromHandle */
     2408            {14, 0x0004a712}, /* _ldrOpenPath */
     2409            {14, 0x00046f10}, /* _LDRClearSem */
     2410            {14, 0x000506cd}, /* _ldrFindModule */
     2411            {14, 0x0000d84c}, /* _KSEMRequestMutex */
     2412            {14, 0x0000d8df}, /* _KSEMReleaseMutex */
     2413            {14, 0x0000d90a}, /* _KSEMQueryMutex */
     2414            {14, 0x0000db1f}, /* _KSEMInit */
     2415            {9 , 0x0000d1e8}, /* _LdrSem */
     2416            {9 , 0x0000b76c}, /* _LDRLibPath */
     2417            {14, 0x00033ecb}, /* _TKSuBuff */
     2418            {14, 0x00033a5e}, /* _TKFuBuff */
     2419            {14, 0x00033c28}, /* _TKFuBufLen */
     2420            {14, 0x00046f5c}, /* _ldrValidateMteHandle */
     2421            {0 , 0x00000b34}, /* _pTCBCur */
     2422            {0 , 0x00000b30}, /* _pPTDACur */
     2423            {3 , 0x0000f8c0}, /* ptda_start */
     2424            {3 , 0x0000f9da}, /* ptda_environ */
     2425            {3 , 0x0000fe94}, /* ptda_ptdasem */
     2426            {3 , 0x0000ffa2}, /* ptda_module */
     2427            {3 , 0x0000f9dc}, /* ptda_pBeginLIBPATH */
     2428            {9 , 0x0000cfac}, /* _ldrpFileNameBuf */
     2429            {14, 0x0004287a}, /* SecPathFromSFN */
    3672430        }
    3682431    },
    3692432    { /* 8261RU.SYM */
    370         8261, 'R', TYPE_UNI, 14,
     2433        8261, KF_UNI, 14,
    3712434        {
    3722435            {13, 0x00009294}, /* _ldrRead */
     
    3842447            {13, 0x0001d2ee}, /* _VMGetOwner */
    3852448            {13, 0x0004315a}, /* g_tkExecPgm */
    386             {9, 0x0000d7d0}, /* f_FuStrLenZ */
    387             {9, 0x0000d786}, /* f_FuStrLen */
    388             {9, 0x0000d8c4}, /* f_FuBuff */
    389         }
    390     },
     2449            {13, 0x000400eb}, /* _tkStartProcess */
     2450            {9 , 0x0000d7d0}, /* f_FuStrLenZ */
     2451            {9 , 0x0000d786}, /* f_FuStrLen */
     2452            {9 , 0x0000d8c4}, /* f_FuBuff */
     2453            {13, 0x0001c654}, /* _VMObjHandleInfo */
     2454            {13, 0x00043b50}, /* _ldrASMpMTEFromHandle */
     2455            {13, 0x0003aab3}, /* _ldrOpenPath */
     2456            {13, 0x00037438}, /* _LDRClearSem */
     2457            {13, 0x0003f88c}, /* _ldrFindModule */
     2458            {13, 0x0000a5e0}, /* _KSEMRequestMutex */
     2459            {13, 0x0000a673}, /* _KSEMReleaseMutex */
     2460            {13, 0x0000a69e}, /* _KSEMQueryMutex */
     2461            {13, 0x0000a8b3}, /* _KSEMInit */
     2462            {8 , 0x0000c86c}, /* _LdrSem */
     2463            {8 , 0x00009cdc}, /* _LDRLibPath */
     2464            {13, 0x00027fc9}, /* _TKSuBuff */
     2465            {13, 0x00027bff}, /* _TKFuBuff */
     2466            {13, 0x00027d89}, /* _TKFuBufLen */
     2467            {13, 0x00037474}, /* _ldrValidateMteHandle */
     2468            {8 , 0x000070e4}, /* _pTCBCur */
     2469            {8 , 0x000070e0}, /* _pPTDACur */
     2470            {2 , 0x0000f99c}, /* ptda_start */
     2471            {2 , 0x0000fa4e}, /* ptda_environ */
     2472            {2 , 0x0000fea8}, /* ptda_ptdasem */
     2473            {2 , 0x0000ffaa}, /* ptda_module */
     2474            {2 , 0x0000fa50}, /* ptda_pBeginLIBPATH */
     2475            {8 , 0x0000bbfc}, /* _ldrpFileNameBuf */
     2476            {13, 0x00033b71}, /* SecPathFromSFN */
     2477        }
     2478    },
     2479#ifdef ALLKERNELS
     2480    { /* 8262AS.SYM */
     2481        8262, KF_SMP | KF_ALLSTRICT, 17,
     2482        {
     2483            {16, 0x0000d7d8}, /* _ldrRead */
     2484            {16, 0x0005c2d0}, /* _ldrOpen */
     2485            {16, 0x0005ce18}, /* _ldrClose */
     2486            {16, 0x0005ce68}, /* _LDRQAppType */
     2487            {16, 0x0005a574}, /* _ldrEnum32bitRelRecs */
     2488            {16, 0x00006320}, /* _IOSftOpen */
     2489            {16, 0x00006808}, /* _IOSftClose */
     2490            {16, 0x000068c0}, /* _IOSftTransPath */
     2491            {16, 0x0000661c}, /* _IOSftReadAt */
     2492            {16, 0x00006623}, /* _IOSftWriteAt */
     2493            {16, 0x000069f8}, /* _SftFileSize */
     2494            {16, 0x000578d4}, /* _VMAllocMem */
     2495            {16, 0x0002fdf6}, /* _VMGetOwner */
     2496            {16, 0x00067948}, /* g_tkExecPgm */
     2497            {16, 0x00063718}, /* _tkStartProcess */
     2498            {13, 0x0000a824}, /* f_FuStrLenZ */
     2499            {13, 0x0000a7a4}, /* f_FuStrLen */
     2500            {13, 0x0000a9ec}, /* f_FuBuff */
     2501            {16, 0x0002e617}, /* _VMObjHandleInfo */
     2502            {16, 0x00068508}, /* _ldrASMpMTEFromHandle */
     2503            {16, 0x0005c58a}, /* _ldrOpenPath */
     2504            {16, 0x00058570}, /* _LDRClearSem */
     2505            {16, 0x00062d50}, /* _ldrFindModule */
     2506            {16, 0x0000f4fc}, /* _KSEMRequestMutex */
     2507            {16, 0x0000f610}, /* _KSEMReleaseMutex */
     2508            {16, 0x0000f670}, /* _KSEMQueryMutex */
     2509            {16, 0x0000f9f4}, /* _KSEMInit */
     2510            {11, 0x0002c800}, /* _LdrSem */
     2511            {11, 0x0002a20c}, /* _LDRLibPath */
     2512            {16, 0x0003f19c}, /* _TKSuBuff */
     2513            {16, 0x0003eced}, /* _TKFuBuff */
     2514            {16, 0x0003eef9}, /* _TKFuBufLen */
     2515            {16, 0x00058608}, /* _ldrValidateMteHandle */
     2516            {0 , 0x00000b34}, /* _pTCBCur */
     2517            {0 , 0x00000b30}, /* _pPTDACur */
     2518            {5 , 0x0000f8b4}, /* ptda_start */
     2519            {5 , 0x0000f9ce}, /* ptda_environ */
     2520            {5 , 0x0000fe88}, /* ptda_ptdasem */
     2521            {5 , 0x0000ffa2}, /* ptda_module */
     2522            {5 , 0x0000f9d0}, /* ptda_pBeginLIBPATH */
     2523            {11, 0x0002c3ec}, /* _ldrpFileNameBuf */
     2524            {16, 0x0005352a}, /* SecPathFromSFN */
     2525        }
     2526    },
     2527#endif
     2528#ifdef ALLKERNELS
     2529    { /* 8262AU.SYM */
     2530        8262, KF_UNI | KF_ALLSTRICT, 16,
     2531        {
     2532            {15, 0x0000a328}, /* _ldrRead */
     2533            {15, 0x0004a3a8}, /* _ldrOpen */
     2534            {15, 0x0004ad48}, /* _ldrClose */
     2535            {15, 0x0004ad98}, /* _LDRQAppType */
     2536            {15, 0x000482b0}, /* _ldrEnum32bitRelRecs */
     2537            {15, 0x00004520}, /* _IOSftOpen */
     2538            {15, 0x00004998}, /* _IOSftClose */
     2539            {15, 0x00004a30}, /* _IOSftTransPath */
     2540            {15, 0x000047e4}, /* _IOSftReadAt */
     2541            {15, 0x000047eb}, /* _IOSftWriteAt */
     2542            {15, 0x00004b58}, /* _SftFileSize */
     2543            {15, 0x00045c2c}, /* _VMAllocMem */
     2544            {15, 0x00023766}, /* _VMGetOwner */
     2545            {15, 0x00053e40}, /* g_tkExecPgm */
     2546            {15, 0x00050578}, /* _tkStartProcess */
     2547            {11, 0x0000ea08}, /* f_FuStrLenZ */
     2548            {11, 0x0000e9bc}, /* f_FuStrLen */
     2549            {11, 0x0000eb20}, /* f_FuBuff */
     2550            {15, 0x000226b0}, /* _VMObjHandleInfo */
     2551            {15, 0x00054908}, /* _ldrASMpMTEFromHandle */
     2552            {15, 0x0004a633}, /* _ldrOpenPath */
     2553            {15, 0x000466e0}, /* _LDRClearSem */
     2554            {15, 0x0004fc78}, /* _ldrFindModule */
     2555            {15, 0x0000bc54}, /* _KSEMRequestMutex */
     2556            {15, 0x0000bd68}, /* _KSEMReleaseMutex */
     2557            {15, 0x0000bdc8}, /* _KSEMQueryMutex */
     2558            {15, 0x0000c14c}, /* _KSEMInit */
     2559            {10, 0x0002a394}, /* _LdrSem */
     2560            {10, 0x00026b90}, /* _LDRLibPath */
     2561            {15, 0x0003170c}, /* _TKSuBuff */
     2562            {15, 0x000312fc}, /* _TKFuBuff */
     2563            {15, 0x000314c8}, /* _TKFuBufLen */
     2564            {15, 0x00046768}, /* _ldrValidateMteHandle */
     2565            {10, 0x0000b84c}, /* _pTCBCur */
     2566            {10, 0x0000b848}, /* _pPTDACur */
     2567            {4 , 0x0000f994}, /* ptda_start */
     2568            {4 , 0x0000fa46}, /* ptda_environ */
     2569            {4 , 0x0000fea0}, /* ptda_ptdasem */
     2570            {4 , 0x0000ffaa}, /* ptda_module */
     2571            {4 , 0x0000fa48}, /* ptda_pBeginLIBPATH */
     2572            {10, 0x0002954c}, /* _ldrpFileNameBuf */
     2573            {15, 0x000424f5}, /* SecPathFromSFN */
     2574        }
     2575    },
     2576#endif
     2577#ifdef ALLKERNELS
     2578    { /* 8262HS.SYM */
     2579        8262, KF_SMP | KF_HALFSTRICT, 17,
     2580        {
     2581            {16, 0x0000c2ec}, /* _ldrRead */
     2582            {16, 0x0004c77c}, /* _ldrOpen */
     2583            {16, 0x0004d1a4}, /* _ldrClose */
     2584            {16, 0x0004d1f4}, /* _LDRQAppType */
     2585            {16, 0x0004ac6c}, /* _ldrEnum32bitRelRecs */
     2586            {16, 0x0000547c}, /* _IOSftOpen */
     2587            {16, 0x00005955}, /* _IOSftClose */
     2588            {16, 0x00005a0c}, /* _IOSftTransPath */
     2589            {16, 0x0000576c}, /* _IOSftReadAt */
     2590            {16, 0x00005773}, /* _IOSftWriteAt */
     2591            {16, 0x00005b36}, /* _SftFileSize */
     2592            {16, 0x0004885c}, /* _VMAllocMem */
     2593            {16, 0x000291bc}, /* _VMGetOwner */
     2594            {16, 0x00056c3a}, /* g_tkExecPgm */
     2595            {16, 0x00053315}, /* _tkStartProcess */
     2596            {13, 0x0000a15c}, /* f_FuStrLenZ */
     2597            {13, 0x0000a0dc}, /* f_FuStrLen */
     2598            {13, 0x0000a305}, /* f_FuBuff */
     2599            {16, 0x00027e13}, /* _VMObjHandleInfo */
     2600            {16, 0x00057724}, /* _ldrASMpMTEFromHandle */
     2601            {16, 0x0004ca22}, /* _ldrOpenPath */
     2602            {16, 0x00049220}, /* _LDRClearSem */
     2603            {16, 0x000529f1}, /* _ldrFindModule */
     2604            {16, 0x0000da8c}, /* _KSEMRequestMutex */
     2605            {16, 0x0000db63}, /* _KSEMReleaseMutex */
     2606            {16, 0x0000db8e}, /* _KSEMQueryMutex */
     2607            {16, 0x0000de2e}, /* _KSEMInit */
     2608            {11, 0x0001d780}, /* _LdrSem */
     2609            {11, 0x0001bcfc}, /* _LDRLibPath */
     2610            {16, 0x000355e7}, /* _TKSuBuff */
     2611            {16, 0x0003517a}, /* _TKFuBuff */
     2612            {16, 0x00035344}, /* _TKFuBufLen */
     2613            {16, 0x0004926c}, /* _ldrValidateMteHandle */
     2614            {0 , 0x00000b34}, /* _pTCBCur */
     2615            {0 , 0x00000b30}, /* _pPTDACur */
     2616            {5 , 0x0000f8c0}, /* ptda_start */
     2617            {5 , 0x0000f9da}, /* ptda_environ */
     2618            {5 , 0x0000fe94}, /* ptda_ptdasem */
     2619            {5 , 0x0000ffa2}, /* ptda_module */
     2620            {5 , 0x0000f9dc}, /* ptda_pBeginLIBPATH */
     2621            {11, 0x0001d544}, /* _ldrpFileNameBuf */
     2622            {16, 0x00044b8a}, /* SecPathFromSFN */
     2623        }
     2624    },
     2625#endif
     2626#ifdef ALLKERNELS
     2627    { /* 8262HU.SYM */
     2628        8262, KF_UNI | KF_HALFSTRICT, 16,
     2629        {
     2630            {15, 0x00009328}, /* _ldrRead */
     2631            {15, 0x0003c03c}, /* _ldrOpen */
     2632            {15, 0x0003c8c8}, /* _ldrClose */
     2633            {15, 0x0003c918}, /* _LDRQAppType */
     2634            {15, 0x0003a224}, /* _ldrEnum32bitRelRecs */
     2635            {15, 0x00003a70}, /* _IOSftOpen */
     2636            {15, 0x00003edc}, /* _IOSftClose */
     2637            {15, 0x00003f71}, /* _IOSftTransPath */
     2638            {15, 0x00003d2a}, /* _IOSftReadAt */
     2639            {15, 0x00003d31}, /* _IOSftWriteAt */
     2640            {15, 0x0000408a}, /* _SftFileSize */
     2641            {15, 0x000384f0}, /* _VMAllocMem */
     2642            {15, 0x0001e072}, /* _VMGetOwner */
     2643            {15, 0x000449b6}, /* g_tkExecPgm */
     2644            {15, 0x00041927}, /* _tkStartProcess */
     2645            {11, 0x0000d7d4}, /* f_FuStrLenZ */
     2646            {11, 0x0000d78a}, /* f_FuStrLen */
     2647            {11, 0x0000d8c8}, /* f_FuBuff */
     2648            {15, 0x0001d3d8}, /* _VMObjHandleInfo */
     2649            {15, 0x000453ac}, /* _ldrASMpMTEFromHandle */
     2650            {15, 0x0003c2b3}, /* _ldrOpenPath */
     2651            {15, 0x00038c38}, /* _LDRClearSem */
     2652            {15, 0x000410c8}, /* _ldrFindModule */
     2653            {15, 0x0000a79c}, /* _KSEMRequestMutex */
     2654            {15, 0x0000a873}, /* _KSEMReleaseMutex */
     2655            {15, 0x0000a89e}, /* _KSEMQueryMutex */
     2656            {15, 0x0000ab3e}, /* _KSEMInit */
     2657            {10, 0x0001ca30}, /* _LdrSem */
     2658            {10, 0x00019e9c}, /* _LDRLibPath */
     2659            {15, 0x00028d4d}, /* _TKSuBuff */
     2660            {15, 0x00028983}, /* _TKFuBuff */
     2661            {15, 0x00028b0d}, /* _TKFuBufLen */
     2662            {15, 0x00038c74}, /* _ldrValidateMteHandle */
     2663            {10, 0x000070e4}, /* _pTCBCur */
     2664            {10, 0x000070e0}, /* _pPTDACur */
     2665            {4 , 0x0000f99c}, /* ptda_start */
     2666            {4 , 0x0000fa4e}, /* ptda_environ */
     2667            {4 , 0x0000fea8}, /* ptda_ptdasem */
     2668            {4 , 0x0000ffaa}, /* ptda_module */
     2669            {4 , 0x0000fa50}, /* ptda_pBeginLIBPATH */
     2670            {10, 0x0001bdc0}, /* _ldrpFileNameBuf */
     2671            {15, 0x00035371}, /* SecPathFromSFN */
     2672        }
     2673    },
     2674#endif
    3912675    { /* 8262RS.SYM */
    392         8262, 'R', TYPE_SMP, 15,
     2676        8262, KF_SMP, 15,
    3932677        {
    3942678            {14, 0x0000c1dc}, /* _ldrRead */
     
    4062690            {14, 0x000279a0}, /* _VMGetOwner */
    4072691            {14, 0x000546fe}, /* g_tkExecPgm */
     2692            {14, 0x00050ef1}, /* _tkStartProcess */
    4082693            {11, 0x0000a15c}, /* f_FuStrLenZ */
    4092694            {11, 0x0000a0dc}, /* f_FuStrLen */
    4102695            {11, 0x0000a305}, /* f_FuBuff */
     2696            {14, 0x000265f7}, /* _VMObjHandleInfo */
     2697            {14, 0x000551e8}, /* _ldrASMpMTEFromHandle */
     2698            {14, 0x0004a612}, /* _ldrOpenPath */
     2699            {14, 0x00046e10}, /* _LDRClearSem */
     2700            {14, 0x000505cd}, /* _ldrFindModule */
     2701            {14, 0x0000d84c}, /* _KSEMRequestMutex */
     2702            {14, 0x0000d8df}, /* _KSEMReleaseMutex */
     2703            {14, 0x0000d90a}, /* _KSEMQueryMutex */
     2704            {14, 0x0000db1f}, /* _KSEMInit */
     2705            {9 , 0x0000d1e8}, /* _LdrSem */
     2706            {9 , 0x0000b76c}, /* _LDRLibPath */
     2707            {14, 0x00033dcb}, /* _TKSuBuff */
     2708            {14, 0x0003395e}, /* _TKFuBuff */
     2709            {14, 0x00033b28}, /* _TKFuBufLen */
     2710            {14, 0x00046e5c}, /* _ldrValidateMteHandle */
     2711            {0 , 0x00000b34}, /* _pTCBCur */
     2712            {0 , 0x00000b30}, /* _pPTDACur */
     2713            {3 , 0x0000f8c0}, /* ptda_start */
     2714            {3 , 0x0000f9da}, /* ptda_environ */
     2715            {3 , 0x0000fe94}, /* ptda_ptdasem */
     2716            {3 , 0x0000ffa2}, /* ptda_module */
     2717            {3 , 0x0000f9dc}, /* ptda_pBeginLIBPATH */
     2718            {9 , 0x0000cfac}, /* _ldrpFileNameBuf */
     2719            {14, 0x0004277a}, /* SecPathFromSFN */
    4112720        }
    4122721    },
    4132722    { /* 8262RU.SYM */
    414         8262, 'R', TYPE_UNI, 14,
     2723        8262, KF_UNI, 14,
    4152724        {
    4162725            {13, 0x00009294}, /* _ldrRead */
     
    4282737            {13, 0x0001d20a}, /* _VMGetOwner */
    4292738            {13, 0x00043076}, /* g_tkExecPgm */
    430             {9, 0x0000d7d4}, /* f_FuStrLenZ */
    431             {9, 0x0000d78a}, /* f_FuStrLen */
    432             {9, 0x0000d8c8}, /* f_FuBuff */
    433         }
    434     },
     2739            {13, 0x00040007}, /* _tkStartProcess */
     2740            {9 , 0x0000d7d4}, /* f_FuStrLenZ */
     2741            {9 , 0x0000d78a}, /* f_FuStrLen */
     2742            {9 , 0x0000d8c8}, /* f_FuBuff */
     2743            {13, 0x0001c570}, /* _VMObjHandleInfo */
     2744            {13, 0x00043a6c}, /* _ldrASMpMTEFromHandle */
     2745            {13, 0x0003a9cf}, /* _ldrOpenPath */
     2746            {13, 0x00037354}, /* _LDRClearSem */
     2747            {13, 0x0003f7a8}, /* _ldrFindModule */
     2748            {13, 0x0000a5e0}, /* _KSEMRequestMutex */
     2749            {13, 0x0000a673}, /* _KSEMReleaseMutex */
     2750            {13, 0x0000a69e}, /* _KSEMQueryMutex */
     2751            {13, 0x0000a8b3}, /* _KSEMInit */
     2752            {8 , 0x0000c86c}, /* _LdrSem */
     2753            {8 , 0x00009cdc}, /* _LDRLibPath */
     2754            {13, 0x00027ee5}, /* _TKSuBuff */
     2755            {13, 0x00027b1b}, /* _TKFuBuff */
     2756            {13, 0x00027ca5}, /* _TKFuBufLen */
     2757            {13, 0x00037390}, /* _ldrValidateMteHandle */
     2758            {8 , 0x000070e4}, /* _pTCBCur */
     2759            {8 , 0x000070e0}, /* _pPTDACur */
     2760            {2 , 0x0000f99c}, /* ptda_start */
     2761            {2 , 0x0000fa4e}, /* ptda_environ */
     2762            {2 , 0x0000fea8}, /* ptda_ptdasem */
     2763            {2 , 0x0000ffaa}, /* ptda_module */
     2764            {2 , 0x0000fa50}, /* ptda_pBeginLIBPATH */
     2765            {8 , 0x0000bbfc}, /* _ldrpFileNameBuf */
     2766            {13, 0x00033a8d}, /* SecPathFromSFN */
     2767        }
     2768    },
     2769#ifdef ALLKERNELS
     2770    { /* 8263AS.SYM */
     2771        8263, KF_SMP | KF_ALLSTRICT, 17,
     2772        {
     2773            {16, 0x0000d854}, /* _ldrRead */
     2774            {16, 0x0005c3ac}, /* _ldrOpen */
     2775            {16, 0x0005cef4}, /* _ldrClose */
     2776            {16, 0x0005cf44}, /* _LDRQAppType */
     2777            {16, 0x0005a644}, /* _ldrEnum32bitRelRecs */
     2778            {16, 0x0000632c}, /* _IOSftOpen */
     2779            {16, 0x00006814}, /* _IOSftClose */
     2780            {16, 0x000068cc}, /* _IOSftTransPath */
     2781            {16, 0x00006628}, /* _IOSftReadAt */
     2782            {16, 0x0000662f}, /* _IOSftWriteAt */
     2783            {16, 0x00006a04}, /* _SftFileSize */
     2784            {16, 0x000579a4}, /* _VMAllocMem */
     2785            {16, 0x0002fe72}, /* _VMGetOwner */
     2786            {16, 0x00067990}, /* g_tkExecPgm */
     2787            {16, 0x000637f4}, /* _tkStartProcess */
     2788            {13, 0x0000a838}, /* f_FuStrLenZ */
     2789            {13, 0x0000a7b8}, /* f_FuStrLen */
     2790            {13, 0x0000aa00}, /* f_FuBuff */
     2791            {16, 0x0002e693}, /* _VMObjHandleInfo */
     2792            {16, 0x00068550}, /* _ldrASMpMTEFromHandle */
     2793            {16, 0x0005c666}, /* _ldrOpenPath */
     2794            {16, 0x00058640}, /* _LDRClearSem */
     2795            {16, 0x00062e2c}, /* _ldrFindModule */
     2796            {16, 0x0000f578}, /* _KSEMRequestMutex */
     2797            {16, 0x0000f68c}, /* _KSEMReleaseMutex */
     2798            {16, 0x0000f6ec}, /* _KSEMQueryMutex */
     2799            {16, 0x0000fa70}, /* _KSEMInit */
     2800            {11, 0x0002c84c}, /* _LdrSem */
     2801            {11, 0x0002a230}, /* _LDRLibPath */
     2802            {16, 0x0003f218}, /* _TKSuBuff */
     2803            {16, 0x0003ed69}, /* _TKFuBuff */
     2804            {16, 0x0003ef75}, /* _TKFuBufLen */
     2805            {16, 0x000586d8}, /* _ldrValidateMteHandle */
     2806            {0 , 0x00000b34}, /* _pTCBCur */
     2807            {0 , 0x00000b30}, /* _pPTDACur */
     2808            {5 , 0x0000f8b4}, /* ptda_start */
     2809            {5 , 0x0000f9ce}, /* ptda_environ */
     2810            {5 , 0x0000fe88}, /* ptda_ptdasem */
     2811            {5 , 0x0000ffa2}, /* ptda_module */
     2812            {5 , 0x0000f9d0}, /* ptda_pBeginLIBPATH */
     2813            {11, 0x0002c434}, /* _ldrpFileNameBuf */
     2814            {16, 0x000535dc}, /* SecPathFromSFN */
     2815        }
     2816    },
     2817#endif
     2818#ifdef ALLKERNELS
     2819    { /* 8263AU.SYM */
     2820        8263, KF_UNI | KF_ALLSTRICT, 16,
     2821        {
     2822            {15, 0x0000a3a4}, /* _ldrRead */
     2823            {15, 0x0004a5b0}, /* _ldrOpen */
     2824            {15, 0x0004af50}, /* _ldrClose */
     2825            {15, 0x0004afa0}, /* _LDRQAppType */
     2826            {15, 0x000484b4}, /* _ldrEnum32bitRelRecs */
     2827            {15, 0x0000452c}, /* _IOSftOpen */
     2828            {15, 0x000049a4}, /* _IOSftClose */
     2829            {15, 0x00004a3c}, /* _IOSftTransPath */
     2830            {15, 0x000047f0}, /* _IOSftReadAt */
     2831            {15, 0x000047f7}, /* _IOSftWriteAt */
     2832            {15, 0x00004b64}, /* _SftFileSize */
     2833            {15, 0x00045e30}, /* _VMAllocMem */
     2834            {15, 0x000237e2}, /* _VMGetOwner */
     2835            {15, 0x0005403c}, /* g_tkExecPgm */
     2836            {15, 0x00050754}, /* _tkStartProcess */
     2837            {11, 0x0000ea08}, /* f_FuStrLenZ */
     2838            {11, 0x0000e9bc}, /* f_FuStrLen */
     2839            {11, 0x0000eb20}, /* f_FuBuff */
     2840            {15, 0x0002272c}, /* _VMObjHandleInfo */
     2841            {15, 0x00054b04}, /* _ldrASMpMTEFromHandle */
     2842            {15, 0x0004a83b}, /* _ldrOpenPath */
     2843            {15, 0x000468e4}, /* _LDRClearSem */
     2844            {15, 0x0004fe40}, /* _ldrFindModule */
     2845            {15, 0x0000bcd0}, /* _KSEMRequestMutex */
     2846            {15, 0x0000bde4}, /* _KSEMReleaseMutex */
     2847            {15, 0x0000be44}, /* _KSEMQueryMutex */
     2848            {15, 0x0000c1c8}, /* _KSEMInit */
     2849            {10, 0x0002a3e8}, /* _LdrSem */
     2850            {10, 0x00026bbc}, /* _LDRLibPath */
     2851            {15, 0x00031788}, /* _TKSuBuff */
     2852            {15, 0x00031378}, /* _TKFuBuff */
     2853            {15, 0x00031544}, /* _TKFuBufLen */
     2854            {15, 0x0004696c}, /* _ldrValidateMteHandle */
     2855            {10, 0x0000b868}, /* _pTCBCur */
     2856            {10, 0x0000b864}, /* _pPTDACur */
     2857            {4 , 0x0000f994}, /* ptda_start */
     2858            {4 , 0x0000fa46}, /* ptda_environ */
     2859            {4 , 0x0000fea0}, /* ptda_ptdasem */
     2860            {4 , 0x0000ffaa}, /* ptda_module */
     2861            {4 , 0x0000fa48}, /* ptda_pBeginLIBPATH */
     2862            {10, 0x0002959c}, /* _ldrpFileNameBuf */
     2863            {15, 0x000425a7}, /* SecPathFromSFN */
     2864        }
     2865    },
     2866#endif
     2867#ifdef ALLKERNELS
     2868    { /* 8263HS.SYM */
     2869        8263, KF_SMP | KF_HALFSTRICT, 17,
     2870        {
     2871            {16, 0x0000c360}, /* _ldrRead */
     2872            {16, 0x0004c870}, /* _ldrOpen */
     2873            {16, 0x0004d298}, /* _ldrClose */
     2874            {16, 0x0004d2e8}, /* _LDRQAppType */
     2875            {16, 0x0004ad54}, /* _ldrEnum32bitRelRecs */
     2876            {16, 0x00005484}, /* _IOSftOpen */
     2877            {16, 0x0000595d}, /* _IOSftClose */
     2878            {16, 0x00005a14}, /* _IOSftTransPath */
     2879            {16, 0x00005774}, /* _IOSftReadAt */
     2880            {16, 0x0000577b}, /* _IOSftWriteAt */
     2881            {16, 0x00005b3e}, /* _SftFileSize */
     2882            {16, 0x00048944}, /* _VMAllocMem */
     2883            {16, 0x00029230}, /* _VMGetOwner */
     2884            {16, 0x00056cde}, /* g_tkExecPgm */
     2885            {16, 0x000533b5}, /* _tkStartProcess */
     2886            {13, 0x0000a170}, /* f_FuStrLenZ */
     2887            {13, 0x0000a0f0}, /* f_FuStrLen */
     2888            {13, 0x0000a319}, /* f_FuBuff */
     2889            {16, 0x00027e87}, /* _VMObjHandleInfo */
     2890            {16, 0x000577c0}, /* _ldrASMpMTEFromHandle */
     2891            {16, 0x0004cb16}, /* _ldrOpenPath */
     2892            {16, 0x00049308}, /* _LDRClearSem */
     2893            {16, 0x00052a91}, /* _ldrFindModule */
     2894            {16, 0x0000db00}, /* _KSEMRequestMutex */
     2895            {16, 0x0000dbd7}, /* _KSEMReleaseMutex */
     2896            {16, 0x0000dc02}, /* _KSEMQueryMutex */
     2897            {16, 0x0000dea2}, /* _KSEMInit */
     2898            {11, 0x0001d7c0}, /* _LdrSem */
     2899            {11, 0x0001bd14}, /* _LDRLibPath */
     2900            {16, 0x0003565b}, /* _TKSuBuff */
     2901            {16, 0x000351ee}, /* _TKFuBuff */
     2902            {16, 0x000353b8}, /* _TKFuBufLen */
     2903            {16, 0x00049354}, /* _ldrValidateMteHandle */
     2904            {0 , 0x00000b34}, /* _pTCBCur */
     2905            {0 , 0x00000b30}, /* _pPTDACur */
     2906            {5 , 0x0000f8c0}, /* ptda_start */
     2907            {5 , 0x0000f9da}, /* ptda_environ */
     2908            {5 , 0x0000fe94}, /* ptda_ptdasem */
     2909            {5 , 0x0000ffa2}, /* ptda_module */
     2910            {5 , 0x0000f9dc}, /* ptda_pBeginLIBPATH */
     2911            {11, 0x0001d580}, /* _ldrpFileNameBuf */
     2912            {16, 0x00044c34}, /* SecPathFromSFN */
     2913        }
     2914    },
     2915#endif
     2916#ifdef ALLKERNELS
     2917    { /* 8263HU.SYM */
     2918        8263, KF_UNI | KF_HALFSTRICT, 16,
     2919        {
     2920            {15, 0x0000939c}, /* _ldrRead */
     2921            {15, 0x0003c1c4}, /* _ldrOpen */
     2922            {15, 0x0003ca50}, /* _ldrClose */
     2923            {15, 0x0003caa0}, /* _LDRQAppType */
     2924            {15, 0x0003a3a4}, /* _ldrEnum32bitRelRecs */
     2925            {15, 0x00003a78}, /* _IOSftOpen */
     2926            {15, 0x00003ee4}, /* _IOSftClose */
     2927            {15, 0x00003f79}, /* _IOSftTransPath */
     2928            {15, 0x00003d32}, /* _IOSftReadAt */
     2929            {15, 0x00003d39}, /* _IOSftWriteAt */
     2930            {15, 0x00004092}, /* _SftFileSize */
     2931            {15, 0x00038670}, /* _VMAllocMem */
     2932            {15, 0x0001e0e6}, /* _VMGetOwner */
     2933            {15, 0x00044b5e}, /* g_tkExecPgm */
     2934            {15, 0x00041ac3}, /* _tkStartProcess */
     2935            {11, 0x0000d7d4}, /* f_FuStrLenZ */
     2936            {11, 0x0000d78a}, /* f_FuStrLen */
     2937            {11, 0x0000d8c8}, /* f_FuBuff */
     2938            {15, 0x0001d44c}, /* _VMObjHandleInfo */
     2939            {15, 0x00045554}, /* _ldrASMpMTEFromHandle */
     2940            {15, 0x0003c43b}, /* _ldrOpenPath */
     2941            {15, 0x00038db8}, /* _LDRClearSem */
     2942            {15, 0x00041250}, /* _ldrFindModule */
     2943            {15, 0x0000a810}, /* _KSEMRequestMutex */
     2944            {15, 0x0000a8e7}, /* _KSEMReleaseMutex */
     2945            {15, 0x0000a912}, /* _KSEMQueryMutex */
     2946            {15, 0x0000abb2}, /* _KSEMInit */
     2947            {10, 0x0001ca70}, /* _LdrSem */
     2948            {10, 0x00019eb4}, /* _LDRLibPath */
     2949            {15, 0x00028dc1}, /* _TKSuBuff */
     2950            {15, 0x000289f7}, /* _TKFuBuff */
     2951            {15, 0x00028b81}, /* _TKFuBufLen */
     2952            {15, 0x00038df4}, /* _ldrValidateMteHandle */
     2953            {10, 0x000070ec}, /* _pTCBCur */
     2954            {10, 0x000070e8}, /* _pPTDACur */
     2955            {4 , 0x0000f99c}, /* ptda_start */
     2956            {4 , 0x0000fa4e}, /* ptda_environ */
     2957            {4 , 0x0000fea8}, /* ptda_ptdasem */
     2958            {4 , 0x0000ffaa}, /* ptda_module */
     2959            {4 , 0x0000fa50}, /* ptda_pBeginLIBPATH */
     2960            {10, 0x0001bdfc}, /* _ldrpFileNameBuf */
     2961            {15, 0x0003541b}, /* SecPathFromSFN */
     2962        }
     2963    },
     2964#endif
    4352965    { /* 8263RS.SYM */
    436         8263, 'R', TYPE_SMP, 15,
     2966        8263, KF_SMP, 15,
    4372967        {
    4382968            {14, 0x0000c250}, /* _ldrRead */
     
    4502980            {14, 0x00027a14}, /* _VMGetOwner */
    4512981            {14, 0x000547a2}, /* g_tkExecPgm */
     2982            {14, 0x00050f91}, /* _tkStartProcess */
    4522983            {11, 0x0000a170}, /* f_FuStrLenZ */
    4532984            {11, 0x0000a0f0}, /* f_FuStrLen */
    4542985            {11, 0x0000a319}, /* f_FuBuff */
     2986            {14, 0x0002666b}, /* _VMObjHandleInfo */
     2987            {14, 0x00055284}, /* _ldrASMpMTEFromHandle */
     2988            {14, 0x0004a706}, /* _ldrOpenPath */
     2989            {14, 0x00046ef8}, /* _LDRClearSem */
     2990            {14, 0x0005066d}, /* _ldrFindModule */
     2991            {14, 0x0000d8c0}, /* _KSEMRequestMutex */
     2992            {14, 0x0000d953}, /* _KSEMReleaseMutex */
     2993            {14, 0x0000d97e}, /* _KSEMQueryMutex */
     2994            {14, 0x0000db93}, /* _KSEMInit */
     2995            {9 , 0x0000d228}, /* _LdrSem */
     2996            {9 , 0x0000b784}, /* _LDRLibPath */
     2997            {14, 0x00033e3f}, /* _TKSuBuff */
     2998            {14, 0x000339d2}, /* _TKFuBuff */
     2999            {14, 0x00033b9c}, /* _TKFuBufLen */
     3000            {14, 0x00046f44}, /* _ldrValidateMteHandle */
     3001            {0 , 0x00000b34}, /* _pTCBCur */
     3002            {0 , 0x00000b30}, /* _pPTDACur */
     3003            {3 , 0x0000f8c0}, /* ptda_start */
     3004            {3 , 0x0000f9da}, /* ptda_environ */
     3005            {3 , 0x0000fe94}, /* ptda_ptdasem */
     3006            {3 , 0x0000ffa2}, /* ptda_module */
     3007            {3 , 0x0000f9dc}, /* ptda_pBeginLIBPATH */
     3008            {9 , 0x0000cfe8}, /* _ldrpFileNameBuf */
     3009            {14, 0x00042824}, /* SecPathFromSFN */
    4553010        }
    4563011    },
    4573012    { /* 8263RU.SYM */
    458         8263, 'R', TYPE_UNI, 14,
     3013        8263, KF_UNI, 14,
    4593014        {
    4603015            {13, 0x00009308}, /* _ldrRead */
     
    4723027            {13, 0x0001d27e}, /* _VMGetOwner */
    4733028            {13, 0x0004321e}, /* g_tkExecPgm */
    474             {9, 0x0000d7d4}, /* f_FuStrLenZ */
    475             {9, 0x0000d78a}, /* f_FuStrLen */
    476             {9, 0x0000d8c8}, /* f_FuBuff */
    477         }
    478     },
     3029            {13, 0x000401a3}, /* _tkStartProcess */
     3030            {9 , 0x0000d7d4}, /* f_FuStrLenZ */
     3031            {9 , 0x0000d78a}, /* f_FuStrLen */
     3032            {9 , 0x0000d8c8}, /* f_FuBuff */
     3033            {13, 0x0001c5e4}, /* _VMObjHandleInfo */
     3034            {13, 0x00043c14}, /* _ldrASMpMTEFromHandle */
     3035            {13, 0x0003ab57}, /* _ldrOpenPath */
     3036            {13, 0x000374d4}, /* _LDRClearSem */
     3037            {13, 0x0003f930}, /* _ldrFindModule */
     3038            {13, 0x0000a654}, /* _KSEMRequestMutex */
     3039            {13, 0x0000a6e7}, /* _KSEMReleaseMutex */
     3040            {13, 0x0000a712}, /* _KSEMQueryMutex */
     3041            {13, 0x0000a927}, /* _KSEMInit */
     3042            {8 , 0x0000c8ac}, /* _LdrSem */
     3043            {8 , 0x00009cf4}, /* _LDRLibPath */
     3044            {13, 0x00027f59}, /* _TKSuBuff */
     3045            {13, 0x00027b8f}, /* _TKFuBuff */
     3046            {13, 0x00027d19}, /* _TKFuBufLen */
     3047            {13, 0x00037510}, /* _ldrValidateMteHandle */
     3048            {8 , 0x000070ec}, /* _pTCBCur */
     3049            {8 , 0x000070e8}, /* _pPTDACur */
     3050            {2 , 0x0000f99c}, /* ptda_start */
     3051            {2 , 0x0000fa4e}, /* ptda_environ */
     3052            {2 , 0x0000fea8}, /* ptda_ptdasem */
     3053            {2 , 0x0000ffaa}, /* ptda_module */
     3054            {2 , 0x0000fa50}, /* ptda_pBeginLIBPATH */
     3055            {8 , 0x0000bc38}, /* _ldrpFileNameBuf */
     3056            {13, 0x00033b37}, /* SecPathFromSFN */
     3057        }
     3058    },
     3059#ifdef ALLKERNELS
     3060    { /* 8264AS.SYM */
     3061        8264, KF_SMP | KF_ALLSTRICT, 17,
     3062        {
     3063            {16, 0x0000d854}, /* _ldrRead */
     3064            {16, 0x0005c344}, /* _ldrOpen */
     3065            {16, 0x0005ce84}, /* _ldrClose */
     3066            {16, 0x0005ced4}, /* _LDRQAppType */
     3067            {16, 0x0005a5f0}, /* _ldrEnum32bitRelRecs */
     3068            {16, 0x0000632c}, /* _IOSftOpen */
     3069            {16, 0x00006814}, /* _IOSftClose */
     3070            {16, 0x000068cc}, /* _IOSftTransPath */
     3071            {16, 0x00006628}, /* _IOSftReadAt */
     3072            {16, 0x0000662f}, /* _IOSftWriteAt */
     3073            {16, 0x00006a04}, /* _SftFileSize */
     3074            {16, 0x00057950}, /* _VMAllocMem */
     3075            {16, 0x0002feb6}, /* _VMGetOwner */
     3076            {16, 0x000678cc}, /* g_tkExecPgm */
     3077            {16, 0x00063784}, /* _tkStartProcess */
     3078            {13, 0x0000a840}, /* f_FuStrLenZ */
     3079            {13, 0x0000a7c0}, /* f_FuStrLen */
     3080            {13, 0x0000aa08}, /* f_FuBuff */
     3081            {16, 0x0002e6d7}, /* _VMObjHandleInfo */
     3082            {16, 0x0006848c}, /* _ldrASMpMTEFromHandle */
     3083            {16, 0x0005c5fe}, /* _ldrOpenPath */
     3084            {16, 0x000585ec}, /* _LDRClearSem */
     3085            {16, 0x00062dbc}, /* _ldrFindModule */
     3086            {16, 0x0000f5cc}, /* _KSEMRequestMutex */
     3087            {16, 0x0000f6e0}, /* _KSEMReleaseMutex */
     3088            {16, 0x0000f740}, /* _KSEMQueryMutex */
     3089            {16, 0x0000fac4}, /* _KSEMInit */
     3090            {11, 0x0002c858}, /* _LdrSem */
     3091            {11, 0x0002a23c}, /* _LDRLibPath */
     3092            {16, 0x0003f274}, /* _TKSuBuff */
     3093            {16, 0x0003edc5}, /* _TKFuBuff */
     3094            {16, 0x0003efd1}, /* _TKFuBufLen */
     3095            {16, 0x00058684}, /* _ldrValidateMteHandle */
     3096            {0 , 0x00000b34}, /* _pTCBCur */
     3097            {0 , 0x00000b30}, /* _pPTDACur */
     3098            {5 , 0x0000f8b4}, /* ptda_start */
     3099            {5 , 0x0000f9ce}, /* ptda_environ */
     3100            {5 , 0x0000fe88}, /* ptda_ptdasem */
     3101            {5 , 0x0000ffa2}, /* ptda_module */
     3102            {5 , 0x0000f9d0}, /* ptda_pBeginLIBPATH */
     3103            {11, 0x0002c440}, /* _ldrpFileNameBuf */
     3104            {16, 0x00053650}, /* SecPathFromSFN */
     3105        }
     3106    },
     3107#endif
     3108#ifdef ALLKERNELS
     3109    { /* 8264AU.SYM */
     3110        8264, KF_UNI | KF_ALLSTRICT, 16,
     3111        {
     3112            {15, 0x0000a3a8}, /* _ldrRead */
     3113            {15, 0x0004a5f0}, /* _ldrOpen */
     3114            {15, 0x0004af88}, /* _ldrClose */
     3115            {15, 0x0004afd8}, /* _LDRQAppType */
     3116            {15, 0x00048508}, /* _ldrEnum32bitRelRecs */
     3117            {15, 0x00004530}, /* _IOSftOpen */
     3118            {15, 0x000049a8}, /* _IOSftClose */
     3119            {15, 0x00004a40}, /* _IOSftTransPath */
     3120            {15, 0x000047f4}, /* _IOSftReadAt */
     3121            {15, 0x000047fb}, /* _IOSftWriteAt */
     3122            {15, 0x00004b68}, /* _SftFileSize */
     3123            {15, 0x00045e84}, /* _VMAllocMem */
     3124            {15, 0x000238ca}, /* _VMGetOwner */
     3125            {15, 0x000540d0}, /* g_tkExecPgm */
     3126            {15, 0x000507d4}, /* _tkStartProcess */
     3127            {11, 0x0000ea10}, /* f_FuStrLenZ */
     3128            {11, 0x0000e9c4}, /* f_FuStrLen */
     3129            {11, 0x0000eb28}, /* f_FuBuff */
     3130            {15, 0x00022814}, /* _VMObjHandleInfo */
     3131            {15, 0x00054b98}, /* _ldrASMpMTEFromHandle */
     3132            {15, 0x0004a87b}, /* _ldrOpenPath */
     3133            {15, 0x00046938}, /* _LDRClearSem */
     3134            {15, 0x0004febf}, /* _ldrFindModule */
     3135            {15, 0x0000bcd4}, /* _KSEMRequestMutex */
     3136            {15, 0x0000bde8}, /* _KSEMReleaseMutex */
     3137            {15, 0x0000be48}, /* _KSEMQueryMutex */
     3138            {15, 0x0000c1cc}, /* _KSEMInit */
     3139            {10, 0x0002a384}, /* _LdrSem */
     3140            {10, 0x00026b58}, /* _LDRLibPath */
     3141            {15, 0x00031888}, /* _TKSuBuff */
     3142            {15, 0x00031478}, /* _TKFuBuff */
     3143            {15, 0x00031644}, /* _TKFuBufLen */
     3144            {15, 0x000469c0}, /* _ldrValidateMteHandle */
     3145            {10, 0x0000b868}, /* _pTCBCur */
     3146            {10, 0x0000b864}, /* _pPTDACur */
     3147            {4 , 0x0000f994}, /* ptda_start */
     3148            {4 , 0x0000fa46}, /* ptda_environ */
     3149            {4 , 0x0000fea0}, /* ptda_ptdasem */
     3150            {4 , 0x0000ffaa}, /* ptda_module */
     3151            {4 , 0x0000fa48}, /* ptda_pBeginLIBPATH */
     3152            {10, 0x00029538}, /* _ldrpFileNameBuf */
     3153            {15, 0x000426a7}, /* SecPathFromSFN */
     3154        }
     3155    },
     3156#endif
     3157#ifdef ALLKERNELS
     3158    { /* 8264HS.SYM */
     3159        8264, KF_SMP | KF_HALFSTRICT, 17,
     3160        {
     3161            {16, 0x0000c360}, /* _ldrRead */
     3162            {16, 0x0004c7b0}, /* _ldrOpen */
     3163            {16, 0x0004d1d0}, /* _ldrClose */
     3164            {16, 0x0004d220}, /* _LDRQAppType */
     3165            {16, 0x0004aca8}, /* _ldrEnum32bitRelRecs */
     3166            {16, 0x00005484}, /* _IOSftOpen */
     3167            {16, 0x0000595d}, /* _IOSftClose */
     3168            {16, 0x00005a14}, /* _IOSftTransPath */
     3169            {16, 0x00005774}, /* _IOSftReadAt */
     3170            {16, 0x0000577b}, /* _IOSftWriteAt */
     3171            {16, 0x00005b3e}, /* _SftFileSize */
     3172            {16, 0x00048898}, /* _VMAllocMem */
     3173            {16, 0x00029210}, /* _VMGetOwner */
     3174            {16, 0x00056be2}, /* g_tkExecPgm */
     3175            {16, 0x00053359}, /* _tkStartProcess */
     3176            {13, 0x0000a178}, /* f_FuStrLenZ */
     3177            {13, 0x0000a0f8}, /* f_FuStrLen */
     3178            {13, 0x0000a321}, /* f_FuBuff */
     3179            {16, 0x00027e67}, /* _VMObjHandleInfo */
     3180            {16, 0x000576c4}, /* _ldrASMpMTEFromHandle */
     3181            {16, 0x0004ca56}, /* _ldrOpenPath */
     3182            {16, 0x0004925c}, /* _LDRClearSem */
     3183            {16, 0x00052a35}, /* _ldrFindModule */
     3184            {16, 0x0000db54}, /* _KSEMRequestMutex */
     3185            {16, 0x0000dc2b}, /* _KSEMReleaseMutex */
     3186            {16, 0x0000dc56}, /* _KSEMQueryMutex */
     3187            {16, 0x0000def6}, /* _KSEMInit */
     3188            {11, 0x0001d7c8}, /* _LdrSem */
     3189            {11, 0x0001bd1c}, /* _LDRLibPath */
     3190            {16, 0x00035653}, /* _TKSuBuff */
     3191            {16, 0x000351e6}, /* _TKFuBuff */
     3192            {16, 0x000353b0}, /* _TKFuBufLen */
     3193            {16, 0x000492a8}, /* _ldrValidateMteHandle */
     3194            {0 , 0x00000b34}, /* _pTCBCur */
     3195            {0 , 0x00000b30}, /* _pPTDACur */
     3196            {5 , 0x0000f8c0}, /* ptda_start */
     3197            {5 , 0x0000f9da}, /* ptda_environ */
     3198            {5 , 0x0000fe94}, /* ptda_ptdasem */
     3199            {5 , 0x0000ffa2}, /* ptda_module */
     3200            {5 , 0x0000f9dc}, /* ptda_pBeginLIBPATH */
     3201            {11, 0x0001d588}, /* _ldrpFileNameBuf */
     3202            {16, 0x00044c58}, /* SecPathFromSFN */
     3203        }
     3204    },
     3205#endif
     3206#ifdef ALLKERNELS
     3207    { /* 8264HU.SYM */
     3208        8264, KF_UNI | KF_HALFSTRICT, 16,
     3209        {
     3210            {15, 0x000093a0}, /* _ldrRead */
     3211            {15, 0x0003c204}, /* _ldrOpen */
     3212            {15, 0x0003ca88}, /* _ldrClose */
     3213            {15, 0x0003cad8}, /* _LDRQAppType */
     3214            {15, 0x0003a3f8}, /* _ldrEnum32bitRelRecs */
     3215            {15, 0x00003a7c}, /* _IOSftOpen */
     3216            {15, 0x00003ee8}, /* _IOSftClose */
     3217            {15, 0x00003f7d}, /* _IOSftTransPath */
     3218            {15, 0x00003d36}, /* _IOSftReadAt */
     3219            {15, 0x00003d3d}, /* _IOSftWriteAt */
     3220            {15, 0x00004096}, /* _SftFileSize */
     3221            {15, 0x000386c4}, /* _VMAllocMem */
     3222            {15, 0x0001e20e}, /* _VMGetOwner */
     3223            {15, 0x00044c02}, /* g_tkExecPgm */
     3224            {15, 0x00041b67}, /* _tkStartProcess */
     3225            {11, 0x0000d7e0}, /* f_FuStrLenZ */
     3226            {11, 0x0000d796}, /* f_FuStrLen */
     3227            {11, 0x0000d8d4}, /* f_FuBuff */
     3228            {15, 0x0001d574}, /* _VMObjHandleInfo */
     3229            {15, 0x000455f8}, /* _ldrASMpMTEFromHandle */
     3230            {15, 0x0003c47b}, /* _ldrOpenPath */
     3231            {15, 0x00038e0c}, /* _LDRClearSem */
     3232            {15, 0x000412f2}, /* _ldrFindModule */
     3233            {15, 0x0000a814}, /* _KSEMRequestMutex */
     3234            {15, 0x0000a8eb}, /* _KSEMReleaseMutex */
     3235            {15, 0x0000a916}, /* _KSEMQueryMutex */
     3236            {15, 0x0000abb6}, /* _KSEMInit */
     3237            {10, 0x0001ca70}, /* _LdrSem */
     3238            {10, 0x00019eb4}, /* _LDRLibPath */
     3239            {15, 0x00028f15}, /* _TKSuBuff */
     3240            {15, 0x00028b49}, /* _TKFuBuff */
     3241            {15, 0x00028cd3}, /* _TKFuBufLen */
     3242            {15, 0x00038e48}, /* _ldrValidateMteHandle */
     3243            {10, 0x000070ec}, /* _pTCBCur */
     3244            {10, 0x000070e8}, /* _pPTDACur */
     3245            {4 , 0x0000f99c}, /* ptda_start */
     3246            {4 , 0x0000fa4e}, /* ptda_environ */
     3247            {4 , 0x0000fea8}, /* ptda_ptdasem */
     3248            {4 , 0x0000ffaa}, /* ptda_module */
     3249            {4 , 0x0000fa50}, /* ptda_pBeginLIBPATH */
     3250            {10, 0x0001bdfc}, /* _ldrpFileNameBuf */
     3251            {15, 0x0003553b}, /* SecPathFromSFN */
     3252        }
     3253    },
     3254#endif
    4793255    { /* 8264RS.SYM */
    480         8264, 'R', TYPE_SMP, 15,
     3256        8264, KF_SMP, 15,
    4813257        {
    4823258            {14, 0x0000c250}, /* _ldrRead */
     
    4943270            {14, 0x000279f4}, /* _VMGetOwner */
    4953271            {14, 0x00054942}, /* g_tkExecPgm */
     3272            {14, 0x0005103d}, /* _tkStartProcess */
    4963273            {11, 0x0000a178}, /* f_FuStrLenZ */
    4973274            {11, 0x0000a0f8}, /* f_FuStrLen */
    4983275            {11, 0x0000a321}, /* f_FuBuff */
     3276            {14, 0x0002664b}, /* _VMObjHandleInfo */
     3277            {14, 0x00055424}, /* _ldrASMpMTEFromHandle */
     3278            {14, 0x0004a7ca}, /* _ldrOpenPath */
     3279            {14, 0x00046fd0}, /* _LDRClearSem */
     3280            {14, 0x00050719}, /* _ldrFindModule */
     3281            {14, 0x0000d914}, /* _KSEMRequestMutex */
     3282            {14, 0x0000d9a7}, /* _KSEMReleaseMutex */
     3283            {14, 0x0000d9d2}, /* _KSEMQueryMutex */
     3284            {14, 0x0000dbe7}, /* _KSEMInit */
     3285            {9 , 0x0000d238}, /* _LdrSem */
     3286            {9 , 0x0000b794}, /* _LDRLibPath */
     3287            {14, 0x00033e37}, /* _TKSuBuff */
     3288            {14, 0x000339ca}, /* _TKFuBuff */
     3289            {14, 0x00033b94}, /* _TKFuBufLen */
     3290            {14, 0x0004701c}, /* _ldrValidateMteHandle */
     3291            {0 , 0x00000b34}, /* _pTCBCur */
     3292            {0 , 0x00000b30}, /* _pPTDACur */
     3293            {3 , 0x0000f8c0}, /* ptda_start */
     3294            {3 , 0x0000f9da}, /* ptda_environ */
     3295            {3 , 0x0000fe94}, /* ptda_ptdasem */
     3296            {3 , 0x0000ffa2}, /* ptda_module */
     3297            {3 , 0x0000f9dc}, /* ptda_pBeginLIBPATH */
     3298            {9 , 0x0000cff8}, /* _ldrpFileNameBuf */
     3299            {14, 0x000429cc}, /* SecPathFromSFN */
    4993300        }
    5003301    },
    5013302    { /* 8264RU.SYM */
    502         8264, 'R', TYPE_UNI, 14,
     3303        8264, KF_UNI, 14,
    5033304        {
    5043305            {13, 0x0000930c}, /* _ldrRead */
     
    5163317            {13, 0x0001d3a6}, /* _VMGetOwner */
    5173318            {13, 0x00043432}, /* g_tkExecPgm */
    518             {9, 0x0000d7e0}, /* f_FuStrLenZ */
    519             {9, 0x0000d796}, /* f_FuStrLen */
    520             {9, 0x0000d8d4}, /* f_FuBuff */
    521         }
    522     },
     3319            {13, 0x000403bb}, /* _tkStartProcess */
     3320            {9 , 0x0000d7e0}, /* f_FuStrLenZ */
     3321            {9 , 0x0000d796}, /* f_FuStrLen */
     3322            {9 , 0x0000d8d4}, /* f_FuBuff */
     3323            {13, 0x0001c70c}, /* _VMObjHandleInfo */
     3324            {13, 0x00043e28}, /* _ldrASMpMTEFromHandle */
     3325            {13, 0x0003ad0b}, /* _ldrOpenPath */
     3326            {13, 0x0003769c}, /* _LDRClearSem */
     3327            {13, 0x0003fb46}, /* _ldrFindModule */
     3328            {13, 0x0000a658}, /* _KSEMRequestMutex */
     3329            {13, 0x0000a6eb}, /* _KSEMReleaseMutex */
     3330            {13, 0x0000a716}, /* _KSEMQueryMutex */
     3331            {13, 0x0000a92b}, /* _KSEMInit */
     3332            {8 , 0x0000c8b4}, /* _LdrSem */
     3333            {8 , 0x00009cfc}, /* _LDRLibPath */
     3334            {13, 0x000280ad}, /* _TKSuBuff */
     3335            {13, 0x00027ce1}, /* _TKFuBuff */
     3336            {13, 0x00027e6b}, /* _TKFuBufLen */
     3337            {13, 0x000376d8}, /* _ldrValidateMteHandle */
     3338            {8 , 0x000070ec}, /* _pTCBCur */
     3339            {8 , 0x000070e8}, /* _pPTDACur */
     3340            {2 , 0x0000f99c}, /* ptda_start */
     3341            {2 , 0x0000fa4e}, /* ptda_environ */
     3342            {2 , 0x0000fea8}, /* ptda_ptdasem */
     3343            {2 , 0x0000ffaa}, /* ptda_module */
     3344            {2 , 0x0000fa50}, /* ptda_pBeginLIBPATH */
     3345            {8 , 0x0000bc40}, /* _ldrpFileNameBuf */
     3346            {13, 0x00033dcb}, /* SecPathFromSFN */
     3347        }
     3348    },
     3349#ifdef ALLKERNELS
     3350    { /* 8265AS.SYM */
     3351        8265, KF_SMP | KF_ALLSTRICT, 17,
     3352        {
     3353            {16, 0x0000d854}, /* _ldrRead */
     3354            {16, 0x0005c394}, /* _ldrOpen */
     3355            {16, 0x0005ced4}, /* _ldrClose */
     3356            {16, 0x0005cf24}, /* _LDRQAppType */
     3357            {16, 0x0005a62c}, /* _ldrEnum32bitRelRecs */
     3358            {16, 0x0000632c}, /* _IOSftOpen */
     3359            {16, 0x00006814}, /* _IOSftClose */
     3360            {16, 0x000068cc}, /* _IOSftTransPath */
     3361            {16, 0x00006628}, /* _IOSftReadAt */
     3362            {16, 0x0000662f}, /* _IOSftWriteAt */
     3363            {16, 0x00006a04}, /* _SftFileSize */
     3364            {16, 0x0005798c}, /* _VMAllocMem */
     3365            {16, 0x0002fede}, /* _VMGetOwner */
     3366            {16, 0x0006791c}, /* g_tkExecPgm */
     3367            {16, 0x000637d4}, /* _tkStartProcess */
     3368            {13, 0x0000a840}, /* f_FuStrLenZ */
     3369            {13, 0x0000a7c0}, /* f_FuStrLen */
     3370            {13, 0x0000aa08}, /* f_FuBuff */
     3371            {16, 0x0002e6ff}, /* _VMObjHandleInfo */
     3372            {16, 0x000684dc}, /* _ldrASMpMTEFromHandle */
     3373            {16, 0x0005c64e}, /* _ldrOpenPath */
     3374            {16, 0x00058628}, /* _LDRClearSem */
     3375            {16, 0x00062e0c}, /* _ldrFindModule */
     3376            {16, 0x0000f5b8}, /* _KSEMRequestMutex */
     3377            {16, 0x0000f6cc}, /* _KSEMReleaseMutex */
     3378            {16, 0x0000f72c}, /* _KSEMQueryMutex */
     3379            {16, 0x0000fab0}, /* _KSEMInit */
     3380            {11, 0x0002c834}, /* _LdrSem */
     3381            {11, 0x0002a218}, /* _LDRLibPath */
     3382            {16, 0x0003f29c}, /* _TKSuBuff */
     3383            {16, 0x0003eded}, /* _TKFuBuff */
     3384            {16, 0x0003eff9}, /* _TKFuBufLen */
     3385            {16, 0x000586c0}, /* _ldrValidateMteHandle */
     3386            {0 , 0x00000b34}, /* _pTCBCur */
     3387            {0 , 0x00000b30}, /* _pPTDACur */
     3388            {5 , 0x0000f8b4}, /* ptda_start */
     3389            {5 , 0x0000f9ce}, /* ptda_environ */
     3390            {5 , 0x0000fe88}, /* ptda_ptdasem */
     3391            {5 , 0x0000ffa2}, /* ptda_module */
     3392            {5 , 0x0000f9d0}, /* ptda_pBeginLIBPATH */
     3393            {11, 0x0002c41c}, /* _ldrpFileNameBuf */
     3394            {16, 0x0005368c}, /* SecPathFromSFN */
     3395        }
     3396    },
     3397#endif
     3398#ifdef ALLKERNELS
     3399    { /* 8265AU.SYM */
     3400        8265, KF_UNI | KF_ALLSTRICT, 16,
     3401        {
     3402            {15, 0x0000a3a8}, /* _ldrRead */
     3403            {15, 0x0004a658}, /* _ldrOpen */
     3404            {15, 0x0004aff0}, /* _ldrClose */
     3405            {15, 0x0004b040}, /* _LDRQAppType */
     3406            {15, 0x00048558}, /* _ldrEnum32bitRelRecs */
     3407            {15, 0x00004530}, /* _IOSftOpen */
     3408            {15, 0x000049a8}, /* _IOSftClose */
     3409            {15, 0x00004a40}, /* _IOSftTransPath */
     3410            {15, 0x000047f4}, /* _IOSftReadAt */
     3411            {15, 0x000047fb}, /* _IOSftWriteAt */
     3412            {15, 0x00004b68}, /* _SftFileSize */
     3413            {15, 0x00045ed4}, /* _VMAllocMem */
     3414            {15, 0x0002390e}, /* _VMGetOwner */
     3415            {15, 0x00054138}, /* g_tkExecPgm */
     3416            {15, 0x0005083c}, /* _tkStartProcess */
     3417            {11, 0x0000ea50}, /* f_FuStrLenZ */
     3418            {11, 0x0000ea04}, /* f_FuStrLen */
     3419            {11, 0x0000eb68}, /* f_FuBuff */
     3420            {15, 0x00022858}, /* _VMObjHandleInfo */
     3421            {15, 0x00054c00}, /* _ldrASMpMTEFromHandle */
     3422            {15, 0x0004a8e3}, /* _ldrOpenPath */
     3423            {15, 0x00046988}, /* _LDRClearSem */
     3424            {15, 0x0004ff27}, /* _ldrFindModule */
     3425            {15, 0x0000bccc}, /* _KSEMRequestMutex */
     3426            {15, 0x0000bde0}, /* _KSEMReleaseMutex */
     3427            {15, 0x0000be40}, /* _KSEMQueryMutex */
     3428            {15, 0x0000c1c4}, /* _KSEMInit */
     3429            {10, 0x0002a360}, /* _LdrSem */
     3430            {10, 0x00026b34}, /* _LDRLibPath */
     3431            {15, 0x000318c8}, /* _TKSuBuff */
     3432            {15, 0x000314b8}, /* _TKFuBuff */
     3433            {15, 0x00031684}, /* _TKFuBufLen */
     3434            {15, 0x00046a10}, /* _ldrValidateMteHandle */
     3435            {10, 0x0000b868}, /* _pTCBCur */
     3436            {10, 0x0000b864}, /* _pPTDACur */
     3437            {4 , 0x0000f994}, /* ptda_start */
     3438            {4 , 0x0000fa46}, /* ptda_environ */
     3439            {4 , 0x0000fea0}, /* ptda_ptdasem */
     3440            {4 , 0x0000ffaa}, /* ptda_module */
     3441            {4 , 0x0000fa48}, /* ptda_pBeginLIBPATH */
     3442            {10, 0x00029514}, /* _ldrpFileNameBuf */
     3443            {15, 0x000426f7}, /* SecPathFromSFN */
     3444        }
     3445    },
     3446#endif
     3447#ifdef ALLKERNELS
     3448    { /* 8265HS.SYM */
     3449        8265, KF_SMP | KF_HALFSTRICT, 17,
     3450        {
     3451            {16, 0x0000c360}, /* _ldrRead */
     3452            {16, 0x0004c86c}, /* _ldrOpen */
     3453            {16, 0x0004d28c}, /* _ldrClose */
     3454            {16, 0x0004d2dc}, /* _LDRQAppType */
     3455            {16, 0x0004ad50}, /* _ldrEnum32bitRelRecs */
     3456            {16, 0x00005484}, /* _IOSftOpen */
     3457            {16, 0x0000595d}, /* _IOSftClose */
     3458            {16, 0x00005a14}, /* _IOSftTransPath */
     3459            {16, 0x00005774}, /* _IOSftReadAt */
     3460            {16, 0x0000577b}, /* _IOSftWriteAt */
     3461            {16, 0x00005b3e}, /* _SftFileSize */
     3462            {16, 0x00048940}, /* _VMAllocMem */
     3463            {16, 0x000292a4}, /* _VMGetOwner */
     3464            {16, 0x00056c8e}, /* g_tkExecPgm */
     3465            {16, 0x00053405}, /* _tkStartProcess */
     3466            {13, 0x0000a178}, /* f_FuStrLenZ */
     3467            {13, 0x0000a0f8}, /* f_FuStrLen */
     3468            {13, 0x0000a321}, /* f_FuBuff */
     3469            {16, 0x00027efb}, /* _VMObjHandleInfo */
     3470            {16, 0x00057770}, /* _ldrASMpMTEFromHandle */
     3471            {16, 0x0004cb12}, /* _ldrOpenPath */
     3472            {16, 0x00049304}, /* _LDRClearSem */
     3473            {16, 0x00052ae1}, /* _ldrFindModule */
     3474            {16, 0x0000db44}, /* _KSEMRequestMutex */
     3475            {16, 0x0000dc1b}, /* _KSEMReleaseMutex */
     3476            {16, 0x0000dc46}, /* _KSEMQueryMutex */
     3477            {16, 0x0000dee6}, /* _KSEMInit */
     3478            {11, 0x0001d7c8}, /* _LdrSem */
     3479            {11, 0x0001bd1c}, /* _LDRLibPath */
     3480            {16, 0x000356e7}, /* _TKSuBuff */
     3481            {16, 0x0003527a}, /* _TKFuBuff */
     3482            {16, 0x00035444}, /* _TKFuBufLen */
     3483            {16, 0x00049350}, /* _ldrValidateMteHandle */
     3484            {0 , 0x00000b34}, /* _pTCBCur */
     3485            {0 , 0x00000b30}, /* _pPTDACur */
     3486            {5 , 0x0000f8c0}, /* ptda_start */
     3487            {5 , 0x0000f9da}, /* ptda_environ */
     3488            {5 , 0x0000fe94}, /* ptda_ptdasem */
     3489            {5 , 0x0000ffa2}, /* ptda_module */
     3490            {5 , 0x0000f9dc}, /* ptda_pBeginLIBPATH */
     3491            {11, 0x0001d588}, /* _ldrpFileNameBuf */
     3492            {16, 0x00044d00}, /* SecPathFromSFN */
     3493        }
     3494    },
     3495#endif
     3496#ifdef ALLKERNELS
     3497    { /* 8265HU.SYM */
     3498        8265, KF_UNI | KF_HALFSTRICT, 16,
     3499        {
     3500            {15, 0x000093a0}, /* _ldrRead */
     3501            {15, 0x0003c12c}, /* _ldrOpen */
     3502            {15, 0x0003c9b0}, /* _ldrClose */
     3503            {15, 0x0003ca00}, /* _LDRQAppType */
     3504            {15, 0x0003a30c}, /* _ldrEnum32bitRelRecs */
     3505            {15, 0x00003a7c}, /* _IOSftOpen */
     3506            {15, 0x00003ee8}, /* _IOSftClose */
     3507            {15, 0x00003f7d}, /* _IOSftTransPath */
     3508            {15, 0x00003d36}, /* _IOSftReadAt */
     3509            {15, 0x00003d3d}, /* _IOSftWriteAt */
     3510            {15, 0x00004096}, /* _SftFileSize */
     3511            {15, 0x000385d8}, /* _VMAllocMem */
     3512            {15, 0x0001e116}, /* _VMGetOwner */
     3513            {15, 0x00044b2a}, /* g_tkExecPgm */
     3514            {15, 0x00041a8f}, /* _tkStartProcess */
     3515            {11, 0x0000d830}, /* f_FuStrLenZ */
     3516            {11, 0x0000d7e6}, /* f_FuStrLen */
     3517            {11, 0x0000d924}, /* f_FuBuff */
     3518            {15, 0x0001d47c}, /* _VMObjHandleInfo */
     3519            {15, 0x00045520}, /* _ldrASMpMTEFromHandle */
     3520            {15, 0x0003c3a3}, /* _ldrOpenPath */
     3521            {15, 0x00038d20}, /* _LDRClearSem */
     3522            {15, 0x0004121a}, /* _ldrFindModule */
     3523            {15, 0x0000a808}, /* _KSEMRequestMutex */
     3524            {15, 0x0000a8df}, /* _KSEMReleaseMutex */
     3525            {15, 0x0000a90a}, /* _KSEMQueryMutex */
     3526            {15, 0x0000abaa}, /* _KSEMInit */
     3527            {10, 0x0001ca70}, /* _LdrSem */
     3528            {10, 0x00019eb4}, /* _LDRLibPath */
     3529            {15, 0x00028e1d}, /* _TKSuBuff */
     3530            {15, 0x00028a51}, /* _TKFuBuff */
     3531            {15, 0x00028bdb}, /* _TKFuBufLen */
     3532            {15, 0x00038d5c}, /* _ldrValidateMteHandle */
     3533            {10, 0x000070ec}, /* _pTCBCur */
     3534            {10, 0x000070e8}, /* _pPTDACur */
     3535            {4 , 0x0000f99c}, /* ptda_start */
     3536            {4 , 0x0000fa4e}, /* ptda_environ */
     3537            {4 , 0x0000fea8}, /* ptda_ptdasem */
     3538            {4 , 0x0000ffaa}, /* ptda_module */
     3539            {4 , 0x0000fa50}, /* ptda_pBeginLIBPATH */
     3540            {10, 0x0001bdfc}, /* _ldrpFileNameBuf */
     3541            {15, 0x00035453}, /* SecPathFromSFN */
     3542        }
     3543    },
     3544#endif
    5233545    { /* 8265RS.SYM */
    524         8265, 'R', TYPE_SMP, 15,
     3546        8265, KF_SMP, 15,
    5253547        {
    5263548            {14, 0x0000c250}, /* _ldrRead */
     
    5383560            {14, 0x00027a7c}, /* _VMGetOwner */
    5393561            {14, 0x000549e2}, /* g_tkExecPgm */
     3562            {14, 0x000510dd}, /* _tkStartProcess */
    5403563            {11, 0x0000a178}, /* f_FuStrLenZ */
    5413564            {11, 0x0000a0f8}, /* f_FuStrLen */
    5423565            {11, 0x0000a321}, /* f_FuBuff */
     3566            {14, 0x000266d3}, /* _VMObjHandleInfo */
     3567            {14, 0x000554c4}, /* _ldrASMpMTEFromHandle */
     3568            {14, 0x0004a87a}, /* _ldrOpenPath */
     3569            {14, 0x0004706c}, /* _LDRClearSem */
     3570            {14, 0x000507b9}, /* _ldrFindModule */
     3571            {14, 0x0000d914}, /* _KSEMRequestMutex */
     3572            {14, 0x0000d9a7}, /* _KSEMReleaseMutex */
     3573            {14, 0x0000d9d2}, /* _KSEMQueryMutex */
     3574            {14, 0x0000dbe7}, /* _KSEMInit */
     3575            {9 , 0x0000d238}, /* _LdrSem */
     3576            {9 , 0x0000b794}, /* _LDRLibPath */
     3577            {14, 0x00033ebf}, /* _TKSuBuff */
     3578            {14, 0x00033a52}, /* _TKFuBuff */
     3579            {14, 0x00033c1c}, /* _TKFuBufLen */
     3580            {14, 0x000470b8}, /* _ldrValidateMteHandle */
     3581            {0 , 0x00000b34}, /* _pTCBCur */
     3582            {0 , 0x00000b30}, /* _pPTDACur */
     3583            {3 , 0x0000f8c0}, /* ptda_start */
     3584            {3 , 0x0000f9da}, /* ptda_environ */
     3585            {3 , 0x0000fe94}, /* ptda_ptdasem */
     3586            {3 , 0x0000ffa2}, /* ptda_module */
     3587            {3 , 0x0000f9dc}, /* ptda_pBeginLIBPATH */
     3588            {9 , 0x0000cff8}, /* _ldrpFileNameBuf */
     3589            {14, 0x00042a68}, /* SecPathFromSFN */
    5433590        }
    5443591    },
    5453592    { /* 8265RU.SYM */
    546         8265, 'R', TYPE_UNI, 14,
     3593        8265, KF_UNI, 14,
    5473594        {
    5483595            {13, 0x0000930c}, /* _ldrRead */
     
    5603607            {13, 0x0001d2a6}, /* _VMGetOwner */
    5613608            {13, 0x00043352}, /* g_tkExecPgm */
    562             {9, 0x0000d830}, /* f_FuStrLenZ */
    563             {9, 0x0000d7e6}, /* f_FuStrLen */
    564             {9, 0x0000d924}, /* f_FuBuff */
    565         }
    566     },
     3609            {13, 0x000402db}, /* _tkStartProcess */
     3610            {9 , 0x0000d830}, /* f_FuStrLenZ */
     3611            {9 , 0x0000d7e6}, /* f_FuStrLen */
     3612            {9 , 0x0000d924}, /* f_FuBuff */
     3613            {13, 0x0001c60c}, /* _VMObjHandleInfo */
     3614            {13, 0x00043d48}, /* _ldrASMpMTEFromHandle */
     3615            {13, 0x0003ac2b}, /* _ldrOpenPath */
     3616            {13, 0x000375a8}, /* _LDRClearSem */
     3617            {13, 0x0003fa66}, /* _ldrFindModule */
     3618            {13, 0x0000a65c}, /* _KSEMRequestMutex */
     3619            {13, 0x0000a6ef}, /* _KSEMReleaseMutex */
     3620            {13, 0x0000a71a}, /* _KSEMQueryMutex */
     3621            {13, 0x0000a92f}, /* _KSEMInit */
     3622            {8 , 0x0000c8b4}, /* _LdrSem */
     3623            {8 , 0x00009cfc}, /* _LDRLibPath */
     3624            {13, 0x00027fad}, /* _TKSuBuff */
     3625            {13, 0x00027be1}, /* _TKFuBuff */
     3626            {13, 0x00027d6b}, /* _TKFuBufLen */
     3627            {13, 0x000375e4}, /* _ldrValidateMteHandle */
     3628            {8 , 0x000070ec}, /* _pTCBCur */
     3629            {8 , 0x000070e8}, /* _pPTDACur */
     3630            {2 , 0x0000f99c}, /* ptda_start */
     3631            {2 , 0x0000fa4e}, /* ptda_environ */
     3632            {2 , 0x0000fea8}, /* ptda_ptdasem */
     3633            {2 , 0x0000ffaa}, /* ptda_module */
     3634            {2 , 0x0000fa50}, /* ptda_pBeginLIBPATH */
     3635            {8 , 0x0000bc40}, /* _ldrpFileNameBuf */
     3636            {13, 0x00033cdb}, /* SecPathFromSFN */
     3637        }
     3638    },
     3639#ifdef ALLKERNELS
     3640    { /* 9024AU.SYM */
     3641        9024, KF_UNI | KF_ALLSTRICT, 15,
     3642        {
     3643            {14, 0x00008c0c}, /* _ldrRead */
     3644            {14, 0x000463f4}, /* _ldrOpen */
     3645            {14, 0x00046d8c}, /* _ldrClose */
     3646            {14, 0x00046ddc}, /* _LDRQAppType */
     3647            {14, 0x000443ec}, /* _ldrEnum32bitRelRecs */
     3648            {14, 0x00003da8}, /* _IOSftOpen */
     3649            {14, 0x0000425c}, /* _IOSftClose */
     3650            {14, 0x00004304}, /* _IOSftTransPath */
     3651            {14, 0x0000407c}, /* _IOSftReadAt */
     3652            {14, 0x00004083}, /* _IOSftWriteAt */
     3653            {14, 0x0000442c}, /* _SftFileSize */
     3654            {14, 0x00041db8}, /* _VMAllocMem */
     3655            {14, 0x0002165e}, /* _VMGetOwner */
     3656            {14, 0x0004f97c}, /* g_tkExecPgm */
     3657            {14, 0x0004c120}, /* _tkStartProcess */
     3658            {11, 0x0000f8d4}, /* f_FuStrLenZ */
     3659            {11, 0x0000f888}, /* f_FuStrLen */
     3660            {11, 0x0000f9ec}, /* f_FuBuff */
     3661            {14, 0x000205bc}, /* _VMObjHandleInfo */
     3662            {14, 0x00050404}, /* _ldrASMpMTEFromHandle */
     3663            {14, 0x0004667f}, /* _ldrOpenPath */
     3664            {14, 0x00042864}, /* _LDRClearSem */
     3665            {14, 0x0004b812}, /* _ldrFindModule */
     3666            {14, 0x0000a5b4}, /* _KSEMRequestMutex */
     3667            {14, 0x0000a6c8}, /* _KSEMReleaseMutex */
     3668            {14, 0x0000a728}, /* _KSEMQueryMutex */
     3669            {14, 0x0000aaac}, /* _KSEMInit */
     3670            {10, 0x000159f0}, /* _LdrSem */
     3671            {10, 0x00015a7c}, /* _LDRLibPath */
     3672            {14, 0x0002ec48}, /* _TKSuBuff */
     3673            {14, 0x0002e83a}, /* _TKFuBuff */
     3674            {14, 0x0002ea06}, /* _TKFuBufLen */
     3675            {14, 0x000428ec}, /* _ldrValidateMteHandle */
     3676            {10, 0x0000b920}, /* _pTCBCur */
     3677            {10, 0x0000b91c}, /* _pPTDACur */
     3678            {4 , 0x0000f9f4}, /* ptda_start */
     3679            {4 , 0x0000fa9a}, /* ptda_environ */
     3680            {4 , 0x0000fecc}, /* ptda_ptdasem */
     3681            {4 , 0x0000ffaa}, /* ptda_module */
     3682            {4 , 0x0000fa9c}, /* ptda_pBeginLIBPATH */
     3683            {10, 0x00017ebc}, /* _ldrpFileNameBuf */
     3684            {14, 0x0003e13e}, /* SecPathFromSFN */
     3685        }
     3686    },
     3687#endif
     3688    { /* 9024RU.SYM */
     3689        9024, KF_UNI, 13,
     3690        {
     3691            {12, 0x00007d68}, /* _ldrRead */
     3692            {12, 0x00036c2c}, /* _ldrOpen */
     3693            {12, 0x000374b4}, /* _ldrClose */
     3694            {12, 0x00037504}, /* _LDRQAppType */
     3695            {12, 0x00034ef8}, /* _ldrEnum32bitRelRecs */
     3696            {12, 0x00003494}, /* _IOSftOpen */
     3697            {12, 0x0000393a}, /* _IOSftClose */
     3698            {12, 0x000039e1}, /* _IOSftTransPath */
     3699            {12, 0x0000375b}, /* _IOSftReadAt */
     3700            {12, 0x00003762}, /* _IOSftWriteAt */
     3701            {12, 0x00003afa}, /* _SftFileSize */
     3702            {12, 0x00033214}, /* _VMAllocMem */
     3703            {12, 0x0001b218}, /* _VMGetOwner */
     3704            {12, 0x0003f196}, /* g_tkExecPgm */
     3705            {12, 0x0003c177}, /* _tkStartProcess */
     3706            {9 , 0x0000e60c}, /* f_FuStrLenZ */
     3707            {9 , 0x0000e5c2}, /* f_FuStrLen */
     3708            {9 , 0x0000e700}, /* f_FuBuff */
     3709            {12, 0x0001a58c}, /* _VMObjHandleInfo */
     3710            {12, 0x0003fb4c}, /* _ldrASMpMTEFromHandle */
     3711            {12, 0x00036ea3}, /* _ldrOpenPath */
     3712            {12, 0x00033954}, /* _LDRClearSem */
     3713            {12, 0x0003b907}, /* _ldrFindModule */
     3714            {12, 0x000090ec}, /* _KSEMRequestMutex */
     3715            {12, 0x0000917f}, /* _KSEMReleaseMutex */
     3716            {12, 0x000091aa}, /* _KSEMQueryMutex */
     3717            {12, 0x000093bf}, /* _KSEMInit */
     3718            {8 , 0x0000a020}, /* _LdrSem */
     3719            {8 , 0x0000a0a0}, /* _LDRLibPath */
     3720            {12, 0x000256b5}, /* _TKSuBuff */
     3721            {12, 0x000252eb}, /* _TKFuBuff */
     3722            {12, 0x00025475}, /* _TKFuBufLen */
     3723            {12, 0x00033990}, /* _ldrValidateMteHandle */
     3724            {8 , 0x000072a8}, /* _pTCBCur */
     3725            {8 , 0x000072a4}, /* _pPTDACur */
     3726            {2 , 0x0000f9fc}, /* ptda_start */
     3727            {2 , 0x0000faa2}, /* ptda_environ */
     3728            {2 , 0x0000fed4}, /* ptda_ptdasem */
     3729            {2 , 0x0000ffaa}, /* ptda_module */
     3730            {2 , 0x0000faa4}, /* ptda_pBeginLIBPATH */
     3731            {8 , 0x0000ba4c}, /* _ldrpFileNameBuf */
     3732            {12, 0x0002fcea}, /* SecPathFromSFN */
     3733        }
     3734    },
     3735#ifdef ALLKERNELS
     3736    { /* 9026AU.SYM */
     3737        9026, KF_UNI | KF_ALLSTRICT, 15,
     3738        {
     3739            {14, 0x00008c8c}, /* _ldrRead */
     3740            {14, 0x0004653c}, /* _ldrOpen */
     3741            {14, 0x00046ed4}, /* _ldrClose */
     3742            {14, 0x00046f24}, /* _LDRQAppType */
     3743            {14, 0x00044534}, /* _ldrEnum32bitRelRecs */
     3744            {14, 0x00003da8}, /* _IOSftOpen */
     3745            {14, 0x0000425c}, /* _IOSftClose */
     3746            {14, 0x00004304}, /* _IOSftTransPath */
     3747            {14, 0x0000407c}, /* _IOSftReadAt */
     3748            {14, 0x00004083}, /* _IOSftWriteAt */
     3749            {14, 0x0000442c}, /* _SftFileSize */
     3750            {14, 0x00041f00}, /* _VMAllocMem */
     3751            {14, 0x00021752}, /* _VMGetOwner */
     3752            {14, 0x0004fadc}, /* g_tkExecPgm */
     3753            {14, 0x0004c280}, /* _tkStartProcess */
     3754            {11, 0x0000f904}, /* f_FuStrLenZ */
     3755            {11, 0x0000f8b8}, /* f_FuStrLen */
     3756            {11, 0x0000fa1c}, /* f_FuBuff */
     3757            {14, 0x0002069c}, /* _VMObjHandleInfo */
     3758            {14, 0x00050560}, /* _ldrASMpMTEFromHandle */
     3759            {14, 0x000467c7}, /* _ldrOpenPath */
     3760            {14, 0x000429ac}, /* _LDRClearSem */
     3761            {14, 0x0004b95a}, /* _ldrFindModule */
     3762            {14, 0x0000a634}, /* _KSEMRequestMutex */
     3763            {14, 0x0000a748}, /* _KSEMReleaseMutex */
     3764            {14, 0x0000a7a8}, /* _KSEMQueryMutex */
     3765            {14, 0x0000ab2c}, /* _KSEMInit */
     3766            {10, 0x000159f8}, /* _LdrSem */
     3767            {10, 0x00015a84}, /* _LDRLibPath */
     3768            {14, 0x0002ed3c}, /* _TKSuBuff */
     3769            {14, 0x0002e92e}, /* _TKFuBuff */
     3770            {14, 0x0002eafa}, /* _TKFuBufLen */
     3771            {14, 0x00042a34}, /* _ldrValidateMteHandle */
     3772            {10, 0x0000b858}, /* _pTCBCur */
     3773            {10, 0x0000b854}, /* _pPTDACur */
     3774            {4 , 0x0000f9f4}, /* ptda_start */
     3775            {4 , 0x0000fa9a}, /* ptda_environ */
     3776            {4 , 0x0000fecc}, /* ptda_ptdasem */
     3777            {4 , 0x0000ffaa}, /* ptda_module */
     3778            {4 , 0x0000fa9c}, /* ptda_pBeginLIBPATH */
     3779            {10, 0x00017ec4}, /* _ldrpFileNameBuf */
     3780            {14, 0x0003e27e}, /* SecPathFromSFN */
     3781        }
     3782    },
     3783#endif
     3784    { /* 9026RU.SYM */
     3785        9026, KF_UNI, 13,
     3786        {
     3787            {12, 0x00007de0}, /* _ldrRead */
     3788            {12, 0x00036d3c}, /* _ldrOpen */
     3789            {12, 0x000375c4}, /* _ldrClose */
     3790            {12, 0x00037614}, /* _LDRQAppType */
     3791            {12, 0x00035008}, /* _ldrEnum32bitRelRecs */
     3792            {12, 0x00003494}, /* _IOSftOpen */
     3793            {12, 0x0000393a}, /* _IOSftClose */
     3794            {12, 0x000039e1}, /* _IOSftTransPath */
     3795            {12, 0x0000375b}, /* _IOSftReadAt */
     3796            {12, 0x00003762}, /* _IOSftWriteAt */
     3797            {12, 0x00003afa}, /* _SftFileSize */
     3798            {12, 0x00033324}, /* _VMAllocMem */
     3799            {12, 0x0001b2dc}, /* _VMGetOwner */
     3800            {12, 0x0003f2ba}, /* g_tkExecPgm */
     3801            {12, 0x0003c29b}, /* _tkStartProcess */
     3802            {9 , 0x0000e644}, /* f_FuStrLenZ */
     3803            {9 , 0x0000e5fa}, /* f_FuStrLen */
     3804            {9 , 0x0000e738}, /* f_FuBuff */
     3805            {12, 0x0001a63c}, /* _VMObjHandleInfo */
     3806            {12, 0x0003fc6c}, /* _ldrASMpMTEFromHandle */
     3807            {12, 0x00036fb3}, /* _ldrOpenPath */
     3808            {12, 0x00033a64}, /* _LDRClearSem */
     3809            {12, 0x0003ba17}, /* _ldrFindModule */
     3810            {12, 0x00009164}, /* _KSEMRequestMutex */
     3811            {12, 0x000091f7}, /* _KSEMReleaseMutex */
     3812            {12, 0x00009222}, /* _KSEMQueryMutex */
     3813            {12, 0x00009437}, /* _KSEMInit */
     3814            {8 , 0x0000a028}, /* _LdrSem */
     3815            {8 , 0x0000a0a8}, /* _LDRLibPath */
     3816            {12, 0x00025775}, /* _TKSuBuff */
     3817            {12, 0x000253ab}, /* _TKFuBuff */
     3818            {12, 0x00025535}, /* _TKFuBufLen */
     3819            {12, 0x00033aa0}, /* _ldrValidateMteHandle */
     3820            {8 , 0x000072ac}, /* _pTCBCur */
     3821            {8 , 0x000072a8}, /* _pPTDACur */
     3822            {2 , 0x0000f9fc}, /* ptda_start */
     3823            {2 , 0x0000faa2}, /* ptda_environ */
     3824            {2 , 0x0000fed4}, /* ptda_ptdasem */
     3825            {2 , 0x0000ffaa}, /* ptda_module */
     3826            {2 , 0x0000faa4}, /* ptda_pBeginLIBPATH */
     3827            {8 , 0x0000ba54}, /* _ldrpFileNameBuf */
     3828            {12, 0x0002fdf2}, /* SecPathFromSFN */
     3829        }
     3830    },
     3831#ifdef ALLKERNELS
     3832    { /* 9027AU.SYM */
     3833        9027, KF_UNI | KF_ALLSTRICT, 15,
     3834        {
     3835            {14, 0x0000a2f0}, /* _ldrRead */
     3836            {14, 0x00049ab4}, /* _ldrOpen */
     3837            {14, 0x0004a44c}, /* _ldrClose */
     3838            {14, 0x0004a49c}, /* _LDRQAppType */
     3839            {14, 0x00047a78}, /* _ldrEnum32bitRelRecs */
     3840            {14, 0x00003e34}, /* _IOSftOpen */
     3841            {14, 0x000042e8}, /* _IOSftClose */
     3842            {14, 0x00004390}, /* _IOSftTransPath */
     3843            {14, 0x00004108}, /* _IOSftReadAt */
     3844            {14, 0x0000410f}, /* _IOSftWriteAt */
     3845            {14, 0x000044b8}, /* _SftFileSize */
     3846            {14, 0x00044be8}, /* _VMAllocMem */
     3847            {14, 0x00022bd2}, /* _VMGetOwner */
     3848            {14, 0x00052efc}, /* g_tkExecPgm */
     3849            {14, 0x0004f6b8}, /* _tkStartProcess */
     3850            {11, 0x0000f91c}, /* f_FuStrLenZ */
     3851            {11, 0x0000f8d0}, /* f_FuStrLen */
     3852            {11, 0x0000fa34}, /* f_FuBuff */
     3853            {14, 0x00021b1c}, /* _VMObjHandleInfo */
     3854            {14, 0x00053980}, /* _ldrASMpMTEFromHandle */
     3855            {14, 0x00049d3f}, /* _ldrOpenPath */
     3856            {14, 0x00045694}, /* _LDRClearSem */
     3857            {14, 0x0004ed92}, /* _ldrFindModule */
     3858            {14, 0x0000bc9c}, /* _KSEMRequestMutex */
     3859            {14, 0x0000bdb0}, /* _KSEMReleaseMutex */
     3860            {14, 0x0000be10}, /* _KSEMQueryMutex */
     3861            {14, 0x0000c194}, /* _KSEMInit */
     3862            {10, 0x00016030}, /* _LdrSem */
     3863            {10, 0x000160bc}, /* _LDRLibPath */
     3864            {14, 0x00030668}, /* _TKSuBuff */
     3865            {14, 0x0003025a}, /* _TKFuBuff */
     3866            {14, 0x00030426}, /* _TKFuBufLen */
     3867            {14, 0x0004571c}, /* _ldrValidateMteHandle */
     3868            {10, 0x0000b8c4}, /* _pTCBCur */
     3869            {10, 0x0000b8c0}, /* _pPTDACur */
     3870            {4 , 0x0000f9f4}, /* ptda_start */
     3871            {4 , 0x0000fa9a}, /* ptda_environ */
     3872            {4 , 0x0000fecc}, /* ptda_ptdasem */
     3873            {4 , 0x0000ffaa}, /* ptda_module */
     3874            {4 , 0x0000fa9c}, /* ptda_pBeginLIBPATH */
     3875            {10, 0x0001862c}, /* _ldrpFileNameBuf */
     3876            {14, 0x00040f46}, /* SecPathFromSFN */
     3877        }
     3878    },
     3879#endif
     3880    { /* 9027RU.SYM */
     3881        9027, KF_UNI, 13,
     3882        {
     3883            {12, 0x0000941c}, /* _ldrRead */
     3884            {12, 0x0003a044}, /* _ldrOpen */
     3885            {12, 0x0003a8cc}, /* _ldrClose */
     3886            {12, 0x0003a91c}, /* _LDRQAppType */
     3887            {12, 0x00038314}, /* _ldrEnum32bitRelRecs */
     3888            {12, 0x00003504}, /* _IOSftOpen */
     3889            {12, 0x000039aa}, /* _IOSftClose */
     3890            {12, 0x00003a51}, /* _IOSftTransPath */
     3891            {12, 0x000037cb}, /* _IOSftReadAt */
     3892            {12, 0x000037d2}, /* _IOSftWriteAt */
     3893            {12, 0x00003b6a}, /* _SftFileSize */
     3894            {12, 0x00035f98}, /* _VMAllocMem */
     3895            {12, 0x0001c924}, /* _VMGetOwner */
     3896            {12, 0x0004245e}, /* g_tkExecPgm */
     3897            {12, 0x0003f3e3}, /* _tkStartProcess */
     3898            {9 , 0x0000e660}, /* f_FuStrLenZ */
     3899            {9 , 0x0000e616}, /* f_FuStrLen */
     3900            {9 , 0x0000e754}, /* f_FuBuff */
     3901            {12, 0x0001bc84}, /* _VMObjHandleInfo */
     3902            {12, 0x00042e10}, /* _ldrASMpMTEFromHandle */
     3903            {12, 0x0003a2bb}, /* _ldrOpenPath */
     3904            {12, 0x000366d8}, /* _LDRClearSem */
     3905            {12, 0x0003eb5d}, /* _ldrFindModule */
     3906            {12, 0x0000a7a4}, /* _KSEMRequestMutex */
     3907            {12, 0x0000a837}, /* _KSEMReleaseMutex */
     3908            {12, 0x0000a862}, /* _KSEMQueryMutex */
     3909            {12, 0x0000aa77}, /* _KSEMInit */
     3910            {8 , 0x0000a3a0}, /* _LdrSem */
     3911            {8 , 0x0000a420}, /* _LDRLibPath */
     3912            {12, 0x0002728d}, /* _TKSuBuff */
     3913            {12, 0x00026ec1}, /* _TKFuBuff */
     3914            {12, 0x0002704b}, /* _TKFuBufLen */
     3915            {12, 0x00036714}, /* _ldrValidateMteHandle */
     3916            {8 , 0x000072b4}, /* _pTCBCur */
     3917            {8 , 0x000072b0}, /* _pPTDACur */
     3918            {2 , 0x0000f9fc}, /* ptda_start */
     3919            {2 , 0x0000faa2}, /* ptda_environ */
     3920            {2 , 0x0000fed4}, /* ptda_ptdasem */
     3921            {2 , 0x0000ffaa}, /* ptda_module */
     3922            {2 , 0x0000faa4}, /* ptda_pBeginLIBPATH */
     3923            {8 , 0x0000bee4}, /* _ldrpFileNameBuf */
     3924            {12, 0x00032a46}, /* SecPathFromSFN */
     3925        }
     3926    },
     3927#ifdef ALLKERNELS
     3928    { /* 9028AU.SYM */
     3929        9028, KF_UNI | KF_ALLSTRICT, 15,
     3930        {
     3931            {14, 0x0000a2fc}, /* _ldrRead */
     3932            {14, 0x0004929c}, /* _ldrOpen */
     3933            {14, 0x00049c34}, /* _ldrClose */
     3934            {14, 0x00049c84}, /* _LDRQAppType */
     3935            {14, 0x00047294}, /* _ldrEnum32bitRelRecs */
     3936            {14, 0x00003e40}, /* _IOSftOpen */
     3937            {14, 0x000042f4}, /* _IOSftClose */
     3938            {14, 0x0000439c}, /* _IOSftTransPath */
     3939            {14, 0x00004114}, /* _IOSftReadAt */
     3940            {14, 0x0000411b}, /* _IOSftWriteAt */
     3941            {14, 0x000044c4}, /* _SftFileSize */
     3942            {14, 0x00044c18}, /* _VMAllocMem */
     3943            {14, 0x00022bf6}, /* _VMGetOwner */
     3944            {14, 0x0005297c}, /* g_tkExecPgm */
     3945            {14, 0x0004f110}, /* _tkStartProcess */
     3946            {11, 0x0000f88c}, /* f_FuStrLenZ */
     3947            {11, 0x0000f840}, /* f_FuStrLen */
     3948            {11, 0x0000f9a4}, /* f_FuBuff */
     3949            {14, 0x00021b40}, /* _VMObjHandleInfo */
     3950            {14, 0x00053400}, /* _ldrASMpMTEFromHandle */
     3951            {14, 0x00049527}, /* _ldrOpenPath */
     3952            {14, 0x000456c4}, /* _LDRClearSem */
     3953            {14, 0x0004e7ea}, /* _ldrFindModule */
     3954            {14, 0x0000bca8}, /* _KSEMRequestMutex */
     3955            {14, 0x0000bdbc}, /* _KSEMReleaseMutex */
     3956            {14, 0x0000be1c}, /* _KSEMQueryMutex */
     3957            {14, 0x0000c1a0}, /* _KSEMInit */
     3958            {10, 0x00015df4}, /* _LdrSem */
     3959            {10, 0x00015e80}, /* _LDRLibPath */
     3960            {14, 0x000306a4}, /* _TKSuBuff */
     3961            {14, 0x00030296}, /* _TKFuBuff */
     3962            {14, 0x00030462}, /* _TKFuBufLen */
     3963            {14, 0x0004574c}, /* _ldrValidateMteHandle */
     3964            {10, 0x0000b8d0}, /* _pTCBCur */
     3965            {10, 0x0000b8cc}, /* _pPTDACur */
     3966            {4 , 0x0000f9f4}, /* ptda_start */
     3967            {4 , 0x0000fa9a}, /* ptda_environ */
     3968            {4 , 0x0000fecc}, /* ptda_ptdasem */
     3969            {4 , 0x0000ffaa}, /* ptda_module */
     3970            {4 , 0x0000fa9c}, /* ptda_pBeginLIBPATH */
     3971            {10, 0x000183d4}, /* _ldrpFileNameBuf */
     3972            {14, 0x00040f46}, /* SecPathFromSFN */
     3973        }
     3974    },
     3975#endif
     3976    { /* 9028RU.SYM */
     3977        9028, KF_UNI, 13,
     3978        {
     3979            {12, 0x00009424}, /* _ldrRead */
     3980            {12, 0x000398cc}, /* _ldrOpen */
     3981            {12, 0x0003a154}, /* _ldrClose */
     3982            {12, 0x0003a1a4}, /* _LDRQAppType */
     3983            {12, 0x00037ba4}, /* _ldrEnum32bitRelRecs */
     3984            {12, 0x0000350c}, /* _IOSftOpen */
     3985            {12, 0x000039b2}, /* _IOSftClose */
     3986            {12, 0x00003a59}, /* _IOSftTransPath */
     3987            {12, 0x000037d3}, /* _IOSftReadAt */
     3988            {12, 0x000037da}, /* _IOSftWriteAt */
     3989            {12, 0x00003b72}, /* _SftFileSize */
     3990            {12, 0x00035e78}, /* _VMAllocMem */
     3991            {12, 0x0001c9b0}, /* _VMGetOwner */
     3992            {12, 0x00041e62}, /* g_tkExecPgm */
     3993            {12, 0x0003ee2f}, /* _tkStartProcess */
     3994            {9 , 0x0000e5bc}, /* f_FuStrLenZ */
     3995            {9 , 0x0000e572}, /* f_FuStrLen */
     3996            {9 , 0x0000e6b0}, /* f_FuBuff */
     3997            {12, 0x0001bd10}, /* _VMObjHandleInfo */
     3998            {12, 0x00042814}, /* _ldrASMpMTEFromHandle */
     3999            {12, 0x00039b43}, /* _ldrOpenPath */
     4000            {12, 0x000365b8}, /* _LDRClearSem */
     4001            {12, 0x0003e5a9}, /* _ldrFindModule */
     4002            {12, 0x0000a7ac}, /* _KSEMRequestMutex */
     4003            {12, 0x0000a83f}, /* _KSEMReleaseMutex */
     4004            {12, 0x0000a86a}, /* _KSEMQueryMutex */
     4005            {12, 0x0000aa7f}, /* _KSEMInit */
     4006            {8 , 0x0000a33c}, /* _LdrSem */
     4007            {8 , 0x0000a3bc}, /* _LDRLibPath */
     4008            {12, 0x0002731d}, /* _TKSuBuff */
     4009            {12, 0x00026f51}, /* _TKFuBuff */
     4010            {12, 0x000270db}, /* _TKFuBufLen */
     4011            {12, 0x000365f4}, /* _ldrValidateMteHandle */
     4012            {8 , 0x000072b8}, /* _pTCBCur */
     4013            {8 , 0x000072b4}, /* _pPTDACur */
     4014            {2 , 0x0000f9fc}, /* ptda_start */
     4015            {2 , 0x0000faa2}, /* ptda_environ */
     4016            {2 , 0x0000fed4}, /* ptda_ptdasem */
     4017            {2 , 0x0000ffaa}, /* ptda_module */
     4018            {2 , 0x0000faa4}, /* ptda_pBeginLIBPATH */
     4019            {8 , 0x0000be7c}, /* _ldrpFileNameBuf */
     4020            {12, 0x00032a37}, /* SecPathFromSFN */
     4021        }
     4022    },
     4023#ifdef ALLKERNELS
     4024    { /* 9029AU.SYM */
     4025        9029, KF_UNI | KF_ALLSTRICT, 15,
     4026        {
     4027            {14, 0x0000a2d4}, /* _ldrRead */
     4028            {14, 0x000493ac}, /* _ldrOpen */
     4029            {14, 0x00049d44}, /* _ldrClose */
     4030            {14, 0x00049d94}, /* _LDRQAppType */
     4031            {14, 0x000473a4}, /* _ldrEnum32bitRelRecs */
     4032            {14, 0x00003e18}, /* _IOSftOpen */
     4033            {14, 0x000042cc}, /* _IOSftClose */
     4034            {14, 0x00004374}, /* _IOSftTransPath */
     4035            {14, 0x000040ec}, /* _IOSftReadAt */
     4036            {14, 0x000040f3}, /* _IOSftWriteAt */
     4037            {14, 0x0000449c}, /* _SftFileSize */
     4038            {14, 0x00044d2c}, /* _VMAllocMem */
     4039            {14, 0x00022b9a}, /* _VMGetOwner */
     4040            {14, 0x00052ae0}, /* g_tkExecPgm */
     4041            {14, 0x0004f268}, /* _tkStartProcess */
     4042            {11, 0x0000f864}, /* f_FuStrLenZ */
     4043            {11, 0x0000f818}, /* f_FuStrLen */
     4044            {11, 0x0000f97c}, /* f_FuBuff */
     4045            {14, 0x00021ae4}, /* _VMObjHandleInfo */
     4046            {14, 0x00053564}, /* _ldrASMpMTEFromHandle */
     4047            {14, 0x00049637}, /* _ldrOpenPath */
     4048            {14, 0x000457d8}, /* _LDRClearSem */
     4049            {14, 0x0004e942}, /* _ldrFindModule */
     4050            {14, 0x0000bc80}, /* _KSEMRequestMutex */
     4051            {14, 0x0000bd94}, /* _KSEMReleaseMutex */
     4052            {14, 0x0000bdf4}, /* _KSEMQueryMutex */
     4053            {14, 0x0000c178}, /* _KSEMInit */
     4054            {10, 0x00015e48}, /* _LdrSem */
     4055            {10, 0x00015ed4}, /* _LDRLibPath */
     4056            {14, 0x00030640}, /* _TKSuBuff */
     4057            {14, 0x00030232}, /* _TKFuBuff */
     4058            {14, 0x000303fe}, /* _TKFuBufLen */
     4059            {14, 0x00045860}, /* _ldrValidateMteHandle */
     4060            {10, 0x0000b8bc}, /* _pTCBCur */
     4061            {10, 0x0000b8b8}, /* _pPTDACur */
     4062            {4 , 0x0000f9f4}, /* ptda_start */
     4063            {4 , 0x0000fa9a}, /* ptda_environ */
     4064            {4 , 0x0000fecc}, /* ptda_ptdasem */
     4065            {4 , 0x0000ffaa}, /* ptda_module */
     4066            {4 , 0x0000fa9c}, /* ptda_pBeginLIBPATH */
     4067            {10, 0x00018428}, /* _ldrpFileNameBuf */
     4068            {14, 0x0004102a}, /* SecPathFromSFN */
     4069        }
     4070    },
     4071#endif
     4072#ifdef ALLKERNELS
     4073    { /* 9029HU.SYM */
     4074        9029, KF_UNI | KF_HALFSTRICT, 15,
     4075        {
     4076            {14, 0x0000947c}, /* _ldrRead */
     4077            {14, 0x0003b03c}, /* _ldrOpen */
     4078            {14, 0x0003b8c4}, /* _ldrClose */
     4079            {14, 0x0003b914}, /* _LDRQAppType */
     4080            {14, 0x0003930c}, /* _ldrEnum32bitRelRecs */
     4081            {14, 0x0000355c}, /* _IOSftOpen */
     4082            {14, 0x00003a02}, /* _IOSftClose */
     4083            {14, 0x00003aa9}, /* _IOSftTransPath */
     4084            {14, 0x00003823}, /* _IOSftReadAt */
     4085            {14, 0x0000382a}, /* _IOSftWriteAt */
     4086            {14, 0x00003bc2}, /* _SftFileSize */
     4087            {14, 0x000375e0}, /* _VMAllocMem */
     4088            {14, 0x0001d618}, /* _VMGetOwner */
     4089            {14, 0x0004361a}, /* g_tkExecPgm */
     4090            {14, 0x000405bf}, /* _tkStartProcess */
     4091            {11, 0x0000e594}, /* f_FuStrLenZ */
     4092            {11, 0x0000e54a}, /* f_FuStrLen */
     4093            {11, 0x0000e688}, /* f_FuBuff */
     4094            {14, 0x0001c978}, /* _VMObjHandleInfo */
     4095            {14, 0x00043fcc}, /* _ldrASMpMTEFromHandle */
     4096            {14, 0x0003b2b3}, /* _ldrOpenPath */
     4097            {14, 0x00037d20}, /* _LDRClearSem */
     4098            {14, 0x0003fd39}, /* _ldrFindModule */
     4099            {14, 0x0000a92c}, /* _KSEMRequestMutex */
     4100            {14, 0x0000aa03}, /* _KSEMReleaseMutex */
     4101            {14, 0x0000aa2e}, /* _KSEMQueryMutex */
     4102            {14, 0x0000acce}, /* _KSEMInit */
     4103            {10, 0x0000a550}, /* _LdrSem */
     4104            {10, 0x0000a5d0}, /* _LDRLibPath */
     4105            {14, 0x00027f8d}, /* _TKSuBuff */
     4106            {14, 0x00027bc1}, /* _TKFuBuff */
     4107            {14, 0x00027d4b}, /* _TKFuBufLen */
     4108            {14, 0x00037d5c}, /* _ldrValidateMteHandle */
     4109            {10, 0x000072b4}, /* _pTCBCur */
     4110            {10, 0x000072b0}, /* _pPTDACur */
     4111            {4 , 0x0000f9fc}, /* ptda_start */
     4112            {4 , 0x0000faa2}, /* ptda_environ */
     4113            {4 , 0x0000fed4}, /* ptda_ptdasem */
     4114            {4 , 0x0000ffaa}, /* ptda_module */
     4115            {4 , 0x0000faa4}, /* ptda_pBeginLIBPATH */
     4116            {10, 0x0000c094}, /* _ldrpFileNameBuf */
     4117            {14, 0x0003419f}, /* SecPathFromSFN */
     4118        }
     4119    },
     4120#endif
    5674121    { /* 9029RU.SYM */
    568         9029, 'R', TYPE_UNI, 13,
     4122        9029, KF_UNI, 13,
    5694123        {
    5704124            {12, 0x00009404}, /* _ldrRead */
     
    5824136            {12, 0x0001c8f0}, /* _VMGetOwner */
    5834137            {12, 0x00041eb6}, /* g_tkExecPgm */
    584             {9, 0x0000e594}, /* f_FuStrLenZ */
    585             {9, 0x0000e54a}, /* f_FuStrLen */
    586             {9, 0x0000e688}, /* f_FuBuff */
    587         }
    588     },
     4138            {12, 0x0003ee7f}, /* _tkStartProcess */
     4139            {9 , 0x0000e594}, /* f_FuStrLenZ */
     4140            {9 , 0x0000e54a}, /* f_FuStrLen */
     4141            {9 , 0x0000e688}, /* f_FuBuff */
     4142            {12, 0x0001bc50}, /* _VMObjHandleInfo */
     4143            {12, 0x00042868}, /* _ldrASMpMTEFromHandle */
     4144            {12, 0x00039b77}, /* _ldrOpenPath */
     4145            {12, 0x000365e0}, /* _LDRClearSem */
     4146            {12, 0x0003e5f9}, /* _ldrFindModule */
     4147            {12, 0x0000a78c}, /* _KSEMRequestMutex */
     4148            {12, 0x0000a81f}, /* _KSEMReleaseMutex */
     4149            {12, 0x0000a84a}, /* _KSEMQueryMutex */
     4150            {12, 0x0000aa5f}, /* _KSEMInit */
     4151            {8 , 0x0000a398}, /* _LdrSem */
     4152            {8 , 0x0000a418}, /* _LDRLibPath */
     4153            {12, 0x00027265}, /* _TKSuBuff */
     4154            {12, 0x00026e99}, /* _TKFuBuff */
     4155            {12, 0x00027023}, /* _TKFuBufLen */
     4156            {12, 0x0003661c}, /* _ldrValidateMteHandle */
     4157            {8 , 0x000072b4}, /* _pTCBCur */
     4158            {8 , 0x000072b0}, /* _pPTDACur */
     4159            {2 , 0x0000f9fc}, /* ptda_start */
     4160            {2 , 0x0000faa2}, /* ptda_environ */
     4161            {2 , 0x0000fed4}, /* ptda_ptdasem */
     4162            {2 , 0x0000ffaa}, /* ptda_module */
     4163            {2 , 0x0000faa4}, /* ptda_pBeginLIBPATH */
     4164            {8 , 0x0000bed8}, /* _ldrpFileNameBuf */
     4165            {12, 0x00032a5f}, /* SecPathFromSFN */
     4166        }
     4167    },
     4168#ifdef ALLKERNELS
     4169    { /* 9030AU.SYM */
     4170        9030, KF_UNI | KF_ALLSTRICT, 16,
     4171        {
     4172            {15, 0x0000a7b4}, /* _ldrRead */
     4173            {15, 0x00049c60}, /* _ldrOpen */
     4174            {15, 0x0004a5f8}, /* _ldrClose */
     4175            {15, 0x0004a648}, /* _LDRQAppType */
     4176            {15, 0x00047b7c}, /* _ldrEnum32bitRelRecs */
     4177            {15, 0x00004318}, /* _IOSftOpen */
     4178            {15, 0x000047cc}, /* _IOSftClose */
     4179            {15, 0x00004874}, /* _IOSftTransPath */
     4180            {15, 0x000045ec}, /* _IOSftReadAt */
     4181            {15, 0x000045f3}, /* _IOSftWriteAt */
     4182            {15, 0x0000499c}, /* _SftFileSize */
     4183            {15, 0x00045510}, /* _VMAllocMem */
     4184            {15, 0x00023390}, /* _VMGetOwner */
     4185            {15, 0x00053590}, /* g_tkExecPgm */
     4186            {15, 0x0004fcd8}, /* _tkStartProcess */
     4187            {11, 0x0000ecfc}, /* f_FuStrLenZ */
     4188            {11, 0x0000ecb0}, /* f_FuStrLen */
     4189            {11, 0x0000ee14}, /* f_FuBuff */
     4190            {15, 0x000222d8}, /* _VMObjHandleInfo */
     4191            {15, 0x00054014}, /* _ldrASMpMTEFromHandle */
     4192            {15, 0x00049eeb}, /* _ldrOpenPath */
     4193            {15, 0x00045fc4}, /* _LDRClearSem */
     4194            {15, 0x0004f3b6}, /* _ldrFindModule */
     4195            {15, 0x0000c160}, /* _KSEMRequestMutex */
     4196            {15, 0x0000c274}, /* _KSEMReleaseMutex */
     4197            {15, 0x0000c2d4}, /* _KSEMQueryMutex */
     4198            {15, 0x0000c658}, /* _KSEMInit */
     4199            {10, 0x00016f2c}, /* _LdrSem */
     4200            {10, 0x00016fb8}, /* _LDRLibPath */
     4201            {15, 0x00030e98}, /* _TKSuBuff */
     4202            {15, 0x00030a88}, /* _TKFuBuff */
     4203            {15, 0x00030c54}, /* _TKFuBufLen */
     4204            {15, 0x0004604c}, /* _ldrValidateMteHandle */
     4205            {10, 0x0000b8ac}, /* _pTCBCur */
     4206            {10, 0x0000b8a8}, /* _pPTDACur */
     4207            {4 , 0x0000f9f4}, /* ptda_start */
     4208            {4 , 0x0000fa9a}, /* ptda_environ */
     4209            {4 , 0x0000fecc}, /* ptda_ptdasem */
     4210            {4 , 0x0000ffaa}, /* ptda_module */
     4211            {4 , 0x0000fa9c}, /* ptda_pBeginLIBPATH */
     4212            {10, 0x0001951c}, /* _ldrpFileNameBuf */
     4213            {15, 0x000418e2}, /* SecPathFromSFN */
     4214        }
     4215    },
     4216#endif
     4217#ifdef ALLKERNELS
     4218    { /* 9030HU.SYM */
     4219        9030, KF_UNI | KF_HALFSTRICT, 16,
     4220        {
     4221            {15, 0x0000980c}, /* _ldrRead */
     4222            {15, 0x0003b8c4}, /* _ldrOpen */
     4223            {15, 0x0003c14c}, /* _ldrClose */
     4224            {15, 0x0003c19c}, /* _LDRQAppType */
     4225            {15, 0x00039acc}, /* _ldrEnum32bitRelRecs */
     4226            {15, 0x0000390c}, /* _IOSftOpen */
     4227            {15, 0x00003db2}, /* _IOSftClose */
     4228            {15, 0x00003e59}, /* _IOSftTransPath */
     4229            {15, 0x00003bd3}, /* _IOSftReadAt */
     4230            {15, 0x00003bda}, /* _IOSftWriteAt */
     4231            {15, 0x00003f72}, /* _SftFileSize */
     4232            {15, 0x00037d98}, /* _VMAllocMem */
     4233            {15, 0x0001dd38}, /* _VMGetOwner */
     4234            {15, 0x0004406e}, /* g_tkExecPgm */
     4235            {15, 0x00040ffb}, /* _tkStartProcess */
     4236            {11, 0x0000db08}, /* f_FuStrLenZ */
     4237            {11, 0x0000dabe}, /* f_FuStrLen */
     4238            {11, 0x0000dbfc}, /* f_FuBuff */
     4239            {15, 0x0001d094}, /* _VMObjHandleInfo */
     4240            {15, 0x00044a20}, /* _ldrASMpMTEFromHandle */
     4241            {15, 0x0003bb3b}, /* _ldrOpenPath */
     4242            {15, 0x000384e0}, /* _LDRClearSem */
     4243            {15, 0x00040775}, /* _ldrFindModule */
     4244            {15, 0x0000acbc}, /* _KSEMRequestMutex */
     4245            {15, 0x0000ad93}, /* _KSEMReleaseMutex */
     4246            {15, 0x0000adbe}, /* _KSEMQueryMutex */
     4247            {15, 0x0000b05e}, /* _KSEMInit */
     4248            {10, 0x0000a56c}, /* _LdrSem */
     4249            {10, 0x0000a5ec}, /* _LDRLibPath */
     4250            {15, 0x000286d9}, /* _TKSuBuff */
     4251            {15, 0x0002830f}, /* _TKFuBuff */
     4252            {15, 0x00028499}, /* _TKFuBufLen */
     4253            {15, 0x0003851c}, /* _ldrValidateMteHandle */
     4254            {10, 0x000072b8}, /* _pTCBCur */
     4255            {10, 0x000072b4}, /* _pPTDACur */
     4256            {4 , 0x0000f9fc}, /* ptda_start */
     4257            {4 , 0x0000faa2}, /* ptda_environ */
     4258            {4 , 0x0000fed4}, /* ptda_ptdasem */
     4259            {4 , 0x0000ffaa}, /* ptda_module */
     4260            {4 , 0x0000faa4}, /* ptda_pBeginLIBPATH */
     4261            {10, 0x0000c0c0}, /* _ldrpFileNameBuf */
     4262            {15, 0x00034957}, /* SecPathFromSFN */
     4263        }
     4264    },
     4265#endif
    5894266    { /* 9030RU.SYM */
    590         9030, 'R', TYPE_UNI, 14,
     4267        9030, KF_UNI, 14,
    5914268        {
    5924269            {13, 0x00009784}, /* _ldrRead */
     
    6044281            {13, 0x0001d000}, /* _VMGetOwner */
    6054282            {13, 0x0004288a}, /* g_tkExecPgm */
    606             {9, 0x0000db08}, /* f_FuStrLenZ */
    607             {9, 0x0000dabe}, /* f_FuStrLen */
    608             {9, 0x0000dbfc}, /* f_FuBuff */
    609         }
    610     },
     4283            {13, 0x0003f83b}, /* _tkStartProcess */
     4284            {9 , 0x0000db08}, /* f_FuStrLenZ */
     4285            {9 , 0x0000dabe}, /* f_FuStrLen */
     4286            {9 , 0x0000dbfc}, /* f_FuBuff */
     4287            {13, 0x0001c35c}, /* _VMObjHandleInfo */
     4288            {13, 0x0004323c}, /* _ldrASMpMTEFromHandle */
     4289            {13, 0x0003a38b}, /* _ldrOpenPath */
     4290            {13, 0x00036d30}, /* _LDRClearSem */
     4291            {13, 0x0003efb5}, /* _ldrFindModule */
     4292            {13, 0x0000ab0c}, /* _KSEMRequestMutex */
     4293            {13, 0x0000ab9f}, /* _KSEMReleaseMutex */
     4294            {13, 0x0000abca}, /* _KSEMQueryMutex */
     4295            {13, 0x0000addf}, /* _KSEMInit */
     4296            {8 , 0x0000a3b4}, /* _LdrSem */
     4297            {8 , 0x0000a434}, /* _LDRLibPath */
     4298            {13, 0x000279a1}, /* _TKSuBuff */
     4299            {13, 0x000275d7}, /* _TKFuBuff */
     4300            {13, 0x00027761}, /* _TKFuBufLen */
     4301            {13, 0x00036d6c}, /* _ldrValidateMteHandle */
     4302            {8 , 0x000072b8}, /* _pTCBCur */
     4303            {8 , 0x000072b4}, /* _pPTDACur */
     4304            {2 , 0x0000f9fc}, /* ptda_start */
     4305            {2 , 0x0000faa2}, /* ptda_environ */
     4306            {2 , 0x0000fed4}, /* ptda_ptdasem */
     4307            {2 , 0x0000ffaa}, /* ptda_module */
     4308            {2 , 0x0000faa4}, /* ptda_pBeginLIBPATH */
     4309            {8 , 0x0000bf04}, /* _ldrpFileNameBuf */
     4310            {13, 0x000331a7}, /* SecPathFromSFN */
     4311        }
     4312    },
     4313#ifdef ALLKERNELS
     4314    { /* 9031AU.SYM */
     4315        9031, KF_UNI | KF_ALLSTRICT, 16,
     4316        {
     4317            {15, 0x0000a84c}, /* _ldrRead */
     4318            {15, 0x0004979c}, /* _ldrOpen */
     4319            {15, 0x0004a138}, /* _ldrClose */
     4320            {15, 0x0004a188}, /* _LDRQAppType */
     4321            {15, 0x000476c4}, /* _ldrEnum32bitRelRecs */
     4322            {15, 0x00004318}, /* _IOSftOpen */
     4323            {15, 0x000047cc}, /* _IOSftClose */
     4324            {15, 0x00004874}, /* _IOSftTransPath */
     4325            {15, 0x000045ec}, /* _IOSftReadAt */
     4326            {15, 0x000045f3}, /* _IOSftWriteAt */
     4327            {15, 0x0000499c}, /* _SftFileSize */
     4328            {15, 0x00045188}, /* _VMAllocMem */
     4329            {15, 0x000234b0}, /* _VMGetOwner */
     4330            {15, 0x000530e4}, /* g_tkExecPgm */
     4331            {15, 0x0004f824}, /* _tkStartProcess */
     4332            {11, 0x0000ecfc}, /* f_FuStrLenZ */
     4333            {11, 0x0000ecb0}, /* f_FuStrLen */
     4334            {11, 0x0000ee14}, /* f_FuBuff */
     4335            {15, 0x000223f0}, /* _VMObjHandleInfo */
     4336            {15, 0x00053b68}, /* _ldrASMpMTEFromHandle */
     4337            {15, 0x00049a27}, /* _ldrOpenPath */
     4338            {15, 0x00045b94}, /* _LDRClearSem */
     4339            {15, 0x0004ef01}, /* _ldrFindModule */
     4340            {15, 0x0000c1b4}, /* _KSEMRequestMutex */
     4341            {15, 0x0000c2c8}, /* _KSEMReleaseMutex */
     4342            {15, 0x0000c328}, /* _KSEMQueryMutex */
     4343            {15, 0x0000c6ac}, /* _KSEMInit */
     4344            {10, 0x00026f18}, /* _LdrSem */
     4345            {10, 0x00026fa4}, /* _LDRLibPath */
     4346            {15, 0x00030b94}, /* _TKSuBuff */
     4347            {15, 0x00030784}, /* _TKFuBuff */
     4348            {15, 0x00030950}, /* _TKFuBufLen */
     4349            {15, 0x00045c1c}, /* _ldrValidateMteHandle */
     4350            {10, 0x0000b8a4}, /* _pTCBCur */
     4351            {10, 0x0000b8a0}, /* _pPTDACur */
     4352            {4 , 0x0000f9f4}, /* ptda_start */
     4353            {4 , 0x0000fa9a}, /* ptda_environ */
     4354            {4 , 0x0000fecc}, /* ptda_ptdasem */
     4355            {4 , 0x0000ffaa}, /* ptda_module */
     4356            {4 , 0x0000fa9c}, /* ptda_pBeginLIBPATH */
     4357            {10, 0x00029508}, /* _ldrpFileNameBuf */
     4358            {15, 0x00041686}, /* SecPathFromSFN */
     4359        }
     4360    },
     4361#endif
     4362#ifdef ALLKERNELS
     4363    { /* 9031HU.SYM */
     4364        9031, KF_UNI | KF_HALFSTRICT, 16,
     4365        {
     4366            {15, 0x0000989c}, /* _ldrRead */
     4367            {15, 0x0003b7b8}, /* _ldrOpen */
     4368            {15, 0x0003c03c}, /* _ldrClose */
     4369            {15, 0x0003c08c}, /* _LDRQAppType */
     4370            {15, 0x000399b4}, /* _ldrEnum32bitRelRecs */
     4371            {15, 0x0000390c}, /* _IOSftOpen */
     4372            {15, 0x00003db2}, /* _IOSftClose */
     4373            {15, 0x00003e59}, /* _IOSftTransPath */
     4374            {15, 0x00003bd3}, /* _IOSftReadAt */
     4375            {15, 0x00003bda}, /* _IOSftWriteAt */
     4376            {15, 0x00003f72}, /* _SftFileSize */
     4377            {15, 0x00037d00}, /* _VMAllocMem */
     4378            {15, 0x0001dd60}, /* _VMGetOwner */
     4379            {15, 0x00044036}, /* g_tkExecPgm */
     4380            {15, 0x00040fa7}, /* _tkStartProcess */
     4381            {11, 0x0000db08}, /* f_FuStrLenZ */
     4382            {11, 0x0000dabe}, /* f_FuStrLen */
     4383            {11, 0x0000dbfc}, /* f_FuBuff */
     4384            {15, 0x0001d0bc}, /* _VMObjHandleInfo */
     4385            {15, 0x000449e8}, /* _ldrASMpMTEFromHandle */
     4386            {15, 0x0003ba2f}, /* _ldrOpenPath */
     4387            {15, 0x00038448}, /* _LDRClearSem */
     4388            {15, 0x00040724}, /* _ldrFindModule */
     4389            {15, 0x0000ad4c}, /* _KSEMRequestMutex */
     4390            {15, 0x0000ae23}, /* _KSEMReleaseMutex */
     4391            {15, 0x0000ae4e}, /* _KSEMQueryMutex */
     4392            {15, 0x0000b0ee}, /* _KSEMInit */
     4393            {10, 0x0001a574}, /* _LdrSem */
     4394            {10, 0x0001a5f4}, /* _LDRLibPath */
     4395            {15, 0x00028705}, /* _TKSuBuff */
     4396            {15, 0x0002833b}, /* _TKFuBuff */
     4397            {15, 0x000284c5}, /* _TKFuBufLen */
     4398            {15, 0x00038484}, /* _ldrValidateMteHandle */
     4399            {10, 0x000072b8}, /* _pTCBCur */
     4400            {10, 0x000072b4}, /* _pPTDACur */
     4401            {4 , 0x0000f9fc}, /* ptda_start */
     4402            {4 , 0x0000faa2}, /* ptda_environ */
     4403            {4 , 0x0000fed4}, /* ptda_ptdasem */
     4404            {4 , 0x0000ffaa}, /* ptda_module */
     4405            {4 , 0x0000faa4}, /* ptda_pBeginLIBPATH */
     4406            {10, 0x0001c0c8}, /* _ldrpFileNameBuf */
     4407            {15, 0x0003499f}, /* SecPathFromSFN */
     4408        }
     4409    },
     4410#endif
    6114411    { /* 9031RU.SYM */
    612         9031, 'R', TYPE_UNI, 14,
     4412        9031, KF_UNI, 14,
    6134413        {
    6144414            {13, 0x00009814}, /* _ldrRead */
     
    6264426            {13, 0x0001d09c}, /* _VMGetOwner */
    6274427            {13, 0x0004288a}, /* g_tkExecPgm */
    628             {9, 0x0000db08}, /* f_FuStrLenZ */
    629             {9, 0x0000dabe}, /* f_FuStrLen */
    630             {9, 0x0000dbfc}, /* f_FuBuff */
    631         }
    632     },
     4428            {13, 0x0003f81b}, /* _tkStartProcess */
     4429            {9 , 0x0000db08}, /* f_FuStrLenZ */
     4430            {9 , 0x0000dabe}, /* f_FuStrLen */
     4431            {9 , 0x0000dbfc}, /* f_FuBuff */
     4432            {13, 0x0001c3f8}, /* _VMObjHandleInfo */
     4433            {13, 0x0004323c}, /* _ldrASMpMTEFromHandle */
     4434            {13, 0x0003a2a3}, /* _ldrOpenPath */
     4435            {13, 0x00036cbc}, /* _LDRClearSem */
     4436            {13, 0x0003ef98}, /* _ldrFindModule */
     4437            {13, 0x0000ab9c}, /* _KSEMRequestMutex */
     4438            {13, 0x0000ac2f}, /* _KSEMReleaseMutex */
     4439            {13, 0x0000ac5a}, /* _KSEMQueryMutex */
     4440            {13, 0x0000ae6f}, /* _KSEMInit */
     4441            {8 , 0x0000a3bc}, /* _LdrSem */
     4442            {8 , 0x0000a43c}, /* _LDRLibPath */
     4443            {13, 0x00027a41}, /* _TKSuBuff */
     4444            {13, 0x00027677}, /* _TKFuBuff */
     4445            {13, 0x00027801}, /* _TKFuBufLen */
     4446            {13, 0x00036cf8}, /* _ldrValidateMteHandle */
     4447            {8 , 0x000072b8}, /* _pTCBCur */
     4448            {8 , 0x000072b4}, /* _pPTDACur */
     4449            {2 , 0x0000f9fc}, /* ptda_start */
     4450            {2 , 0x0000faa2}, /* ptda_environ */
     4451            {2 , 0x0000fed4}, /* ptda_ptdasem */
     4452            {2 , 0x0000ffaa}, /* ptda_module */
     4453            {2 , 0x0000faa4}, /* ptda_pBeginLIBPATH */
     4454            {8 , 0x0000bf0c}, /* _ldrpFileNameBuf */
     4455            {13, 0x00033213}, /* SecPathFromSFN */
     4456        }
     4457    },
     4458#ifdef ALLKERNELS
     4459    { /* 9032AU.SYM */
     4460        9032, KF_UNI | KF_ALLSTRICT, 16,
     4461        {
     4462            {15, 0x0000a84c}, /* _ldrRead */
     4463            {15, 0x000496c8}, /* _ldrOpen */
     4464            {15, 0x0004a060}, /* _ldrClose */
     4465            {15, 0x0004a0b0}, /* _LDRQAppType */
     4466            {15, 0x000475e4}, /* _ldrEnum32bitRelRecs */
     4467            {15, 0x00004318}, /* _IOSftOpen */
     4468            {15, 0x000047cc}, /* _IOSftClose */
     4469            {15, 0x00004874}, /* _IOSftTransPath */
     4470            {15, 0x000045ec}, /* _IOSftReadAt */
     4471            {15, 0x000045f3}, /* _IOSftWriteAt */
     4472            {15, 0x0000499c}, /* _SftFileSize */
     4473            {15, 0x000450a8}, /* _VMAllocMem */
     4474            {15, 0x000234a8}, /* _VMGetOwner */
     4475            {15, 0x000530d4}, /* g_tkExecPgm */
     4476            {15, 0x0004f828}, /* _tkStartProcess */
     4477            {11, 0x0000ecf8}, /* f_FuStrLenZ */
     4478            {11, 0x0000ecac}, /* f_FuStrLen */
     4479            {11, 0x0000ee10}, /* f_FuBuff */
     4480            {15, 0x000223e8}, /* _VMObjHandleInfo */
     4481            {15, 0x00053b58}, /* _ldrASMpMTEFromHandle */
     4482            {15, 0x00049953}, /* _ldrOpenPath */
     4483            {15, 0x00045ab4}, /* _LDRClearSem */
     4484            {15, 0x0004ef05}, /* _ldrFindModule */
     4485            {15, 0x0000c1b4}, /* _KSEMRequestMutex */
     4486            {15, 0x0000c2c8}, /* _KSEMReleaseMutex */
     4487            {15, 0x0000c328}, /* _KSEMQueryMutex */
     4488            {15, 0x0000c6ac}, /* _KSEMInit */
     4489            {10, 0x00026f00}, /* _LdrSem */
     4490            {10, 0x00026f8c}, /* _LDRLibPath */
     4491            {15, 0x00030b60}, /* _TKSuBuff */
     4492            {15, 0x00030752}, /* _TKFuBuff */
     4493            {15, 0x0003091e}, /* _TKFuBufLen */
     4494            {15, 0x00045b3c}, /* _ldrValidateMteHandle */
     4495            {10, 0x0000b88c}, /* _pTCBCur */
     4496            {10, 0x0000b888}, /* _pPTDACur */
     4497            {4 , 0x0000f9f4}, /* ptda_start */
     4498            {4 , 0x0000fa9a}, /* ptda_environ */
     4499            {4 , 0x0000fecc}, /* ptda_ptdasem */
     4500            {4 , 0x0000ffaa}, /* ptda_module */
     4501            {4 , 0x0000fa9c}, /* ptda_pBeginLIBPATH */
     4502            {10, 0x000294f0}, /* _ldrpFileNameBuf */
     4503            {15, 0x000415ff}, /* SecPathFromSFN */
     4504        }
     4505    },
     4506#endif
     4507#ifdef ALLKERNELS
     4508    { /* 9032HU.SYM */
     4509        9032, KF_UNI | KF_HALFSTRICT, 16,
     4510        {
     4511            {15, 0x0000989c}, /* _ldrRead */
     4512            {15, 0x0003b9cc}, /* _ldrOpen */
     4513            {15, 0x0003c250}, /* _ldrClose */
     4514            {15, 0x0003c2a0}, /* _LDRQAppType */
     4515            {15, 0x00039bc8}, /* _ldrEnum32bitRelRecs */
     4516            {15, 0x0000390c}, /* _IOSftOpen */
     4517            {15, 0x00003db2}, /* _IOSftClose */
     4518            {15, 0x00003e59}, /* _IOSftTransPath */
     4519            {15, 0x00003bd3}, /* _IOSftReadAt */
     4520            {15, 0x00003bda}, /* _IOSftWriteAt */
     4521            {15, 0x00003f72}, /* _SftFileSize */
     4522            {15, 0x00037f14}, /* _VMAllocMem */
     4523            {15, 0x0001dd5e}, /* _VMGetOwner */
     4524            {15, 0x0004421a}, /* g_tkExecPgm */
     4525            {15, 0x00041197}, /* _tkStartProcess */
     4526            {11, 0x0000db00}, /* f_FuStrLenZ */
     4527            {11, 0x0000dab6}, /* f_FuStrLen */
     4528            {11, 0x0000dbf4}, /* f_FuBuff */
     4529            {15, 0x0001d0bc}, /* _VMObjHandleInfo */
     4530            {15, 0x00044bcc}, /* _ldrASMpMTEFromHandle */
     4531            {15, 0x0003bc43}, /* _ldrOpenPath */
     4532            {15, 0x0003865c}, /* _LDRClearSem */
     4533            {15, 0x00040914}, /* _ldrFindModule */
     4534            {15, 0x0000ad4c}, /* _KSEMRequestMutex */
     4535            {15, 0x0000ae23}, /* _KSEMReleaseMutex */
     4536            {15, 0x0000ae4e}, /* _KSEMQueryMutex */
     4537            {15, 0x0000b0ee}, /* _KSEMInit */
     4538            {10, 0x0001a574}, /* _LdrSem */
     4539            {10, 0x0001a5f4}, /* _LDRLibPath */
     4540            {15, 0x00028711}, /* _TKSuBuff */
     4541            {15, 0x00028347}, /* _TKFuBuff */
     4542            {15, 0x000284d1}, /* _TKFuBufLen */
     4543            {15, 0x00038698}, /* _ldrValidateMteHandle */
     4544            {10, 0x000072b8}, /* _pTCBCur */
     4545            {10, 0x000072b4}, /* _pPTDACur */
     4546            {4 , 0x0000f9fc}, /* ptda_start */
     4547            {4 , 0x0000faa2}, /* ptda_environ */
     4548            {4 , 0x0000fed4}, /* ptda_ptdasem */
     4549            {4 , 0x0000ffaa}, /* ptda_module */
     4550            {4 , 0x0000faa4}, /* ptda_pBeginLIBPATH */
     4551            {10, 0x0001c0c8}, /* _ldrpFileNameBuf */
     4552            {15, 0x00034a13}, /* SecPathFromSFN */
     4553        }
     4554    },
     4555#endif
    6334556    { /* 9032RU.SYM */
    634         9032, 'R', TYPE_UNI, 14,
     4557        9032, KF_UNI, 14,
    6354558        {
    6364559            {13, 0x00009814}, /* _ldrRead */
     
    6484571            {13, 0x0001d09a}, /* _VMGetOwner */
    6494572            {13, 0x00042b3a}, /* g_tkExecPgm */
    650             {9, 0x0000db00}, /* f_FuStrLenZ */
    651             {9, 0x0000dab6}, /* f_FuStrLen */
    652             {9, 0x0000dbf4}, /* f_FuBuff */
    653         }
    654     },
     4573            {13, 0x0003fad3}, /* _tkStartProcess */
     4574            {9 , 0x0000db00}, /* f_FuStrLenZ */
     4575            {9 , 0x0000dab6}, /* f_FuStrLen */
     4576            {9 , 0x0000dbf4}, /* f_FuBuff */
     4577            {13, 0x0001c3f8}, /* _VMObjHandleInfo */
     4578            {13, 0x000434ec}, /* _ldrASMpMTEFromHandle */
     4579            {13, 0x0003a4f3}, /* _ldrOpenPath */
     4580            {13, 0x00036f0c}, /* _LDRClearSem */
     4581            {13, 0x0003f250}, /* _ldrFindModule */
     4582            {13, 0x0000ab9c}, /* _KSEMRequestMutex */
     4583            {13, 0x0000ac2f}, /* _KSEMReleaseMutex */
     4584            {13, 0x0000ac5a}, /* _KSEMQueryMutex */
     4585            {13, 0x0000ae6f}, /* _KSEMInit */
     4586            {8 , 0x0000a3bc}, /* _LdrSem */
     4587            {8 , 0x0000a43c}, /* _LDRLibPath */
     4588            {13, 0x00027a4d}, /* _TKSuBuff */
     4589            {13, 0x00027683}, /* _TKFuBuff */
     4590            {13, 0x0002780d}, /* _TKFuBufLen */
     4591            {13, 0x00036f48}, /* _ldrValidateMteHandle */
     4592            {8 , 0x000072b8}, /* _pTCBCur */
     4593            {8 , 0x000072b4}, /* _pPTDACur */
     4594            {2 , 0x0000f9fc}, /* ptda_start */
     4595            {2 , 0x0000faa2}, /* ptda_environ */
     4596            {2 , 0x0000fed4}, /* ptda_ptdasem */
     4597            {2 , 0x0000ffaa}, /* ptda_module */
     4598            {2 , 0x0000faa4}, /* ptda_pBeginLIBPATH */
     4599            {8 , 0x0000bf0c}, /* _ldrpFileNameBuf */
     4600            {13, 0x000332c3}, /* SecPathFromSFN */
     4601        }
     4602    },
     4603#ifdef ALLKERNELS
     4604    { /* 9033AU.SYM */
     4605        9033, KF_UNI | KF_ALLSTRICT, 16,
     4606        {
     4607            {15, 0x0000a850}, /* _ldrRead */
     4608            {15, 0x00049814}, /* _ldrOpen */
     4609            {15, 0x0004a1b4}, /* _ldrClose */
     4610            {15, 0x0004a204}, /* _LDRQAppType */
     4611            {15, 0x0004771c}, /* _ldrEnum32bitRelRecs */
     4612            {15, 0x00004318}, /* _IOSftOpen */
     4613            {15, 0x000047cc}, /* _IOSftClose */
     4614            {15, 0x00004874}, /* _IOSftTransPath */
     4615            {15, 0x000045ec}, /* _IOSftReadAt */
     4616            {15, 0x000045f3}, /* _IOSftWriteAt */
     4617            {15, 0x0000499c}, /* _SftFileSize */
     4618            {15, 0x000451e0}, /* _VMAllocMem */
     4619            {15, 0x0002358c}, /* _VMGetOwner */
     4620            {15, 0x00053228}, /* g_tkExecPgm */
     4621            {15, 0x0004f97c}, /* _tkStartProcess */
     4622            {11, 0x0000ed2c}, /* f_FuStrLenZ */
     4623            {11, 0x0000ece0}, /* f_FuStrLen */
     4624            {11, 0x0000ee44}, /* f_FuBuff */
     4625            {15, 0x000224cc}, /* _VMObjHandleInfo */
     4626            {15, 0x00053cac}, /* _ldrASMpMTEFromHandle */
     4627            {15, 0x00049a9f}, /* _ldrOpenPath */
     4628            {15, 0x00045bec}, /* _LDRClearSem */
     4629            {15, 0x0004f059}, /* _ldrFindModule */
     4630            {15, 0x0000c1c4}, /* _KSEMRequestMutex */
     4631            {15, 0x0000c2d8}, /* _KSEMReleaseMutex */
     4632            {15, 0x0000c338}, /* _KSEMQueryMutex */
     4633            {15, 0x0000c6bc}, /* _KSEMInit */
     4634            {10, 0x00026ecc}, /* _LdrSem */
     4635            {10, 0x00026f58}, /* _LDRLibPath */
     4636            {15, 0x00030c44}, /* _TKSuBuff */
     4637            {15, 0x00030836}, /* _TKFuBuff */
     4638            {15, 0x00030a02}, /* _TKFuBufLen */
     4639            {15, 0x00045c74}, /* _ldrValidateMteHandle */
     4640            {10, 0x0000b898}, /* _pTCBCur */
     4641            {10, 0x0000b894}, /* _pPTDACur */
     4642            {4 , 0x0000f9f4}, /* ptda_start */
     4643            {4 , 0x0000fa9a}, /* ptda_environ */
     4644            {4 , 0x0000fecc}, /* ptda_ptdasem */
     4645            {4 , 0x0000ffaa}, /* ptda_module */
     4646            {4 , 0x0000fa9c}, /* ptda_pBeginLIBPATH */
     4647            {10, 0x000294bc}, /* _ldrpFileNameBuf */
     4648            {15, 0x000416f7}, /* SecPathFromSFN */
     4649        }
     4650    },
     4651#endif
     4652#ifdef ALLKERNELS
     4653    { /* 9033HU.SYM */
     4654        9033, KF_UNI | KF_HALFSTRICT, 16,
     4655        {
     4656            {15, 0x000098ac}, /* _ldrRead */
     4657            {15, 0x0003bb24}, /* _ldrOpen */
     4658            {15, 0x0003c3b0}, /* _ldrClose */
     4659            {15, 0x0003c400}, /* _LDRQAppType */
     4660            {15, 0x00039d0c}, /* _ldrEnum32bitRelRecs */
     4661            {15, 0x0000390c}, /* _IOSftOpen */
     4662            {15, 0x00003db2}, /* _IOSftClose */
     4663            {15, 0x00003e59}, /* _IOSftTransPath */
     4664            {15, 0x00003bd3}, /* _IOSftReadAt */
     4665            {15, 0x00003bda}, /* _IOSftWriteAt */
     4666            {15, 0x00003f72}, /* _SftFileSize */
     4667            {15, 0x00038058}, /* _VMAllocMem */
     4668            {15, 0x0001de42}, /* _VMGetOwner */
     4669            {15, 0x0004437a}, /* g_tkExecPgm */
     4670            {15, 0x000412f7}, /* _tkStartProcess */
     4671            {11, 0x0000db30}, /* f_FuStrLenZ */
     4672            {11, 0x0000dae6}, /* f_FuStrLen */
     4673            {11, 0x0000dc24}, /* f_FuBuff */
     4674            {15, 0x0001d1a0}, /* _VMObjHandleInfo */
     4675            {15, 0x00044d2c}, /* _ldrASMpMTEFromHandle */
     4676            {15, 0x0003bd9b}, /* _ldrOpenPath */
     4677            {15, 0x000387a0}, /* _LDRClearSem */
     4678            {15, 0x00040a74}, /* _ldrFindModule */
     4679            {15, 0x0000ad68}, /* _KSEMRequestMutex */
     4680            {15, 0x0000ae3f}, /* _KSEMReleaseMutex */
     4681            {15, 0x0000ae6a}, /* _KSEMQueryMutex */
     4682            {15, 0x0000b10a}, /* _KSEMInit */
     4683            {10, 0x0001a578}, /* _LdrSem */
     4684            {10, 0x0001a5f8}, /* _LDRLibPath */
     4685            {15, 0x000287f5}, /* _TKSuBuff */
     4686            {15, 0x0002842b}, /* _TKFuBuff */
     4687            {15, 0x000285b5}, /* _TKFuBufLen */
     4688            {15, 0x000387dc}, /* _ldrValidateMteHandle */
     4689            {10, 0x000072bc}, /* _pTCBCur */
     4690            {10, 0x000072b8}, /* _pPTDACur */
     4691            {4 , 0x0000f9fc}, /* ptda_start */
     4692            {4 , 0x0000faa2}, /* ptda_environ */
     4693            {4 , 0x0000fed4}, /* ptda_ptdasem */
     4694            {4 , 0x0000ffaa}, /* ptda_module */
     4695            {4 , 0x0000faa4}, /* ptda_pBeginLIBPATH */
     4696            {10, 0x0001c0cc}, /* _ldrpFileNameBuf */
     4697            {15, 0x00034b0b}, /* SecPathFromSFN */
     4698        }
     4699    },
     4700#endif
    6554701    { /* 9033RU.SYM */
    656         9033, 'R', TYPE_UNI, 14,
     4702        9033, KF_UNI, 14,
    6574703        {
    6584704            {13, 0x00009824}, /* _ldrRead */
     
    6704716            {13, 0x0001d172}, /* _VMGetOwner */
    6714717            {13, 0x00042c8e}, /* g_tkExecPgm */
    672             {9, 0x0000db30}, /* f_FuStrLenZ */
    673             {9, 0x0000dae6}, /* f_FuStrLen */
    674             {9, 0x0000dc24}, /* f_FuBuff */
    675         }
    676     },
     4718            {13, 0x0003fc27}, /* _tkStartProcess */
     4719            {9 , 0x0000db30}, /* f_FuStrLenZ */
     4720            {9 , 0x0000dae6}, /* f_FuStrLen */
     4721            {9 , 0x0000dc24}, /* f_FuBuff */
     4722            {13, 0x0001c4d0}, /* _VMObjHandleInfo */
     4723            {13, 0x00043640}, /* _ldrASMpMTEFromHandle */
     4724            {13, 0x0003a63f}, /* _ldrOpenPath */
     4725            {13, 0x00037044}, /* _LDRClearSem */
     4726            {13, 0x0003f3a4}, /* _ldrFindModule */
     4727            {13, 0x0000abb8}, /* _KSEMRequestMutex */
     4728            {13, 0x0000ac4b}, /* _KSEMReleaseMutex */
     4729            {13, 0x0000ac76}, /* _KSEMQueryMutex */
     4730            {13, 0x0000ae8b}, /* _KSEMInit */
     4731            {8 , 0x0000a3c0}, /* _LdrSem */
     4732            {8 , 0x0000a440}, /* _LDRLibPath */
     4733            {13, 0x00027b25}, /* _TKSuBuff */
     4734            {13, 0x0002775b}, /* _TKFuBuff */
     4735            {13, 0x000278e5}, /* _TKFuBufLen */
     4736            {13, 0x00037080}, /* _ldrValidateMteHandle */
     4737            {8 , 0x000072bc}, /* _pTCBCur */
     4738            {8 , 0x000072b8}, /* _pPTDACur */
     4739            {2 , 0x0000f9fc}, /* ptda_start */
     4740            {2 , 0x0000faa2}, /* ptda_environ */
     4741            {2 , 0x0000fed4}, /* ptda_ptdasem */
     4742            {2 , 0x0000ffaa}, /* ptda_module */
     4743            {2 , 0x0000faa4}, /* ptda_pBeginLIBPATH */
     4744            {8 , 0x0000bf10}, /* _ldrpFileNameBuf */
     4745            {13, 0x000333af}, /* SecPathFromSFN */
     4746        }
     4747    },
     4748#ifdef ALLKERNELS
     4749    { /* 9034AU.SYM */
     4750        9034, KF_UNI | KF_ALLSTRICT, 16,
     4751        {
     4752            {15, 0x0000a3cc}, /* _ldrRead */
     4753            {15, 0x0004a144}, /* _ldrOpen */
     4754            {15, 0x0004aae8}, /* _ldrClose */
     4755            {15, 0x0004ab38}, /* _LDRQAppType */
     4756            {15, 0x00048048}, /* _ldrEnum32bitRelRecs */
     4757            {15, 0x000044b4}, /* _IOSftOpen */
     4758            {15, 0x00004968}, /* _IOSftClose */
     4759            {15, 0x00004a10}, /* _IOSftTransPath */
     4760            {15, 0x00004788}, /* _IOSftReadAt */
     4761            {15, 0x0000478f}, /* _IOSftWriteAt */
     4762            {15, 0x00004b38}, /* _SftFileSize */
     4763            {15, 0x00045b0c}, /* _VMAllocMem */
     4764            {15, 0x0002399c}, /* _VMGetOwner */
     4765            {15, 0x00053b44}, /* g_tkExecPgm */
     4766            {15, 0x00050264}, /* _tkStartProcess */
     4767            {11, 0x0000ed44}, /* f_FuStrLenZ */
     4768            {11, 0x0000ecf8}, /* f_FuStrLen */
     4769            {11, 0x0000ee5c}, /* f_FuBuff */
     4770            {15, 0x000228dc}, /* _VMObjHandleInfo */
     4771            {15, 0x000545dc}, /* _ldrASMpMTEFromHandle */
     4772            {15, 0x0004a3cf}, /* _ldrOpenPath */
     4773            {15, 0x00046518}, /* _LDRClearSem */
     4774            {15, 0x0004f950}, /* _ldrFindModule */
     4775            {15, 0x0000bcfc}, /* _KSEMRequestMutex */
     4776            {15, 0x0000be10}, /* _KSEMReleaseMutex */
     4777            {15, 0x0000be70}, /* _KSEMQueryMutex */
     4778            {15, 0x0000c1f4}, /* _KSEMInit */
     4779            {10, 0x00027160}, /* _LdrSem */
     4780            {10, 0x000271ec}, /* _LDRLibPath */
     4781            {15, 0x00031014}, /* _TKSuBuff */
     4782            {15, 0x00030c04}, /* _TKFuBuff */
     4783            {15, 0x00030dd0}, /* _TKFuBufLen */
     4784            {15, 0x000465a0}, /* _ldrValidateMteHandle */
     4785            {10, 0x0000b9b0}, /* _pTCBCur */
     4786            {10, 0x0000b9ac}, /* _pPTDACur */
     4787            {4 , 0x0000f9f4}, /* ptda_start */
     4788            {4 , 0x0000fa9a}, /* ptda_environ */
     4789            {4 , 0x0000fecc}, /* ptda_ptdasem */
     4790            {4 , 0x0000ffaa}, /* ptda_module */
     4791            {4 , 0x0000fa9c}, /* ptda_pBeginLIBPATH */
     4792            {10, 0x0002978c}, /* _ldrpFileNameBuf */
     4793            {15, 0x00041d7e}, /* SecPathFromSFN */
     4794        }
     4795    },
     4796#endif
     4797#ifdef ALLKERNELS
     4798    { /* 9034HU.SYM */
     4799        9034, KF_UNI | KF_HALFSTRICT, 16,
     4800        {
     4801            {15, 0x000093fc}, /* _ldrRead */
     4802            {15, 0x0003be50}, /* _ldrOpen */
     4803            {15, 0x0003c6dc}, /* _ldrClose */
     4804            {15, 0x0003c72c}, /* _LDRQAppType */
     4805            {15, 0x0003a034}, /* _ldrEnum32bitRelRecs */
     4806            {15, 0x00003a30}, /* _IOSftOpen */
     4807            {15, 0x00003ed6}, /* _IOSftClose */
     4808            {15, 0x00003f7d}, /* _IOSftTransPath */
     4809            {15, 0x00003cf7}, /* _IOSftReadAt */
     4810            {15, 0x00003cfe}, /* _IOSftWriteAt */
     4811            {15, 0x00004096}, /* _SftFileSize */
     4812            {15, 0x00038380}, /* _VMAllocMem */
     4813            {15, 0x0001e136}, /* _VMGetOwner */
     4814            {15, 0x0004476a}, /* g_tkExecPgm */
     4815            {15, 0x000416e7}, /* _tkStartProcess */
     4816            {11, 0x0000db44}, /* f_FuStrLenZ */
     4817            {11, 0x0000dafa}, /* f_FuStrLen */
     4818            {11, 0x0000dc38}, /* f_FuBuff */
     4819            {15, 0x0001d494}, /* _VMObjHandleInfo */
     4820            {15, 0x00045130}, /* _ldrASMpMTEFromHandle */
     4821            {15, 0x0003c0c7}, /* _ldrOpenPath */
     4822            {15, 0x00038ac8}, /* _LDRClearSem */
     4823            {15, 0x00040e74}, /* _ldrFindModule */
     4824            {15, 0x0000a874}, /* _KSEMRequestMutex */
     4825            {15, 0x0000a94b}, /* _KSEMReleaseMutex */
     4826            {15, 0x0000a976}, /* _KSEMQueryMutex */
     4827            {15, 0x0000ac16}, /* _KSEMInit */
     4828            {10, 0x0001a5bc}, /* _LdrSem */
     4829            {10, 0x0001a63c}, /* _LDRLibPath */
     4830            {15, 0x00028aa1}, /* _TKSuBuff */
     4831            {15, 0x000286d7}, /* _TKFuBuff */
     4832            {15, 0x00028861}, /* _TKFuBufLen */
     4833            {15, 0x00038b04}, /* _ldrValidateMteHandle */
     4834            {10, 0x000072dc}, /* _pTCBCur */
     4835            {10, 0x000072d8}, /* _pPTDACur */
     4836            {4 , 0x0000f9fc}, /* ptda_start */
     4837            {4 , 0x0000faa2}, /* ptda_environ */
     4838            {4 , 0x0000fed4}, /* ptda_ptdasem */
     4839            {4 , 0x0000ffaa}, /* ptda_module */
     4840            {4 , 0x0000faa4}, /* ptda_pBeginLIBPATH */
     4841            {10, 0x0001c148}, /* _ldrpFileNameBuf */
     4842            {15, 0x00034f09}, /* SecPathFromSFN */
     4843        }
     4844    },
     4845#endif
    6774846    { /* 9034RU.SYM */
    678         9034, 'R', TYPE_UNI, 14,
     4847        9034, KF_UNI, 14,
    6794848        {
    6804849            {13, 0x00009368}, /* _ldrRead */
     
    6924861            {13, 0x0001d2fa}, /* _VMGetOwner */
    6934862            {13, 0x00042fda}, /* g_tkExecPgm */
    694             {9, 0x0000db44}, /* f_FuStrLenZ */
    695             {9, 0x0000dafa}, /* f_FuStrLen */
    696             {9, 0x0000dc38}, /* f_FuBuff */
    697         }
    698     },
     4863            {13, 0x0003ff73}, /* _tkStartProcess */
     4864            {9 , 0x0000db44}, /* f_FuStrLenZ */
     4865            {9 , 0x0000dafa}, /* f_FuStrLen */
     4866            {9 , 0x0000dc38}, /* f_FuBuff */
     4867            {13, 0x0001c658}, /* _VMObjHandleInfo */
     4868            {13, 0x000439a0}, /* _ldrASMpMTEFromHandle */
     4869            {13, 0x0003a977}, /* _ldrOpenPath */
     4870            {13, 0x00037374}, /* _LDRClearSem */
     4871            {13, 0x0003f700}, /* _ldrFindModule */
     4872            {13, 0x0000a6b8}, /* _KSEMRequestMutex */
     4873            {13, 0x0000a74b}, /* _KSEMReleaseMutex */
     4874            {13, 0x0000a776}, /* _KSEMQueryMutex */
     4875            {13, 0x0000a98b}, /* _KSEMInit */
     4876            {8 , 0x0000a404}, /* _LdrSem */
     4877            {8 , 0x0000a484}, /* _LDRLibPath */
     4878            {13, 0x00027c65}, /* _TKSuBuff */
     4879            {13, 0x0002789b}, /* _TKFuBuff */
     4880            {13, 0x00027a25}, /* _TKFuBufLen */
     4881            {13, 0x000373b0}, /* _ldrValidateMteHandle */
     4882            {8 , 0x000072dc}, /* _pTCBCur */
     4883            {8 , 0x000072d8}, /* _pPTDACur */
     4884            {2 , 0x0000f9fc}, /* ptda_start */
     4885            {2 , 0x0000faa2}, /* ptda_environ */
     4886            {2 , 0x0000fed4}, /* ptda_ptdasem */
     4887            {2 , 0x0000ffaa}, /* ptda_module */
     4888            {2 , 0x0000faa4}, /* ptda_pBeginLIBPATH */
     4889            {8 , 0x0000bf8c}, /* _ldrpFileNameBuf */
     4890            {13, 0x000337b5}, /* SecPathFromSFN */
     4891        }
     4892    },
     4893#ifdef ALLKERNELS
     4894    { /* 9035AU.SYM */
     4895        9035, KF_UNI | KF_ALLSTRICT, 16,
     4896        {
     4897            {15, 0x0000a3cc}, /* _ldrRead */
     4898            {15, 0x00049cf0}, /* _ldrOpen */
     4899            {15, 0x0004a68c}, /* _ldrClose */
     4900            {15, 0x0004a6dc}, /* _LDRQAppType */
     4901            {15, 0x00047c08}, /* _ldrEnum32bitRelRecs */
     4902            {15, 0x000044b4}, /* _IOSftOpen */
     4903            {15, 0x00004968}, /* _IOSftClose */
     4904            {15, 0x00004a10}, /* _IOSftTransPath */
     4905            {15, 0x00004788}, /* _IOSftReadAt */
     4906            {15, 0x0000478f}, /* _IOSftWriteAt */
     4907            {15, 0x00004b38}, /* _SftFileSize */
     4908            {15, 0x000456cc}, /* _VMAllocMem */
     4909            {15, 0x000237ac}, /* _VMGetOwner */
     4910            {15, 0x00053758}, /* g_tkExecPgm */
     4911            {15, 0x0004feb0}, /* _tkStartProcess */
     4912            {11, 0x0000ed44}, /* f_FuStrLenZ */
     4913            {11, 0x0000ecf8}, /* f_FuStrLen */
     4914            {11, 0x0000ee5c}, /* f_FuBuff */
     4915            {15, 0x000226ec}, /* _VMObjHandleInfo */
     4916            {15, 0x000541f0}, /* _ldrASMpMTEFromHandle */
     4917            {15, 0x00049f7b}, /* _ldrOpenPath */
     4918            {15, 0x000460d8}, /* _LDRClearSem */
     4919            {15, 0x0004f59c}, /* _ldrFindModule */
     4920            {15, 0x0000bcfc}, /* _KSEMRequestMutex */
     4921            {15, 0x0000be10}, /* _KSEMReleaseMutex */
     4922            {15, 0x0000be70}, /* _KSEMQueryMutex */
     4923            {15, 0x0000c1f4}, /* _KSEMInit */
     4924            {10, 0x00027164}, /* _LdrSem */
     4925            {10, 0x000271f0}, /* _LDRLibPath */
     4926            {15, 0x00030e3c}, /* _TKSuBuff */
     4927            {15, 0x00030a2c}, /* _TKFuBuff */
     4928            {15, 0x00030bf8}, /* _TKFuBufLen */
     4929            {15, 0x00046160}, /* _ldrValidateMteHandle */
     4930            {10, 0x0000b9b0}, /* _pTCBCur */
     4931            {10, 0x0000b9ac}, /* _pPTDACur */
     4932            {4 , 0x0000f9f4}, /* ptda_start */
     4933            {4 , 0x0000fa9a}, /* ptda_environ */
     4934            {4 , 0x0000fecc}, /* ptda_ptdasem */
     4935            {4 , 0x0000ffaa}, /* ptda_module */
     4936            {4 , 0x0000fa9c}, /* ptda_pBeginLIBPATH */
     4937            {10, 0x00029790}, /* _ldrpFileNameBuf */
     4938            {15, 0x00041af0}, /* SecPathFromSFN */
     4939        }
     4940    },
     4941#endif
     4942#ifdef ALLKERNELS
     4943    { /* 9035HU.SYM */
     4944        9035, KF_UNI | KF_HALFSTRICT, 16,
     4945        {
     4946            {15, 0x000093fc}, /* _ldrRead */
     4947            {15, 0x0003c0b4}, /* _ldrOpen */
     4948            {15, 0x0003c938}, /* _ldrClose */
     4949            {15, 0x0003c988}, /* _LDRQAppType */
     4950            {15, 0x0003a2ac}, /* _ldrEnum32bitRelRecs */
     4951            {15, 0x00003a30}, /* _IOSftOpen */
     4952            {15, 0x00003ed6}, /* _IOSftClose */
     4953            {15, 0x00003f7d}, /* _IOSftTransPath */
     4954            {15, 0x00003cf7}, /* _IOSftReadAt */
     4955            {15, 0x00003cfe}, /* _IOSftWriteAt */
     4956            {15, 0x00004096}, /* _SftFileSize */
     4957            {15, 0x000385f8}, /* _VMAllocMem */
     4958            {15, 0x0001e272}, /* _VMGetOwner */
     4959            {15, 0x00044a1e}, /* g_tkExecPgm */
     4960            {15, 0x00041997}, /* _tkStartProcess */
     4961            {11, 0x0000db44}, /* f_FuStrLenZ */
     4962            {11, 0x0000dafa}, /* f_FuStrLen */
     4963            {11, 0x0000dc38}, /* f_FuBuff */
     4964            {15, 0x0001d5d0}, /* _VMObjHandleInfo */
     4965            {15, 0x000453e4}, /* _ldrASMpMTEFromHandle */
     4966            {15, 0x0003c32b}, /* _ldrOpenPath */
     4967            {15, 0x00038d40}, /* _LDRClearSem */
     4968            {15, 0x00041124}, /* _ldrFindModule */
     4969            {15, 0x0000a874}, /* _KSEMRequestMutex */
     4970            {15, 0x0000a94b}, /* _KSEMReleaseMutex */
     4971            {15, 0x0000a976}, /* _KSEMQueryMutex */
     4972            {15, 0x0000ac16}, /* _KSEMInit */
     4973            {10, 0x0001a5bc}, /* _LdrSem */
     4974            {10, 0x0001a63c}, /* _LDRLibPath */
     4975            {15, 0x00028be9}, /* _TKSuBuff */
     4976            {15, 0x0002881f}, /* _TKFuBuff */
     4977            {15, 0x000289a9}, /* _TKFuBufLen */
     4978            {15, 0x00038d7c}, /* _ldrValidateMteHandle */
     4979            {10, 0x000072dc}, /* _pTCBCur */
     4980            {10, 0x000072d8}, /* _pPTDACur */
     4981            {4 , 0x0000f9fc}, /* ptda_start */
     4982            {4 , 0x0000faa2}, /* ptda_environ */
     4983            {4 , 0x0000fed4}, /* ptda_ptdasem */
     4984            {4 , 0x0000ffaa}, /* ptda_module */
     4985            {4 , 0x0000faa4}, /* ptda_pBeginLIBPATH */
     4986            {10, 0x0001c148}, /* _ldrpFileNameBuf */
     4987            {15, 0x000350b6}, /* SecPathFromSFN */
     4988        }
     4989    },
     4990#endif
    6994991    { /* 9035RU.SYM */
    700         9035, 'R', TYPE_UNI, 14,
     4992        9035, KF_UNI, 14,
    7014993        {
    7024994            {13, 0x00009368}, /* _ldrRead */
     
    7145006            {13, 0x0001d436}, /* _VMGetOwner */
    7155007            {13, 0x0004324e}, /* g_tkExecPgm */
    716             {9, 0x0000db44}, /* f_FuStrLenZ */
    717             {9, 0x0000dafa}, /* f_FuStrLen */
    718             {9, 0x0000dc38}, /* f_FuBuff */
    719         }
    720     },
     5008            {13, 0x000401eb}, /* _tkStartProcess */
     5009            {9 , 0x0000db44}, /* f_FuStrLenZ */
     5010            {9 , 0x0000dafa}, /* f_FuStrLen */
     5011            {9 , 0x0000dc38}, /* f_FuBuff */
     5012            {13, 0x0001c794}, /* _VMObjHandleInfo */
     5013            {13, 0x00043c14}, /* _ldrASMpMTEFromHandle */
     5014            {13, 0x0003abdb}, /* _ldrOpenPath */
     5015            {13, 0x000375ec}, /* _LDRClearSem */
     5016            {13, 0x0003f977}, /* _ldrFindModule */
     5017            {13, 0x0000a6b8}, /* _KSEMRequestMutex */
     5018            {13, 0x0000a74b}, /* _KSEMReleaseMutex */
     5019            {13, 0x0000a776}, /* _KSEMQueryMutex */
     5020            {13, 0x0000a98b}, /* _KSEMInit */
     5021            {8 , 0x0000a404}, /* _LdrSem */
     5022            {8 , 0x0000a484}, /* _LDRLibPath */
     5023            {13, 0x00027dad}, /* _TKSuBuff */
     5024            {13, 0x000279e3}, /* _TKFuBuff */
     5025            {13, 0x00027b6d}, /* _TKFuBufLen */
     5026            {13, 0x00037628}, /* _ldrValidateMteHandle */
     5027            {8 , 0x000072dc}, /* _pTCBCur */
     5028            {8 , 0x000072d8}, /* _pPTDACur */
     5029            {2 , 0x0000f9fc}, /* ptda_start */
     5030            {2 , 0x0000faa2}, /* ptda_environ */
     5031            {2 , 0x0000fed4}, /* ptda_ptdasem */
     5032            {2 , 0x0000ffaa}, /* ptda_module */
     5033            {2 , 0x0000faa4}, /* ptda_pBeginLIBPATH */
     5034            {8 , 0x0000bf8c}, /* _ldrpFileNameBuf */
     5035            {13, 0x00033962}, /* SecPathFromSFN */
     5036        }
     5037    },
     5038#ifdef ALLKERNELS
     5039    { /* 9036AU.SYM */
     5040        9036, KF_UNI | KF_ALLSTRICT, 16,
     5041        {
     5042            {15, 0x0000a444}, /* _ldrRead */
     5043            {15, 0x00049f78}, /* _ldrOpen */
     5044            {15, 0x0004a914}, /* _ldrClose */
     5045            {15, 0x0004a964}, /* _LDRQAppType */
     5046            {15, 0x00047e84}, /* _ldrEnum32bitRelRecs */
     5047            {15, 0x0000452c}, /* _IOSftOpen */
     5048            {15, 0x000049e0}, /* _IOSftClose */
     5049            {15, 0x00004a88}, /* _IOSftTransPath */
     5050            {15, 0x00004800}, /* _IOSftReadAt */
     5051            {15, 0x00004807}, /* _IOSftWriteAt */
     5052            {15, 0x00004bb0}, /* _SftFileSize */
     5053            {15, 0x00045948}, /* _VMAllocMem */
     5054            {15, 0x00023814}, /* _VMGetOwner */
     5055            {15, 0x00053a98}, /* g_tkExecPgm */
     5056            {15, 0x00050188}, /* _tkStartProcess */
     5057            {11, 0x0000ed84}, /* f_FuStrLenZ */
     5058            {11, 0x0000ed38}, /* f_FuStrLen */
     5059            {11, 0x0000ee9c}, /* f_FuBuff */
     5060            {15, 0x00022754}, /* _VMObjHandleInfo */
     5061            {15, 0x00054560}, /* _ldrASMpMTEFromHandle */
     5062            {15, 0x0004a203}, /* _ldrOpenPath */
     5063            {15, 0x00046354}, /* _LDRClearSem */
     5064            {15, 0x0004f873}, /* _ldrFindModule */
     5065            {15, 0x0000bd6c}, /* _KSEMRequestMutex */
     5066            {15, 0x0000be80}, /* _KSEMReleaseMutex */
     5067            {15, 0x0000bee0}, /* _KSEMQueryMutex */
     5068            {15, 0x0000c264}, /* _KSEMInit */
     5069            {10, 0x000272f4}, /* _LdrSem */
     5070            {10, 0x00027380}, /* _LDRLibPath */
     5071            {15, 0x00030eb8}, /* _TKSuBuff */
     5072            {15, 0x00030aa8}, /* _TKFuBuff */
     5073            {15, 0x00030c74}, /* _TKFuBufLen */
     5074            {15, 0x000463dc}, /* _ldrValidateMteHandle */
     5075            {10, 0x0000bab8}, /* _pTCBCur */
     5076            {10, 0x0000bab4}, /* _pPTDACur */
     5077            {4 , 0x0000f9e8}, /* ptda_start */
     5078            {4 , 0x0000fa9a}, /* ptda_environ */
     5079            {4 , 0x0000fecc}, /* ptda_ptdasem */
     5080            {4 , 0x0000ffaa}, /* ptda_module */
     5081            {4 , 0x0000fa9c}, /* ptda_pBeginLIBPATH */
     5082            {10, 0x00029920}, /* _ldrpFileNameBuf */
     5083            {15, 0x00041d19}, /* SecPathFromSFN */
     5084        }
     5085    },
     5086#endif
     5087#ifdef ALLKERNELS
     5088    { /* 9036HU.SYM */
     5089        9036, KF_UNI | KF_HALFSTRICT, 16,
     5090        {
     5091            {15, 0x00009448}, /* _ldrRead */
     5092            {15, 0x0003c2d4}, /* _ldrOpen */
     5093            {15, 0x0003cb58}, /* _ldrClose */
     5094            {15, 0x0003cba8}, /* _LDRQAppType */
     5095            {15, 0x0003a4b8}, /* _ldrEnum32bitRelRecs */
     5096            {15, 0x00003a7c}, /* _IOSftOpen */
     5097            {15, 0x00003f22}, /* _IOSftClose */
     5098            {15, 0x00003fc9}, /* _IOSftTransPath */
     5099            {15, 0x00003d43}, /* _IOSftReadAt */
     5100            {15, 0x00003d4a}, /* _IOSftWriteAt */
     5101            {15, 0x000040e2}, /* _SftFileSize */
     5102            {15, 0x00038804}, /* _VMAllocMem */
     5103            {15, 0x0001e31a}, /* _VMGetOwner */
     5104            {15, 0x00044cea}, /* g_tkExecPgm */
     5105            {15, 0x00041bf3}, /* _tkStartProcess */
     5106            {11, 0x0000db94}, /* f_FuStrLenZ */
     5107            {11, 0x0000db4a}, /* f_FuStrLen */
     5108            {11, 0x0000dc88}, /* f_FuBuff */
     5109            {15, 0x0001d678}, /* _VMObjHandleInfo */
     5110            {15, 0x000456e0}, /* _ldrASMpMTEFromHandle */
     5111            {15, 0x0003c54b}, /* _ldrOpenPath */
     5112            {15, 0x00038f4c}, /* _LDRClearSem */
     5113            {15, 0x0004137f}, /* _ldrFindModule */
     5114            {15, 0x0000a8b4}, /* _KSEMRequestMutex */
     5115            {15, 0x0000a98b}, /* _KSEMReleaseMutex */
     5116            {15, 0x0000a9b6}, /* _KSEMQueryMutex */
     5117            {15, 0x0000ac56}, /* _KSEMInit */
     5118            {10, 0x0001a5f0}, /* _LdrSem */
     5119            {10, 0x0001a670}, /* _LDRLibPath */
     5120            {15, 0x00028c99}, /* _TKSuBuff */
     5121            {15, 0x000288cf}, /* _TKFuBuff */
     5122            {15, 0x00028a59}, /* _TKFuBufLen */
     5123            {15, 0x00038f88}, /* _ldrValidateMteHandle */
     5124            {10, 0x000072fc}, /* _pTCBCur */
     5125            {10, 0x000072f8}, /* _pPTDACur */
     5126            {4 , 0x0000f9f0}, /* ptda_start */
     5127            {4 , 0x0000faa2}, /* ptda_environ */
     5128            {4 , 0x0000fed4}, /* ptda_ptdasem */
     5129            {4 , 0x0000ffaa}, /* ptda_module */
     5130            {4 , 0x0000faa4}, /* ptda_pBeginLIBPATH */
     5131            {10, 0x0001c17c}, /* _ldrpFileNameBuf */
     5132            {15, 0x00035319}, /* SecPathFromSFN */
     5133        }
     5134    },
     5135#endif
    7215136    { /* 9036RU.SYM */
    722         9036, 'R', TYPE_UNI, 14,
     5137        9036, KF_UNI, 14,
    7235138        {
    7245139            {13, 0x000093b4}, /* _ldrRead */
     
    7365151            {13, 0x0001d4ee}, /* _VMGetOwner */
    7375152            {13, 0x0004359e}, /* g_tkExecPgm */
    738             {9, 0x0000db94}, /* f_FuStrLenZ */
    739             {9, 0x0000db4a}, /* f_FuStrLen */
    740             {9, 0x0000dc88}, /* f_FuBuff */
     5153            {13, 0x000404c7}, /* _tkStartProcess */
     5154            {9 , 0x0000db94}, /* f_FuStrLenZ */
     5155            {9 , 0x0000db4a}, /* f_FuStrLen */
     5156            {9 , 0x0000dc88}, /* f_FuBuff */
     5157            {13, 0x0001c84c}, /* _VMObjHandleInfo */
     5158            {13, 0x00043f94}, /* _ldrASMpMTEFromHandle */
     5159            {13, 0x0003ae03}, /* _ldrOpenPath */
     5160            {13, 0x00037800}, /* _LDRClearSem */
     5161            {13, 0x0003fc54}, /* _ldrFindModule */
     5162            {13, 0x0000a708}, /* _KSEMRequestMutex */
     5163            {13, 0x0000a79b}, /* _KSEMReleaseMutex */
     5164            {13, 0x0000a7c6}, /* _KSEMQueryMutex */
     5165            {13, 0x0000a9db}, /* _KSEMInit */
     5166            {8 , 0x0000a438}, /* _LdrSem */
     5167            {8 , 0x0000a4b8}, /* _LDRLibPath */
     5168            {13, 0x00027e6d}, /* _TKSuBuff */
     5169            {13, 0x00027aa3}, /* _TKFuBuff */
     5170            {13, 0x00027c2d}, /* _TKFuBufLen */
     5171            {13, 0x0003783c}, /* _ldrValidateMteHandle */
     5172            {8 , 0x000072fc}, /* _pTCBCur */
     5173            {8 , 0x000072f8}, /* _pPTDACur */
     5174            {2 , 0x0000f9f0}, /* ptda_start */
     5175            {2 , 0x0000faa2}, /* ptda_environ */
     5176            {2 , 0x0000fed4}, /* ptda_ptdasem */
     5177            {2 , 0x0000ffaa}, /* ptda_module */
     5178            {2 , 0x0000faa4}, /* ptda_pBeginLIBPATH */
     5179            {8 , 0x0000bfc0}, /* _ldrpFileNameBuf */
     5180            {13, 0x00033bcd}, /* SecPathFromSFN */
    7415181        }
    7425182    },
    7435183    { /* Terminating entry */
    744         0,0,0,0,
     5184        0,0,0,
    7455185        {
    7465186            {0,0},
     
    7615201            {0,0},
    7625202            {0,0},
     5203            {0,0},
     5204            {0,0},
     5205            {0,0},
     5206            {0,0},
     5207            {0,0},
     5208            {0,0},
     5209            {0,0},
     5210            {0,0},
     5211            {0,0},
     5212            {0,0},
     5213            {0,0},
     5214            {0,0},
     5215            {0,0},
     5216            {0,0},
     5217            {0,0},
     5218            {0,0},
     5219            {0,0},
     5220            {0,0},
     5221            {0,0},
     5222            {0,0},
     5223            {0,0},
     5224            {0,0},
     5225            {0,0},
     5226            {0,0},
     5227            {0,0},
    7635228        }
    7645229    }
  • trunk/src/win32k/dev16/d16globl.c

    r2898 r4164  
    1 /* $Id: d16globl.c,v 1.1 2000-02-25 18:19:24 bird Exp $
     1/* $Id: d16globl.c,v 1.2 2000-09-02 21:07:55 bird Exp $
    22 *
    33 * d16globals - global data (16-bit)
     
    1818*******************************************************************************/
    1919#include <os2.h>
     20#include "devSegDf.h"
    2021#include "options.h"
    2122#include "log.h"
     23
    2224
    2325/*******************************************************************************
     
    2729/* Note: All global variables must be initialized!  *
    2830 *       Uninitialized variables ends up in DATA32. */
     31PFN         Device_Help = NULL;
     32ULONG       TKSSBase16  = 0;
     33USHORT      R0FlatCS16  = 0;
     34USHORT      R0FlatDS16  = 0;
     35BOOL        fInitTime   = TRUE;
     36struct options
     37            DATA16_GLOBAL options = DEFAULT_OPTION_ASSIGMENTS;
    2938
    30 PFN     Device_Help = NULL;
    31 ULONG   TKSSBase16  = 0;
    32 USHORT  R0FlatCS16  = 0;
    33 USHORT  R0FlatDS16  = 0;
    34 BOOL    fInitTime   = TRUE;
     39CHAR        szBuildDate[] = {__DATE__};
     40CHAR        szBuildTime[] = {__TIME__};
    3541
    36 struct options  options = DEFAULT_OPTION_ASSIGMENTS;
    37 
  • trunk/src/win32k/dev16/d16init.c

    r2898 r4164  
    1 /* $Id: d16init.c,v 1.6 2000-02-25 18:15:02 bird Exp $
     1/* $Id: d16init.c,v 1.7 2000-09-02 21:07:55 bird Exp $
    22 *
    33 * d16init - init routines for both drivers.
     
    66 *            compleated. CodeEnd and DataEnd should not be set here.?
    77 *
    8  * Copyright (c) 1999 knut st. osmundsen
     8 * Copyright (c) 1999-2000 knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    99 *
    1010 * Project Odin Software License can be found in LICENSE.TXT
     
    3636#include <memory.h>
    3737
     38#include "devSegDf.h"
     39#undef  DATA16_INIT
     40#define DATA16_INIT
     41#undef  CODE16_INIT
     42#define CODE16_INIT
    3843#include "probkrnl.h"
    3944#include "dev1632.h"
    4045#include "dev16.h"
     46#include "vprntf16.h"
     47#include "log.h"
     48#include "options.h"
     49
     50
    4151
    4252/**
     
    5161USHORT NEAR dev0Init(PRPINITIN pRpIn, PRPINITOUT pRpOut)
    5262{
     63    APIRET  rc;
    5364    Device_Help = pRpIn->DevHlpEP;
    5465
     66    /*
     67     * Does this work at Ring-3 (inittime)?
     68     * If this work we could be saved from throuble!
     69     */
     70    rc = initGetDosTableData();
     71    if (rc != NO_ERROR)
     72        printf16("win32k - elf$: initGetDosTableData failed with rc=%d\n", rc);
     73
    5574    pRpOut->BPBArray = NULL;
    56     pRpOut->CodeEnd  = (USHORT)&CODE16END;
    57     pRpOut->DataEnd  = (USHORT)&DATA16END;
     75    pRpOut->CodeEnd = (USHORT)&CODE16_INITSTART;
     76    pRpOut->DataEnd = (USHORT)&DATA16_INITSTART;
    5877    pRpOut->Unit     = 0;
    5978    pRpOut->rph.Status = STATUS_DONE;
     
    8099    NPSZ            npszErrMsg = NULL;
    81100
     101    /*
     102     * Probe kernel data.
     103     */
    82104    rc = ProbeKernel(pRpIn);
    83105    if (rc == NO_ERROR)
    84106    {
     107        /*
     108         * Open and send a Ring-0 init packet to elf$.
     109         * If this succeeds win32k$ init succeeds.
     110         */
    85111        rc = DosOpen("\\dev\\elf$", &hDev0, &usAction, 0UL, FILE_NORMAL,
    86112                     OPEN_ACTION_FAIL_IF_NEW | OPEN_ACTION_OPEN_IF_EXISTS,
     
    93119            if (rc == NO_ERROR)
    94120            {
    95                 if (data.Status != STATUS_DONE)
    96                     npszErrMsg = "Ring-0 initiation failed\n\r";
     121                if ((rc = data.Status) == STATUS_DONE)
     122                {
     123                    if (!options.fQuiet)
     124                        printf16("Win32k.sys succesfully initiated!\n");
     125                    pRpOut->Status = pRpOut->rph.Status = data.Status;
     126                }
    97127                else
    98                 {
    99                     /* FIXME quiet test! */
    100                     register NPSZ npsz = "Win32k.sys succesfully initiated!\n\r";
    101                     DosPutMessage(1, strlen(npsz)+1, npsz);
    102                     pRpOut->Status = data.Status;
    103                 }
     128                    npszErrMsg = "Ring-0 initiation failed. rc=%d\n";
    104129            }
    105130            else
    106             {
    107                 APIRET rc2 = rc;
    108                 NPSZ   npsz;
    109                             /*0123456789012345678901234567890 1*/
    110                 npszErrMsg = "DosDevIOCtl failed. rc=       \n\r";
    111 
    112                 npsz  = &npszErrMsg[29];
    113                 do
    114                 {
    115                     *npsz-- = (char)((rc2 % 10) + '0');
    116                     rc2 = rc2/10;
    117                 } while (rc2 > 0);
    118             }
    119 
     131                npszErrMsg = "Ring-0 init: DosDevIOCtl failed. rc=%d\n";
    120132            DosClose(hDev0);
    121133        }
    122134        else
    123             npszErrMsg = "DosOpen failed.\n\r";
     135            npszErrMsg = "Ring-0 init: DosOpen failed. rc=%d\n";
    124136    }
    125137    else
    126         npszErrMsg = "ProbeKernel failed.\n\r";
    127     pRpOut->BPBArray = NULL;
    128     pRpOut->CodeEnd = (USHORT)&CODE16END;
    129     pRpOut->DataEnd = (USHORT)&DATA16END;
     138        npszErrMsg = ""; /* ProbeKrnl do its own complaining, but we need something here to indicate failure. */
     139
     140    /*
     141     * Fill return data.
     142     */
     143    pRpOut->CodeEnd = (USHORT)&CODE16_INITSTART;
     144    pRpOut->DataEnd = (USHORT)&DATA16_INITSTART;
     145    pRpOut->BPBArray= NULL;
    130146    pRpOut->Unit    = 0;
    131147
     148    /*
     149     * Any errors?, if so complain!
     150     */
    132151    if (npszErrMsg)
    133152    {
    134         DosPutMessage(1, strlen(npszErrMsg) + 1, npszErrMsg);
    135         return pRpOut->rph.Status = STATUS_DONE | STERR | ERROR_I24_QUIET_INIT_FAIL;
    136     }
    137 
     153        printf16(npszErrMsg, rc);
     154        pRpOut->Status = pRpOut->rph.Status = STATUS_DONE | STERR | ERROR_I24_QUIET_INIT_FAIL;
     155    }
     156
     157    /* Init is completed. */
     158    fInitTime = FALSE;
     159
     160    /* successful return */
    138161    return pRpOut->rph.Status;
    139162}
     
    142165
    143166/**
    144  * R0 16-bit initiation function.
     167 * R0 16-bit initiation.
    145168 * This gets TKSSBase, thunks parameters and calls R0 32-bit initiation function.
    146169 * @returns   Status word.
    147170 * @param     pRp  Generic IO Control request packet.
    148171 */
    149 USHORT NEAR R0Init16(PRP_GENIOCTL pRp)
     172USHORT NEAR  R0Init16(PRP_GENIOCTL pRp)
    150173{
    151174    USHORT usRc = STATUS_DONE;
     
    162185        ULONG ulLinData;
    163186
     187        /*
     188         * Thunk the request packet and lock userdata.
     189         */
    164190        if (!DevHelp_VirtToLin(SELECTOROF(pRp->ParmPacket), OFFSETOF(pRp->ParmPacket), &ulLinParm)
    165191            &&
     
    175201                                (LIN)~0UL, SSToDS_16(&hLockData[0]), &cPages)
    176202                )
    177             {   /* data and param is locked (do we need to lock the request packet too ?). */
    178                 /* create new 32-bit packet */
     203            {
     204                /*
     205                 * -data and param is locked (do we need to lock the request packet too ?).-
     206                 * Create new 32-bit init packet - Parameter pointer is thunked.
     207                 */
    179208                RP32INIT rp32init;
    180209
     
    191220                ((PD16R0INITDATA)pRp->DataPacket)->Status = usRc;
    192221
    193                 /* finished - unlock data and parm */
     222                /*
     223                 * finished - unlock data and parm
     224                 */
    194225                DevHelp_VMUnLock((LIN)SSToDS_16(&hLockParm[0]));
    195226                DevHelp_VMUnLock((LIN)SSToDS_16(&hLockData[0]));
     
    204235        usRc |= ERROR_I24_GEN_FAILURE;
    205236
    206 
    207     #if 0
    208     rc = DevHelp_VMLock(VMDHL_LONG | VMDHL_WRITE | VMDHL_VERIFY,
    209                         &DATA32START,
    210                         (ULONG)(&end) - (ULONG)&DATA32START),
    211                         (void*)-1,
    212                         &lock[0],
    213                         &cPages);
    214 
    215     rc = DevHelp_VMLock(VMDHL_LONG | VMDHL_VERIFY,
    216                         &CODE32START,
    217                         (ULONG)(&CODE32END) - (ULONG)&CODE32START),
    218                         (void*)-1,
    219                         &lock[0],
    220                         &cPages);
    221     #endif
    222 
    223237    return usRc;
    224238}
     
    235249 *            After R0Init16 is called TKSSBase16 _is_ set.
    236250 *            IMPORTANT! This function must _not_ be called after the initiation of the second device driver!!!
    237  */
    238 USHORT NEAR initGetDosTableData(void)
     251 *                       (Since this is init code not present after init...)
     252 */
     253USHORT NEAR  initGetDosTableData(void)
    239254{
    240255    APIRET     rc;
     
    244259    if (TKSSBase16 != 0)
    245260        return NO_ERROR;
     261    /*
     262    _asm {
     263        int 3;
     264    }
     265    */
    246266
    247267    /* First we're to get the DosTable2 stuff. */
  • trunk/src/win32k/dev16/d16strat.c

    r2898 r4164  
    1 /* $Id: d16strat.c,v 1.8 2000-02-25 18:15:02 bird Exp $
     1/* $Id: d16strat.c,v 1.9 2000-09-02 21:07:56 bird Exp $
    22 *
    33 * d16strat.c - 16-bit strategy routine, device headers, device_helper (ptr)
     
    1515#define INCL_DOSERRORS
    1616#define INCL_NOPMAPI
     17
     18#define NO_WIN32K_LIB_FUNCTIONS
    1719
    1820/*******************************************************************************
     
    2830/* Note that C-library function are only allowed during init! */
    2931
     32#include "devSegDf.h"
    3033#include "dev1632.h"
    3134#include "dev16.h"
     
    119122 * @param     pRp  Request packet.
    120123 */
    121 USHORT dev0GenIOCtl(PRP_GENIOCTL pRp)
     124USHORT NEAR dev0GenIOCtl(PRP_GENIOCTL pRp)
    122125{
    123126    USHORT rc;
     
    135138                {
    136139                    rc = R0Init16(pRp);
    137                     fInitTime = FALSE;
    138140                    return rc;
    139141                }
     
    218220 * @param     pRp  Request packet.
    219221 */
    220 USHORT dev1GenIOCtl(PRP_GENIOCTL pRp)
     222USHORT NEAR dev1GenIOCtl(PRP_GENIOCTL pRp)
    221223{
    222224    if (pRp->Category == IOCTL_W32K_K32 || pRp->Category == IOCTL_W32K_ELF)
  • trunk/src/win32k/dev16/probkrnl.c

    r3411 r4164  
    1 /* $Id: probkrnl.c,v 1.20 2000-04-17 01:56:48 bird Exp $
     1/* $Id: probkrnl.c,v 1.21 2000-09-02 21:07:56 bird Exp $
    22 *
    33 * Description:   Autoprobes the os2krnl file and os2krnl[*].sym files.
     
    1414 *                How this works:
    1515 *                1. parses the device-line parameters and collects some "SysInfo".
    16  *                2. gets the kernel object table. (elf$)
    17  *                3. finds the kernel image and scans it for a build number.
    18  *                4. locates and scans the symbol-file(s) for the entrypoints which are wanted.
     16 *                2. gets the kernel object table and kernel info like build no. (elf$)
     17 *                3. if non-debug kernel the symbol database is scanned to get the syms
     18 *                4. if Syms not found THEN locates and scans the symbol-file(s) for the
     19 *                   entrypoints which are wanted.
    1920 *                5. the entry points are verified. (elf$)
    2021 *                6. finished.
    2122 *
    22  * Copyright (c) 1998-2000 knut st. osmundsen
     23 * Copyright (c) 1998-2000 knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    2324 *
    2425 * Project Odin Software License can be found in LICENSE.TXT
     
    5152#define INCL_NOPMAPI
    5253
    53 
    5454/*******************************************************************************
    5555*   Header Files                                                               *
     
    6161#include <reqpkt.h>
    6262
     63#include "devSegDf.h"
     64#undef  DATA16_INIT
     65#define DATA16_INIT
     66#undef  CODE16_INIT
     67#define CODE16_INIT
    6368#include "os2krnl.h"                    /* must be included before dev1632.h! */
    6469#include "sym.h"
     
    6873#include "vprntf16.h"
    6974#include "log.h"
    70 
     75#include "options.h"
     76#include "errors.h"
    7177
    7278/*******************************************************************************
     
    7480*   Note: must be inited or else we'll get BSS segment                         *
    7581*******************************************************************************/
    76 /*
    77  * kernel data - !only valid during init!
    78  */
     82
    7983
    8084/*
    8185 * aImportTab defines the imported and overloaded OS/2 kernel functions.
    82  * IMPORTANT: aImportTab has a sibling array in d32init.c, aulProc, which must
    83  *            match entry by entry. Adding/removing/shuffling aImportTab, aulProc
    84  *            has to be updated immediately!
    85  */
    86 IMPORTKRNLSYM aImportTab[NBR_OF_KRNLIMPORTS] =
     86 * IMPORTANT: aImportTab has two sibling arrays, one in d32init.c, aulProc, and
     87 *            the calltab.asm, which must match entry by entry.
     88 *            When adding/removing/shuffling items in aImportTab, aulProc and
     89 *            calltab.asm has to be updated immediately!
     90 */
     91IMPORTKRNLSYM DATA16_GLOBAL aImportTab[NBR_OF_KRNLIMPORTS] =
    8792{/* iFound     cchName                  offObject    usSel     fType    */
    8893 /*      iObject      achName                 ulAddress  cProlog        */
     
    101106    {FALSE, -1, 11, "_VMGetOwner",          -1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 12 */
    102107    {FALSE, -1, 11, "g_tkExecPgm",          -1,  -1,  -1,  -1, EPT_PROC32},        /* 13 */
    103     {FALSE, -1, 11, "f_FuStrLenZ",          -1,  -1,  -1,  -1, EPT_PROCIMPORT16},  /* 14 */
    104     {FALSE, -1, 10, "f_FuStrLen",           -1,  -1,  -1,  -1, EPT_PROCIMPORT16},  /* 15 */
    105     {FALSE, -1,  8, "f_FuBuff",             -1,  -1,  -1,  -1, EPT_PROCIMPORT16},  /* 16 */
    106     {FALSE, -1, 16, "_VMObjHandleInfo",     -1,  -1,  -1,  -1, EPT_PROCIMPORT}     /* 17 */
    107 /*    {FALSE, -1, 11, "",          -1,  -1, -1, EPT_PROCIMPORT16} */ /* 16 */
     108    {FALSE, -1, 15, "_tkStartProcess",      -1,  -1,  -1,  -1, EPT_PROC32},        /* 14 */
     109    {FALSE, -1, 11, "f_FuStrLenZ",          -1,  -1,  -1,  -1, EPT_PROCIMPORT16},  /* 15 */
     110    {FALSE, -1, 10, "f_FuStrLen",           -1,  -1,  -1,  -1, EPT_PROCIMPORT16},  /* 16 */
     111    {FALSE, -1,  8, "f_FuBuff",             -1,  -1,  -1,  -1, EPT_PROCIMPORT16},  /* 17 */
     112    {FALSE, -1, 16, "_VMObjHandleInfo",     -1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 18 */
     113    {FALSE, -1, 21, "_ldrASMpMTEFromHandle",-1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 19 */
     114    {FALSE, -1, 12, "_ldrOpenPath",         -1,  -1,  -1,  -1, EPT_PROC32},        /* 20 */
     115    {FALSE, -1, 12, "_LDRClearSem",         -1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 21 */
     116    {FALSE, -1, 14, "_ldrFindModule",       -1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 22 */
     117    {FALSE, -1, 17, "_KSEMRequestMutex",    -1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 23 */
     118    {FALSE, -1, 17, "_KSEMReleaseMutex",    -1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 24 */
     119    {FALSE, -1, 15, "_KSEMQueryMutex",      -1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 25 */
     120    {FALSE, -1,  9, "_KSEMInit",            -1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 26 */
     121    {FALSE, -1,  7, "_LdrSem",              -1,  -1,  -1,  -1, EPT_VARIMPORT32},   /* 27 */
     122    {FALSE, -1, 11, "_LDRLibPath",          -1,  -1,  -1,  -1, EPT_VARIMPORT32},   /* 28 */
     123    {FALSE, -1,  9, "_TKSuBuff",            -1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 29 */
     124    {FALSE, -1,  9, "_TKFuBuff",            -1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 30 */
     125    {FALSE, -1, 11, "_TKFuBufLen",          -1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 31 */
     126    {FALSE, -1, 21, "_ldrValidateMteHandle",-1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 32 */
     127    {FALSE, -1,  8, "_pTCBCur",             -1,  -1,  -1,  -1, EPT_VARIMPORT16},   /* 33 */
     128    {FALSE, -1,  9, "_pPTDACur",            -1,  -1,  -1,  -1, EPT_VARIMPORT16},   /* 34 */
     129    {FALSE, -1, 10, "ptda_start",           -1,  -1,  -1,  -1, EPT_VARIMPORT16},   /* 35 */
     130    {FALSE, -1, 12, "ptda_environ",         -1,  -1,  -1,  -1, EPT_VARIMPORT16},   /* 36 */
     131    {FALSE, -1, 12, "ptda_ptdasem",         -1,  -1,  -1,  -1, EPT_VARIMPORT16},   /* 37 */
     132    {FALSE, -1, 11, "ptda_module",          -1,  -1,  -1,  -1, EPT_VARIMPORT16},   /* 38 */
     133    {FALSE, -1, 18, "ptda_pBeginLIBPATH",   -1,  -1,  -1,  -1, EPT_VARIMPORT16},   /* 39 */
     134    {FALSE, -1, 16, "_ldrpFileNameBuf",     -1,  -1,  -1,  -1, EPT_VARIMPORT32},   /* 40 */
     135    {FALSE, -1, 14, "SecPathFromSFN",       -1,  -1,  -1,  -1, EPT_PROCIMPORTNR32},/* 41 */
     136
    108137};
    109138
    110 unsigned short int  usBuild          = 0;
    111 unsigned short      usVerMajor       = 0;
    112 unsigned short      usVerMinor       = 0;
    113 unsigned char       fchType          = TYPE_UNI;        /* TYPE_SMP, TYPE_UNI, TYPE_W4 */
    114 unsigned char       fDebug           = FALSE;
     139char DATA16_GLOBAL  szUsrSym[50] = {0};
     140
    115141
    116142
     
    118144 * privat data
    119145 */
    120 static int          fQuiet           = 0;
    121 static char         szUsrOS2Krnl[50] = {0};
    122 static char         szOS2Krnl[]      = {"c:\\os2krnl"};
    123 
    124 static char         szUsrSym[50]     = {0};
    125 static char *       apszSym[]        =
     146#if defined(DEBUGR3)
     147static char     DATA16_INIT szUsrOS2Krnl[50] = {0};
     148static char     DATA16_INIT szOS2Krnl[]      = {"c:\\os2krnl"};
     149#endif
     150static char *   DATA16_INIT apszSym[]        =
    126151{
    127152    {"c:\\os2krnl.sym"},                              /* usual for debugkernel */
     
    144169
    145170/* Result from GetKernelInfo/ReadOS2Krnl. */
    146 static unsigned char  cObjects = 0;
    147 static POTE           paKrnlOTEs = NULL;
    148 
     171static unsigned char DATA16_INIT  cObjects = 0;
     172static POTE          DATA16_INIT  paKrnlOTEs = NULL;
     173
     174
     175/*
     176 *
     177 */
     178static struct
     179{
     180    short       sErr;
     181    const char *pszMsg;
     182} DATA16_INIT aErrorMsgs[] =
     183{
     184    {ERROR_PROB_KRNL_OPEN_FAILED,       "Krnl: Failed to open kernel file."},
     185    {ERROR_PROB_KRNL_SEEK_SIZE,         "Krnl: Failed to seek to end to of file."},
     186    {ERROR_PROB_KRNL_SEEK_FIRST,        "Krnl: Failed to start of file."},
     187    {ERROR_PROB_KRNL_READ_FIRST,        "Krnl: Failed to read (first)."},
     188    {ERROR_PROB_KRNL_READ_NEXT,         "Krnl: Failed to read."},
     189    {ERROR_PROB_KRNL_TAG_NOT_FOUND,     "Krnl: Build level tag was not found."},
     190    {ERROR_PROB_KRNL_INV_SIGANTURE,     "Krnl: Invalid build level signature."},
     191    {ERROR_PROB_KRNL_INV_BUILD_NBR,     "Krnl: Invalid build level number."},
     192    {ERROR_PROB_KRNL_BUILD_VERSION,     "Krnl: Invalid build level version."},
     193    {ERROR_PROB_KRNL_MZ_SEEK,           "Krnl: Failed to seek to start of file. (MZ)"},
     194    {ERROR_PROB_KRNL_MZ_READ,           "Krnl: Failed to read MZ header."},
     195    {ERROR_PROB_KRNL_NEOFF_INVALID,     "Krnl: Invalid new-header offset in MZ header."},
     196    {ERROR_PROB_KRNL_NEOFF_SEEK,        "Krnl: Failed to seek to new-header offset."},
     197    {ERROR_PROB_KRNL_LX_READ,           "Krnl: Failed to read LX header."},
     198    {ERROR_PROB_KRNL_LX_SIGNATURE,      "Krnl: Invalid LX header signature."},
     199    {ERROR_PROB_KRNL_OBJECT_CNT,        "Krnl: Object count don't match the running kernel."},
     200    {ERROR_PROB_KRNL_OBJECT_CNR_10,     "Krnl: Less than 10 objects - not a valid kernel file!"},
     201    {ERROR_PROB_KRNL_OTE_SEEK,          "Krnl: Failed to seek to OTEs."},
     202    {ERROR_PROB_KRNL_OTE_READ,          "Krnl: Failed to read OTEs."},
     203    {ERROR_PROB_KRNL_OTE_SIZE_MIS,      "Krnl: Size of a OTE didn't match the running kernel."},
     204
     205    /*
     206     * ProbeSymFile error messages
     207     */
     208    {ERROR_PROB_SYM_FILE_NOT_FOUND,     "Sym: Symbol file was not found."},
     209    {ERROR_PROB_SYM_READERROR,          "Sym: Read failed."},
     210    {ERROR_PROB_SYM_INVALID_MOD_NAME,   "Sym: Invalid module name (not OS2KRNL)."},
     211    {ERROR_PROB_SYM_SEGS_NE_OBJS,       "Sym: Number of segments don't match the object count of the kernel."},
     212    {ERROR_PROB_SYM_SEG_DEF_SEEK,       "Sym: Failed to seek to a segment definition."},
     213    {ERROR_PROB_SYM_SEG_DEF_READ,       "Sym: Failed to read a segment definition."},
     214    {ERROR_PROB_SYM_IMPORTS_NOTFOUND,   "Sym: All the imports wasn't found."},
     215    {ERROR_PROB_SYM_V_PROC_NOT_FND,     "Sym: Verify failed: Procedure not found."},
     216    {ERROR_PROB_SYM_V_OBJ_OR_ADDR,      "Sym: Verify failed: Invalid object or address."},
     217    {ERROR_PROB_SYM_V_ADDRESS,          "Sym: Verify failed: Invalid address."},
     218    {ERROR_PROB_SYM_V_PROLOG,           "Sym: Verify failed: Invalid prolog."},
     219    {ERROR_PROB_SYM_V_NOT_IMPL,         "Sym: Verify failed: Not implemented."},
     220
     221    {ERROR_PROB_SYMDB_KRNL_NOT_FOUND,   "SymDB: Kernel was not found."}
     222};
     223
     224/*
     225 * Fake data for Ring-3 testing.
     226 */
     227#ifdef R3TST
     228USHORT DATA16_INIT usFakeVerMajor = 0;
     229USHORT DATA16_INIT usFakeVerMinor = 0;
     230#ifdef R3TST
     231static DATA16_INIT ach[11] =  {0}; /* works around compiler/linker bug */
     232#endif
     233#endif
    149234
    150235
     
    157242static int      fseek(HFILE hfile, signed long off, int iOrg);
    158243static unsigned long fsize(HFILE hFile);
    159 static void     puts(char *psz);
    160 
    161 /* C-library replacements. */
     244
     245/* C-library replacements and additions. */
    162246static void     kmemcpy(char *psz1, const char *psz2, int cch);
    163247static char *   kstrstr(const char *psz1, const char *psz2);
     
    169253static int      kargncpy(char *pszTarget, const char *pszArg, unsigned cchMaxlen);
    170254
     255static const char * GetErrorMsg(short sErr);
     256
    171257/* Workers */
    172 static int      LookupKrnlEntry(unsigned uBuild, unsigned char chType,
    173                                 unsigned char fchType, unsigned char cObjects);
     258static int      LookupKrnlEntry(unsigned short usBuild, unsigned short fKernel, unsigned char cObjects);
    174259static int      VerifyPrologs(void);
    175260static int      ProbeSymFile(const char *pszFilename);
     
    177262
    178263/* Ouput */
    179 static void     ShowDecNumber(unsigned long ul);
    180 static void     ShowHexNumber(unsigned long ul);
    181264static void     ShowResult(int rc, int iSym);
    182265
     
    187270static int      processFile(const char *pszFilename);
    188271
     272#if 0 /*ndef CODE16_INIT*/
     273#pragma alloc_text(CODE16_INIT, fopen, fread, fseek, fsize)
     274#pragma alloc_text(CODE16_INIT, kmemcpy, kstrstr, kstrcmp, kstrncmp, kstrnicmp, kstrlen, kstrcpy, kargncpy)
     275#pragma alloc_text(CODE16_INIT, GetErrorMsg)
     276#pragma alloc_text(CODE16_INIT, LookupKrnlEntry, VerifyPrologs, ProbeSymFile, GetKernelInfo)
     277#pragma alloc_text(CODE16_INIT, ShowResult)
     278#pragma alloc_text(CODE16_INIT, VerifyKernelVer, ReadOS2Krnl, ReadOS2Krnl2, processFile)
     279#endif
    189280
    190281
     
    277368
    278369/**
    279  * puts lookalike
    280  */
    281 static void puts(char * psz)
    282 {
    283     DosPutMessage(0, kstrlen(psz), psz);
    284 }
    285 
    286 
    287 /**
    288370 * kmemcpy - memory copy - slow!
    289371 * @param     psz1  target
     
    421503    while (*pszSource != '\0')
    422504        *psz++ = *pszSource++;
    423 
     505    *psz = '\0';
    424506    return pszTarget;
    425507}
     
    478560
    479561    return i;
     562}
     563
     564
     565/**
     566 * Get the message text for an error message.
     567 * @returns Pointer to error text. NULL if not found.
     568 * @param   sErr  Error code id.
     569 * @status  completely implemented.
     570 * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     571 */
     572static const char * GetErrorMsg(short sErr)
     573{
     574    int i;
     575    for (i = 0; i < sizeof(aErrorMsgs) / sizeof(aErrorMsgs[0]); i++)
     576    {
     577        if (aErrorMsgs[i].sErr == sErr)
     578            return aErrorMsgs[i].pszMsg;
     579    }
     580    return NULL;
    480581}
    481582
     
    493594 *            1 if not found.
    494595 *            Error code on error.
    495  * @param     uBuild        Build level.
    496  * @param     fchBldType    'A' all strict
    497  *                          'H' half strict
    498  *                          'R' retail
    499  * @param     fchType       TYPE_SMP, TYPE_UNI, TYPE_W4
     596 * @param     usBuild       Build level.
     597 * @param     fKernel       Kernel (type) flags. (KF_* from options.h)
    500598 * @param     cObjects      Count of object in the running kernel.
    501599 * @sketch    Loop thru the table.
     
    503601 * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
    504602 */
    505 static int LookupKrnlEntry(unsigned uBuild, unsigned char fchBldType, unsigned char fchType, unsigned char cObjects)
     603static int LookupKrnlEntry(unsigned short usBuild, unsigned short fKernel, unsigned char cObjects)
    506604{
    507605    int i;
     
    512610    for (i = 0; aKrnlSymDB[i].usBuild != 0; i++)
    513611    {
    514         if (aKrnlSymDB[i].usBuild       == uBuild
    515             && aKrnlSymDB[i].fchBldType == fchBldType
    516             && aKrnlSymDB[i].fchType    == fchType
    517             && aKrnlSymDB[i].cObjects   == cObjects)
     612        if (   aKrnlSymDB[i].usBuild  == usBuild
     613            && aKrnlSymDB[i].fKernel  == fKernel
     614            && aKrnlSymDB[i].cObjects == cObjects)
    518615        {   /* found matching entry! */
    519616            int j;
     
    533630                                           + pEntry->aSyms[j].offObject;
    534631                aImportTab[j].usSel      = paKrnlOTEs[pEntry->aSyms[j].iObject].ote_sel;
    535                 aImportTab[j].fFound     = TRUE;
     632                aImportTab[j].fFound     = (char)((aImportTab[j].offObject != 0xFFFFFFFFUL) ? 1 : 0);
    536633                dprintf(("  %-3d addr=0x%08lx off=0x%08lx  %s\n",
    537634                         j, aImportTab[j].ulAddress, aImportTab[j].offObject,
     
    550647
    551648    /* not found */
    552     return 1;
     649    return ERROR_PROB_SYMDB_KRNL_NOT_FOUND;
    553650}
    554651#endif /* !EXTRACT */
     652
    555653
    556654/**
     
    574672        rc = DosDevIOCtl("", "", D16_IOCTL_VERIFYIMPORTTAB, D16_IOCTL_CAT, hDev0);
    575673        DosClose(hDev0);
     674        if (rc != NO_ERROR)
     675        {
     676            register APIRET rc2 = rc & STECODE;
     677            if (rc2 >= ERROR_D32_VERIFYIMPORTTAB_FIRST && rc2 <= ERROR_D32_VERIFYIMPORTTAB_LAST)
     678                rc = rc2 + ERROR_PROB_SYM_VERIFY_FIRST - ERROR_D32_VERIFYIMPORTTAB_FIRST;
     679        }
     680    }
     681    else
     682    {
     683        dprintf(("DosOpen Failed with rc=%d\n", rc));
     684        DosSleep(2000);
    576685    }
    577686
     
    616725    {
    617726        dprintf(("Error opening file %s\n", pszFilename));
    618         return -50;
     727        return ERROR_PROB_SYM_FILE_NOT_FOUND;
    619728    }
    620729    dprintf(("\nSuccessfully opened symbolfile: %s\n", pszFilename));
     
    629738    {   /* oops! read failed, close file and fail. */
    630739        fclose(hSym);
    631         return -51;
     740        return ERROR_PROB_SYM_READERROR;
    632741    }
    633742    achBuffer[0] = MapDef.achModName[0];
     
    646755        dprintf(("Modulename verify failed\n"));
    647756        fclose(hSym);
    648         return -51;
     757        return ERROR_PROB_SYM_INVALID_MOD_NAME;
    649758    }
    650759
     
    658767        dprintf(("Segment No. verify failed\n"));
    659768        fclose(hSym);
    660         return -52;
     769        return ERROR_PROB_SYM_SEGS_NE_OBJS;
    661770    }
    662771    #endif /* !EXTRACT */
     
    701810        {   /* Failed to seek to the segment definition, fail! */
    702811            fclose(hSym);
    703             return -53;
     812            return ERROR_PROB_SYM_SEG_DEF_SEEK;
    704813        }
    705814        rc = fread(&SegDef, sizeof(SEGDEF), 1, hSym);
     
    707816        {   /* Failed to read the segment definition, fail! */
    708817            fclose(hSym);
    709             return -53;
     818            return ERROR_PROB_SYM_SEG_DEF_READ;
    710819        }
    711820
     
    731840        for (iSym = 0; iSym < SegDef.cSymbols && cLeftToFind; iSym++)
    732841        {
     842            IMPORTKRNLSYM * pImport;
    733843            unsigned cchName;
     844
    734845            /*
    735846             * Fileoffset of the current symbol.
     
    784895             * Search proctable.
    785896             */
    786             for (i = 0; i < NBR_OF_KRNLIMPORTS; i++)
     897            for (i = 0, pImport = &aImportTab[0]; i < NBR_OF_KRNLIMPORTS; i++, pImport++)
    787898            {
    788                 if (!aImportTab[i].fFound                                     /* Not allready found */
    789                     && (aImportTab[i].fType & EPT_BIT_MASK) == fSegEPTBitType /* Equal bittype */
    790                     && (fCode || (aImportTab[i].fType & EPT_VARIMPORT))       /* Don't look for code in a data segment and vice versa */
    791                     && aImportTab[i].cchName == cchName                       /* Equal name length */
    792                     && kstrncmp(aImportTab[i].achName, achBuffer, cchName) == 0  /* Equal name */
     899                if (!pImport->fFound                                       /* Not allready found */
     900                    && (pImport->fType & EPT_VARIMPORT ? !fCode : fCode)   /* Don't look for code in a data segment */
     901                    && pImport->cchName == cchName                         /* Equal name length */
     902                    && kstrncmp(pImport->achName, achBuffer, cchName) == 0 /* Equal name */
    793903                    )
    794904                {   /* Symbol was found */
    795                     aImportTab[i].offObject = (SegDef.bFlags & 0x01 ? SymDef32.wSymVal : SymDef16.wSymVal);
    796                     aImportTab[i].ulAddress = aImportTab[i].offObject + paKrnlOTEs[iSeg].ote_base;
    797                     aImportTab[i].iObject   = (unsigned char)iSeg;
    798                     aImportTab[i].usSel     = paKrnlOTEs[iSeg].ote_sel;
     905                    pImport->offObject = (SegDef.bFlags & 0x01 ? SymDef32.wSymVal : SymDef16.wSymVal);
     906                    pImport->ulAddress = pImport->offObject + paKrnlOTEs[iSeg].ote_base;
     907                    pImport->iObject   = (unsigned char)iSeg;
     908                    pImport->usSel     = paKrnlOTEs[iSeg].ote_sel;
    799909                    dprintf(("debug: base=%lx, size=%lx iSeg=%d\n", paKrnlOTEs[iSeg].ote_base, paKrnlOTEs[iSeg].ote_size, iSeg));
    800910
    801911                    /* Paranoia test! */
    802912                    #ifndef EXTRACT
    803                     if (aImportTab[i].offObject < paKrnlOTEs[iSeg].ote_size)
     913                    if (pImport->offObject < paKrnlOTEs[iSeg].ote_size)
    804914                    {
    805                         aImportTab[i].fFound = TRUE;
     915                        pImport->fFound = TRUE;
    806916                        cLeftToFind--;
    807917                        dprintf(("Found: %s at off 0x%lx addr 0x%lx, sel=0x%x\n",
    808                                  aImportTab[i].achName, aImportTab[i].offObject,
    809                                  aImportTab[i].ulAddress, aImportTab[i].usSel));
     918                                 pImport->achName, pImport->offObject,
     919                                 pImport->ulAddress, pImport->usSel));
    810920                    }
    811921                    else/* test failed, continue on next symbol*/
    812                         dprintf(("Error: Paranoia test failed for %s\n", aImportTab[i].achName));;
     922                        dprintf(("Error: Paranoia test failed for %s\n", pImport->achName));;
    813923                    #else
    814                     aImportTab[i].fFound = TRUE;
     924                    pImport->fFound = TRUE;
    815925                    cLeftToFind--;
    816926                    #endif /* !EXTRACT */
     
    832942     * If not all procedures were found fail.
    833943     */
    834     if (cLeftToFind != 0)
    835         return -57;
     944    for (i = 0; i < NBR_OF_KRNLIMPORTS; i++)
     945        if (!aImportTab[i].fFound && !(aImportTab[i].fType & EPT_NOT_REQ))
     946            return ERROR_PROB_SYM_IMPORTS_NOTFOUND;
    836947
    837948    /*
     
    843954
    844955/**
    845  * Gets the os/2 kernel OTE's (object table entries).
    846  * @returns   0 on success. Not 0 on error.
     956 * Get kernelinformation (OTEs (object table entries), build, type, debug...)
     957 * @returns 0 on success.
     958 *              options.ulBuild, fchType, fDebug, cObjects and paKrnlOTEs is set on successful return.
     959 *          Not 0 on error.
    847960 */
    848961static int   GetKernelInfo(void)
    849962{
    850 #if !defined(DEBUGR3) && !defined(EXTRACT) /* IOCtl not available after inittime! */
    851     static KRNLINFO KrnlInfo = {0};
     963#if !defined(DEBUGR3) && !defined(EXTRACT) /* This IOCtl is not available after inittime! */
     964    static KRNLINFO DATA16_INIT KrnlInfo = {0};
    852965    APIRET          rc;
    853966    HFILE           hDev0 = 0;
    854967    USHORT          usAction = 0;
    855968
     969    /*
     970     * Issue an IOCtl to elf$ to query kernel information.
     971     */
    856972    rc = DosOpen("\\dev\\elf$", &hDev0, &usAction, 0UL, FILE_NORMAL,
    857973                 OPEN_ACTION_FAIL_IF_NEW | OPEN_ACTION_OPEN_IF_EXISTS,
     
    863979        if (rc == NO_ERROR)
    864980        {
    865             int i;
    866 
    867             /* Set the exported parameters */
    868             usBuild  = KrnlInfo.usBuild;
    869             fchType  = KrnlInfo.fchType;
    870             fDebug   = KrnlInfo.fDebug;
    871             cObjects = KrnlInfo.cObjects;
    872             paKrnlOTEs = &KrnlInfo.aObjects[0];
    873981            #ifdef DEBUG
    874             for (i = 0; i < NBR_OF_KRNLIMPORTS; i++)
     982            unsigned i;
     983            #endif
     984
     985            /*
     986             * Set the exported parameters
     987             */
     988            options.ulBuild = KrnlInfo.ulBuild;
     989            options.fKernel = KrnlInfo.fKernel;
     990            cObjects        = KrnlInfo.cObjects;
     991            paKrnlOTEs      = &KrnlInfo.aObjects[0];
     992
     993            /*
     994             * If debugging probkrnl dump kernel OTEs.
     995             */
     996            #ifdef DEBUG
     997            dprintf(("debug: kernel OTE:\n"));
     998            for (i = 0; i < cObjects; i++)
    875999                dprintf(("debug: no.%2d base=%lx size=%lx sel=%x\n",
    8761000                         i,
     
    8791003                         paKrnlOTEs[i].ote_sel));
    8801004            #endif
    881 
    8821005        }
    8831006        DosClose(hDev0);
     
    8851008
    8861009    if (rc != NO_ERROR)
    887         printf16("Failed to get kernel OTEs\r\n");
     1010        printf16("Failed to get kernel OTEs. rc=%d\n", rc);
    8881011
    8891012    return rc;
     
    8991022        {
    9001023            rc = ReadOS2Krnl(szUsrOS2Krnl);
    901             if (rc != 0)
     1024            if (rc != NO_ERROR)
    9021025            {
    903                 puts("Warning: Invalid kernel file specified. Tries defaults.\n\r");
     1026                printf16("Warning: Invalid kernel file specified. Tries defaults.\n");
    9041027                szUsrOS2Krnl[0] = '\0';
    9051028                rc = ReadOS2Krnl(szOS2Krnl);
     
    9181041/**
    9191042 * Shows result of kernelprobing if not quiet or on error.
    920  * @param     rc          Return code.
    921  * @param     iSym        index of .sym-file into static struct.
     1043 * @param   rc      Return code.
     1044 * @param   iSym    index of .sym-file into static struct.
    9221045 */
    9231046#ifndef EXTRACT
     
    9291052     * Complain even if quiet on error
    9301053     */
    931     if (!fQuiet || rc != 0)
     1054    if (!options.fQuiet || rc != NO_ERROR)
    9321055    {
    9331056        printf16("Win32k - Odin32 support driver.\n");
     
    9361059         * kernel stuff
    9371060         */
    938         if (rc <= -50 || rc == 0)
     1061        if (rc == NO_ERROR || rc > ERROR_PROB_KRNL_LAST)
    9391062        {
    9401063            #ifdef DEBUGR3
    9411064            printf16("    Found kernel:     %s\n", szOS2Krnl);
    9421065            #endif
    943             printf16("    Build:            %d - v%d.%d\n",
    944                      usBuild, usVerMajor, usVerMinor);
    945         }
     1066            printf16("    Build:            %ld - v%d.%d\n",
     1067                     options.ulBuild, options.usVerMajor, options.usVerMinor);
     1068        }
     1069        else if (rc >= ERROR_PROB_KRNL_FIRST)
     1070            printf16("    Kernel probing failed with rc=%d.\n", rc);
    9461071        else
    947             printf16("    Kernel probing failed with rc=%d.\n", rc);
     1072            printf16("    Failed before probing kernel.\n");
    9481073
    9491074        /*
    9501075         * symbol-file
    9511076         */
    952         if (rc == 0)
     1077        if (rc == NO_ERROR || (rc > ERROR_PROB_SYM_LAST && (szUsrSym[0] != '\0' || apszSym[iSym] != NULL)))
    9531078            printf16("    Found symbolfile: %s\n",
    9541079                     szUsrSym[0] == '\0' ? apszSym[iSym] : szUsrSym);
     1080        else if (rc >= ERROR_PROB_SYM_FIRST)
     1081            printf16("    Failed to find symbolfile!\n");
    9551082        else
    956             printf16("    Failed to find symbolfile! rc=%d\n", rc);
     1083            printf16("    Failed before searching for symbolfile.\n");
    9571084
    9581085        /*
    9591086         * function listing
    9601087         */
    961         for (i = 0; i < NBR_OF_KRNLIMPORTS; i++)
    962         {
    963             printf16("  %-20s at ",aImportTab[i].achName);
    964             if (aImportTab[i].fFound)
    965                 printf16("0x%08lx%s", aImportTab[i].ulAddress, (i % 2) == 0 ? "" : "\n");
    966             else
    967                 printf16("failed!%s", (i % 2) == 0 ? "" : "\n");
    968         }
    969         if (i % 2) printf16("\n");
     1088        if (options.fLogging || rc != NO_ERROR)
     1089        {
     1090            for (i = 0; i < NBR_OF_KRNLIMPORTS; i++)
     1091            {
     1092                printf16("  %-21s at ", aImportTab[i].achName);
     1093                if (aImportTab[i].fFound)
     1094                    printf16("0x%08lx%s", aImportTab[i].ulAddress, (i % 2) == 0 ? "" : "\n");
     1095                else
     1096                    printf16("not found!%s", (i % 2) == 0 ? "" : "\n");
     1097            }
     1098            if (i % 2) printf16("\n");
     1099        }
     1100
     1101        /*
     1102         * Display error code.
     1103         */
     1104        if (rc != NO_ERROR)
     1105        {
     1106            const char *psz = GetErrorMsg(rc);
     1107            printf16("ProbeKernel failed with rc=%d.\n", rc);
     1108            if (psz) printf16("%s\n", psz);
     1109        }
    9701110    }
    9711111}
     
    10031143                switch (pReqPack->InitArgs[i])
    10041144                {
     1145                    #if defined(DEBUGR3)
    10051146                    case 'k':
    10061147                    case 'K': /* Kernel file */
     
    10081149                        i += kargncpy(szUsrOS2Krnl, &pReqPack->InitArgs[i], sizeof(szUsrOS2Krnl));
    10091150                        break;
     1151                    #endif
    10101152
    10111153                    case 'n':
    10121154                    case 'N': /* NoLoader */
     1155                        options.fNoLoader = TRUE;
    10131156                        return 0;
    10141157
    10151158                    case 'q':
    10161159                    case 'Q': /* Quiet */
    1017                         fQuiet = 1;
     1160                        options.fQuiet = TRUE;
    10181161                        break;
    10191162
     
    10211164                    case 'S': /* Symbol file */
    10221165                        i++;
    1023                         if (pReqPack->InitArgs[i] == 'Y' || pReqPack->InitArgs[i] == 'y')
     1166                        if (   pReqPack->InitArgs[i] != 'c' && pReqPack->InitArgs[i] != 'C'
     1167                            && pReqPack->InitArgs[i] != 'm' && pReqPack->InitArgs[i] != 'M'
     1168                            ) /* -script and -smp is ignored */
    10241169                            i += kargncpy(szUsrSym, &pReqPack->InitArgs[i], sizeof(szUsrSym));
    10251170                        break;
     
    10271172                    case 'v':
    10281173                    case 'V': /* Verbose */
    1029                         fQuiet = 0;
     1174                        options.fQuiet = FALSE;
    10301175                        break;
    10311176                }
     
    10441189    pGIS = MAKEPGINFOSEG(selGIS);
    10451190    usBootDrive = pGIS->bootdrive;
    1046     usVerMajor  = pGIS->uchMajorVersion;
    1047     usVerMinor  = pGIS->uchMinorVersion;
     1191#ifndef R3TST
     1192    options.usVerMajor  = pGIS->uchMajorVersion;
     1193    options.usVerMinor  = pGIS->uchMinorVersion;
     1194#else
     1195    if (usFakeVerMajor == 0)
     1196    {
     1197        usFakeVerMajor = pGIS->uchMajorVersion;
     1198        usFakeVerMinor = pGIS->uchMinorVersion;
     1199    }
     1200    options.usVerMajor  = usFakeVerMajor;
     1201    options.usVerMinor  = usFakeVerMinor;
     1202#endif
    10481203    dprintf(("BootDrive: %d\n", usBootDrive));
    10491204
    10501205    /* set driveletter in constants strings */
    10511206    usBootDrive = (char)usBootDrive + (char)'a' - 1;
     1207    #if defined(DEBUGR3)
    10521208    szOS2Krnl[0] = (char)usBootDrive;
     1209    #endif
    10531210    for (i = 0; apszSym[i] != NULL; i++)
    10541211        apszSym[i][0] = (char)usBootDrive;
     
    10581215    /*-----------------*/
    10591216    rc = GetKernelInfo();
    1060     if (rc != NO_ERROR)
    1061         return rc;
    10621217
    10631218    /*--------------*/
     
    10721227            if (rc)
    10731228            {
    1074                 puts("Warning: Invalid symbol file specified. Tries defaults.\n\r");
     1229                printf16("Warning: Invalid symbol file specified. Tries defaults.\n");
    10751230                szUsrSym[0] = '\0';
    10761231            }
    10771232        }
    1078         if (rc != 0) /* if user sym failed or don't exists. */
     1233        if (rc != NO_ERROR) /* if user sym failed or don't exists. */
    10791234        {
    10801235            /*
    10811236             * Check database - only if not a debug kernel!
    10821237             * You usually have a .sym-file when using a debug kernel.
    1083              * (Currently I am not able to distinguish between half and all strict kernels...)
     1238             * (This is because I am unable to distinguish between half and
     1239             *  all strict kernels...)
    10841240             */
    1085             if (fDebug ||
    1086                 (rc = LookupKrnlEntry((unsigned short)usBuild, 'R', fchType, cObjects)) != 0
     1241            if ((options.fKernel & KF_DEBUG) ||
     1242                (rc = LookupKrnlEntry((unsigned short)options.ulBuild,
     1243                                      (unsigned short)options.fKernel,
     1244                                      cObjects)
     1245                 ) != NO_ERROR
    10871246                )
    10881247            {
     1248                #if 1 /* ndef R3TST */
     1249                APIRET rc2;
    10891250                /* search on disk */
    10901251                i = 0;
    1091                 while (apszSym[i] != NULL && (rc = ProbeSymFile(apszSym[i])) != 0)
     1252                while (apszSym[i] != NULL
     1253                       && (rc2 = ProbeSymFile(apszSym[i])) != NO_ERROR
     1254                       )
     1255                {
    10921256                    i++;
     1257                    if (rc2 >= ERROR_PROB_SYM_VERIFY_FIRST)
     1258                        rc = rc2;
     1259                }
     1260                if (rc == 1 || rc2 == NO_ERROR)
     1261                    rc = rc2;
     1262                #endif
    10931263            }
    10941264        }
     
    10991269    ShowResult(rc, i);
    11001270
     1271    /* Copy the symbol file name to szUsrSym. */
     1272    if (szUsrSym[0] == '\0' && apszSym[i] != NULL)
     1273        kstrcpy(szUsrSym, apszSym[i]);
     1274
    11011275    return rc;
    11021276}
     
    11131287    int VerMinor, VerMajor;
    11141288
    1115     VerMajor = usBuild < 20000 ? 20 : 30/*?*/;
    1116     VerMinor = usBuild <  6600 ? 10 :  usBuild <  8000 ? 11 : usBuild < 9000 ? 30 :
    1117                usBuild < 10000 ? 40 :  usBuild < 15000 ? 45 : 50;
    1118 
    1119     return VerMajor - (int)usVerMajor | VerMinor - (int)usVerMinor;
     1289    VerMajor = options.ulBuild < 20000 ? 20 : 30/*?*/;
     1290    VerMinor = options.ulBuild <  6600 ? 10 :  options.ulBuild <  8000 ? 11 : options.ulBuild < 9000 ? 30 :
     1291               options.ulBuild < 10000 ? 40 :  options.ulBuild < 15000 ? 45 : 50;
     1292
     1293    return VerMajor - (int)options.usVerMajor | VerMinor - (int)options.usVerMinor;
    11201294}
    11211295
     
    11231297/**
    11241298 * Reads and verifies OS/2 kernel.
    1125  * @returns   0 on success, not 0 on failure.
    1126  * @param     filename   Filename of the OS/2 kernel.
    1127  * @result    usBuild is set.
     1299 * @returns   0 on success.
     1300 *            One of the ERROR_PROB_KRNL_* defines on error.
     1301 * @param     pszFilename   Filename of the OS/2 kernel.
     1302 * @result    options.ulBuild is set.
    11281303 * @remark    This step will be eliminated by searching thru the DOSGROUP datasegment
    11291304 *            in the kernel memory. This segment have a string "Internal revision 9.034[smp|uni]"
     
    11401315    if (hKrnl != 0)
    11411316    {
     1317        /*
     1318         * Get size of kernel file.
     1319         */
    11421320        cbKrnl = fsize(hKrnl);
    11431321        if (!fseek(hKrnl, 0, SEEK_SET))
     1322        {
     1323            /*
     1324             * Call worker with filehandle and size.
     1325             */
    11441326            rc = ReadOS2Krnl2(hKrnl, cbKrnl);
     1327        }
    11451328        else
    1146             rc = -2;
     1329            rc = ERROR_PROB_KRNL_SEEK_SIZE;
    11471330        fclose(hKrnl);
    11481331    }
     
    11501333    {
    11511334        dprintf(("Could not open file\n"));
    1152         rc = -1;
     1335        rc = ERROR_PROB_KRNL_OPEN_FAILED;
    11531336    }
    11541337    return rc;
     
    11591342 * Worker function for ReadOS2Krnl
    11601343 * @returns   0 on success.
    1161  *            errorcodes on failure. (-1 >= rc >= -14)
     1344 *            One of the ERROR_PROB_KRNL_* defines on error.
    11621345 * @param     hKrnl   Handle to the kernel file.
    11631346 * @param     cbKrnl  Size of the kernel file.
     
    11671350{
    11681351    #if defined(DEBUGR3) || !defined(EXTRACT)
    1169     static KRNLINFO KrnlInfo = {0};
     1352    static KRNLINFO DATA16_INIT KrnlInfo = {0};
    11701353    #endif
    11711354    int            i, j;
     
    11761359
    11771360
    1178     /* find bldlevel string - "@#IBM:14.020#@  IBM OS/2 Kernel - 14.020F" */
     1361    /*
     1362     * Find bldlevel string - for example: "@#IBM:14.020#@  IBM OS/2 Kernel - 14.020F"
     1363     * Searching the entire file lineary from the start.
     1364     */
    11791365    if (fseek(hKrnl, 0, SEEK_SET))
    1180         return -2;
     1366        return ERROR_PROB_KRNL_SEEK_FIRST;
    11811367
    11821368    if (!fread(&achBuffer[KERNEL_ID_STRING_LENGTH], 1, KERNEL_READ_SIZE, hKrnl))
    1183         return -3;
     1369        return ERROR_PROB_KRNL_READ_FIRST;
    11841370
    11851371    i = KERNEL_ID_STRING_LENGTH;
     
    11911377            kmemcpy(achBuffer, &achBuffer[KERNEL_READ_SIZE], KERNEL_ID_STRING_LENGTH);
    11921378            if (!fread(&achBuffer[KERNEL_ID_STRING_LENGTH], 1, cbKrnl > KERNEL_READ_SIZE ? KERNEL_READ_SIZE : (int)cbKrnl, hKrnl))
    1193                 return -3;
     1379                return ERROR_PROB_KRNL_READ_NEXT;
    11941380
    11951381            i = 0;
     
    12041390    }
    12051391
     1392    /* found it? */
    12061393    if (cbKrnl == 0)
    12071394    {
    12081395        fclose(hKrnl);
    1209         return -4;
    1210     }
     1396        return ERROR_PROB_KRNL_TAG_NOT_FOUND;
     1397    }
     1398
     1399
     1400    /*
     1401     * We've found the @#IBM: tag. So now we'll try read it.
     1402     */
    12111403
    12121404    /* displacement */
     
    12171409    /* verify signature */
    12181410    if (kstrncmp(&achBuffer[i+10+j], "#@  IBM OS/2 Kernel", 19) != 0)
    1219         return -5;
    1220 
    1221     /* read usBuild */
    1222     usBuild  = (char)(achBuffer[i+6] - '0') * 1000;
     1411        return ERROR_PROB_KRNL_INV_SIGANTURE;
     1412
     1413    /*
     1414     * read options.ulBuild
     1415     */
     1416    options.ulBuild  = (char)(achBuffer[i+6] - '0') * 1000;
    12231417    if (achBuffer[i+7] != '.')
    12241418    {
    12251419        /* this code is for Warp5 */
    1226         usBuild *= 10;
    1227         usBuild += (char)(achBuffer[i+7] - '0') * 1000;
     1420        options.ulBuild *= 10;
     1421        options.ulBuild += (char)(achBuffer[i+7] - '0') * 1000;
    12281422        i++;
    12291423        j--;
    12301424        if (achBuffer[i+7] != '.')
    12311425        {
    1232             usBuild = usBuild * 10;
    1233             usBuild = usBuild + (unsigned short)(achBuffer[i+7] - '0') * 1000;
     1426            options.ulBuild *= 10;
     1427            options.ulBuild += (unsigned long)(achBuffer[i+7] - '0') * 1000;
    12341428            i++;
    12351429            j--;
     
    12391433    if (j == 0)
    12401434    {
    1241         usBuild += (achBuffer[i+ 8] - '0') * 10;
    1242         usBuild += (achBuffer[i+ 9] - '0') * 1;
     1435        options.ulBuild += (achBuffer[i+ 8] - '0') * 10;
     1436        options.ulBuild += (achBuffer[i+ 9] - '0') * 1;
    12431437    }
    12441438    else
    12451439    {
    12461440        if (j == 3)
    1247             return -9;
    1248         usBuild += (achBuffer[i+ 8] - '0') * 100;
    1249         usBuild += (achBuffer[i+ 9] - '0') * 10;
    1250         usBuild += (achBuffer[i+10] - '0');
    1251     }
    1252 
     1441            return ERROR_PROB_KRNL_INV_BUILD_NBR;
     1442        options.ulBuild += (achBuffer[i+ 8] - '0') * 100;
     1443        options.ulBuild += (achBuffer[i+ 9] - '0') * 10;
     1444        options.ulBuild += (achBuffer[i+10] - '0');
     1445    }
     1446
     1447    /*
     1448     * We've read the build number. Let's check that it matches the OS/2
     1449     * version reported by DosGetInfoSeg.
     1450     */
    12531451    if (VerifyKernelVer())
    1254         return -9;
    1255     dprintf(("usBuild: %d\n", usBuild));
     1452        return ERROR_PROB_KRNL_BUILD_VERSION;
     1453    dprintf(("options.ulBuild: %d\n", options.ulBuild));
    12561454
    12571455    /* get segment number */
    12581456    /* read-MZheader */
    12591457    if (fseek(hKrnl,0,SEEK_SET))
    1260         return -2;
     1458        return ERROR_PROB_KRNL_MZ_SEEK;
    12611459
    12621460    if (!fread(achBuffer, 1, 0x40, hKrnl))
    1263         return -3;
     1461        return ERROR_PROB_KRNL_MZ_READ;
    12641462
    12651463    offLXHdr = *(unsigned long int *)&achBuffer[0x3c];
    12661464
    12671465    if (offLXHdr > 0x2000 && offLXHdr < 0x80) /* just to detect garbage */
    1268         return -6;
     1466        return ERROR_PROB_KRNL_NEOFF_INVALID;
    12691467
    12701468    if (fseek(hKrnl, offLXHdr, SEEK_SET))
    1271         return -2;
     1469        return ERROR_PROB_KRNL_NEOFF_SEEK;
    12721470
    12731471    if (!fread(achBuffer, 1, sizeof(struct e32_exe), hKrnl))
    1274         return -3;
     1472        return ERROR_PROB_KRNL_LX_READ;
    12751473
    12761474    /* check LX-magic */
    12771475    if (achBuffer[0] != 'L' || achBuffer[1] != 'X')
    1278         return -7;
     1476        return ERROR_PROB_KRNL_LX_SIGNATURE;
    12791477
    12801478#if !defined(DEBUGR3) && !defined(EXTRACT)
     
    12821480    pLXHdr = (struct e32_exe *)achBuffer;
    12831481    if ((UCHAR)pLXHdr->e32_objcnt != cObjects)
    1284         return -8;
     1482        return ERROR_PROB_KRNL_OBJECT_CNT;
    12851483
    12861484    if (pLXHdr->e32_objcnt < 10)
    1287         return -9;
    1288 
    1289     /* check objects (sizes and flags(?)) */
     1485        return ERROR_PROB_KRNL_OBJECT_CNR_10;
     1486
     1487    /* check objects sizes. */
    12901488    if (!fseek(hKrnl, (LONG)offLXHdr + (LONG)pLXHdr->e32_objtab, SEEK_SET))
    12911489    {
     
    12941492        {
    12951493            if (!fread(achBuffer, 1, sizeof(OTE), hKrnl))
    1296                 return -11;
     1494                return ERROR_PROB_KRNL_OTE_READ;
    12971495            if (pObj->o32_size < paKrnlOTEs[i].ote_size)
    1298                 return -12;
    1299 
    1300             #if 0 /* don't work! */
    1301             if ((pObj->o32_flags & 0xffffUL) != (paKrnlOTEs[i].ote_flags & 0xffffUL))
    1302                 return -14;
    1303             #endif
     1496                return ERROR_PROB_KRNL_OTE_SIZE_MIS;
    13041497        }
    13051498    }
    13061499    else
    1307         return -10;
     1500        return ERROR_PROB_KRNL_OTE_SEEK;
    13081501#else
    13091502    /* Since we can't get the OTEs from the kernel when debugging in RING-3,
     
    13221515        for (i = 0; i < (int)cObjects; i++)
    13231516            if (!fread(&paKrnlOTEs[i], 1, sizeof(struct o32_obj), hKrnl))
    1324                 return -11;
     1517                return ERROR_PROB_KRNL_OTE_READ;
    13251518    }
    13261519    else
    1327         return -10;
     1520        return ERROR_PROB_KRNL_OTE_SEEK;
    13281521#endif
    13291522
    1330     return 0;
     1523    return NO_ERROR;
    13311524}
    13321525
     
    13701563 * Where: n - are the build number 4 or 5 digits.
    13711564 *        t - kernel type. R = retail, H = half strict, A = all strict.
    1372  *        m - UNI or SMP.  U = UNI processor kernel. S = SMP processor kernel.
     1565 *        m - UNI or SMP.  U = UNI processor kernel. S = SMP processor kernel. 4 = Warp 4 FP13+
    13731566 * @returns   NO_ERROR on success. Untracable error code on error.
    13741567 * @param     pszFilename  Pointer to read only filename of the .sym-file.
     
    13811574    APIRET   rc;
    13821575    int      cch = kstrlen(pszFilename);
     1576
     1577    DosWrite(2, (char*)pszFilename, cch, &rc);
     1578    DosWrite(2, "\r\n", 2, &rc);
    13831579
    13841580    /* Filename check */
     
    13971593    }
    13981594
    1399     /** @remark
    1400      * All a/h-strict files are currently ignored.
    1401      * When a debug kernel is used we'll have to use the
    1402      * .sym-file for it. This is so because I can't distinguish
    1403      * between a all-strick and a half-strick kernel (yet).
    1404      */
    1405     if (pszFilename[cch-6] != 'R')
    1406         return 0;
    1407 
    14081595    /*
    14091596     * Probe kernelfile
     
    14191606        int i;
    14201607
     1608        /** @remark
     1609         * Currently information for retail kernels are usable, but we'll
     1610         * generate it for the debug kernels too, but this information
     1611         * is enclaved within an "#ifdef ALLKERNELS ... #endif".
     1612         */
     1613        if (pszFilename[cch-6] != 'R')
     1614            printf16("#ifdef ALLKERNELS\n");
     1615
    14211616        printf16("    { /* %s */\n"
    1422                  "        %.*s, \'%c\', %s, %d,\n"
     1617                 "        %.*s, ",
     1618                 pszFilename,
     1619                 cch - 6, &pszFilename[0]              /* build number */
     1620                 );
     1621
     1622        switch (pszFilename[cch - 5])
     1623        {
     1624            case 'S':   printf16("KF_SMP"); break;
     1625            case '4':   printf16("KF_UNI | KF_W4"); break;
     1626            case 'U':   printf16("KF_UNI"); break;
     1627        }
     1628        switch (pszFilename[cch - 6])
     1629        {
     1630            case 'A':   printf16(" | KF_ALLSTRICT"); break;
     1631            case 'H':   printf16(" | KF_HALFSTRICT"); break;
     1632        }
     1633        printf16(", %d,\n"
    14231634                 "        {\n",
    1424                  pszFilename,
    1425                  cch - 6, &pszFilename[0],              /* build number */
    1426                  pszFilename[cch - 6],                  /* Type, A=astrict, H=halfstrict, R=Retail */
    1427                  pszFilename[cch - 5] == 'S' ?          /* UNI: TYPE_UNI  SMP: TYPE_SMP  W4: TYPE_W4 */
    1428                     "TYPE_SMP" :  pszFilename[cch - 5] == '4' ? "TYPE_W4" : "TYPE_UNI",
    14291635                 aImportTab[0].iObject + 1); /* ASSUMES that DOSCODE32 is the last object. */
    14301636
     
    14321638        {
    14331639            char *psz = aImportTab[i].achName;
    1434             printf16("            {%2d, 0x%08lx}, /* %s */\n",
     1640            printf16("            {%-2d, 0x%08lx}, /* %s */\n",
    14351641                     aImportTab[i].iObject,
    1436                      aImportTab[i].offObject,
     1642                     aImportTab[i].fFound ? aImportTab[i].offObject : 0xFFFFFFFFUL,
    14371643                     (char *)&aImportTab[i].achName[0]
    14381644                     );
     
    14401646        printf16("        }\n"
    14411647                 "    },\n");
     1648
     1649        /** @remark
     1650         * Currently information for retail kernels are usable, but we'll
     1651         * generate it for the debug kernels too, but this information
     1652         * is enclaved within an "#ifdef ALLKERNELS ... #endif".
     1653         */
     1654        if (pszFilename[cch-6] != 'R')
     1655            printf16("#endif\n");
    14421656    }
    14431657    else
     
    14601674{
    14611675    APIRET  rc;
    1462 
     1676    const char *  psz;
    14631677
    14641678    /*
    14651679     * Set paKrnlOTEs to point to an zeroed array of OTEs.
    14661680     */
    1467     static KRNLINFO KrnlInfo = {0};
     1681    static KRNLINFO DATA16_INIT  KrnlInfo = {0};
    14681682    paKrnlOTEs = &KrnlInfo.aObjects[0];
    14691683
     
    14741688         */
    14751689        int i;
    1476         for (i = 0; i < argc; i++)
     1690        for (i = 1; i < argc; i++)
    14771691        {
    14781692            rc = processFile(argv[i]);
     
    14801694            {
    14811695                printf16("processFile failed with rc=%d for file %s\n",
    1482                           rc, argv[i]);
     1696                         rc, argv[i]);
     1697                if (psz = GetErrorMsg(rc))
     1698                    printf16("%s\n", psz);
    14831699                return rc;
    14841700            }
     
    14981714        int         i;
    14991715
    1500         printf16("/* $Id: probkrnl.c,v 1.20 2000-04-17 01:56:48 bird Exp $\n"
     1716        printf16("/* $Id: probkrnl.c,v 1.21 2000-09-02 21:07:56 bird Exp $\n"
    15011717                 "*\n"
    15021718                 "* Autogenerated kernel symbol database.\n"
     
    15121728                 "#define INCL_NOBASEAPI\n"
    15131729                 "#include <os2.h>\n"
     1730                 "#include \"DevSegDf.h\"\n"
    15141731                 "#include \"probkrnl.h\"\n"
     1732                 "#include \"options.h\"\n"
    15151733                 "\n");
    15161734
    1517         printf16("KRNLDBENTRY aKrnlSymDB[] = \n"
     1735        printf16("KRNLDBENTRY DATA16_INIT aKrnlSymDB[] = \n"
    15181736                 "{\n");
    15191737
     
    15281746                printf16("processFile failed with rc=%d for file %s\n",
    15291747                         rc, &ffb.achName[0]);
     1748                if (psz = GetErrorMsg(rc))
     1749                    printf16("%s\n", psz);
    15301750                return rc;
    15311751            }
     
    15371757
    15381758        printf16("    { /* Terminating entry */\n"
    1539                  "        0,0,0,0,\n"
     1759                 "        0,0,0,\n"
    15401760                 "        {\n");
    15411761        for (i = 0; i < NBR_OF_KRNLIMPORTS; i++)
  • trunk/src/win32k/dev16/vprntf16.c

    r2905 r4164  
    1 /* $Id: vprntf16.c,v 1.2 2000-02-26 17:49:28 bird Exp $
     1/* $Id: vprntf16.c,v 1.3 2000-09-02 21:07:56 bird Exp $
    22 *
    33 * vprintf and printf - 16-bit.
     
    3636#include <os2.h>
    3737
     38#include "devSegDf.h"                   /* Win32k segment definitions. */
     39#include "dev16.h"
    3840#include "vprntf16.h"
    3941#ifdef RING0
     
    4143#include "conio.h"
    4244#endif
    43 #include "dev16.h"
    4445
    4546/*******************************************************************************
    4647*   Global Variables                                                           *
    4748*******************************************************************************/
     49static char chReturn  = '\r';
    4850static char chNewLine = '\n';
    49 static char chReturn  = '\r';
     51static char chReturnWithNewLine[2] = "\r\n";
    5052
    5153/*******************************************************************************
     
    217219 * @param     args        Argument list.
    218220 */
    219 int vprintf16(const char *pszFormat, va_list args)
     221int FAR vprintf16(const char *pszFormat, va_list args)
    220222{
    221223    int cch = 0;
     
    327329                        char *pszStr = va_arg(args, char*);
    328330
    329                         if (pszStr < (char*)0x10000)
     331                        if (pszStr == NULL)
    330332                            pszStr = "<NULL>";
    331333                        cchStr = _strnlen(pszStr, (unsigned)cchPrecision);
     
    391393 * @param     ...        Optional parameters.
    392394 */
    393 int printf16(const char *pszFormat, ...)
     395int FAR printf16(const char *pszFormat, ...)
    394396{
    395397    int     cch;
     
    413415static void choutconsole(int ch)
    414416{
    415     USHORT usWrote;
    416 
    417417    if (ch != '\r')
    418418    {
     419        USHORT  usWrote;                /* Bytes written (ignored). */
    419420        if (ch == '\n')
    420         {
    421             usWrote = 1;
    422             DosWrite(1, (PVOID)&chReturn, 1, &usWrote);
    423         }
    424         usWrote = 1;
    425         DosWrite(1, (PVOID)&ch, 1, &usWrote);
     421            DosWrite(1, (PVOID)&chReturnWithNewLine, 2, &usWrote);
     422        else
     423            DosWrite(1, (PVOID)&ch, 1, &usWrote);
    426424    }
    427425}
     
    438436 *            At runtime the text is only sendt to com-port.
    439437 */
    440 static char *stroutconsole(char *psz, signed cchMax)
    441 {
     438static char *stroutconsole(register char *psz, signed cchMax)
     439{
     440    register CHAR   ch;
     441
    442442    while (cchMax > 0 && *psz != '\0')
    443443    {
    444         USHORT cch = 0;
    445         USHORT us;
    446 
    447         while (cchMax - cch > 0 && psz[cch] != '\0' && psz[cch] != '\r' && psz[cch] != '\n')
     444        register signed cch = 0;
     445        USHORT          us;             /* Bytes written (ignored). */
     446
     447        while (cchMax > cch && (ch = psz[cch]) != '\0' && ch != '\r' && ch != '\n')
    448448            cch++;
    449449
    450450        /* write string part */
    451         us = cch;
    452451        DosWrite(1, (PVOID)psz, cch, &us);
    453452
    454         /* cr and lf check + skip */
    455         if (psz[cch] == '\n' || psz[cch] == '\r')
    456         {
    457             if (psz[cch] == '\n')
    458             {
    459                 DosWrite(1, (PVOID)&chReturn, 1, &us);
    460                 DosWrite(1, (PVOID)&chNewLine, 1, &us);
    461             }
    462 
    463             while (cchMax - cch > 0 && (psz[cch] == '\r' || psz[cch] == '\n'))
    464                 cch++;
     453        /* cr and lf: expand lf to cr+lf and ignore cr. */
     454        while (cchMax > cch)
     455        {
     456            if ((ch = psz[cch]) == '\n')
     457                DosWrite(1, (PVOID)&chReturnWithNewLine, 2, &us);
     458            else
     459                if (ch != '\r')
     460                    break;
     461            cch++;
    465462        }
    466463
     
    481478static void chout(int ch)
    482479{
    483     #ifdef RING0
     480    #if defined(RING0) && !defined(R3TST)
    484481        if (fInitTime)
    485482            choutconsole(ch);
     
    514511static char *strout(char *psz, signed cchMax)
    515512{
    516     #ifdef RING0
     513    #if defined(RING0) && !defined(R3TST)
    517514        int cchYield = 0;
    518515
     
    539536
    540537            /* cr and lf check + skip */
    541             if (psz[cch] == '\n' || psz[cch] == '\r')
     538            if (cch < cchMax && (psz[cch] == '\n' || psz[cch] == '\r'))
    542539            {
    543540                if (psz[cch] == '\n')
  • trunk/src/win32k/dev32/d32ElfIOCtl.c

    r2799 r4164  
    1 /* $Id: d32ElfIOCtl.c,v 1.1 2000-02-15 23:39:18 bird Exp $
     1/* $Id: d32ElfIOCtl.c,v 1.2 2000-09-02 21:07:57 bird Exp $
    22 *
    33 * Elf driver IOCtl handler function.
     
    2020#include <os2.h>
    2121
     22#include "devSegDf.h"
    2223#include "dev1632.h"
    2324#include "dev32.h"
  • trunk/src/win32k/dev32/d32Win32kIOCtl.c

    r2799 r4164  
    1 /* $Id: d32Win32kIOCtl.c,v 1.1 2000-02-15 23:39:19 bird Exp $
     1/* $Id: d32Win32kIOCtl.c,v 1.2 2000-09-02 21:07:57 bird Exp $
    22 *
    33 * Win32k driver IOCtl handler function.
     
    1414#define INCL_NOPMAPI
    1515
     16#define NO_WIN32K_LIB_FUNCTIONS
     17
    1618
    1719/*******************************************************************************
     
    2022#include <os2.h>
    2123
     24#include "devSegDf.h"
    2225#include "dev1632.h"
    2326#include "dev32.h"
     27#include "OS2Krnl.h"
    2428#include "Win32k.h"
    2529#include "k32.h"
     
    4953                    return STATUS_DONE;
    5054                }
     55
     56                case K32_QUERYOTES:
     57                {
     58                    PK32QUERYOTES pParm = (PK32QUERYOTES)pRpIOCtl->ParmPacket;
     59                    if (pParm == NULL)
     60                        return STATUS_DONE | STERR | ERROR_I24_INVALID_PARAMETER;
     61                    pParm->rc = k32QueryOTEs((HMTE)pParm->hMTE, pParm->pQOte, pParm->cbQOte);
     62                    return STATUS_DONE;
     63                }
     64
     65                case K32_QUERYOPTIONSSTATUS:
     66                {
     67                    PK32QUERYOPTIONSSTATUS pParm = (PK32QUERYOPTIONSSTATUS)pRpIOCtl->ParmPacket;
     68                    if (pParm == NULL)
     69                        return STATUS_DONE | STERR | ERROR_I24_INVALID_PARAMETER;
     70                    pParm->rc = k32QueryOptionsStatus(pParm->pOptions, pParm->pStatus);
     71                    return STATUS_DONE;
     72                }
     73
     74                case K32_SETOPTIONS:
     75                {
     76                    PK32SETOPTIONS pParm = (PK32SETOPTIONS)pRpIOCtl->ParmPacket;
     77                    if (pParm == NULL)
     78                        return STATUS_DONE | STERR | ERROR_I24_INVALID_PARAMETER;
     79                    pParm->rc = k32SetOptions(pParm->pOptions);
     80                    return STATUS_DONE;
     81                }
     82
    5183            }
    5284            break;
  • trunk/src/win32k/dev32/d32hlp.asm

    r1535 r4164  
    1 ; $Id: d32hlp.asm,v 1.3 1999-10-31 23:57:02 bird Exp $
     1; $Id: d32hlp.asm,v 1.4 2000-09-02 21:07:57 bird Exp $
    22;
    33; d32hlp - 32-bit Device Driver Helper Function.
     
    3434; extrns
    3535;
    36 extrn _Device_Help:dword
     36    extrn _Device_Help:dword
    3737
    3838;CODE32 segment
    39 CODE32 segment dword public 'CODE' use32
     39CODE32 segment
    4040    assume cs:CODE32, ds:flat, ss:nothing, es:nothing
    4141    .386p
    4242
    4343;PVOID  D32HLPCALL D32Hlp_VirtToLin(ULONG  ulPtr16); /* eax */
     44; Sideeffect: edx holds the error code on error.
    4445D32Hlp_VirtToLin proc near
    4546    push    esi
     
    5152Thunk32_VirtToLin::
    5253    jnc     Finished
     54    mov     edx, eax
    5355    xor     eax, eax
    5456
     
    6163;PVOID  D32HLPCALL D32Hlp_VirtToLin2(USHORT usSelector, /*  ax */
    6264;                                    ULONG  ulOffset);  /* edx */
     65; Sideeffect: edx holds the error code on error.
    6366D32Hlp_VirtToLin2 proc near
    6467    push    esi
     
    6972Thunk32_VirtToLin2::
    7073    jnc     Finished
     74    mov     edx, eax
    7175    xor     eax, eax
    7276
     
    106110Thunk32_GetDOSVar::
    107111    jc  Error
    108     shl     ebx, 16
     112    shl     eax, 16
    109113    mov     bx, ax
    110114    xchg    eax, ebx
     
    277281
    278282;CODE16 segment
    279 CODE16 segment word public 'CODE' use16
     283CODE16 segment
    280284    assume cs:CODE16, ds:FLAT
    281285
  • trunk/src/win32k/dev32/d32init.c

    r3485 r4164  
    1 /* $Id: d32init.c,v 1.19 2000-05-03 10:46:06 bird Exp $
     1/* $Id: d32init.c,v 1.20 2000-09-02 21:07:57 bird Exp $
    22 *
    33 * d32init.c - 32-bits init routines.
     
    1414#define MAXSIZE_PROLOG 0x18             /* Note that this must be synced with */
    1515                                        /* the one used in calltab.asm.       */
    16 #define static                          /* just to make all symbols visible in the kernel debugger.  */
    1716#if  0                                  /* Enable this to have extra debug logging. */
    1817    #define kprintf2(a) kprintf
     
    2423#define INCL_NOPMAPI
    2524#define LDR_INCL_INITONLY
     25#define INCL_OS2KRNL_ALL
    2626
    2727/*******************************************************************************
     
    3232#include <string.h>
    3333
     34#include "devSegDf.h"
    3435#include "OS2Krnl.h"
    3536#include "options.h"
     
    4445#include "ldrCalls.h"
    4546#include "macros.h"
     47#include "errors.h"
     48
     49#ifdef R3TST
     50    #include "test.h"
     51#endif
    4652
    4753
     
    5359static char * apszInfoLevel[] = {"INFOLEVEL_QUIET", "INFOLEVEL_ERROR", "INFOLEVEL_WARNING", "INFOLEVEL_INFO", "INFOLEVEL_INFOALL", "!invalid!"};
    5460#endif
    55 static PMTE    pKrnlMTE = NULL;
    56 static PSMTE   pKrnlSMTE = NULL;
    57 static POTE    pKrnlOTE = NULL;
     61PMTE    pKrnlMTE = NULL;
     62PSMTE   pKrnlSMTE = NULL;
     63POTE    pKrnlOTE = NULL;
    5864
    5965
     
    6167*   Internal Functions                                                         *
    6268*******************************************************************************/
    63 static ULONG        readnum(const char *pszNum);
    64 _Inline int         ModR_M_32bit(char bModRM);
    65 static int          interpretFunctionProlog32(char *pach, BOOL fOverload);
    66 static int          interpretFunctionProlog16(char *pach, BOOL fOverload);
    67 static int          ImportTabInit(void);
     69 ULONG          readnum(const char *pszNum);
     70_Inline int     ModR_M_32bit(char bModRM);
     71_Inline int     ModR_M_16bit(char bModRM);
     72int             interpretFunctionProlog32(char *pach, BOOL fOverload);
     73int             interpretFunctionProlog16(char *pach, BOOL fOverload);
     74int             importTabInit(void);
     75#ifdef R3TST
     76PMTE            GetOS2KrnlMTETst(void);
     77void            R3TstFixImportTab(void);
     78#endif
     79PSZ SECCALL     nopSecPathFromSFN(SFN hFile);
     80
    6881
    6982
     
    7891/* extern(s) located in mytkExecPgm.asm  */
    7992extern char     mytkExecPgm;
    80 
    81 
    82 #ifndef DEBUGR3
     93extern char     mytkStartProcess;
     94
     95
    8396/**
    8497 * Ring-0, 32-bit, init function.
     
    118131        {
    119132            case 'c':
    120             case 'C': /* -C[1|2] - com-port no, def:-C2 */
    121                 switch (pszTmp[1])
    122                 {
    123                     case '1':
    124                         options.usCom = OUTPUT_COM1;
    125                         break;
    126 
    127                     case '2':
    128                     default:
    129                         options.usCom = OUTPUT_COM2;
    130                 }
     133            case 'C': /* -C[1|2] or -Com:[1|2]  -  com-port no, def:-C2 */
     134                pszTmp2 = strpbrk(pszTmp, ":=/- ");
     135                if (pszTmp2 != NULL && (*pszTmp2 == ':' || *pszTmp2 == '='))
     136                    pszTmp2++;
     137                else
     138                    pszTmp2 = pszTmp + 1;
     139                options.usCom = (USHORT)(*pszTmp2 == '1' ? OUTPUT_COM1 : OUTPUT_COM2);
    131140                break;
    132141
     
    134143            case 'E':/* ELF */
    135144                pszTmp2 = strpbrk(pszTmp, ":=/- ");
    136                 if (pszTmp2 != NULL && (int)(pszTmp2-pszTmp) < cch-1
     145                if (pszTmp2 != NULL
    137146                    && (pszTmp2[1] == 'N' ||pszTmp2[1] == 'n' || pszTmp2[1] == 'D' || pszTmp2[1] == 'd')
    138147                    )
     
    145154            case 'H': /* Heap options */
    146155                pszTmp2 = strpbrk(pszTmp, ":=/- ");
    147                 if (pszTmp2 != NULL && (int)(pszTmp2-pszTmp) < cch-1
    148                     && (*pszTmp2 == ':' || *pszTmp2 == '='))
     156                if (pszTmp2 != NULL && (*pszTmp2 == ':' || *pszTmp2 == '='))
    149157                {
    150158                    ul = readnum(pszTmp2 + 1);
     
    159167                break;
    160168
     169            case 'j':
     170            case 'J': /* -Java:<Yes|No> */
     171                pszTmp2 = strpbrk(pszTmp, ":=/- ");
     172                options.fJava =
     173                    pszTmp2 != NULL
     174                    && (int)(pszTmp2-pszTmp) < cch-1
     175                    && (*pszTmp2 == ':' || *pszTmp2 == '=')
     176                    && (pszTmp2[1] == 'Y' || pszTmp2[1] == 'y');
     177                break;
     178
    161179            case 'l':
    162180            case 'L': /* -L[..]<:|=| >[<Y..|E..| > | <N..|D..>] */
    163181                pszTmp2 = strpbrk(pszTmp, ":=/- ");
    164                 if (pszTmp2 != NULL && (int)(pszTmp2-pszTmp) < cch-1
    165                     && (pszTmp2[1] == 'N' ||pszTmp2[1] == 'n' || pszTmp2[1] == 'D' || pszTmp2[1] == 'd')
     182                if (pszTmp2 != NULL
     183                    && (pszTmp2[1] == 'Y' ||pszTmp2[1] == 'y' || pszTmp2[1] == 'E' || pszTmp2[1] == 'e')
    166184                    )
     185                    options.fLogging = TRUE;
     186                else
    167187                    options.fLogging = FALSE;
    168                 else
    169                     options.fLogging = TRUE;
    170188                break;
    171189
     
    178196            case 'P': /* PE */
    179197                pszTmp2 = strpbrk(pszTmp, ":=/- ");
    180                 if (pszTmp2 != NULL && (int)(pszTmp2-pszTmp) < cch-1
    181                     && (*pszTmp2 == ':' || *pszTmp2 == '='))
     198                if (pszTmp2 != NULL && (*pszTmp2 == ':' || *pszTmp2 == '='))
    182199                {
    183                     pszTmp++;
    184                     if (strnicmp(pszTmp, "pe2lx", 5) == 0)
     200                    pszTmp2++;
     201                    if (strnicmp(pszTmp2, "pe2lx", 5) == 0)
    185202                        options.fPE = FLAGS_PE_PE2LX;
    186                     else if (strnicmp(pszTmp, "pe", 2) == 0)
     203                    else if (strnicmp(pszTmp2, "pe", 2) == 0)
    187204                        options.fPE = FLAGS_PE_PE;
    188                     else if (strnicmp(pszTmp, "mixed", 2) == 0)
     205                    else if (strnicmp(pszTmp2, "mixed", 2) == 0)
    189206                        options.fPE = FLAGS_PE_MIXED;
    190                     else if (strnicmp(pszTmp, "not", 2) == 0)
     207                    else if (strnicmp(pszTmp2, "not", 2) == 0)
    191208                        options.fPE = FLAGS_PE_NOT;
    192209                    else
     
    203220
    204221            case 'r':
    205             case 'R': /* ResHeap options */
     222            case 'R': /* ResHeap options or REXX option */
    206223                pszTmp2 = strpbrk(pszTmp, ":=/- ");
    207                 if (pszTmp2 != NULL && (int)(pszTmp2-pszTmp) < cch-1
    208                     && (*pszTmp2 == ':' || *pszTmp2 == '='))
    209                 {
    210                     ul = readnum(pszTmp2 + 1);
    211                     if (ul > 0x1000UL && ul < 0x700000UL) /* 4KB < ul < 7MB */
     224                if (   (pszTmp[1] == 'E' || pszTmp[1] == 'e')
     225                    && (pszTmp[2] == 'X' || pszTmp[2] == 'x'))
     226                {   /* REXX */
     227                    options.fREXXScript =
     228                        pszTmp2 != NULL
     229                        && (int)(pszTmp2-pszTmp) < cch-1
     230                        && (*pszTmp2 == ':' || *pszTmp2 == '=')
     231                        && (pszTmp2[1] == 'Y' || pszTmp2[1] == 'y');
     232                }
     233                else
     234                {   /* ResHeap options */
     235                    if (pszTmp2 != NULL && (*pszTmp2 == ':' || *pszTmp2 == '='))
    212236                    {
    213                         if (strnicmp(pszTmp, "resheapm", 8) == 0)
    214                             options.cbResHeapMax = ul;
    215                         else
    216                             options.cbResHeapInit = ul;
     237                        ul = readnum(pszTmp2 + 1);
     238                        if (ul > 0x1000UL && ul < 0x700000UL) /* 4KB < ul < 7MB */
     239                        {
     240                            if (strnicmp(pszTmp, "resheapm", 8) == 0)
     241                                options.cbResHeapMax = ul;
     242                            else
     243                                options.cbResHeapInit = ul;
     244                        }
    217245                    }
    218246                }
     
    222250            case 'S': /* Sym:<filename> or Script:<Yes|No> or Smp */
    223251                /* SMP kernel */
    224                 if (pszTmp[1] == 'm' || pszTmp[1] == 'M')
    225                     options.fKernel = KF_SMP;
    226                 else
     252                pszTmp2 = strpbrk(pszTmp, ":=/- ");
     253                if (pszTmp[1] == 'c' || pszTmp[1] == 'C')
    227254                {
    228                     if (pszTmp[1] == 'c' || pszTmp[1] == 'C')
    229                     {
    230                         pszTmp2 = strpbrk(pszTmp, ":=/- ");
    231                         options.fScript = pszTmp2 != NULL && (int)(pszTmp2-pszTmp) < cch-1
    232                             && (*pszTmp2 == ':' || *pszTmp2 == '=')
    233                             && (pszTmp2[1] == 'Y' || pszTmp2[1] == 'y');
    234                     }
    235                 }
    236                 break;
    237 
    238             case 'u':
    239             case 'U': /* UNI kernel */
    240                 options.fKernel = KF_UNI;
     255                    options.fUNIXScript =
     256                        pszTmp2 != NULL
     257                        && (int)(pszTmp2-pszTmp) < cch-1
     258                        && (*pszTmp2 == ':' || *pszTmp2 == '=')
     259                        && (pszTmp2[1] == 'Y' || pszTmp2[1] == 'y');
     260                }
    241261                break;
    242262
     
    247267
    248268            case 'w':
    249             case 'W':
     269            case 'W': /* ModuleBase info level; -W<n> or -Warning:<n> */
    250270                if (pszTmp[1] >= '0' && pszTmp[1] <= '4')
    251271                    options.ulInfoLevel = pszTmp[1] - '0';
     
    253273                {
    254274                    pszTmp2 = strpbrk(pszTmp, ":=/- ");
    255                     if (pszTmp2 != NULL && (int)(pszTmp2-pszTmp) < cch-1
    256                         && (*pszTmp2 == ':' || *pszTmp2 == '=')
    257                         && pszTmp2[1] >= '0' && pszTmp2[1] <= '4'
    258                         )
    259                         options.ulInfoLevel = pszTmp2[1] - '0';
     275                    if (pszTmp2 != NULL && (*pszTmp2 == ':' || *pszTmp2 == '='))
     276                        pszTmp2++;
     277                    else
     278                        pszTmp2 = pszTmp + 1;
     279
     280                    if (*pszTmp2 >= '0' && *pszTmp2 <= '4')
     281                        options.ulInfoLevel = *pszTmp2 - '0';
    260282                }
    261283                break;
     
    270292    if (options.cbResHeapInit > options.cbResHeapMax)
    271293        options.cbResHeapMax = options.cbResHeapInit;
    272 
    273     /* Transfer version and build number from 16-bit probkrnl.c */
    274     options.ulBuild    = _usBuild;
    275     options.usVerMajor = _usVerMajor;
    276     options.usVerMinor = _usVerMinor;
    277294
    278295    /* Log option summary */
     
    288305    else
    289306        kprintf(("\tlogging disabled\n"));
    290     kprintf(("\tCom port no.%d\n", options.usCom));
    291 
    292     kprintf(("\tKernel: ver%d.%d  build %d  type %s\n",
     307    kprintf(("\tCom port no.%03xh\n", options.usCom));
     308
     309    kprintf(("\tKernel: v%d.%d  build %d  type ",
    293310                options.usVerMajor,
    294311                options.usVerMinor,
    295                 options.ulBuild,
    296                 (options.fKernel & KF_SMP) ? "SMP" : "UNI"
    297               ));
    298     kprintf(("\tfPE=%d (%s)\n", options.fPE, apszPE[MIN(options.fPE, 5)]));
     312                options.ulBuild));
     313    if (options.fKernel & KF_SMP)
     314        kprintf(("SMP "));
     315    else if (options.fKernel & KF_W4)
     316        kprintf(("W4 "));
     317    else
     318        kprintf(("UNI "));
     319    if (options.fKernel & KF_DEBUG)
     320        kprintf(("DEBUG\n"));
     321    else
     322        kprintf(("\n"));
     323
     324    kprintf(("\tfPE=%d (%s)\n",     options.fPE, apszPE[MIN(options.fPE, 5)]));
    299325    kprintf(("\tulInfoLevel=%d (%s)\n", options.ulInfoLevel, apszInfoLevel[MIN(options.ulInfoLevel, 5)]));
    300     kprintf(("\tfElf=%d\n", options.fElf));
    301     kprintf(("\tfScript=%d\n", options.fScript));
    302     kprintf(("\tfNoLoader=%d\n", options.fNoLoader));
     326    kprintf(("\tfElf=%d\n",         options.fElf));
     327    kprintf(("\tfUNIXScript=%d\n",  options.fUNIXScript));
     328    kprintf(("\tfREXXScript=%d\n",  options.fREXXScript));
     329    kprintf(("\tfJAVA=%d\n",        options.fJava));
     330    kprintf(("\tfNoLoader=%d\n",    options.fNoLoader));
    303331    kprintf(("\tcbSwpHeapInit=0x%08x  cbSwpHeapMax=0x%08x\n",
    304332             options.cbSwpHeapInit, options.cbSwpHeapMax));
    305333    kprintf(("\tcbResHeapInit=0x%08x  cbResHeapMax=0x%08x\n",
    306              options.cbSwpHeapInit, options.cbSwpHeapMax));
     334             options.cbResHeapInit, options.cbResHeapMax));
    307335    kprintf(("Options - Summary - End\n"));
    308336    #endif /* debug */
     
    325353    /* functionoverrides */
    326354    if (!options.fNoLoader)
    327         if (ImportTabInit() != NO_ERROR)
     355        if (importTabInit() != NO_ERROR)
    328356            return STATUS_DONE | STERR | ERROR_I24_QUIET_INIT_FAIL;
    329357
     
    369397 * @author    knut st. osmundsen
    370398 */
    371 static ULONG    readnum(const char *pszNum)
     399ULONG    readnum(const char *pszNum)
    372400{
    373401    ULONG ulRet = 0;
     
    428456
    429457    /* Find the kernel OTE table */
     458#ifndef R3TST
    430459    pKrnlMTE = GetOS2KrnlMTE();
     460#else
     461    pKrnlMTE = GetOS2KrnlMTETst();
     462#endif
    431463    if (pKrnlMTE != NULL)
    432464    {
     
    461493                     * Search for internal revision stuff in the two first objects.
    462494                     */
    463                     pKrnlInfo->usBuild = 0;
    464                     for (i = 0; i < 2 && pKrnlInfo->usBuild == 0; i++)
     495                    pKrnlInfo->ulBuild = 0;
     496                    for (i = 0; i < 2 && pKrnlInfo->ulBuild == 0; i++)
    465497                    {
    466498                        const char *psz = (const char*)pKrnlOTE[i].ote_base;
    467                         const char *pszEnd = psz + pKrnlOTE[i].ote_size;
    468 
    469                         while (psz + 100 < pszEnd)
     499                        const char *pszEnd = psz + pKrnlOTE[i].ote_size - 50; /* Last possible search position. */
     500
     501                        while (psz < pszEnd)
    470502                        {
    471503                            if (strncmp(psz, "Internal revision ", 18) == 0 && (psz[18] >= '0' && psz[18] <= '9'))
    472504                            {
    473505                                int j;
    474                                 kprintf2(("GetOTEs32: found internal revision: '%s'\n", psz));
     506                                kprintf2(("GetKernelInfo32: found internal revision: '%s'\n", psz));
    475507
    476508                                /* skip to end of "Internal revision " string. */
     
    481513                                {
    482514                                    if (*psz != '.')
    483                                         pKrnlInfo->usBuild = (unsigned short)(pKrnlInfo->usBuild * 10 + (*psz - '0'));
     515                                        pKrnlInfo->ulBuild = (unsigned short)(pKrnlInfo->ulBuild * 10 + (*psz - '0'));
    484516                                    psz++;
    485517                                }
    486518
    487519                                /* Check if build number seems valid. */
    488                                 if (   !(pKrnlInfo->usBuild >=  8254 && pKrnlInfo->usBuild <  8383) /* Warp 3 fp 32 -> fp 60 */
    489                                     && !(pKrnlInfo->usBuild >=  9023 && pKrnlInfo->usBuild <= 9036) /* Warp 4 GA -> fp 12 */
    490                                     && !(pKrnlInfo->usBuild >= 14039 && pKrnlInfo->usBuild < 14080) /* Warp 4.5 GA -> fp 40 */
     520                                if (   !(pKrnlInfo->ulBuild >=  8254 && pKrnlInfo->ulBuild <  8383) /* Warp 3 fp 32 -> fp 60 */
     521                                    && !(pKrnlInfo->ulBuild >=  9023 && pKrnlInfo->ulBuild <= 9036) /* Warp 4 GA -> fp 12 */
     522                                    && !(pKrnlInfo->ulBuild >= 14039 && pKrnlInfo->ulBuild < 14080) /* Warp 4.5 GA -> fp 40 */
     523                                    && !(pKrnlInfo->ulBuild >=  6600 && pKrnlInfo->ulBuild <= 6678) /* Warp 2.1x fix?? (just for fun!) */
    491524                                      )
    492525                                {
    493                                     kprintf(("GetOTEs32: info summary: Build %d is invalid - invalid fixpack?\n", pKrnlInfo->usBuild));
    494                                     usRc = 6;
     526                                    kprintf(("GetKernelInfo32: info summary: Build %d is invalid - invalid fixpack?\n", pKrnlInfo->ulBuild));
     527                                    usRc = ERROR_D32_INVALID_BUILD;
    495528                                    break;
    496529                                }
     
    500533                                    || (psz[0] == '_' && (psz[1] == 'S' || psz[1] == 's'))  /* _SMP  */
    501534                                    )
    502                                     pKrnlInfo->fchType = TYPE_SMP;
    503                                 else if (psz[0] == '_' && psz[1] == 'W' && psz[2] == '4')    /* _W4  */
    504                                     pKrnlInfo->fchType = TYPE_W4;
     535                                    pKrnlInfo->fKernel = KF_SMP;
    505536                                else
    506                                     pKrnlInfo->fchType = TYPE_UNI;
     537                                    if (*psz != ','
     538                                        && (   (psz[0] == '_' && psz[1] == 'W' && psz[2] == '4')  /* _W4 */
     539                                            || (psz[1] == '_' && psz[2] == 'W' && psz[3] == '4')  /* A_W4 */
     540                                            || (psz[0] == '_' && psz[1] == 'U' && psz[2] == 'N' && psz[3] == 'I' && psz[4] == '4')  /* _UNI4 */
     541                                            || (psz[1] == '_' && psz[2] == 'U' && psz[3] == 'N' && psz[4] == 'I' && psz[5] == '4')  /* A_UNI4 */
     542                                            )
     543                                        )
     544                                    pKrnlInfo->fKernel = KF_W4 | KF_UNI;
     545                                else
     546                                    pKrnlInfo->fKernel = KF_UNI;
    507547
    508548
    509549                                /* Check if its a debug kernel (look for DEBUG at start of object 3-5) */
    510550                                j = 3;
    511                                 pKrnlInfo->fDebug = FALSE;
    512551                                while (j < 5)
    513552                                {
     
    520559                                        && strncmp((char*)pKrnlOTE[j].ote_base, "DEBUG", 5) == 0)
    521560                                    {
    522                                         pKrnlInfo->fDebug = TRUE;
     561                                        pKrnlInfo->fKernel |= KF_DEBUG;
    523562                                        break;
    524563                                    }
     
    527566
    528567                                /* Display info */
    529                                 kprintf(("GetOTEs32: info summary: Build %d, fchType=%d, fDebug=%d\n",
    530                                          pKrnlInfo->usBuild, pKrnlInfo->fchType, pKrnlInfo->fDebug));
     568                                kprintf(("GetKernelInfo32: info summary: Build %d, fKernel=%d\n",
     569                                         pKrnlInfo->ulBuild, pKrnlInfo->fKernel));
    531570
    532571                                /* Break out */
     
    540579
    541580                    /* Set error code if not found */
    542                     if (pKrnlInfo->usBuild == 0)
     581                    if (pKrnlInfo->ulBuild == 0)
    543582                    {
    544                         usRc = 5;
    545                         kprintf(("GetOTEs32: Internal revision was not found!\n"));
     583                        usRc = ERROR_D32_BUILD_INFO_NOT_FOUND;
     584                        kprintf(("GetKernelInfo32: Internal revision was not found!\n"));
    546585                    }
    547586                }
    548587                else
    549                     usRc = 4;
     588                    usRc = ERROR_D32_NO_OBJECT_TABLE;
    550589            }
    551590            else
    552                 usRc = 3;
     591                usRc = ERROR_D32_TOO_MANY_OBJECTS;
    553592        }
    554593        else
    555             usRc = 2;
     594            usRc = ERROR_D32_NO_SWAPMTE;
    556595    }
    557596    else
    558         usRc = 1;
    559 
    560 
    561     if (usRc != 0)
    562         kprintf(("GetOTEs32: failed. usRc = %d\n", usRc));
     597        usRc = ERROR_D32_GETOS2KRNL_FAILED;
     598
     599    if (usRc != NO_ERROR)
     600        kprintf(("GetKernelInfo32: failed. usRc = %d\n", usRc));
    563601
    564602    return (USHORT)(usRc | (usRc != NO_ERROR ? STATUS_DONE | STERR : STATUS_DONE));
    565603}
    566 #endif /* !DEBUGR3*/
    567604
    568605
     
    575612 * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
    576613 */
    577 _Inline int ModR_M_32bit(char bModRM)
     614int ModR_M_32bit(char bModRM)
    578615{
    579616    if ((bModRM & 0xc0) == 0x80  /* ex. mov ax,[ebp+11145543h] */
    580617        || ((bModRM & 0xc0) == 0 && (bModRM & 0x07) == 5)) /* ex. mov ebp,[0ff231234h] */
    581618    {   /* 32-bit displacement */
    582         return 5;
     619        return 5 + ((bModRM & 0x7) == 0x4); // + SIB
     620    }
     621    else if ((bModRM & 0xc0) == 0x40) /* ex. mov ecx,[esi]+4fh */
     622    {   /* 8-bit displacement */
     623        return 2 + ((bModRM & 0x7) == 0x4); // + SIB
     624    }
     625    /* no displacement (only /r byte) */
     626    return 1;
     627}
     628
     629
     630/**
     631 * Functions which cacluates the instructionsize given a ModR/M byte.
     632 * @returns   Number of bytes to add to cb and pach.
     633 * @param     bModRM  ModR/M byte.
     634 * @status    completely implemented.
     635 * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     636 */
     637int ModR_M_16bit(char bModRM)
     638{
     639    if ((bModRM & 0xc0) == 0x80  /* ex. mov ax,[ebp+11145543h] */
     640        || ((bModRM & 0xc0) == 0 && (bModRM & 0x07) == 5)) /* ex. mov ebp,[0ff231234h] */
     641    {   /* 16-bit displacement */
     642        return 4;
    583643    }
    584644    else if ((bModRM & 0xc0) == 0x40) /* ex. mov ecx,[esi]+4fh */
     
    603663 *                       FALSE: Function is to be imported.
    604664 */
    605 static int interpretFunctionProlog32(char *pach, BOOL fOverload)
     665int interpretFunctionProlog32(char *pach, BOOL fOverload)
    606666{
    607667    int cb = -3;
    608 
    609668    kprintf2(("interpretFunctionProlog32(0x%08x, %d):\n"
    610669              "\t%02x %02x %02x %02x - %02x %02x %02x %02x\n"
     
    630689     *     push ebp
    631690     *  or
     691     *     mov ecx, r/m32
     692     *  or
     693     *     jmp dword
     694     *  or
     695     *     sub esp, imm8
     696     *  or
     697     *     call ptr16:32
     698     *  or
     699     *     enter imm16, imm8    (2.1x)
     700     *  or
     701     *     mov eax, imm32       (2.1x)
     702     *     <anything>
     703     *  or
     704     *     xor r32, r/m32
     705     *  or
    632706     *     mov eax, msoff32
    633707     *
    634708     */
    635     if ((pach[0] == 0x55 && (pach[1] == 0x8b || pach[1] == 0xa1)) /* two first prologs */
     709    if ((pach[0] == 0x55 && (pach[1] == 0x8b || pach[1] == 0xa1)) /* the two first prologs */
    636710        ||
    637         (pach[0] == 0xB8 && (pach[5] == 0xEB || pach[5] == 0x55 ) && !fOverload) /* two next prologs */
     711        (pach[0] == 0xB8 && (pach[5] == 0xEB || pach[5] == 0x55) && !fOverload) /* the two next prologs */
     712        ||
     713        (pach[0] == 0x8B && !fOverload) /* the next prolog */
     714        ||
     715        (pach[0] == 0xFF && !fOverload) /* the next prolog */
     716        ||
     717        (pach[0] == 0x83 && !fOverload) /* the next prolog */
     718        ||
     719        (pach[0] == 0x9a && !fOverload) /* the next prolog */
     720        ||
     721        (pach[0] == 0xc8)               /* the next prolog */
     722        ||
     723        (pach[0] == 0xB8 && !fOverload) /* the next prolog */
     724        ||
     725        (pach[0] == 0x33 && !fOverload) /* the next prolog */
    638726        ||
    639727        (pach[0] == 0xa1 && !fOverload) /* last prolog */
    640728        )
    641729    {
    642         BOOL fForce;
     730        BOOL fForce = FALSE;
     731        int  cbWord = 4;
    643732        cb = 0;
    644733        while (cb < 5 || fForce)                  /* 5 is the size of a jump instruction. */
    645734        {
    646735            int cb2;
     736            if (!fForce && cbWord != 4)
     737                cbWord = 4;
    647738            fForce = FALSE;
    648739            switch (*pach)
     
    656747                case 0x65:              /* gs segment override */
    657748                    fForce = TRUE;
     749                    break;
     750
     751                case 0x66:              /* 16 bit */
     752                    fForce = TRUE;
     753                    cbWord = 2;
    658754                    break;
    659755
     
    703799                case 0xa1:              /* mov eax, moffs16 */
    704800                case 0xa3:              /* mov moffs16, eax */
    705                     pach += 4;
    706                     cb += 4;
     801                    pach += cbWord;
     802                    cb += cbWord;
    707803                    break;
    708804
     
    722818                case 0x8b:              /* mov /r */
    723819                case 0x8d:              /* lea /r */
    724                     if ((pach[1] & 0x7) == 4 && (pach[1] & 0xc0) != 0xc0) /* invalid instruction!?! */
    725                         return -1;
    726820                    cb += cb2 = ModR_M_32bit(pach[1]);
    727821                    pach += cb2;
     
    751845                        )
    752846                    {
    753                         cb += cb2 = 4 + ModR_M_32bit(pach[1]); /* 4 is the size of the imm32 */
     847                        cb += cb2 = cbWord + ModR_M_32bit(pach[1]); /* cbWord is the size of the imm32/imm16 */
    754848                        pach += cb2;
    755849                    }
     
    759853                        return -2;
    760854                    }
     855                    break;
     856
     857                case 0x9a:              /* call ptr16:32 */
     858                    cb += cb2 = 6;
     859                    pach += cb2;
     860                    break;
     861
     862                case 0xc8:              /* enter imm16, imm8 */
     863                    cb += cb = 3;
     864                    pach += cb2;
     865                    break;
     866
     867                /*
     868                 * jmp /digit
     869                 */
     870                case 0xff:
     871                    cb += cb2 = cbWord + ModR_M_32bit(pach[1]); /* cbWord is the size of the imm32/imm16 */
     872                    pach += cb2;
    761873                    break;
    762874
     
    771883    else
    772884    {
    773         kprintf(("interpretFunctionProlog32: unknown prolog start. 0x%x 0x%x 0x%x\n", pach[0], pach[1], pach[2]));
     885        kprintf(("interpretFunctionProlog32: unknown prolog start. 0x%x 0x%x 0x%x 0x%x 0x%x\n",
     886                 pach[0], pach[1], pach[2], pach[3], pach[4]));
    774887        cb = 0;
    775888    }
     
    787900 *                       FALSE: Function is to be imported.
    788901 */
    789 static int interpretFunctionProlog16(char *pach, BOOL fOverload)
     902int interpretFunctionProlog16(char *pach, BOOL fOverload)
    790903{
    791904    int cb = -7;
     
    809922        while (cb < 8 || fForce)        /* 8 is the size of a 66h prefixed far jump instruction. */
    810923        {
     924            int cb2;
    811925            fForce = FALSE;
    812926            switch (*pach)
    813927            {
     928                case 0x06:              /* push es */
     929                case 0x0e:              /* push cs */
     930                case 0x1e:              /* push ds */
     931                case 0x16:              /* push ss */
     932                    break;
     933
    814934                case 0x0f:              /* push gs and push fs */
    815935                    if (pach[1] != 0xA0 && pach[1] != 0xA8)
     
    8881008                    break;
    8891009
     1010                /* complex sized instruction - "/5 ib" */
     1011                case 0x80:              /* 5: sub r/m8, imm8  7: cmp r/m8, imm8 */
     1012                case 0x83:              /* 5: sub r/m16, imm8 7: cmp r/m16, imm8 */
     1013                    if ((pach[1] & 0x38) == (5<<3)
     1014                        || (pach[1] & 0x38) == (7<<3)
     1015                        )
     1016                    {
     1017                        cb += cb2 = 1 + ModR_M_16bit(pach[1]); /* 1 is the size of the imm8 */
     1018                        pach += cb2;
     1019                    }
     1020                    else
     1021                    {
     1022                        kprintf(("interpretFunctionProlog16: unknown instruction (-3) 0x%x 0x%x 0x%x\n", pach[0], pach[1], pach[2]));
     1023                        return -3;
     1024                    }
     1025                    break;
     1026
     1027
    8901028                default:
    8911029                    kprintf(("interpretFunctionProlog16: unknown instruction 0x%x 0x%x 0x%x\n", pach[0], pach[1], pach[2]));
     
    9041042
    9051043
    906 #ifndef DEBUGR3
    9071044/**
    9081045 * Verifies the aImportTab.
     
    9131050USHORT _loadds _Far32 _Pascal VerifyImportTab32(void)
    9141051{
    915     int i;
    916     int cb;
    917     int cbmin;
     1052    USHORT  usRc;
     1053    int     i;
     1054    int     cb;
     1055    int     cbmin;
    9181056
    9191057    /* VerifyImporTab32 is called before the initroutine! */
     
    9211059
    9221060    /* Check that pKrnlOTE is set */
    923     if (GetKernelInfo32(NULL) != NO_ERROR)
    924         return STATUS_DONE | STERR | 1;
     1061    usRc = GetKernelInfo32(NULL);
     1062    if (usRc != NO_ERROR)
     1063        return (USHORT)(STATUS_DONE | STERR | (usRc & STECODE));
    9251064
    9261065    /*
     
    9331072         */
    9341073        kprintf2(("VerifyImportTab32: procedure no.%d is being checked: %s addr=0x%08x iObj=%d offObj=%d\n",
    935                   i, &_aImportTab[i].achName[0], _aImportTab[i].ulAddress,
    936                   _aImportTab[i].iObject, _aImportTab[i].offObject));
     1074                  i, &aImportTab[i].achName[0], aImportTab[i].ulAddress,
     1075                  aImportTab[i].iObject, aImportTab[i].offObject));
    9371076
    9381077        /* Verify that it is found */
    939         if (!_aImportTab[i].fFound)
    940         {
    941             kprintf(("VerifyImportTab32: procedure no.%d was not fFound!\n", i));
    942             return STATUS_DONE | STERR | 2;
     1078        if (!aImportTab[i].fFound)
     1079        {
     1080            if (aImportTab[i].fType & EPT_NOT_REQ)
     1081                continue;
     1082            else
     1083            {
     1084                kprintf(("VerifyImportTab32: procedure no.%d was not fFound!\n", i));
     1085                return STATUS_DONE | STERR | ERROR_D32_PROC_NOT_FOUND;
     1086            }
    9431087        }
    9441088
    9451089        /* Verify read/writeable. */
    946         if (_aImportTab[i].iObject >= pKrnlSMTE->smte_objcnt                                /* object index valid? */
    947             || _aImportTab[i].ulAddress < pKrnlOTE[_aImportTab[i].iObject].ote_base         /* address valid? */
    948             || _aImportTab[i].ulAddress + 16 > (pKrnlOTE[_aImportTab[i].iObject].ote_base +
    949                                                 pKrnlOTE[_aImportTab[i].iObject].ote_size)  /* address valid? */
    950             || _aImportTab[i].ulAddress - _aImportTab[i].offObject
    951                != pKrnlOTE[_aImportTab[i].iObject].ote_base                                 /* offObject ok?  */
     1090        if (aImportTab[i].iObject >= pKrnlSMTE->smte_objcnt                                /* object index valid? */
     1091            || aImportTab[i].ulAddress < pKrnlOTE[aImportTab[i].iObject].ote_base          /* address valid? */
     1092            || aImportTab[i].ulAddress + 16 > (pKrnlOTE[aImportTab[i].iObject].ote_base +
     1093                                                pKrnlOTE[aImportTab[i].iObject].ote_size)  /* address valid? */
     1094            || aImportTab[i].ulAddress - aImportTab[i].offObject
     1095               != pKrnlOTE[aImportTab[i].iObject].ote_base                                 /* offObject ok?  */
    9521096            )
    9531097        {
    9541098            kprintf(("VerifyImportTab32: procedure no.%d has an invalid address or object number.!\n"
    9551099                     "                   %s  addr=0x%08x iObj=%d offObj=%d\n",
    956                      i, &_aImportTab[i].achName[0], _aImportTab[i].ulAddress,
    957                      _aImportTab[i].iObject, _aImportTab[i].offObject));
    958             return STATUS_DONE | STERR | 3;
     1100                     i, &aImportTab[i].achName[0], aImportTab[i].ulAddress,
     1101                     aImportTab[i].iObject, aImportTab[i].offObject));
     1102            return STATUS_DONE | STERR | ERROR_D32_INVALID_OBJ_OR_ADDR;
    9591103        }
    9601104
    9611105
    962 
    963         if (_aImportTab[i].ulAddress < 0xffe00000UL)
     1106        #ifndef R3TST
     1107        if (aImportTab[i].ulAddress < 0xff400000UL)
    9641108        {
    9651109            kprintf(("VerifyImportTab32: procedure no.%d has an invalid address, %#08x!\n",
    966                      i, _aImportTab[i].ulAddress));
    967             return STATUS_DONE | STERR | 4;
     1110                     i, aImportTab[i].ulAddress));
     1111            return STATUS_DONE | STERR | ERROR_D32_INVALID_ADDRESS;
    9681112        }
    969 
    970         switch (_aImportTab[i].fType & ~EPT_BIT_MASK)
     1113        #endif
     1114
     1115        switch (aImportTab[i].fType & ~(EPT_BIT_MASK | EPT_NOT_REQ))
    9711116        {
    9721117            case EPT_PROC:
     
    9751120                 * Verify known function prolog.
    9761121                 */
    977                 if (EPT32BitEntry(_aImportTab[i]))
     1122                if (EPT32BitEntry(aImportTab[i]))
    9781123                {
    979                     cb = interpretFunctionProlog32((char*)_aImportTab[i].ulAddress,
    980                                                    _aImportTab[i].fType == EPT_PROC32);
     1124                    cb = interpretFunctionProlog32((char*)aImportTab[i].ulAddress,
     1125                                                   aImportTab[i].fType == EPT_PROC32);
    9811126                    cbmin = 5; /* Size of the jump instruction */
    9821127                }
    9831128                else
    9841129                {
    985                     cb = interpretFunctionProlog16((char*)_aImportTab[i].ulAddress,
    986                                                    _aImportTab[i].fType == EPT_PROC16);
     1130                    cb = interpretFunctionProlog16((char*)aImportTab[i].ulAddress,
     1131                                                   aImportTab[i].fType == EPT_PROC16);
    9871132                    cbmin = 7; /* Size of the far jump instruction */
    9881133                }
     
    9911136                 * Check result of the function prolog interpretations.
    9921137                 */
    993                 if (cb <= 0 && cb + cbmin >= MAXSIZE_PROLOG)
     1138                if (cb <= 0 || cb + cbmin >= MAXSIZE_PROLOG)
    9941139                {   /* failed, too small or too large. */
    995                     kprintf(("VerifyImportTab32: verify failed for procedure no.%d (cd=%d)\n", i, cb));
    996                     return STATUS_DONE | STERR | 5;
     1140                    kprintf(("VerifyImportTab32: verify failed for procedure no.%d (cb=%d)\n", i, cb));
     1141                    return STATUS_DONE | STERR | ERROR_D32_TOO_INVALID_PROLOG;
    9971142                }
    9981143                break;
     
    10031148
    10041149            default:
    1005                 kprintf(("VerifyImportTab32: only EPT_PROC is implemented\n",i));
     1150                kprintf(("VerifyImportTab32: invalid type/type not implemented\n",i));
    10061151                Int3(); /* temporary fix! */
    1007                 return STATUS_DONE | STERR | 6;
     1152                return STATUS_DONE | STERR | ERROR_D32_NOT_IMPLEMENTED;
    10081153        }
    10091154    }
     
    10171162 * @returns   NO_ERROR on success. !0 on error.
    10181163 */
    1019 static int importTabInit(void)
     1164int importTabInit(void)
    10201165{
    1021     /* This table must be updated with the overloading functions. */
     1166    /* This table must be updated with the overloading functions.
     1167     * It should also hold NOP functions for functions which are of the
     1168     * not required type.
     1169     */
    10221170    static unsigned auFuncs[NBR_OF_KRNLIMPORTS] =
    10231171    {
    1024         (unsigned)myldrRead,
    1025         (unsigned)myldrOpen,
    1026         (unsigned)myldrClose,
    1027         (unsigned)myLDRQAppType,
    1028         (unsigned)myldrEnum32bitRelRecs,
    1029         0,
    1030         0,
    1031         0,
    1032         0,
    1033         0,
    1034         0,
    1035         0,
    1036         0,
    1037         (unsigned)&mytkExecPgm,
    1038         0,
    1039         0,
    1040         0,
    1041         0
     1172        (unsigned)myldrRead,            /* 0 */
     1173        (unsigned)myldrOpen,            /* 1 */
     1174        (unsigned)myldrClose,           /* 2 */
     1175        (unsigned)myLDRQAppType,        /* 3 */
     1176        (unsigned)myldrEnum32bitRelRecs,/* 4 */
     1177        0,                              /* 5 */
     1178        0,                              /* 6 */
     1179        0,                              /* 7 */
     1180        0,                              /* 8 */
     1181        0,                              /* 9 */
     1182        0,                              /* 10 */
     1183        0,                              /* 11 */
     1184        0,                              /* 12 */
     1185        (unsigned)&mytkExecPgm,         /* 13 */
     1186        (unsigned)&mytkStartProcess,    /* 14 */
     1187        0,                              /* 15 */
     1188        0,                              /* 16 */
     1189        0,                              /* 17 */
     1190        0,                              /* 18 */
     1191        0,                              /* 19 */
     1192        (unsigned)myldrOpenPath,        /* 20 */
     1193        0,                              /* 21 */
     1194        0,                              /* 22 */
     1195        0,                              /* 23 */
     1196        0,                              /* 24 */
     1197        0,                              /* 25 */
     1198        0,                              /* 26 */
     1199        0,                              /* 27 */
     1200        0,                              /* 28 */
     1201        0,                              /* 29 */
     1202        0,                              /* 30 */
     1203        0,                              /* 31 */
     1204        0,                              /* 32 */
     1205        0,                              /* 33 */
     1206        0,                              /* 34 */
     1207        0,                              /* 35 */
     1208        0,                              /* 36 */
     1209        0,                              /* 37 */
     1210        0,                              /* 38 */
     1211        0,                              /* 39 */
     1212        0,                              /* 40 */
     1213        (unsigned)nopSecPathFromSFN,    /* 41 */
    10421214    };
    1043 
    10441215    int i;
    10451216    int cb;
    10461217    int cbmin;
     1218
     1219#ifdef R3TST
     1220    R3TstFixImportTab();
     1221#endif
    10471222
    10481223    /*
     
    10521227    {
    10531228        /* EPT_VARIMPORTs are skipped */
    1054         if ((_aImportTab[i].fType & ~EPT_BIT_MASK) == EPT_VARIMPORT)
     1229        if ((aImportTab[i].fType & ~EPT_BIT_MASK) == EPT_VARIMPORT)
    10551230            continue;
    1056 
    1057         if (EPT32BitEntry(_aImportTab[i]))
    1058         {
    1059             cb = interpretFunctionProlog32((char*)_aImportTab[i].ulAddress, _aImportTab[i].fType == EPT_PROC32);
     1231        /* EPT_NOT_REQ which is not found are set pointing to the nop function provided. */
     1232        if (!aImportTab[i].fFound && (aImportTab[i].fType & EPT_NOT_REQ))
     1233        {
     1234            aImportTab[i].ulAddress = auFuncs[i];
     1235            continue;
     1236        }
     1237
     1238        if (EPT32BitEntry(aImportTab[i]))
     1239        {
     1240            cb = interpretFunctionProlog32((char*)aImportTab[i].ulAddress, aImportTab[i].fType == EPT_PROC32);
    10601241            cbmin = 5; /* Size of the jump instruction */
    10611242        }
    10621243        else
    10631244        {
    1064             cb = interpretFunctionProlog16((char*)_aImportTab[i].ulAddress, _aImportTab[i].fType == EPT_PROC16);
     1245            cb = interpretFunctionProlog16((char*)aImportTab[i].ulAddress, aImportTab[i].fType == EPT_PROC16);
    10651246            cbmin = 7; /* Size of the far jump instruction */
    10661247        }
     
    10681249        {
    10691250            kprintf(("ImportTabInit: Verify failed for procedure no.%d, cb=%d\n", i, cb));
    1070             return 1;
     1251            return ERROR_D32_VERIFY_FAILED;
    10711252        }
    10721253    }
     
    10771258    for (i = 0; i < NBR_OF_KRNLIMPORTS; i++)
    10781259    {
    1079         switch (_aImportTab[i].fType)
     1260        switch (aImportTab[i].fType & ~EPT_NOT_REQ)
    10801261        {
    10811262            /*
     
    10871268            case EPT_PROC32:
    10881269            {
    1089                 cb = interpretFunctionProlog32((char*)_aImportTab[i].ulAddress, TRUE);
    1090                 _aImportTab[i].cbProlog = (char)cb;
     1270                cb = interpretFunctionProlog32((char*)aImportTab[i].ulAddress, TRUE);
     1271                aImportTab[i].cbProlog = (char)cb;
    10911272                if (cb >= 5 && cb + 5 < MAXSIZE_PROLOG) /* 5(1st): size of jump instruction in the function prolog which jumps to my overloading function */
    10921273                {                                       /* 5(2nd): size of jump instruction which jumps back to the original function after executing the prolog copied to the callTab entry for this function. */
     
    10941275                     * Copy function prolog which will be overwritten by the jmp to calltabl.
    10951276                     */
    1096                     memcpy(callTab[i], (void*)_aImportTab[i].ulAddress, (size_t)cb);
     1277                    memcpy(callTab[i], (void*)aImportTab[i].ulAddress, (size_t)cb);
    10971278
    10981279                    /*
     
    11021283                     */
    11031284                    callTab[i][cb] = 0xE9; /* jmp */
    1104                     *(unsigned long*)(void*)&callTab[i][cb+1] = _aImportTab[i].ulAddress + cb - (unsigned long)&callTab[i][cb+5];
     1285                    *(unsigned long*)(void*)&callTab[i][cb+1] = aImportTab[i].ulAddress + cb - (unsigned long)&callTab[i][cb+5];
    11051286
    11061287                    /*
    11071288                     * Jump from original function to my function - an cli(?) could be needed here
    11081289                     */
    1109                     *(char*)_aImportTab[i].ulAddress = 0xE9; /* jmp */
    1110                     *(unsigned long*)(_aImportTab[i].ulAddress + 1) = auFuncs[i] - (_aImportTab[i].ulAddress + 5);
     1290                    *(char*)aImportTab[i].ulAddress = 0xE9; /* jmp */
     1291                    *(unsigned long*)(aImportTab[i].ulAddress + 1) = auFuncs[i] - (aImportTab[i].ulAddress + 5);
    11111292                }
    11121293                else
    11131294                {   /* !fatal! - this could never happen really... */
    1114                     kprintf(("ImportTabInit: FATAL verify failed for procedure no.%d when rehooking it!\n",i));
     1295                    kprintf(("ImportTabInit: FATAL verify failed for procedure no.%d when rehooking it!\n", i));
    11151296                    Int3(); /* ipe - later! */
    1116                     return 1;
     1297                    return ERROR_D32_VERIFY_FAILED;
    11171298                }
    11181299                break;
     
    11291310                Int3();
    11301311
    1131                 cb = interpretFunctionProlog16((char*)_aImportTab[i].ulAddress, TRUE);
    1132                 _aImportTab[i].cbProlog = (char)cb;
     1312                cb = interpretFunctionProlog16((char*)aImportTab[i].ulAddress, TRUE);
     1313                aImportTab[i].cbProlog = (char)cb;
    11331314                if (cb >= 8 && cb + 7 < MAXSIZE_PROLOG) /* 8: size of a 16:32 jump which jumps to my overloading function (prefixed with 66h in a 16-bit segment) */
    11341315                {                                       /* 7: size of a 16:32 jump which is added to the call tab */
     
    11361317                     * Copy function prolog which is to be overwritten.
    11371318                     */
    1138                     memcpy(callTab[i], (void*)_aImportTab[i].ulAddress, (size_t)cb);
     1319                    memcpy(callTab[i], (void*)aImportTab[i].ulAddress, (size_t)cb);
    11391320
    11401321                    /*
     
    11431324                     */
    11441325                    callTab[i][cb] = 0xEA; /* jmp far ptr */
    1145                     *(unsigned long*)(void*)&callTab[i][cb+1] = _aImportTab[i].offObject;
    1146                     *(unsigned short*)(void*)&callTab[i][cb+5] = _aImportTab[i].usSel;
     1326                    *(unsigned long*)(void*)&callTab[i][cb+1] = aImportTab[i].offObject;
     1327                    *(unsigned short*)(void*)&callTab[i][cb+5] = aImportTab[i].usSel;
    11471328
    11481329                    /*
     
    11501331                     * 0x66 0xEA <four byte target address> <two byte target selector>
    11511332                     */
    1152                     *(char*)(_aImportTab[i].ulAddress    ) = 0x66;    /* operandsize prefix */
    1153                     *(char*)(_aImportTab[i].ulAddress + 1) = 0xEA;    /* jmp far ptr */
    1154                     *(unsigned long*)(_aImportTab[i].ulAddress + 2) = auFuncs[i];   /* FIXME? */
    1155                     *(unsigned short*)(_aImportTab[i].ulAddress + 6) = _R0FlatCS16; /* FIXME */
     1333                    *(char*)(aImportTab[i].ulAddress    ) = 0x66;    /* operandsize prefix */
     1334                    *(char*)(aImportTab[i].ulAddress + 1) = 0xEA;    /* jmp far ptr */
     1335                    *(unsigned long*)(aImportTab[i].ulAddress + 2) = auFuncs[i];   /* FIXME? */
     1336                    *(unsigned short*)(aImportTab[i].ulAddress + 6) = _R0FlatCS16; /* FIXME */
    11561337                }
    11571338                else
    11581339                {   /* !fatal! - this could never happen really... */
    1159                     kprintf(("ImportTabInit: FATAL verify failed for procedure no.%d when rehooking it!\n",i));
     1340                    kprintf(("ImportTabInit: FATAL verify failed for procedure no.%d when rehooking it!\n", i));
    11601341                    Int3(); /* ipe - later! */
    1161                     return 1;
     1342                    return ERROR_D32_VERIFY_FAILED;
    11621343                }
    11631344                break;
     
    11711352            case EPT_PROCIMPORT32:
    11721353            {
    1173                 cb = interpretFunctionProlog32((char*)_aImportTab[i].ulAddress, FALSE);
    1174                 _aImportTab[i].cbProlog = (char)cb;
     1354                cb = interpretFunctionProlog32((char*)aImportTab[i].ulAddress, FALSE);
     1355                aImportTab[i].cbProlog = (char)cb;
    11751356                if (cb > 0) /* Since no prolog part is copied to the function table, it's ok as long as the prolog has been recognzied. */
    11761357                {
     
    11811362                     */
    11821363                    callTab[i][0] = 0xE9; /* jmp */
    1183                     *(unsigned*)(void*)&callTab[i][1] = _aImportTab[i].ulAddress - (unsigned)&callTab[i][5];
     1364                    *(unsigned*)(void*)&callTab[i][1] = aImportTab[i].ulAddress - (unsigned)&callTab[i][5];
    11841365                }
    11851366                else
    11861367                {   /* !fatal! - this should never really happen... */
    1187                     kprintf(("ImportTabInit: FATAL verify failed for procedure no.%d when importing it!\n",i));
     1368                    kprintf(("ImportTabInit: FATAL verify failed for procedure no.%d when importing it!\n", i));
    11881369                    Int3(); /* ipe - later! */
    1189                     return 1;
     1370                    return ERROR_D32_VERIFY_FAILED;
    11901371                }
    11911372                break;
     
    11991380            case EPT_PROCIMPORT16:
    12001381            {
    1201                 cb = interpretFunctionProlog16((char*)_aImportTab[i].ulAddress, FALSE);
    1202                 _aImportTab[i].cbProlog = (char)cb;
     1382                cb = interpretFunctionProlog16((char*)aImportTab[i].ulAddress, FALSE);
     1383                aImportTab[i].cbProlog = (char)cb;
    12031384                if (cb > 0) /* Since no prolog part is copied to the function table, it's ok as long as the prolog has been recognzied. */
    12041385                {
     
    12081389                     */
    12091390                    callTab[i][0] = 0xEA; /* jmp far ptr */
    1210                     *(unsigned long*)(void*)&callTab[i][1] = _aImportTab[i].offObject;
    1211                     *(unsigned short*)(void*)&callTab[i][5] = _aImportTab[i].usSel;
     1391                    *(unsigned long*)(void*)&callTab[i][1] = aImportTab[i].offObject;
     1392                    *(unsigned short*)(void*)&callTab[i][5] = aImportTab[i].usSel;
    12121393                }
    12131394                else
    12141395                {   /* !fatal! - this should never really happen... */
    1215                     kprintf(("ImportTabInit: FATAL verify failed for procedure no.%d when importing it!\n",i));
     1396                    kprintf(("ImportTabInit: FATAL verify failed for procedure no.%d when importing it!\n", i));
    12161397                    Int3(); /* ipe - later! */
    1217                     return 1;
     1398                    return ERROR_D32_VERIFY_FAILED;
    12181399                }
    12191400                break;
     
    12311412            case EPT_VARIMPORT32:
    12321413            case EPT_VARIMPORT16:
    1233                 _aImportTab[i].cbProlog = (char)0;
    1234                 *(unsigned long*)(void*)&callTab[i][0] = _aImportTab[i].ulAddress;
    1235                 *(unsigned long*)(void*)&callTab[i][4] = _aImportTab[i].offObject;
    1236                 *(unsigned short*)(void*)&callTab[i][8] = _aImportTab[i].usSel;
    1237                 *(unsigned short*)(void*)&callTab[i][0xa] = (unsigned short)_aImportTab[i].offObject;
    1238                 *(unsigned short*)(void*)&callTab[i][0xc] = _aImportTab[i].usSel;
     1414                aImportTab[i].cbProlog = (char)0;
     1415                *(unsigned long*)(void*)&callTab[i][0] = aImportTab[i].ulAddress;
     1416                *(unsigned long*)(void*)&callTab[i][4] = aImportTab[i].offObject;
     1417                *(unsigned short*)(void*)&callTab[i][8] = aImportTab[i].usSel;
     1418                *(unsigned short*)(void*)&callTab[i][0xa] = (unsigned short)aImportTab[i].offObject;
     1419                *(unsigned short*)(void*)&callTab[i][0xc] = aImportTab[i].usSel;
    12391420                break;
    12401421
     
    12421423                kprintf(("ImportTabInit: unsupported type. (procedure no.%d, cb=%d)\n", i, cb));
    12431424                Int3(); /* ipe - later! */
    1244                 return 1;
     1425                return ERROR_D32_VERIFY_FAILED;
    12451426        } /* switch - type */
    12461427    }   /* for */
     
    12481429    return NO_ERROR;
    12491430}
    1250 #endif /* !DEBUGR3 */
    1251 
    1252 
    1253 
    1254 
    1255 /*******************************************************************************
    1256 *   Ring-3 Debug Stuff
    1257 *******************************************************************************/
    1258 #ifdef DEBUGR3
    1259 #include <stdio.h>
    1260 
    1261 void main(void)
     1431
     1432
     1433#ifdef R3TST
     1434/**
     1435 * Creates a fake kernel MTE, SMTE and OTE for use while testing in Ring3.
     1436 * @returns Pointer to the fake kernel MTE.
     1437 * @status  completely implemented.
     1438 * @author  knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     1439 */
     1440PMTE GetOS2KrnlMTETst(void)
    12621441{
    1263     char ach_ldrRead[] = {
    1264         0x55, 0x8b, 0xec, 0x8d, 0x65, 0xf8, 0x53, 0x56,
    1265         0x57, 0x33, 0xd2, 0x42, 0x89, 0x55, 0xf8, 0x38,
    1266         0x35, 0xce, 0x70, 0x00, 0x00, 0x75, 0x4d, 0x8b,
    1267         0x55, 0x08, 0x66, 0x83, 0xfa, 0xff, 0x74, 0x62
    1268     };
    1269     char ach_ldrOpen[] = {
    1270         0x55, 0x8b, 0xec, 0x33, 0xc0, 0x38, 0x05, 0xce,
    1271         0x70, 0x00, 0x00, 0x75, 0x4b, 0x50, 0xff, 0x75,
    1272         0x08, 0x6a, 0x01, 0x68, 0xa3, 0x00, 0x00, 0x00,
    1273         0xff, 0x75, 0x0c, 0xff, 0x15, 0xc4, 0xc1, 0x0d
    1274     };
    1275     char ach_ldrClose[] = {
    1276         0x55, 0x8b, 0xec, 0x33, 0xc0, 0x38, 0x05, 0xce,
    1277         0x70, 0x00, 0x00, 0x75, 0x13, 0x8b, 0x55, 0x08,
    1278         0x0f, 0xb7, 0xd2, 0x66, 0x83, 0xfa, 0xff, 0x74,
    1279         0x07, 0x52, 0xff, 0x15, 0xcc, 0xc1, 0x0d, 0x00
    1280     };
    1281     char ach_LDRQAppType[] = {
    1282         0x55, 0x8b, 0x0d, 0xa0, 0x0a, 0x00, 0x00, 0x8b,
    1283         0xec, 0x83, 0xec, 0x3c, 0x53, 0x81, 0xc1, 0x24,
    1284         0x06, 0x00, 0x00, 0x57, 0x56, 0x6a, 0xff, 0x66,
    1285         0xc7, 0x45, 0xc6, 0x00, 0x00, 0x51, 0xe8, 0x38
    1286     };
    1287     char ach_ldrEnum32bitRelRecs[] = {
    1288         0x55, 0xa1, 0xe8, 0xcf, 0x0d, 0x00, 0x8b, 0xec,
    1289         0x83, 0xec, 0x5c, 0x53, 0x8b, 0x55, 0x08, 0x57,
    1290         0x56, 0x8b, 0x52, 0x04, 0xf6, 0x40, 0x04, 0x80,
    1291         0x89, 0x55, 0xfc, 0x0f, 0x84, 0x10, 0x01, 0x00
    1292     };
    1293     char ach_IOSftOpen[] = {
    1294         0x55, 0x8b, 0xec, 0x8d, 0xa5, 0xa0, 0xfe, 0xff,
    1295         0xff, 0xf6, 0x05, 0x95, 0x2d, 0x00, 0x00, 0x80,
    1296         0x74, 0x13, 0x66, 0x68, 0x50, 0x30, 0xff, 0x75,
    1297         0x08, 0x6a, 0x3c, 0x6a, 0x06, 0xe8, 0x5a, 0x03
    1298     };
    1299     char ach_IOSftClose[] = {
    1300         0x55, 0x8b, 0xec, 0x8d, 0xa5, 0x28, 0xff, 0xff,
    1301         0xff, 0xf6, 0x05, 0x95, 0x2d, 0x00, 0x00, 0x80,
    1302         0x74, 0x16, 0x50, 0x66, 0x68, 0x51, 0x30, 0x8b,
    1303         0x45, 0x08, 0x50, 0x6a, 0x0c, 0x6a, 0x06, 0xe8
    1304     };
    1305     char ach_IOSftTransPath[] = {
    1306         0x55, 0x8b, 0xec, 0x8d, 0xa5, 0xd8, 0xfd, 0xff,
    1307         0xff, 0x53, 0x56, 0x57, 0x1e, 0x06, 0xa1, 0xa4,
    1308         0x0a, 0x00, 0x00, 0x66, 0x8d, 0x9d, 0xe2, 0xfe,
    1309         0xff, 0xff, 0x66, 0x89, 0x98, 0xf6, 0x01, 0x00
    1310     };
    1311     char ach_IOSftReadAt[] = {
    1312         0xb8, 0xc4, 0x68, 0x14, 0x00, 0xeb, 0x05, 0xb8,
    1313         0xcc, 0x68, 0x14, 0x00, 0x55, 0x8b, 0xec, 0x8d,
    1314         0xa5, 0x20, 0xff, 0xff, 0xff, 0xf6, 0x05, 0x95,
    1315         0x2d, 0x00, 0x00, 0x80, 0x74, 0x28, 0x50, 0x66
    1316     };
    1317     char ach_IOSftWriteAt[] = {
    1318         0xb8, 0xcc, 0x68, 0x14, 0x00, 0x55, 0x8b, 0xec,
    1319         0x8d, 0xa5, 0x20, 0xff, 0xff, 0xff, 0xf6, 0x05,
    1320         0x95, 0x2d, 0x00, 0x00, 0x80, 0x74, 0x28, 0x50,
    1321         0x66, 0x68, 0x52, 0x30, 0x8b, 0x45, 0x08, 0x25
    1322     };
    1323     char ach_SftFileSize[] = {
    1324         0x55, 0x8b, 0xec, 0x8d, 0xa5, 0x28, 0xff, 0xff,
    1325         0xff, 0x57, 0x56, 0x53, 0xc6, 0x85, 0x2b, 0xff,
    1326         0xff, 0xff, 0x00, 0x8b, 0x35, 0xa4, 0x0a, 0x00,
    1327         0x00, 0xf6, 0x46, 0x04, 0x01, 0x74, 0x0a, 0x80
    1328     };
    1329     char ach_VMAllocMem[] = {
    1330         0xa1, 0xe8, 0xcf, 0x0d, 0x00, 0x55, 0x8b, 0xec,
    1331         0x83, 0xec, 0x44, 0x53, 0x57, 0xf6, 0x40, 0x04,
    1332         0x80, 0x56, 0x0f, 0x84, 0x34, 0x01, 0x00, 0x00,
    1333         0xf6, 0x00, 0x40, 0x74, 0x44, 0xa1, 0xcc, 0x02
    1334     };
    1335     char ach_VMGetOwner[] = {
    1336         0x55, 0x8b, 0xec, 0x83, 0xec, 0x30, 0x57, 0x66,
    1337         0x8b, 0x4d, 0x08, 0x66, 0x89, 0x4d, 0xd8, 0xf6,
    1338         0xc1, 0x04, 0x75, 0x39, 0x80, 0x3d, 0x40, 0x8c,
    1339         0x00, 0x00, 0x00, 0x74, 0x07, 0xa1, 0xac, 0x0a
    1340     };
    1341     char achg_tkExecPgm[] = {
    1342         0x55, 0x8b, 0xec, 0x8d, 0x65, 0xa4, 0x66, 0x89,
    1343         0x5d, 0xf4, 0x66, 0x8c, 0x45, 0xf6, 0x66, 0x89,
    1344         0x55, 0xfc, 0x66, 0x8c, 0x5d, 0xfe, 0x66, 0x89,
    1345         0x75, 0xf0, 0x66, 0x89, 0x7d, 0xf2, 0xc7, 0x45
    1346     };
    1347     char achf_FuStrLenZ[] = {
    1348         0x6a, 0x02, 0x52, 0x66, 0x55, 0x0f, 0xa8, 0x68,
    1349         0x0c, 0x00, 0x0f, 0xa9, 0x65, 0x67, 0x66, 0x8b,
    1350         0x2d, 0xa8, 0x0a, 0x00, 0x00, 0x65, 0x67, 0xff,
    1351         0xb5, 0xb4, 0x1f, 0x00, 0x00, 0x65, 0x67, 0x66
    1352     };
    1353     char achf_FuStrLen[] = {
    1354         0x6a, 0x02, 0x52, 0x66, 0x55, 0x0f, 0xa8, 0x68,
    1355         0x0c, 0x00, 0x0f, 0xa9, 0x65, 0x67, 0x66, 0x8b,
    1356         0x2d, 0xa8, 0x0a, 0x00, 0x00, 0x65, 0x67, 0xff,
    1357         0xb5, 0xb4, 0x1f, 0x00, 0x00, 0x65, 0x67, 0x66
    1358     };
    1359     char achf_FuBuff[] = {
    1360         0x6a, 0x02, 0x52, 0x66, 0x55, 0x0f, 0xa8, 0x68,
    1361         0x0c, 0x00, 0x0f, 0xa9, 0x65, 0x67, 0x66, 0x8b,
    1362         0x2d, 0xa8, 0x0a, 0x00, 0x00, 0x65, 0x67, 0xff,
    1363         0xb5, 0xb4, 0x1f, 0x00, 0x00, 0x65, 0x67, 0x66
    1364     };
    1365     char achf_VMObjHandleInfo[] =  {
    1366         0x55, 0x8B, 0x0D, 0x9C, 0xBF, 0x0D, 0x00, 0x8B,
    1367         0xEC, 0x83, 0xEC, 0x0C, 0x53, 0x57, 0x8D, 0x55,
    1368         0xF8
    1369     };
    1370 
    1371 
    1372     char *aProcs[] =
     1442    static MTE    KrnlMTE;
     1443    static SMTE   KrnlSMTE;
     1444
     1445    KrnlMTE.mte_swapmte = &KrnlSMTE;
     1446    KrnlSMTE.smte_objtab = &aKrnlOTE[0];
     1447    KrnlSMTE.smte_objcnt = cObjectsFake;
     1448
     1449    return &KrnlMTE;
     1450}
     1451
     1452/**
     1453 * -Ring-3 testing-
     1454 * Changes the entries in aImportTab to point to their fake equivalents.
     1455 * @returns void
     1456 * @param   void
     1457 * @status  completely implemented.
     1458 * @author  knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     1459 * @remark  Called before the aImportTab array is used/verified.
     1460 */
     1461VOID R3TstFixImportTab(VOID)
     1462{
     1463    struct _TstFaker
    13731464    {
    1374         ach_ldrRead            ,
    1375         ach_ldrOpen            ,
    1376         ach_ldrClose           ,
    1377         ach_LDRQAppType        ,
    1378         ach_ldrEnum32bitRelRecs,
    1379         ach_IOSftOpen          ,
    1380         ach_IOSftClose         ,
    1381         ach_IOSftTransPath     ,
    1382         ach_IOSftReadAt        ,
    1383         ach_IOSftWriteAt       ,
    1384         ach_SftFileSize        ,
    1385         ach_VMAllocMem         ,
    1386         ach_VMGetOwner         ,
    1387         achg_tkExecPgm         ,
    1388         achf_FuStrLenZ         ,
    1389         achf_FuStrLen          ,
    1390         achf_FuBuff            ,
    1391         achf_VMObjHandleInfo   ,
    1392         NULL
     1465        unsigned   uAddress;
     1466        int        fObj;                   /* 1 = CODE32, 2 = CODE16, 3 = DATA32, 4 = DATA16 */
     1467    }
     1468    aTstFakers[NBR_OF_KRNLIMPORTS] =
     1469    {
     1470        {(unsigned)fakeldrRead,             1},
     1471        {(unsigned)fakeldrOpen,             1},
     1472        {(unsigned)fakeldrClose,            1},
     1473        {(unsigned)fakeLDRQAppType,         1},
     1474        {(unsigned)fakeldrEnum32bitRelRecs, 1},
     1475        {(unsigned)fakeIOSftOpen,           1},
     1476        {(unsigned)fakeIOSftClose,          1},
     1477        {(unsigned)fakeIOSftTransPath,      1},
     1478        {(unsigned)fakeIOSftReadAt,         1},
     1479        {(unsigned)fakeIOSftWriteAt,        1},
     1480        {(unsigned)fakeSftFileSize,         1},
     1481        {(unsigned)fakeVMAllocMem,          1},
     1482        {(unsigned)fakeVMGetOwner,          1},
     1483        {(unsigned)fakeg_tkExecPgm,         1},
     1484        {(unsigned)fake_tkStartProcess,     1},
     1485        {(unsigned)fakef_FuStrLenZ,         2},
     1486        {(unsigned)fakef_FuStrLen,          2},
     1487        {(unsigned)fakef_FuBuff,            2},
     1488        {(unsigned)fakeVMObjHandleInfo,     1},
     1489        {(unsigned)fakeldrASMpMTEFromHandle,1},
     1490        {(unsigned)fakeldrOpenPath,         1},
     1491        {(unsigned)fakeLDRClearSem,         1},
     1492        {(unsigned)fakeldrFindModule,       1},
     1493        {(unsigned)fakeKSEMRequestMutex,    1},
     1494        {(unsigned)fakeKSEMReleaseMutex,    1},
     1495        {(unsigned)fakeKSEMQueryMutex,      1},
     1496        {(unsigned)fakeKSEMInit,            1},
     1497        {(unsigned)&fakeLDRSem,             3},
     1498        {(unsigned)&fakeLDRLibPath,         3},
     1499        {(unsigned)fakeTKSuBuff,            1},
     1500        {(unsigned)fakeTKFuBuff,            1},
     1501        {(unsigned)fakeTKFuBufLen,          1},
     1502        {(unsigned)fakeldrValidateMteHandle,1},
     1503        {(unsigned)&fakepTCBCur,            4},
     1504        {(unsigned)&fakepPTDACur,           4},
     1505        {(unsigned)&fakeptda_start,         4},
     1506        {(unsigned)&fakeptda_environ,       4},
     1507        {(unsigned)&fakeptda_ptdasem,       4},
     1508        {(unsigned)&fakeptda_module,        4},
     1509        {(unsigned)&fakeptda_pBeginLIBPATH, 4},
     1510        {(unsigned)&fakeldrpFileNameBuf,    3},
     1511        {(unsigned)&fakeSecPathFromSFN,     3}
    13931512    };
    13941513    int i;
    13951514
    1396     /* loop thru procs */
    1397     for (i = 0; aProcs[i] != NULL; i++)
     1515    for (i = 0; i < NBR_OF_KRNLIMPORTS; i++)
    13981516    {
    1399         unsigned cb;
    1400         printf("Proc.no.%i\n", i);
    1401         if (i < 14 || i > 16)
    1402             cb = interpretFunctionProlog32(aProcs[i], i < 5 || i == 13);
    1403         else
    1404             cb = interpretFunctionProlog16(aProcs[i], FALSE);
    1405         printf(" cb=%d\n\n", cb);
    1406     }
     1517        switch (aImportTab[i].fType)
     1518        {
     1519            case EPT_PROC32:
     1520                if (aTstFakers[i].fObj != 1)
     1521                    kprintf(("R3TstFixImportTab: invalid segment config for entry %i. (PROC32)\n", i));
     1522                break;
     1523            case EPT_PROCIMPORT32:
     1524                if (aTstFakers[i].fObj != 1)
     1525                    kprintf(("R3TstFixImportTab: invalid segment config for entry %i. (PROCIMPORT32)\n", i));
     1526                break;
     1527            case EPT_PROCIMPORT16:
     1528                if (aTstFakers[i].fObj != 2)
     1529                    kprintf(("R3TstFixImportTab: invalid segment config for entry %i. (PROCIMPORT16)\n", i));
     1530                break;
     1531            case EPT_VARIMPORT32:
     1532            case EPT_VARIMPORT16:
     1533                if (aTstFakers[i].fObj != 3 && aTstFakers[i].fObj != 4)
     1534                    kprintf(("R3TstFixImportTab: invalid segment config for entry %i. (VARIMPORT32/16)\n", i));
     1535                break;
     1536        } /* switch - type */
     1537
     1538        aImportTab[i].ulAddress = aTstFakers[i].uAddress;
     1539        switch (aTstFakers[i].fObj)
     1540        {
     1541            case 1:
     1542                aImportTab[i].usSel = GetSelectorCODE32();
     1543                aImportTab[i].offObject = aTstFakers[i].uAddress - (unsigned)&CODE32START;
     1544                break;
     1545            case 2:
     1546                aImportTab[i].usSel = GetSelectorCODE16();
     1547                aImportTab[i].offObject = aTstFakers[i].uAddress - (unsigned)&CODE16START;
     1548                break;
     1549            case 3:
     1550                aImportTab[i].usSel = GetSelectorDATA32();
     1551                aImportTab[i].offObject = aTstFakers[i].uAddress - (unsigned)&DATA32START;
     1552                break;
     1553            case 4:
     1554                aImportTab[i].usSel = GetSelectorDATA16();
     1555                aImportTab[i].offObject = aTstFakers[i].uAddress - (unsigned)&DATA16START;
     1556                break;
     1557            default:
     1558                kprintf(("R3TstFixImportTab: invalid segment config for entry %i.\n", i));
     1559        }
     1560    } /* for */
    14071561}
    14081562#endif
     1563
     1564/**
     1565 * Dummy nop function if SecPathFromSFN isn't found.
     1566 */
     1567PSZ SECCALL nopSecPathFromSFN(SFN hFile)
     1568{
     1569    NOREF(hFile);
     1570    return NULL;
     1571}
  • trunk/src/win32k/dev32/devfirst.asm

    r2898 r4164  
    1 ; $Id: devfirst.asm,v 1.5 2000-02-25 18:15:03 bird Exp $
     1; $Id: devfirst.asm,v 1.6 2000-09-02 21:07:58 bird Exp $
    22;
    33; DevFirst - entrypoint and segment definitions
     
    1919;
    2020    public CODE16START
     21    public CODE16_INITSTART
    2122    public DATA16START
    2223    public DATA16START
    2324    public DATA16_BSSSTART
    2425    public DATA16_CONSTSTART
     26    public DATA16_INITSTART
    2527    public CODE16START
    2628    public CODE32START
     
    6062;$win32ki entry point
    6163_strategyAsm0:
     64;    int 3
    6265    push    0
    6366    jmp     _strategyAsm
     
    6568;$win32k entry point
    6669_strategyAsm1:
     70;    int 3
    6771    push    1
    6872    jmp     _strategyAsm
     
    101105    call    far ptr FLAT:GETKERNELINFO32
    102106    pop     ds
    103     retn
     107    ret
    104108_CallGetKernelInfo32 ENDP
    105109
     
    155159; @author    knut st. osmundsen
    156160; @remark    es is cs, not ds!
    157 _SSToDS_16a proc near
     161_SSToDS_16a proc NEAR
    158162    assume CS:CODE16, DS:DATA16, ES:NOTHING
    159163    mov     edx, ds:_TKSSBase16         ; get pointer held by _TKSSBase16 (pointer to stack base)
     
    168172    mov     edx, eax
    169173    shr     edx, 16                     ; dx high 16-bit of 32-bit stack pointer.
    170     ret
     174    retn
    171175_SSToDS_16a endp
    172176
     
    218222CODE32 ends
    219223
     224CODE16_INIT segment
     225CODE16_INITSTART label byte
     226CODE16_INIT ends
    220227
    221228DATA16 segment
     
    231238DATA16_CONST ends
    232239
     240DATA16_INIT segment
     241DATA16_INITSTART label byte
     242DATA16_INIT ends
     243
    233244DATA32 segment
    234245DATA32START label byte
  • trunk/src/win32k/dev32/devlast.asm

    r2898 r4164  
    1 ; $Id: devlast.asm,v 1.5 2000-02-25 18:15:03 bird Exp $
     1; $Id: devlast.asm,v 1.6 2000-09-02 21:07:58 bird Exp $
    22;
    33; DevLast - the object file termintating the resident part of the objects.
     
    2121; Exported symbols
    2222;
    23     public CODE16END
    2423    public DATA16END
    2524    public DATA16_BSSEND
    2625    public DATA16_CONSTEND
     26    public DATA16_INITEND
     27    public DATA16_INIT_BSSEND
     28    public DATA16_INIT_CONSTEND
    2729    public CODE16END
     30    public CODE16_INITEND
    2831    public CODE32END
    2932    public DATA32END
     
    3235    public _VFTEND
    3336    public EH_DATAEND
     37
    3438    public _CallR0Init32
    3539    public _CallVerifyImportTab32
     
    5256DATA16_CONST ends
    5357
     58DATA16_INIT segment
     59DATA16_INITEND db ?
     60DATA16_INIT ends
     61
     62DATA16_INIT_BSS segment
     63DATA16_INIT_BSSEND db ?
     64DATA16_INIT_BSS ends
     65
     66DATA16_INIT_CONST segment
     67DATA16_INIT_CONSTEND db ?
     68DATA16_INIT_CONST ends
     69
     70CODE16 segment
     71CODE16END db ?
     72CODE16 ends
    5473
    5574extrn R0INIT32:FAR
    5675extrn VERIFYIMPORTTAB32:FAR
    5776
    58 CODE16 segment
    59 CODE16END db ?
    60 
     77CODE16_INIT segment
    6178;;
    6279; Thunk procedure for R0Init32.
     
    6784; @author    knut st. osmundsen
    6885_CallR0Init32 PROC NEAR
    69     ASSUME CS:CODE16
     86    ASSUME CS:CODE16_INIT
    7087    push    ds
    7188    push    word ptr [esp+6]            ; push high word.
     
    7390    call    far ptr FLAT:R0INIT32
    7491    pop     ds
    75     retn
     92    ret
    7693_CallR0Init32 ENDP
    7794
     
    84101; @author    knut st. osmundsen
    85102_CallVerifyImportTab32 PROC NEAR
    86     ASSUME CS:CODE16
     103    ASSUME CS:CODE16_INIT
    87104    push    ds
    88105    call    far ptr FLAT:VERIFYIMPORTTAB32
    89106    pop     ds
    90     retn
     107    ret
    91108_CallVerifyImportTab32 ENDP
    92109
    93 CODE16 ends
     110CODE16_INITEND LABEL BYTE
     111CODE16_INIT ends
    94112
    95113
     
    118136EH_DATA ends
    119137
     138
    120139END
    121140
  • trunk/src/win32k/elf2lx/elf2lx.cpp

    r2924 r4164  
    1 /* $Id: elf2lx.cpp,v 1.3 2000-02-27 02:13:19 bird Exp $
     1/* $Id: elf2lx.cpp,v 1.4 2000-09-02 21:07:58 bird Exp $
    22 *
    33 * Elf2Lx - implementation.
     
    2828#include <newexe.h>                     /* OS/2 NE structs and definitions. */
    2929#include <exe386.h>                     /* OS/2 LX structs and definitions. */
     30
     31#include "devSegDf.h"                   /* Win32k segment definitions. */
    3032
    3133#include "malloc.h"                     /* win32k malloc (resident). Not C library! */
  • trunk/src/win32k/include/LdrCalls.h

    r2501 r4164  
    1 /* $Id: LdrCalls.h,v 1.3 2000-01-22 18:21:00 bird Exp $
     1/* $Id: LdrCalls.h,v 1.4 2000-09-02 21:08:02 bird Exp $
    22 *
    33 * Prototypes for the loader overrided function.
     
    3535 */
    3636extern ULONG LDRCALL ldrOpen(   /* retd  0x0c */
    37     PSFN p1,                    /* ebp + 0x08 */
    38     PCHAR p2,                   /* ebp + 0x0c */
    39     ULONG p3                    /* ebp + 0x10 */
    40     );
    41 
    42 ULONG LDRCALL myldrOpen(PSFN,PCHAR,ULONG);
     37    PSFN    p1,                 /* ebp + 0x08 */
     38    PCHAR   p2,                 /* ebp + 0x0c */
     39    PULONG  p3                  /* ebp + 0x10 */
     40    );
     41
     42ULONG LDRCALL myldrOpen(PSFN phFile, PSZ pszFilename, PULONG pfl);
    4343
    4444
     
    4747 */
    4848extern ULONG LDRCALL ldrRead(   /* retd  0x18 */
    49     SFN p1,                     /* ebp + 0x08 */
    50     ULONG p2,                   /* ebp + 0x0c */
    51     PVOID p3,                   /* ebp + 0x10 */
    52     ULONG p4,                   /* ebp + 0x14 */
    53     ULONG p5,                   /* ebp + 0x18 */
    54     PMTE p6                     /* ebp + 0x1c */
     49    SFN     hFile,              /* ebp + 0x08 */
     50    ULONG   ulOffset,           /* ebp + 0x0c */
     51    PVOID   pvBuffer,           /* ebp + 0x10 */
     52    ULONG   fpBuffer,           /* ebp + 0x14 */
     53    ULONG   cbToRead,           /* ebp + 0x18 */
     54    PMTE    pMTE                /* ebp + 0x1c */
    5555    );
    5656
    5757ULONG LDRCALL myldrRead(
    58     SFN   hFile,
    59     ULONG ulOffset,
    60     PVOID pBuffer,
    61     ULONG ulFlags ,
    62     ULONG ulBytesToRead,
    63     PMTE  pMTE
     58    SFN     hFile,
     59    ULONG   ulOffset,
     60    PVOID   pvBuffer,
     61    ULONG   fpBuffer,
     62    ULONG   cbToRead,
     63    PMTE    pMTE
    6464    );
    6565
     
    9999
    100100
    101 #if 0
    102 /****************************************/
    103 /* _LDRLoadExe                          */
    104 /****************************************/
    105 extern int LDRCALL _LDRLoadExe(     /* retd  0x08 */
    106         PCHAR pExeName,             /* ebp + 0x08 */
    107         PULONG param2               /* ebp + 0x0c */
    108     );
    109 
    110 int LDRCALL myLDRLoadExe(PCHAR,PULONG);
    111 
    112 
    113 
    114 /****************************************/
    115 /* _ldrGetResource                      */
    116 /****************************************/
    117 extern int LDRCALL _ldrGetResource( /* retd 0x14 - 20d */
    118         USHORT idType,              /* ebp + 0x08 */
    119         ULONG  idName,              /* ebp + 0x0c */
    120         USHORT hMod,                /* ebp + 0x10 */
    121         PPVOID ppRes,               /* ebp + 0x14 */
    122         ULONG ulP5                  /* ebp + 0x18 */
    123     );
    124 
    125 int LDRCALL myldrGetResource(USHORT,ULONG,USHORT,PPVOID,ULONG);
    126 
    127 
    128 
    129 /****************************************/
    130 /* _ldrOpenNewExe                       */
    131 /****************************************/
    132 extern int LDRCALL _ldrOpenNewExe(  /* retd 0x10 - 16d */
    133         PCHAR  pszName,             /* ebp + 0x08 */
    134         USHORT lenName,             /* ebp + 0x0c */
    135         ULONG  ulP3,                /* ebp + 0x10 */
    136         ULONG  ulP4                 /* ebp + 0x14 */
    137     );
    138 
    139 int LDRCALL myldrOpenNewExe(PCHAR,USHORT,ULONG,ULONG);
    140 
    141 
    142 
    143 /****************************************/
    144 /* _ldrCreateMte                        */
    145 /****************************************/
    146 extern int LDRCALL  _ldrCreateMte(  /* retd  0x08 */
    147         ULONG p1,                   /* ebp + 0x08 */
    148         ULONG p2                    /* ebp + 0x0c */
    149     );
    150 
    151 int LDRCALL myldrCreateMte(ULONG,ULONG);
    152 
    153 
    154 
    155 /****************************************/
    156 /* _ldrGetMte                           */
    157 /****************************************/
    158 extern int LDRCALL  _ldrGetMte(     /* retd 0x14 - 20d */
    159         ULONG  p1,                  /* ebp + 0x08 */
    160         ULONG  p2,                  /* ebp + 0x0c */
    161         ULONG  p3,                  /* ebp + 0x10 */
    162         ULONG  p4,                  /* ebp + 0x14 */
    163         ULONG  p5                   /* ebp + 0x18 */
    164     );
    165 
    166 int LDRCALL myldrGetMte(ULONG,ULONG,ULONG,ULONG,ULONG);
    167 
    168 #endif
     101
     102/**
     103 * Loader local variables from KERNEL.SDF.
     104 */
     105typedef struct ldrlv_s /* #memb 12 size 39 (0x027) */
     106{
     107    PMTE        lv_pmte;                /* Pointer to mte. (ldrCreateMte/ldrXXX) */
     108    ULONG       lv_lbufaddr;
     109    ULONG       lv_sbufaddr;
     110    ULONG       lv_lrecbufaddr;
     111    ULONG       lv_srecbufaddr;
     112    ULONG       lv_new_exe_off;
     113    USHORT      lv_sfn;                 /* Handle to the module being loaded */
     114    USHORT      lv_hobmte;
     115    ULONG       lv_objnum;
     116    ULONG       lv_csmte;               /* size of the swappable mte heap block. (ldrCreateMte) */
     117    USHORT      lv_class;               /* Object class CLASS_* defines in OS2Krnl (mteflags1) it seems. */
     118                                        /* CLASS_PROGRAM    Program class. */
     119                                        /* CLASS_GLOBAL     Global class. */
     120                                        /* CLASS_SPECIFIC   Specific class, as against global. */
     121                                        /* CLASS_ALL (0)    Nonspecific class  all modules. */
     122                                        /* CLASS_MASK       Class mask. */
     123    UCHAR       lv_type;                /* Type of executable image expected loaded. */
     124} ldrlv_t;
     125
     126
     127/*
     128 * Values of the lv_type byte. (Qualified guesses.)
     129 */
     130#define LVTYPE_EXE      0               /* Executable program. */
     131#define LVTYPE_DLL      1               /* Dynamic Link Library. */
     132#define LVTYPE_DD       2               /* Device Driver. */
     133#define LVTYPE_IFS      3               /* Installable Filesystem. */
     134#define LVTYPE_VDD      4               /* Virtual Device Driver (for VDMs). */
     135
     136
     137
     138/**
     139 * ldrOpenPath
     140 * @returns   OS2 return code.
     141 *            pLdrLv->lv_sfn  is set to filename handle.
     142 * @param     pachModname   Pointer to modulename. Not zero terminated!
     143 * @param     cchModname    Modulename length.
     144 * @param     pLdrLv        Loader local variables? (Struct from KERNEL.SDF)
     145 * @param     pfl           Pointer to flags which are passed on to ldrOpen.
     146 * @sketch
     147 *  if !CLASS_GLOBAL or miniifs then
     148 *      ldrOpen(pachModName)
     149 *  else
     150 *      loop until no more libpath elements
     151 *          get next libpath element and add it to the modname.
     152 *          try open the modname
     153 *          if successfull then break the loop.
     154 *      endloop
     155 *  endif
     156 */
     157extern ULONG LDRCALL ldrOpenPath(   /* retd  0x10 */
     158    PCHAR       pachFilename,       /* ebp + 0x08 */
     159    USHORT      cchFilename,        /* ebp + 0x0c */
     160    ldrlv_t *   plv,                /* ebp + 0x10 */
     161    PULONG      pful                /* ebp + 0x14 */
     162    );
     163
     164ULONG LDRCALL myldrOpenPath(PCHAR pachFilename, USHORT cchFilename, ldrlv_t *plv, PULONG pful);
     165
     166
     167/**
     168 * Finds a module if it's loaded.
     169 * @returns     NO_ERROR on success.
     170 *              OS/2 errorcode on error.
     171 * @param       pachFilename    Pointer to module filename.
     172 * @param       cchFilename     Length of modulefilename.
     173 * @param       usClass         Module class. (CLASS_*)
     174 * @param       ppMTE           Pointer to pMTE found.
     175 * @sketch
     176 */
     177ULONG LDRCALL ldrFindModule(PCHAR pachFilename, USHORT cchFilename, USHORT usClass, PPMTE ppMTE);
     178
     179
     180/**
     181 * LDRClearSem - Clears the loader semaphore.
     182 * (It does some garbage collection on release.)
     183 * @returns   NO_ERROR on success.
     184 *            OS/2 error on failure. (ERROR_INTERRUPT?)
     185 */
     186extern ULONG LDRCALL LDRClearSem(void);
     187
     188
     189/**
     190 * LDRRequestSem - Requests the loader semaphore..
     191 * @returns   NO_ERROR if succesfully.
     192 *            OS2 errorcode on failure. (ERROR_INTERRUPT?)
     193 */
     194#define LDRRequestSem()   KSEMRequestMutex(pLdrSem, (ULONG)-1)
     195
     196
     197/*
     198 * Pointer to the loader semaphore.
     199 */
     200#ifdef _OS2KSEM_h_
     201extern PKSEMMTX    pLdrSem;
     202#endif
     203
     204
     205/**
     206 * Validates an hMTE and gets the MTE pointer.
     207 * @returns   Pointer to MTE on success.
     208 *            NULL on error.
     209 * @param     hMTE  MTE handle.
     210 * @remark    If you wan't to this faster:
     211 *              Use the hMTE as a HOB and get the HOB address (by using VMGetHandleInfo).
     212 */
     213extern PMTE LDRCALL ldrValidateMteHandle(HMTE hMTE);
     214
     215
     216/**
     217 * Gets the pMTE from a hMTE. No checks.
     218 * @returns     Pointer to the pMTE for a given hMTE.
     219 * @param       hMTE    Module handle.
     220 * @sketch
     221 */
     222extern PMTE KRNLCALL ldrASMpMTEFromHandle(HMTE  hMTE);
     223
     224
     225/**
     226 * Pointer to the loader filename buffer.
     227 * Upon return from ldrOpen (and ldrOpenPath which calls ldrOpen) this is
     228 * set to the fully qualified filename of the file last opened (successfully).
     229 */
     230extern PSZ *pldrpFileNameBuf;
     231#define ldrpFileNameBuf (*pldrpFileNameBuf)
     232
    169233
    170234#ifdef __cplusplus
  • trunk/src/win32k/include/ModuleBase.h

    r2925 r4164  
    1 /* $Id: ModuleBase.h,v 1.3 2000-02-27 02:16:43 bird Exp $
     1/* $Id: ModuleBase.h,v 1.4 2000-09-02 21:07:59 bird Exp $
    22 *
    33 * ModuleBase - Declaration of the Basic module class.
    44 *
    5  * Copyright (c) 1999 knut st. osmundsen
     5 * Copyright (c) 1999-2000 knut st. osmundsen
    66 *
    77 * Project Odin Software License can be found in LICENSE.TXT
    88 *
    99 */
    10 #ifndef _MODULEBASE_H_
    11 #define _MODULEBASE_H_
     10#ifndef _modulebase_h_
     11#define _modulebase_h_
    1212
    1313
     
    7373 *           RING0: Map this to ldrRead with 0UL as flFlags.
    7474 *           RING3: Implementes this function as a static function, ReadAt.
    75  *  ReadAtF: Same as ReadAt but two extra parameters; an additional flag and a pointer to an MTE.
    76  *           Used in the read method.
     75 *  ReadAtF: Same as ReadAt but two extra parameters; an additional far pointer to the buffer and
     76 *           a MTE pointer. Used in the read method.
    7777 *           RING0: Map directly to ldrRead.
    7878 *           RING3: Map to ReadAt, ignoring the two extra parameters.
     
    8181    #define ReadAt(hFile, ulOffset, pvBuffer, cbToRead) \
    8282        ldrRead(hFile, ulOffset, pvBuffer, 0UL, cbToRead, NULL)
    83     #define ReadAtF(hFile, ulOffset, pvBuffer, cbToRead, flFlags, pMTE) \
    84         ldrRead(hFile, ulOffset, pvBuffer, flFlags, cbToRead, pMTE)
     83    #define ReadAtF(hFile, ulOffset, pvBuffer, fpBuffer, cbToRead, pMTE) \
     84        ldrRead(hFile, ulOffset, pvBuffer, fpBuffer, cbToRead, pMTE)
    8585#else
    86     #define ReadAtF(hFile, ulOffset, pvBuffer, cbToRead, flFlags, pMTE) \
     86    #define ReadAtF(hFile, ulOffset, pvBuffer, fpBuffer, cbToRead, pMTE) \
    8787        ReadAt(hFile, ulOffset, pvBuffer, cbToRead)
    8888#endif
     
    9696#endif
    9797
    98 
     98/*
     99 * Make sure that pLdrLv is defined.
     100 */
     101#if !defined(RING0) && !defined(_ldrCalls_h_)
     102typedef struct ldrlv_s  ldrlv_t;
     103#endif
    99104
    100105/**
     
    111116
    112117    /** @cat Public Main methods */
    113     virtual ULONG  init(PCSZ pszFilename);
    114     virtual ULONG  read(ULONG offLXFile, PVOID pvBuffer, ULONG cbToRead, ULONG flFlags, PMTE pMTE) = 0;
    115     virtual ULONG  applyFixups(PMTE pMTE, ULONG iObject, ULONG iPageTable, PVOID pvPage,
    116                                ULONG ulPageAddress, PVOID pvPTDA); /*(ldrEnum32bitRelRecs)*/
     118    virtual ULONG   init(PCSZ pszFilename);
     119    virtual ULONG   read(ULONG offLXFile, PVOID pvBuffer, ULONG fpBuffer, ULONG cbToRead, PMTE pMTE) = 0;
     120    virtual ULONG   applyFixups(PMTE pMTE, ULONG iObject, ULONG iPageTable, PVOID pvPage,
     121                                ULONG ulPageAddress, PVOID pvPTDA); /*(ldrEnum32bitRelRecs)*/
     122    virtual ULONG   openPath(PCHAR pachFilename, USHORT cchFilename, ldrlv_t *pLdrLv, PULONG pful); /* (ldrOpenPath) */
    117123    #ifndef RING0
    118     virtual ULONG  writeFile(PCSZ pszLXFilename);
     124    virtual ULONG   writeFile(PCSZ pszLXFilename);
    119125    #endif
    120126
    121127    /** @cat public Helper methods */
    122     virtual VOID   dumpVirtualLxFile() = 0;
    123     BOOL           queryIsModuleName(PCSZ pszFilename);
     128    virtual VOID    dumpVirtualLxFile() = 0;
     129    BOOL            queryIsModuleName(PCSZ pszFilename);
     130    PCSZ            getFilename();
     131    PCSZ            getModuleName();
    124132
    125133    /** @cat static print method */
     
    133141    SFN         hFile;                  /* filehandle */
    134142    PSZ         pszFilename;            /* fullpath */
    135     PSZ         pszModuleName;          /* filename without extention. */
     143    PSZ         pszModuleName;          /* filename without path and extention. */
    136144
    137145    /** @cat public static data. */
  • trunk/src/win32k/include/OS2KPTDA.h

    r3829 r4164  
    1 /* $Id: OS2KPTDA.h,v 1.1 2000-07-16 22:21:19 bird Exp $
     1/* $Id: OS2KPTDA.h,v 1.2 2000-09-02 21:07:59 bird Exp $
    22 *
    33 * PTDA access functions.
     
    5454
    5555
    56 USHORT  ptdaGet_ptda_environ(PPTDA pPTDA);
    57 
     56USHORT      ptdaGet_ptda_environ(PPTDA pPTDA);
     57USHORT      ptdaGet_ptda_module(PPTDA pPTDA);
     58HKSEMMTX    ptda_ptda_ptdasem(PPTDA pPTDA);
    5859
    5960#ifdef __cplusplus
  • trunk/src/win32k/include/OS2KSEM.h

    r3829 r4164  
    1 /* $Id: OS2KSEM.h,v 1.1 2000-07-16 22:21:19 bird Exp $
     1/* $Id: OS2KSEM.h,v 1.2 2000-09-02 21:07:59 bird Exp $
    22 *
    33 * OS/2 kernel Semaphore functions.
     
    1616*   Defined Constants And Macros                                               *
    1717*******************************************************************************/
    18 #define KSEM_INDEFINITE_WAIT     -1L
    19 #define KSEM_IMMEDIATE_RETURN     0L
     18#define KSEM_INDEFINITE_WAIT       -1UL
     19#define KSEM_IMMEDIATE_RETURN       0UL
     20
     21/*
     22 * Semaphore type. ( Used with the generic KSEM routines. )
     23 */
     24#define KSEM_EVENT                  0
     25#define KSEM_MUTEX                  1
     26#define KSEM_SHARED                 2
     27
     28/*
     29 * Sempahore flags. (according to SG24-4640-00)
     30 */
     31#define KSEM_DEFAULT                0
     32#define KSEM_NOINTERRUPT            1
     33#define KSEM_WRITE                  2
     34#define KSEM_DISPLAYID              4
     35#define KSEM_NOBLOCKED              8
    2036
    2137
     
    2339*   Structures and Typedefs                                                    *
    2440*******************************************************************************/
    25 typedef ULONG  HKSEM;                   /* Handle to kernel semaphore. */
    26 typedef HKSEM  PHKSEM;                  /* Pointer to kernel semaphore handle. */
    27 typedef HKSEM  HKMTX;                   /* Handle to kernel mutex semaphore. */
    28 typedef HKSEM  HKEV;                    /* Handle to kernel event semaphore. */
     41/* (This is according to SG24-4640-00.) */
     42
     43typedef struct _KSEMSHR
     44{
     45    /**
     46     * Astrict 16 is byte while retail 12 is bytes.
     47     * We'll reserve 20 bytes just to be sure!.
     48     */
     49    char achDummy[20];
     50
     51    struct
     52    {
     53        char            ks_achSignature[4];
     54        char            ks_bFlags;
     55        char            ks_bType;
     56        unsigned short  ks_Owner;
     57        unsigned short  ks_cusPendingWriters;
     58        unsigned short  ks_cusNest;
     59        unsigned short  ks_cusReaders;
     60        unsigned short  ks_cusPendingReaders;
     61    } debug;
     62
     63    struct
     64    {
     65        char            ks_bFlags;
     66        char            ks_bType;
     67        unsigned short  ks_Owner;
     68        unsigned short  ks_cusPendingWriters;
     69        unsigned short  ks_cusNest;
     70        unsigned short  ks_cusReaders;
     71        unsigned short  ks_cusPendingReaders;
     72    } release;
     73
     74}   KSEMSHR,
     75   *PKSEMSHR,
     76   *HKSEMSHR;                           /* Handle to kernel shared semphore. */
     77typedef HKSEMSHR * PHKSEMSHR;
     78
     79
     80typedef union _KSEMMTX
     81{
     82    /**
     83     * Astrict is 12 byte while retail is 8 bytes.
     84     * We'll reserve 20 bytes just to be sure!
     85     */
     86    char achDummy[20];
     87
     88    struct
     89    {
     90        char            ksem_achSignature[4];
     91        char            ksem_bFlags;
     92        char            ksem_bType;
     93        unsigned short  ksem_Owner;
     94        unsigned short  ksem_cusPendingWriters;
     95        unsigned short  ksem_cusNest;
     96    }debug;
     97    struct
     98    {
     99        char            ksem_bFlags;
     100        char            ksem_bType;
     101        unsigned short  ksem_Owner;
     102        unsigned short  ksem_cusPendingWriters;
     103        unsigned short  ksem_cusNest;
     104    } release;
     105}   KSEMMTX,
     106   *PKSEMMTX,
     107   *HKSEMMTX;                           /* Handle to kernel mutex semaphore. */
     108typedef HKSEMMTX * PHKSEMMTX;
     109
     110
     111typedef struct _KSEMEVT
     112{
     113    /**
     114     * Astrict is 16 byte while retail is 12 bytes.
     115     * We'll reserve 20 bytes just to be sure!
     116     */
     117    char achDummy[20];
     118
     119    struct
     120    {
     121        char            kse_achSignature[4];
     122        char            kse_bFlags;
     123        char            kse_bType;
     124        unsigned short  kse_Owner;
     125        unsigned short  kse_cusPendingWriters;
     126    } debug;
     127
     128    struct
     129    {
     130        char            kse_bFlags;
     131        char            kse_bType;
     132        unsigned short  kse_Owner;
     133        unsigned short  kse_cusPendingWriters;
     134    } release;
     135
     136}   KSEMEVT,
     137   *PKSEMEVT,
     138   *HKSEMEVT;                           /* Handle to kernel event sempahore. */
     139typedef HKSEMEVT * PHKSEMEVT;
     140
     141
     142typedef union _KSEM
     143{
     144    KSEMSHR shr;
     145    KSEMMTX mtx;
     146    KSEMEVT evt;
     147} KSEM, *PKSEM, *HKSEM;                 /* Generic kernel semaphore handle. */
     148typedef HKSEM * PHKSEM;
    29149
    30150
     
    34154/*
    35155 * Mutex semaphores.
    36  * NOTE! Only is KSEMRequestMutex currently is imported!
    37156 */
    38 extern ULONG KRNLCALL KSEMRequestMutex(HKMTX hkmtx, ULONG ulTimeout);
    39 extern VOID  KRNLCALL KSEMReleaseMutex(HKMTX hkmtx);
    40 extern ULONG KRNLCALL KSEMQueryMutex(HKMTX hkmtx, PUSHORT pus);
     157extern ULONG KRNLCALL KSEMRequestMutex(HKSEMMTX hkmtx, ULONG ulTimeout);
     158extern VOID  KRNLCALL KSEMReleaseMutex(HKSEMMTX hkmtx);
     159extern ULONG KRNLCALL KSEMQueryMutex(HKSEMMTX hkmtx, PUSHORT pcusNest);
    41160
    42161
     
    48167extern VOID  KRNLCALL KSEMPostEvent(HKEV hkevent);
    49168extern ULONG KRNLCALL KSEMWaitEvent(HKEV hkevent);
     169#endif
    50170
    51171/*
    52172 * Some other KSEM prefixed functions - parameters's not that obvious...
    53173 */
     174#if 0
    54175extern ULONG KRNLCALL KSEMAlloc(PHKSEM phksem, ULONG p1, ULONG p2);
    55176extern ULONG KRNLCALL KSEMCreate(PHKSEM phksem, ULONG type);
     
    57178extern ULONG KRNLCALL KSEMRequestShared(HKSEM hksem, ULONG);
    58179extern VOID  KRNLCALL KSEMDestroy(HKSEM hksem);
    59 extern VOID  KRNLCALL KSEMInit(HKSEM hksem, ULONG p1, ULONG p2);
     180#endif
     181extern VOID  KRNLCALL KSEMInit(PKSEM pksem, ULONG fulType, ULONG fulFlags);
     182#if 0
    60183extern VOID  KRNLCALL KSEMQuery(HKSEM hksem, ULONG p2)
    61184extern VOID  KRNLCALL KSEMRelease(HKSEM hksem);
  • trunk/src/win32k/include/OS2KTK.h

    r3829 r4164  
    1 /* $Id: OS2KTK.h,v 1.1 2000-07-16 22:21:18 bird Exp $
     1/* $Id: OS2KTK.h,v 1.2 2000-09-02 21:08:00 bird Exp $
    22 *
    33 * OS2KTK - OS/2 Kernel Task.
     
    2121
    2222#define TKFuChar(pch, pchUsr) \
    23             TKFuBuff((PVOID)pch, (PVOID)pchUsr, sizeof(char), TK_FUSU_FATAL);
     23            TKFuBuff((PVOID)pch, (PVOID)pchUsr, sizeof(char), TK_FUSU_FATAL)
    2424#define TKSuChar(pchUsr, pch) \
    25             TKSuBuff((PVOID)pchUsr, (PVOID)pch, sizeof(char), TK_FUSU_FATAL);
     25            TKSuBuff((PVOID)pchUsr, (PVOID)pch, sizeof(char), TK_FUSU_FATAL)
    2626
    2727#define TKFuCharNF(pch, pchUsr) \
    28             TKFuBuff((PVOID)pch, (PVOID)pchUsr, sizeof(char), TK_FUSU_NONFATAL);
     28            TKFuBuff((PVOID)pch, (PVOID)pchUsr, sizeof(char), TK_FUSU_NONFATAL)
    2929#define TKSuCharNF(pchUsr, pch) \
    30             TKSuBuff((PVOID)pchUsr, (PVOID)pch, sizeof(char), TK_FUSU_NONFATAL);
     30            TKSuBuff((PVOID)pchUsr, (PVOID)pch, sizeof(char), TK_FUSU_NONFATAL)
    3131
    3232
    3333#define TKFuUShort(pus, pusUsr) \
    34             TKFuBuff((PVOID)pus, (PVOID)pusUsr, sizeof(USHORT), TK_FUSU_FATAL);
     34            TKFuBuff((PVOID)pus, (PVOID)pusUsr, sizeof(USHORT), TK_FUSU_FATAL)
    3535#define TKSuUShort(pusUsr, pus) \
    36             TKSuBuff((PVOID)pusUsr, (PVOID)pus, sizeof(USHORT), TK_FUSU_FATAL);
     36            TKSuBuff((PVOID)pusUsr, (PVOID)pus, sizeof(USHORT), TK_FUSU_FATAL)
    3737
    3838#define TKFuUShortNF(pus, pusUsr) \
    39             TKFuBuff((PVOID)pus, (PVOID)pusUsr, sizeof(USHORT), TK_FUSU_NONFATAL);
     39            TKFuBuff((PVOID)pus, (PVOID)pusUsr, sizeof(USHORT), TK_FUSU_NONFATAL)
    4040#define TKSuUShortNF(pusUsr, pus) \
    41             TKSuBuff((PVOID)pusUsr, (PVOID)pus, sizeof(USHORT), TK_FUSU_NONFATAL);
     41            TKSuBuff((PVOID)pusUsr, (PVOID)pus, sizeof(USHORT), TK_FUSU_NONFATAL)
    4242
    4343
    4444#define TKFuULong(pul, pulUsr) \
    45             TKFuBuff((PVOID)pul, (PVOID)pulUsr, sizeof(ULONG), TK_FUSU_FATAL);
     45            TKFuBuff((PVOID)pul, (PVOID)pulUsr, sizeof(ULONG), TK_FUSU_FATAL)
    4646#define TKSuULong(pulUsr, pul) \
    47             TKSuBuff((PVOID)pulUsr, (PVOID)pul, sizeof(ULONG), TK_FUSU_FATAL);
     47            TKSuBuff((PVOID)pulUsr, (PVOID)pul, sizeof(ULONG), TK_FUSU_FATAL)
    4848
    4949#define TKFuULongNF(pul, pulUsr) \
    50             TKFuBuff((PVOID)pul, (PVOID)pulUsr, sizeof(ULONG), TK_FUSU_NONFATAL);
     50            TKFuBuff((PVOID)pul, (PVOID)pulUsr, sizeof(ULONG), TK_FUSU_NONFATAL)
    5151#define TKSuULongNF(pulUsr, pul) \
    52             TKSuBuff((PVOID)pulUsr, (PVOID)pul, sizeof(ULONG), TK_FUSU_NONFATAL);
     52            TKSuBuff((PVOID)pulUsr, (PVOID)pul, sizeof(ULONG), TK_FUSU_NONFATAL)
    5353
    5454
  • trunk/src/win32k/include/OS2KVM.h

    r3411 r4164  
    1 /* $Id: OS2KVM.h,v 1.4 2000-04-17 01:56:49 bird Exp $
     1/* $Id: OS2KVM.h,v 1.5 2000-09-02 21:08:00 bird Exp $
    22 *
    33 * OS/2 kernel VM functions.
     
    8282
    8383
    84 typedef USHORT HMTE, *PHMTE;
    85 typedef USHORT HPTDA, *PHPTDA;
    86 
    8784/*******************************************************************************
    8885*   Exported Functions                                                         *
     
    108105    PUSHORT pushPTDA);
    109106
     107PMTE KRNLCALL VMPseudoHandleMap(
     108    HMTE    hMTE);
    110109#endif
  • trunk/src/win32k/include/OS2Krnl.h

    r2799 r4164  
    1 /* $Id: OS2Krnl.h,v 1.7 2000-02-15 23:39:19 bird Exp $
     1/* $Id: OS2Krnl.h,v 1.8 2000-09-02 21:08:00 bird Exp $
    22 *
    33 * OS/2 kernel structures, typedefs and macros.
     
    153153} MTE,*PMTE,**PPMTE;
    154154
     155typedef USHORT HMTE, *PHMTE;
     156typedef USHORT HPTDA, *PHPTDA;
    155157
    156158
     
    228230
    229231/*
     232 * Calling convention for Security Helpers.
     233 */
     234#define SECCALL  _System
     235
     236/*
    230237 *
    231238 * Other Kernel Parts
     
    235242    #define INCL_OS2KRNL_IO
    236243    #define INCL_OS2KRNL_VM
     244    #define INCL_OS2KRNL_SEM
     245    #define INCL_OS2KRNL_TK
     246    #define INCL_OS2KRNL_PTDA
     247    #define INCL_OS2KRNL_TCB
     248    #define INCL_OS2KRNL_SEC
     249#endif
     250
     251#if defined(INCL_OS2KRNL_PTDA) && !defined(INCL_OS2KRNL_SEM)
     252    #define INCL_OS2KRNL_SEM
    237253#endif
    238254
     
    245261#endif
    246262
    247 #endif
     263#ifdef INCL_OS2KRNL_SEM
     264    #include <OS2KSEM.h>
     265#endif
     266
     267#ifdef INCL_OS2KRNL_TK
     268    #include <OS2KTK.h>
     269#endif
     270
     271#ifdef INCL_OS2KRNL_PTDA
     272    #include <OS2KPTDA.h>
     273#endif
     274
     275#ifdef INCL_OS2KRNL_TCB
     276    #include <OS2KTCB.h>
     277#endif
     278
     279#ifdef INCL_OS2KRNL_SEC
     280    #include <OS2KSEC.h>
     281#endif
     282
     283#endif
  • trunk/src/win32k/include/dev16.h

    r2898 r4164  
    1 /* $Id: dev16.h,v 1.8 2000-02-25 18:15:04 bird Exp $
     1/* $Id: dev16.h,v 1.9 2000-09-02 21:08:00 bird Exp $
    22 * dev16 - 16-bit specific. Should not be used in 32-bit C/C++.
    33 *
     
    113113USHORT NEAR R0Init16(PRP_GENIOCTL pRp);
    114114USHORT NEAR initGetDosTableData(void);
    115 
     115#if 0 /*ndef CODE16_INIT*/
     116#pragma alloc_text(CODE16_INIT, dev0Init, dev1Init, R0Init16, initGetDosTableData)
     117#endif
    116118
    117119/*
     
    123125USHORT NEAR CallElfIOCtl(LIN pRpIOCtl);
    124126USHORT NEAR CallWin32kIOCtl(LIN pRpIOCtl);
     127#if 0 /*ndef CODE16_INIT*/
     128#pragma alloc_text(CODE16_INIT, CallR0Init32, CallVerifyImportTab32, CallGetKernelInfo32)
     129#endif
    125130
    126131
     
    148153#define SSToDS_16(pStackVar) (SSToDS_16a((void NEAR *)pStackVar))
    149154
    150 extern LIN   SSToDS_16a(void NEAR *pStackVar);
     155extern LIN NEAR SSToDS_16a(void NEAR *pStackVar);
    151156
    152157/*
    153158 * START and END labels. NOTE: these are not bytes only assembly labels.
    154159 */
    155 extern char PASCAL CODE16START      ;
    156 extern char PASCAL DATA16START      ;
    157160extern char PASCAL DATA16START      ;
    158161extern char PASCAL DATA16_BSSSTART  ;
    159162extern char PASCAL DATA16_CONSTSTART;
     163extern char PASCAL DATA16_INITSTART      ;
     164extern char PASCAL DATA16_INIT_BSSSTART  ;
     165extern char PASCAL DATA16_INIT_CONSTSTART;
    160166extern char PASCAL CODE16START      ;
     167extern char PASCAL CODE16_INITSTART      ;
    161168extern char PASCAL CODE32START      ;
    162169extern char PASCAL DATA32START      ;
     
    168175extern char PASCAL CODE16END      ;
    169176extern char PASCAL DATA16END      ;
    170 extern char PASCAL DATA16END      ;
    171177extern char PASCAL DATA16_BSSEND  ;
    172178extern char PASCAL DATA16_CONSTEND;
     179extern char PASCAL DATA16_INITEND      ;
     180extern char PASCAL DATA16_INIT_BSSEND  ;
     181extern char PASCAL DATA16_INIT_CONSTEND;
    173182extern char PASCAL CODE16END      ;
     183extern char PASCAL CODE16_INITEND      ;
    174184extern char PASCAL CODE32END      ;
    175185extern char PASCAL DATA32END      ;
     
    180190
    181191
    182 
    183 
    184192#endif
  • trunk/src/win32k/include/dev1632.h

    r3321 r4164  
    1 /* $Id: dev1632.h,v 1.5 2000-04-05 18:40:41 bird Exp $
     1/* $Id: dev1632.h,v 1.6 2000-09-02 21:08:00 bird Exp $
    22 * dev1632.h - Common header file for 16-bit and 32-bit C
    33 *
     
    5050typedef struct _KRNLINFO
    5151{
     52    unsigned long   ulBuild;
     53    unsigned short  fKernel;
    5254    unsigned char   cObjects;
    53     unsigned char   fDebug;
    54     unsigned char   fchType;             /* TYPE_SMP, TYPE_UNI, TYPE_W4 */
    55     unsigned short  usBuild;
     55    unsigned char   chPadding;
    5656    OTE             aObjects[MAXKRNLOBJECTS];
    5757} KRNLINFO, FAR * PKRNLINFO;
     
    6464
    6565#pragma pack()
     66
     67
     68/*
     69 * Global data...
     70 */
     71extern CHAR DATA16_GLOBAL   szBuildDate[];
     72extern CHAR DATA16_GLOBAL   szBuildTime[];
     73#if defined(__IBMC__) || defined(__IBMCPP__)
     74    #pragma map( szBuildDate , "_szBuildDate" )
     75    #pragma map( szBuildTime , "_szBuildTime" )
    6676#endif
     77
     78#endif
  • trunk/src/win32k/include/dev32.h

    r2898 r4164  
    1 /* $Id: dev32.h,v 1.8 2000-02-25 18:15:04 bird Exp $
     1/* $Id: dev32.h,v 1.9 2000-09-02 21:08:00 bird Exp $
    22 *
    33 * dev32 - header file for 32-bit part of the driver.
     
    100100 * START and END labels. NOTE: these are not bytes only assembly labels.
    101101 */
    102 extern char CODE16START      ;
    103 extern char DATA16START      ;
    104102extern char DATA16START      ;
    105103extern char DATA16_BSSSTART  ;
    106104extern char DATA16_CONSTSTART;
     105extern char DATA16_INITSTART      ;
     106extern char DATA16_INIT_BSSSTART  ;
     107extern char DATA16_INIT_CONSTSTART;
    107108extern char CODE16START      ;
     109extern char CODE16_INITSTART      ;
    108110extern char CODE32START      ;
    109111extern char DATA32START      ;
     
    115117extern char CODE16END      ;
    116118extern char DATA16END      ;
    117 extern char DATA16END      ;
    118119extern char DATA16_BSSEND  ;
    119120extern char DATA16_CONSTEND;
     121extern char DATA16_INITEND      ;
     122extern char DATA16_INIT_BSSEND  ;
     123extern char DATA16_INIT_CONSTEND;
    120124extern char CODE16END      ;
     125extern char CODE16_INITEND      ;
    121126extern char CODE32END      ;
    122127extern char DATA32END      ;
     
    126131extern char EH_DATAEND     ;
    127132
    128 
    129 
    130 
    131133#endif
  • trunk/src/win32k/include/devSegDf.inc

    r2838 r4164  
    1 ; $Id: devSegDf.inc,v 1.5 2000-02-21 09:24:00 bird Exp $
     1; $Id: devSegDf.inc,v 1.6 2000-09-02 21:08:01 bird Exp $
    22;
    33; Segment definitions for win32k.sys.
     
    1818DATA16_CONST ends
    1919
    20 DATA16_GROUP    group DATA16, DATA16_CONST, DATA16_BSS
     20DATA16_GLOBAL segment word public 'FAR_DATA' use16
     21DATA16_GLOBAL ends
     22
     23;DATA16_GROUP    group DATA16, DATA16_CONST, DATA16_BSS, DATA16_GLOBAL
     24
     25
     26DATA16_INIT segment word public 'FAR_DATA' use16
     27DATA16_INIT ends
     28
     29DATA16_INIT_CONST segment word public 'FAR_DATA' use16
     30DATA16_INIT_CONST ends
     31
     32DATA16_INIT_BSS segment word public 'FAR_DATA' use16
     33DATA16_INIT_BSS ends
     34
     35;DATA16_INIT_GROUP   group DATA16_INIT, DATA16_INIT_CONST, DATA16_INIT_BSS
     36;
     37;A bad trick to make all the 16-bit data segments one
     38;
     39DATA16_GROUP    group DATA16, DATA16_CONST, DATA16_BSS, DATA16_GLOBAL, DATA16_INIT, DATA16_INIT_CONST, DATA16_INIT_BSS
    2140
    2241
    2342CODE16 segment word public 'CODE' use16
    2443CODE16 ends
     44
     45CODE16_INIT segment word public 'CODE' use16
     46CODE16_INIT ends
     47
     48CODE16_IOSEG segment word public 'CODE' use16
     49CODE16_IOSEG ends
    2550
    2651
     
    3358
    3459;DGROUP group BSS32, DATA32
    35 DGROUP group BSS32, DATA32, CONST32_RO, _VFT, EH_DATA
     60DGROUP group CALLTAB, BSS32, DATA32, CONST32_RO, _VFT, c_common, DDE4_DATA32, CTOR_DTOR1, CTOR_DTOR2, CTOR_DTOR3, EH_DATA
    3661
    3762DATA32  segment dword public 'DATA' use32
     
    4166c_common ends
    4267
     68DDE4_DATA32  segment dword public 'DATA' use32
     69DDE4_DATA32 ends
     70
    4371BSS32 segment dword public 'BSS' use32
    4472BSS32 ends
    4573
     74CTOR_DTOR1 segment dword public 'DATA' use32
     75CTOR_DTOR1 ends
     76
     77CTOR_DTOR2 segment dword public 'DATA' use32
     78CTOR_DTOR2 ends
     79
     80CTOR_DTOR3 segment dword public 'DATA' use32
     81CTOR_DTOR3 ends
    4682
    4783;CONSTGROUP group CONST32_RO, _VFT, EH_DATA
  • trunk/src/win32k/include/env.h

    r3412 r4164  
    1 /* $Id: env.h,v 1.2 2000-04-17 02:26:04 bird Exp $
     1/* $Id: env.h,v 1.3 2000-09-02 21:08:01 bird Exp $
    22 *
    33 * Environment access functions
     
    2121*******************************************************************************/
    2222const char *ScanEnv(const char *paszEnv, const char *pszVar);
    23 const char *GetEnv(void);
     23const char *GetEnv(BOOL fExecChild);
    2424
    2525
  • trunk/src/win32k/include/k32.h

    r2799 r4164  
    1 /* $Id: k32.h,v 1.2 2000-02-15 23:39:19 bird Exp $
     1/* $Id: k32.h,v 1.3 2000-09-02 21:08:02 bird Exp $
    22 *
    33 * k32 - definitions.
     
    2020*******************************************************************************/
    2121APIRET k32AllocMemEx(PPVOID ppb, ULONG cb, ULONG flag, ULONG ulCS, ULONG ulEIP);
     22APIRET k32QueryOTEs(HMTE hMTE, PQOTEBUFFER pQOte, ULONG cbOte);
     23APIRET k32QueryOptionsStatus(PK32OPTIONS pOptions, PK32STATUS pStatus);
     24APIRET k32SetOptions(PK32OPTIONS pOptions);
    2225
    2326
  • trunk/src/win32k/include/ldr.h

    r2501 r4164  
    1 /* $Id: ldr.h,v 1.5 2000-01-22 18:20:59 bird Exp $
    2  *
    3  * ldr - loader header file.
    4  *
    5  * Copyright (c)  1999 knut  St.  osmundsen
     1/* $Id: ldr.h,v 1.6 2000-09-02 21:08:02 bird Exp $
     2 *
     3 * ldr - Our loader "subsystem" public header file.
     4 *
     5 * Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
    66 *
    77 * Project Odin Software License can be found in LICENSE.TXT
     
    1212#ifndef _ldr_h_
    1313#define _ldr_h_
    14     #ifndef LDR_INCL_INITONLY
    15         /* state variable */
    16         extern BOOL fQAppType;
    17 
    18         /*
    19          * handle state - Array of handle states. Eight state per byte!
    20          */
    21         #define MAX_FILE_HANDLES 0x10000
    22 
    23         extern unsigned char achHandleStates[MAX_FILE_HANDLES/8];
    24 
    25         #define HSTATE_UNUSED       0x00    /* Handle not used (or OS/2). */
    26         #define HSTATE_OS2          0x00    /* OS/2 module filehandle. */
    27         #define HSTATE_OUR          0x01    /* Our module filehandle. */
    28         #define HSTATE_MASK         0xFE
    29         #define HSTATE_UMASK        0x01
    30 
    31         #define GetState(a)         (HSTATE_UMASK & (achHandleStates[(a)/8] >> ((a)%8)))
    32         #define SetState(a,b)       (achHandleStates[(a)/8] = (achHandleStates[(a)/8] & (HSTATE_MASK << ((a)%8) | HSTATE_MASK >> 8-((a)%8)) | ((b) & 0x1) << ((a)%8)))
    33 
    34 
    35         /*
    36          * Module struct.
    37          */
    38         typedef struct _Module
    39         {
    40             AVLNODECORE     coreKey;    /* Key is hFile. */
    41             AVLNODECORE     coreMTE;    /* Key is pMTE. */
    42 
    43             SFN             hFile;      /* System file number or file handle if you prefer that. */
    44             PMTE            pMTE;       /* Pointer to MTE if we got one - NULL is allowed. */
    45 
    46             ULONG           fFlags;     /* Flags. Flags if coreMte is in use and what Data contains. */
    47             union
    48             {
    49                 ModuleBase *pModule;    /* Pointer to a Pe2Lx object. (Win32 executables) */
    50                 #if defined(_PE2LX_H_)
    51                 Pe2Lx *     pPe2Lx;     /* Pointer to a Pe2Lx object. (Win32 executables) */
    52                 #endif
    53                 #if defined(_ELF2LX_H_)
    54                 Elf2Lx *    pElf2Lx;    /* Pointer to a Elf2Lx object. (ELF executables) */
    55                 #endif
    56                 #if defined(_SCRIPT_H_)
    57                 Script *    pScript;    /* Pointer to a Script object. (Shell scripts) */
    58                 #endif
    59                 #if defined(_PE_H_)
    60                 Pe *        pPe;        /* Pointer to a Pe object. (Ring3 loader) */
    61                 #endif
    62             } Data;                     /* Pointer to data. Currently it's allways a Pe2Lx object! */
    63         } MODULE, *PMODULE;
    64 
    65         #define MOD_FLAGS_IN_MTETREE    0x00000010UL /* The node is present in the MTE-tree. */
    66         #define MOD_TYPE_MASK           0x0000000FUL /* Type mask. */
    67         #define MOD_TYPE_PE2LX          0x00000001UL /* Pe2Lx module. */
    68         #define MOD_TYPE_ELF2LX         0x00000002UL /* Elf2Lx module. */
    69         #define MOD_TYPE_SCRIPT         0x00000003UL /* Script module. */
    70         #define MOD_TYPE_PE             0x00000004UL /* Pe module. */
    71 
    72 
    73         /*
    74          * Modules operations.
    75          */
    76         PMODULE     getModuleBySFN(SFN hFile);
    77         PMODULE     getModuleByMTE(PMTE pMTE);
    78         PMODULE     getModuleByFilename(PCSZ pszFilename);
    79 
    80         ULONG       addModule(SFN hFile, PMTE pMTE, ULONG fFlags, ModuleBase *pModObj);
    81         ULONG       removeModule(SFN hFile);
    82 
    83     #endif
    84 
    85     /*************/
    86     /* functions */
    87     /*************/
    88     #ifdef __cplusplus
    89     extern "C" {
    90     #endif
    91 
    92     ULONG ldrInit(void);
    93 
    94     #ifdef __cplusplus
     14
     15#ifdef __cplusplus
     16extern "C" {
     17#endif
     18
     19
     20#ifndef LDR_INCL_INITONLY
     21
     22/*
     23 * Fail if dependent header files is missing
     24 */
     25#ifndef _AVL_H_
     26#error "You'll have to include avl.h before ldr.h!"
     27#endif
     28
     29
     30/** @design Loader State.
     31 *
     32 * Used to determin behaviour in different cases.
     33 * Use the isLdrState<State> macros to query current state.
     34 * IMPORTANT! Don't change this variable if you don't really mean it!
     35 *            And only change it thru the setLdrState* macros!
     36 *
     37 * The state is changing as follows:
     38 *    1) Load a new program
     39 *      mytkExecPgm will set the state to LDRSTATE_TKEXECPGM on successful overloading.
     40 *          myldrOpenPath will set the type part of the loaderbits. (EXE,DLL or UNSUPPORTED)
     41 *          (NB! myldrOpenPath is called several times. First for the EXE then for imported modules.)
     42 *              IF executable THEN myLdrOpen might set the LDRSTATE_OUR flag.
     43 *          myldrOpenPath will reset the type part of the loaderbits upon return.
     44 *      mytkExecPgm resets the state to LDRSTATE_UNKNOWN upon return.
     45 *
     46 *    2) Query program type.
     47 *      myLDRQAppType will set the state to LDRSTATE_LDRQAPPTYPE on entry.
     48 *          myldrOpenPath will set the type part of the loaderbits. (EXE,DLL or UNSUPPORTED)
     49 *          (NB! myldrOpenPath may be called several times.)
     50 *              IF executable THEN myLdrOpen might set the LDRSTATE_OUR flag.
     51 *          myldrOpenPath will reset the type part of the loaderbits upon return.
     52 *      myLDRQAppType resets the state to LDRSTATE_UNKNOWN upon return.
     53 *
     54 *    3) Unknown invocation - probably DosLoadModule. Base state is LDRSTATE_UNKNOWN.
     55 *          myldrOpenPath will set the type part of the loaderbits. (EXE,DLL or UNSUPPORTED)
     56 *          (NB! myldrOpenPath is probably called several times. Import modules.)
     57 *          myldrOpenPath will reset the type part of the loaderbits upon return.
     58 *
     59 */
     60extern ULONG    ulLdrState;
     61
     62#define LDRSTATE_UNKNOWN        0       /* Default state - undertermined. */
     63#define LDRSTATE_TKEXECPGM      1       /* A program is being loaded. */
     64#define LDRSTATE_LDRQAPPTYPE    2       /* Loader called from LDRQAPPTYPE */
     65/*#define LDRSTATE_LOADMODULE     3 */  /* A module is being loaded by DosLoadModule. Not implemented! */
     66#define LDRSTATE_MASK           0x00FF  /* State mask. */
     67
     68/*
     69 * The following flags are only valid when myldrOpenPath is on the stack!, ie. in ldrOpen.
     70 * These flags is the "loading-bits".
     71 */
     72#define LDRSTATE_EXE            0x0100  /* Flags telling that an executable is being opened. */
     73#define LDRSTATE_DLL            0x0200  /* Flags telling that an dll is being opened. */
     74#define LDRSTATE_UNSUPPORTED    0x0300  /* Flags telling to not override this open call. */
     75#define LDRSTATE_TYPE_MASK      0x0f00  /* Load Type Mask. */
     76/* The following flag will tell us if the executable which is loading is ours or not. */
     77#define LDRSTATE_OUREXE         0x1000
     78#define LDRSTATE_LOADERBITS     0xff00  /* Mask */
     79
     80
     81/*
     82 * Query macros.
     83 */
     84#define isLdrStateUnknown()             ((ulLdrState & LDRSTATE_MASK) == LDRSTATE_UNKNOWN)
     85#define isLdrStateExecPgm()             ((ulLdrState & LDRSTATE_MASK) == LDRSTATE_TKEXECPGM)
     86#define isLdrStateQAppType()            ((ulLdrState & LDRSTATE_MASK) == LDRSTATE_LDRQAPPTYPE)
     87/*#define isLdrStateLoadModule()        ((ulLdrState & LDRSTATE_MASK) == LDRSTATE_LOADMODULE)*/
     88
     89#define isLdrStateLoadingEXE()          ((ulLdrState & LDRSTATE_TYPE_MASK) == LDRSTATE_EXE)
     90#define isLdrStateLoadingDLL()          ((ulLdrState & LDRSTATE_TYPE_MASK) == LDRSTATE_DLL)
     91#define isLdrStateLoadingUnsupported()  ((ulLdrState & LDRSTATE_TYPE_MASK) == LDRSTATE_UNSUPPORTED)
     92
     93#define isLdrStateLoadingOurEXE()       (ulLdrState & LDRSTATE_OUREXE)
     94
     95
     96/*
     97 * Set macros.
     98 */
     99#define setLdrStateQAppType()           ulLdrState = LDRSTATE_LDRQAPPTYPE
     100#define setLdrStateUnknown()            ulLdrState = LDRSTATE_UNKNOWN
     101/*      setLdrStateExecPgm() isn't needed as this is in assembly source! */
     102/*#define setLdrStateLoadModule()         ulLdrState = LDRSTATE_LOADMODULE */
     103
     104#define setLdrStateLoadingEXE()         ulLdrState = (ulLdrState & (ULONG)(~LDRSTATE_TYPE_MASK)) | LDRSTATE_EXE
     105#define setLdrStateLoadingDLL()         ulLdrState = (ulLdrState & (ULONG)(~LDRSTATE_TYPE_MASK)) | LDRSTATE_DLL
     106#define setLdrStateLoadingUnsupported() ulLdrState = (ulLdrState & (ULONG)(~LDRSTATE_TYPE_MASK)) | LDRSTATE_UNSUPPORTED
     107#define setLdrStateClearLoadingType()   ulLdrState &= (ULONG)(~LDRSTATE_TYPE_MASK)
     108
     109#define setLdrStateLoadingOurEXE()      ulLdrState |= LDRSTATE_OUREXE
     110
     111
     112/*
     113 * Loader State assert macros.
     114 */
     115#define ASSERT_LdrStateUnknown(fn)      ASSERT_LdrState(fn, LDRSTATE_UNKNOWN)
     116#define ASSERT_LdrStateExecPgm(fn)      ASSERT_LdrState(fn, LDRSTATE_TKEXECPGM)
     117#define ASSERT_LdrStateQAppType(fn)     ASSERT_LdrState(fn, LDRSTATE_LDRQAPPTYPE)
     118
     119#define ASSERT_LdrState(fn, state) \
     120    {                              \
     121        if ((ulLdrState & LDRSTATE_MASK) != (state)) \
     122        {                          \
     123            kprintf((fn ": assertion incorrect loader state. ulLdrState (%d) != " #state "(%d)", \
     124                     ulLdrState, state)); \
     125        }                          \
    95126    }
    96     #endif
    97 
    98     #pragma pack()
    99 
    100 #endif
     127
     128
     129/*
     130 * handle state - Array of handle states. Eight state per byte!
     131 */
     132#define MAX_FILE_HANDLES 0x10000
     133
     134extern unsigned char achHandleStates[MAX_FILE_HANDLES/8];
     135
     136#define HSTATE_UNUSED       0x00    /* Handle not used (or OS/2). */
     137#define HSTATE_OS2          0x00    /* OS/2 module filehandle. */
     138#define HSTATE_OUR          0x01    /* Our module filehandle. */
     139#define HSTATE_MASK         0xFE
     140#define HSTATE_UMASK        0x01
     141
     142#define GetState(a)         (HSTATE_UMASK & (achHandleStates[(a)/8] >> ((a)%8)))
     143#define SetState(a,b)       (achHandleStates[(a)/8] = (achHandleStates[(a)/8] & (HSTATE_MASK << ((a)%8) | HSTATE_MASK >> 8-((a)%8)) | ((b) & 0x1) << ((a)%8)))
     144
     145
     146/*
     147 * Declare the module classes used below in case they aren't declared yet.
     148 */
     149#ifdef __cplusplus
     150class ModuleBase;
     151class Pe2Lx;
     152class Elf2Lx;
     153#else
     154typedef char ModuleBase;
     155typedef char Pe2Lx;
     156typedef char Elf2Lx;
     157#endif
     158
     159
     160/*
     161 * Module struct.
     162 */
     163typedef struct _Module
     164{
     165    AVLNODECORE     coreKey;    /* Key is hFile. */
     166    AVLNODECORE     coreMTE;    /* Key is pMTE. */
     167
     168    SFN             hFile;      /* System file number or file handle if you prefer that. */
     169    PMTE            pMTE;       /* Pointer to MTE if we got one - NULL is allowed. */
     170
     171    ULONG           fFlags;     /* Flags. Flags if coreMte is in use and what Data contains. */
     172    union
     173    {
     174        ModuleBase *pModule;    /* Pointer to base module. */
     175        Pe2Lx *     pPe2Lx;     /* Pointer to a Pe2Lx object. (Win32 executables) */
     176        Elf2Lx *    pElf2Lx;    /* Pointer to a Elf2Lx object. (ELF executables) */
     177        #if 0
     178        Script *    pScript;    /* Pointer to a Script object. (Shell scripts) */
     179        Pe *        pPe;        /* Pointer to a Pe object. (Ring3 loader) */
     180        #endif
     181    } Data;                     /* Pointer to data. Currently it's allways a Pe2Lx object! */
     182} MODULE, *PMODULE;
     183
     184#define MOD_FLAGS_IN_MTETREE    0x00000010UL /* The node is present in the MTE-tree. */
     185#define MOD_TYPE_MASK           0x0000000FUL /* Type mask. */
     186#define MOD_TYPE_PE2LX          0x00000001UL /* Pe2Lx module. */
     187#define MOD_TYPE_ELF2LX         0x00000002UL /* Elf2Lx module. */
     188#define MOD_TYPE_SCRIPT         0x00000003UL /* Script module. */
     189#define MOD_TYPE_PE             0x00000004UL /* Pe module. */
     190
     191
     192/*
     193 * Pointer to the currently loading executable module.
     194 * Available at tkExecPgm time when loading a converted module.
     195 */
     196extern PMODULE pExeModule;
     197
     198
     199/*
     200 * Modules operations.
     201 */
     202PMODULE     getModuleBySFN(SFN hFile);
     203PMODULE     getModuleByMTE(PMTE pMTE);
     204PMODULE     getModuleByhMTE(HMTE hMTE);
     205PMODULE     getModuleByFilename(PCSZ pszFilename);
     206
     207ULONG       addModule(SFN hFile, PMTE pMTE, ULONG fFlags, ModuleBase *pModObj);
     208ULONG       removeModule(SFN hFile);
     209
     210
     211
     212/*
     213 * mytkExecPgm variables and functions
     214 *
     215 * (See ldr\mytkExecPgm.asm for further info on these variabels and functions.)
     216 */
     217#define CCHFILENAME     261             /* This is defined in mytkExecPgm.asm too. */
     218#define CCHARGUMENTS   1536             /* This is defined in mytkExecPgm.asm too. */
     219extern const char   fTkExecPgm;
     220extern char         achTkExecPgmFilename[CCHFILENAME];
     221extern char         achTkExecPgmArguments[CCHARGUMENTS];
     222#endif
     223ULONG _Optlink  tkExecPgmEnvLength(void);
     224ULONG _Optlink  tkExecPgmCopyEnv(char *pachBuffer, unsigned cchBuffer);
     225
     226
     227
     228/*
     229 * functions
     230 */
     231PSZ         ldrGetExePath(PSZ pszPath, BOOL fExecChild);
     232ULONG       ldrInit(void);
     233
     234#ifdef __cplusplus
     235}
     236#endif
     237
     238#pragma pack()
     239
     240#endif
  • trunk/src/win32k/include/log.h

    r2898 r4164  
    1 /* $Id: log.h,v 1.4 2000-02-25 18:15:04 bird Exp $
     1/* $Id: log.h,v 1.5 2000-09-02 21:08:02 bird Exp $
    22 *
    33 * log - C-style logging - kprintf.
     
    2525#define OUTPUT_COM1 0x3f8
    2626#define OUTPUT_COM2 0x2f8
     27#define OUTPUT_COM3 0x3e8
     28#define OUTPUT_COM4 0x2e8
    2729
    2830
     
    3234#define dprintf kprintf
    3335#if defined(DEBUG) && !defined(NOLOGGING)
    34     #ifndef INCL_16
     36    #ifdef INCL_16
     37        /* 16-bit */
     38        #include "vprntf16.h"
     39        #define kprintf(a)          printf16 a
     40        #define printf this function is not used in 16-bit code! Use printf16!
     41    #else
    3542        /* 32-bit */
    3643        #include <stdarg.h>
    3744        #include "vprintf.h"
    3845        #define kprintf(a)          printf a
    39     #else
    40         /* 16-bit */
    41         #include "vprntf16.h"
    42         #define kprintf(a)          printf16 a
    4346    #endif
    4447#else
    45     #define kprintf(a)              (void)0
     48    #define kprintf(a)              ((void)0)
    4649#endif
    4750
  • trunk/src/win32k/include/macros.h

    r3485 r4164  
    1 /* $Id: macros.h,v 1.2 2000-05-03 10:46:07 bird Exp $
     1/* $Id: macros.h,v 1.3 2000-09-02 21:08:02 bird Exp $
    22 *
    33 * Common macros for Win32k/Elf.
     
    2424#define ALIGN(a, alignment) (((a) + (alignment - 1UL)) & ~(alignment - 1UL))
    2525
     26/*
     27 * Not referenced parameter warning fix.
     28 */
     29#define NOREF(a) (a=a)
    2630
    2731/*
  • trunk/src/win32k/include/myExecPgm.h

    r2828 r4164  
    1 /* $Id: myExecPgm.h,v 1.1 2000-02-19 08:41:10 bird Exp $
     1/* $Id: myExecPgm.h,v 1.2 2000-09-02 21:08:03 bird Exp $
    22 *
    33 * Desclarations for buffer.asm and mytkExecPgm.
     
    1212#define _myExecPgm_h_
    1313
    14 /*******************************************************************************
    15 *   Defined Constants And Macros                                               *
    16 *******************************************************************************/
    17 #define CB_BUFFER   1536                /* This is to be updated in the files buffer.asm and tkExecPgm too! */
    18 #define CCH_FILENAME 261                /* This is to be updated in the files buffer.asm and tkExecPgm too! */
    19 
    20 
    21 /*******************************************************************************
    22 *   Structures and Typedefs                                                    *
    23 *******************************************************************************/
    24 #pragma pack(1)
    25 typedef struct _EXECPGMBUFFER
    26 {
    27     char szFilename[CCH_FILENAME];          /* Executable filename. */
    28     char achArgs[CB_BUFFER - CCH_FILENAME]; /* collection of ASCIIZ which ends with an empty string */
    29 } EXECPGMBUFFER, *PEXECPGMBUFFER;
    30 #pragma pack()
    31 
    32 
    33 /*******************************************************************************
    34 *   Functions Prototypes                                                       *
    35 *******************************************************************************/
    36 PEXECPGMBUFFER _Optlink QueryBufferPointerFromFilename(const char *pszFilename);
     14/* obsolete */
    3715
    3816#endif
  • trunk/src/win32k/include/omf.h

    r1678 r4164  
    1 /* $Id: omf.h,v 1.2 1999-11-10 01:45:33 bird Exp $ */
     1/* $Id: omf.h,v 1.3 2000-09-02 21:08:03 bird Exp $ */
    22/*
    33 * OMF stuff
     
    1616#define LIBEND      0xF1
    1717#define THEADR      0x80
    18 
    1918#define MODEND      0x8a
    2019#define MODEND2     0x8b
    21 
    2220#define COMENT      0x88
    2321#define     IMPDEF  0x01
    24 
     22#define PUBDEF      0x90
    2523#define LNAMES      0x96
     24#define SEGDEF      0x98
     25#define SEGDEF2     0x99
     26#define GRPDEF      0x9A
     27#define FIXUPP      0x9C
     28#define FIXUPP2     0x9D
     29#define LEDATA      0xA0
     30#define LEDATA2     0xA1
    2631
    2732#endif
  • trunk/src/win32k/include/options.h

    r2898 r4164  
    1 /* $Id: options.h,v 1.10 2000-02-25 18:15:06 bird Exp $
     1/* $Id: options.h,v 1.11 2000-09-02 21:08:03 bird Exp $
    22 *
    33 * Options.
     
    1616*******************************************************************************/
    1717/* fKernel */
    18 #define KF_UNI              0x00000000UL
    19 #define KF_SMP              0x00000001UL
     18#define KF_UNI              0x0000
     19#define KF_SMP              0x0001
     20#define KF_W4               0x0002
     21#define KF_DEBUG            0x1000
     22#define KF_HAS_DEBUGTYPE    0x2000
     23#define KF_ALLSTRICT        0x3000
     24#define KF_HALFSTRICT       0x7000
    2025
    2126/* fPE */
     
    3338
    3439/* default heapsizes */
    35 #define CB_SWP_INIT         (1024*512)      /* 512KB */
    36 #define CB_SWP_MAX          (1024*1024*16)  /*  16MB  */
    37 #define CB_RES_INIT         (1024*256)      /* 256KB */
    38 #define CB_RES_MAX          (1024*1024*10)  /*  10MB  */
     40#define CB_SWP_INIT         ((unsigned long)1024*512)      /* 512KB */
     41#define CB_SWP_MAX          ((unsigned long)1024*1024*16)  /*  16MB  */
     42#define CB_RES_INIT         ((unsigned long)1024*256)      /* 256KB */
     43#define CB_RES_MAX          ((unsigned long)1024*1024*10)  /*  10MB  */
    3944
    4045/* default assignments */
     
    4752            (unsigned short)~0,     /* usVerMajor    */     \
    4853            (unsigned short)~0,     /* usVerMinor    */     \
    49             FLAGS_PE_PE2LX,         /* fPE           */     \
     54            FLAGS_PE_MIXED,         /* fPE           */     \
    5055            INFOLEVEL_QUIET,        /* ulInfoLevel   */     \
    5156            FALSE,                  /* fElf          */     \
    52             TRUE,                   /* fScript       */     \
     57            TRUE,                   /* fUNIXScript   */     \
     58            TRUE,                   /* fREXXScript   */     \
     59            TRUE,                   /* fJava         */     \
    5360            FALSE,                  /* fNoLoader     */     \
    5461            CB_SWP_INIT,            /* cbSwpHeapInit */     \
     
    5764            CB_RES_MAX}             /* cbResHeapMax  */
    5865
     66#define isAnyLoaderEnabled()        (!options.fNoLoader && \
     67                                    (isPELoaderEnabled() || isELFEnabled() || isUNIXScriptEnabled() || isREXXScriptEnabled() || isJAVAEnabled()))
     68#define isPELoaderEnabled()         (options.fPE != FLAGS_PE_NOT)
     69#define isPELoaderDisabled()        (options.fPE == FLAGS_PE_NOT)
     70#define isPe2LxLoaderEnabled()      (options.fPE == FLAGS_PE_PE2LX)
     71#define isMixedPeLoaderEnabled()    (options.fPE == FLAGS_PE_MIXED)
     72
     73#define isELFDisabled()             (!options.fElf)
     74#define isELFEnabled()              (options.fElf)
     75#define isUNIXScriptDisabled()      (!options.fUNIXScript)
     76#define isUNIXScriptEnabled()       (options.fUNIXScript)
     77#define isREXXScriptDisabled()      (!options.fREXXScript)
     78#define isREXXScriptEnabled()       (options.fREXXScript)
     79#define isJAVADisabled()            (!options.fJava)
     80#define isJAVAEnabled()             (options.fJava)
     81
     82#define isSMPKernel()               (options.fKernel & KF_SMP)
     83#define isUNIKernel()               !(options.fKernel & KF_SMP)
    5984
    6085
     
    86111    ULONG       fElf;                   /* Elf flags. */
    87112
    88     /** @cat Options affecting the script executables */
    89     ULONG       fScript;                /* Script flags. */
     113    /** @cat Options affecting the UNIX script executables */
     114    ULONG       fUNIXScript;            /* UNIX script flags. */
    90115
    91     /** @cat Options affecting the script executables */
    92     ULONG       fNoLoader;              /* No loader stuff. */
     116    /** @cat Options affecting the REXX script executables */
     117    ULONG       fREXXScript;            /* REXX script flags. */
     118
     119    /** @cat Options affecting the JAVA executables */
     120    ULONG       fJava;                  /* Java flags. */
     121
     122    /** @cat Options affecting the  executables */
     123    ULONG       fNoLoader;              /* No loader stuff. !FIXME! We should import / functions even if this flag is set!!! */
    93124
    94125    /** @cat Options affecting the heap. */
     
    100131#pragma pack()
    101132
    102 
    103133/*******************************************************************************
    104134*   Global Variables                                                           *
    105135*******************************************************************************/
    106 extern struct options options;      /* defined in d32globals.c */
     136extern struct options DATA16_GLOBAL options;    /* defined in d16globals.c */
    107137#if defined(__IBMC__) || defined(__IBMCPP__)
    108138    #pragma map( options , "_options"  )
  • trunk/src/win32k/include/pe2lx.h

    r2925 r4164  
    1 /* $Id: pe2lx.h,v 1.9 2000-02-27 02:16:43 bird Exp $
     1/* $Id: pe2lx.h,v 1.10 2000-09-02 21:08:03 bird Exp $
    22 *
    33 * Pe2Lx class declarations. Ring 0 and Ring 3
     
    6666    ULONG  applyFixups(PMTE pMTE, ULONG iObject, ULONG iPageTable, PVOID pvPage,
    6767                       ULONG ulPageAddress, PVOID pvPTDA); /*(ldrEnum32bitRelRecs)*/
     68    ULONG  openPath(PCHAR pachFilename, USHORT cchFilename, ldrlv_t *pLdrLv, PULONG pful); /* (ldrOpenPath) */
     69    static ULONG  openPath2(PCHAR pachFilename, ULONG cchFilename, ldrlv_t *pLdrLv, PULONG pful, BOOL fOdin32PathValid);
    6870    #ifndef RING0
    6971    ULONG  testApplyFixups();
    7072    ULONG  writeFile(PCSZ pszLXFilename);
    7173    #endif
     74
     75    /** @cat public query methods */
     76    BOOL    isExe();
     77    BOOL    isDll();
     78    static SFN  getKernel32SFN()        {   return sfnKernel32;   }
     79    static VOID setKernel32SFN(SFN sfn) {   sfnKernel32 = sfn;    }
     80    static VOID invalidateOdin32Path();
     81    static LONG getLoadedModuleCount()  {   return cLoadedModules;}
    7282
    7383    /** @cat public Helper methods */
     
    120130    /** @cat static helpers */
    121131    static PCSZ queryOdin32ModuleName(PCSZ pszWin32ModuleName);
     132    static BOOL initOdin32Path();
     133    static BOOL setOdin32Path(const char *psz);
    122134
    123135    /** @cat static dump methods */
     
    195207        ULONG flFlags;                      /* equivalent object flags */
    196208    } paSecChars2Flags[];
     209
     210    static LONG             cLoadedModules; /* Count of existing objects. Updated by constructor and destructor. */
     211    static const char *     pszOdin32Path;  /* Odin32 base path (include a slash). */
     212    static ULONG            cchOdin32Path;  /* Odin32 base path length. */
     213    static SFN              sfnKernel32;    /* Odin32 Kernel32 filehandle. */
    197214};
    198215
  • trunk/src/win32k/include/probkrnl.h

    r3411 r4164  
    1 /* $Id: probkrnl.h,v 1.13 2000-04-17 01:56:49 bird Exp $
     1/* $Id: probkrnl.h,v 1.14 2000-09-02 21:08:04 bird Exp $
    22 *
    33 * Include file for ProbKrnl.
     
    1616*   Defined Constants And Macros                                               *
    1717*******************************************************************************/
    18 #define NBR_OF_KRNLIMPORTS      18      /* When this is changed make sure to   */
     18#define NBR_OF_KRNLIMPORTS      42      /* When this is changed make sure to   */
    1919                                        /* update the arrays in d32init.c and  */
    20                                         /* probkrnl.c */
     20                                        /* probkrnl.c, make test faker in      */
     21                                        /* test.h and the appropriate fake.c   */
     22                                        /* fakea.asm.                          */
    2123#define MAX_LENGTH_NAME         32      /* Max length for the function. */
    2224
     
    2426#define EPT_PROC                0x00    /* procedure - overload procedure*/
    2527#define EPT_PROCIMPORT          0x01    /* procedure 32bit - import only */
    26 #define EPT_VARIMPORT           0x02    /* variable/non-procedure 32bit - not implemented yet */
    27 #define EPT_32BIT               0x00    /* 16 bit entry-point  */
    28 #define EPT_16BIT               0x80    /* 32 bit entry-point */
     28#define EPT_VARIMPORT           0x02    /* variable/non-procedure 32bit */
     29#define EPT_NOT_REQ             0x04    /* Not required flag. */
     30#define EPT_32BIT               0x00    /* 32 bit entry-point  */
     31#define EPT_16BIT               0x80    /* 16 bit entry-point */
    2932#define EPT_BIT_MASK            0x80    /* Mask bit entry-point */
    3033#define EPT16BitEntry(a)    (((a).fType & EPT_BIT_MASK) == EPT_16BIT)
     
    3437#define EPT_PROC32              (EPT_PROC | EPT_32BIT)
    3538#define EPT_PROCIMPORT32        (EPT_PROCIMPORT | EPT_32BIT)
     39#define EPT_PROCIMPORTNR32      (EPT_PROCIMPORT | EPT_32BIT | EPT_NOT_REQ)
    3640#define EPT_VARIMPORT32         (EPT_VARIMPORT | EPT_32BIT)
    3741
     
    4145#define EPT_VARIMPORT16         (EPT_VARIMPORT | EPT_16BIT)
    4246
    43 /* Kernel type: SMP/UNI/W4 */
    44 #define TYPE_UNI                0       /* Any UNI processor kernel except Warp 4 fp13 and above. */
    45 #define TYPE_SMP                1       /* SMP Warp3 Adv. or Warp 4.5 SMP */
    46 #define TYPE_W4                 2       /* Warp4 fp13 and above. */
     47
     48/* Kernel type: SMP/UNI/W4 (flags matches KF_* in options.h)  */
     49#if 0
     50#define TYPE_UNI                0x00     /* Any UNI processor kernel except Warp 4 fp13 and above. */
     51#define TYPE_SMP                0x01     /* SMP Warp3 Adv. or Warp 4.5 SMP */
     52#define TYPE_W4                 0x02     /* Warp4 fp13 and above. */
     53#endif
    4754
    4855
     
    7380{
    7481    unsigned short usBuild;             /* Build number */
    75     unsigned char  fchBldType;          /* R, H, A */
    76     unsigned char  fchType;             /* TYPE_SMP, TYPE_UNI, TYPE_W4 */
     82    unsigned short fKernel;             /* Kernel flag (KF_* defines in options.h). */
    7783    unsigned char  cObjects;            /* Count of objects */
    7884    struct
     
    9197*   NOTE! These are only available at init time!                               *
    9298*******************************************************************************/
    93 extern IMPORTKRNLSYM _aImportTab[NBR_OF_KRNLIMPORTS]; /* 'aImportTab' in PrbKrnl.c */
    94 extern unsigned short int _usBuild;     /* 'ulBuild'         in PrbKrnl.c */
    95 extern unsigned short int _usVerMajor;  /* 'usVerMajor'      in PrbKrnl.c */
    96 extern unsigned short int _usVerMinor;  /* 'usVerMinor'      in PrbKrnl.c */
    97 extern KRNLDBENTRY aKrnlSymDB[];        /* defined in symdb.c (for 16-bit usage) */
    98 extern KRNLDBENTRY _aKrnlSymDB[];       /* defined in symdb.c (for 32-bit usage) */
     99extern IMPORTKRNLSYM DATA16_GLOBAL  aImportTab[NBR_OF_KRNLIMPORTS]; /* Defined in ProbKrnl.c */
     100extern char          DATA16_GLOBAL  szUsrSym[50];                   /* Defined in ProbKrnl.c */
     101extern KRNLDBENTRY   DATA16_INIT    aKrnlSymDB[];                   /* Defined in symdb.c (for 16-bit usage) */
    99102
     103#if defined(__IBMC__) || defined(__IBMCPP__)
     104    #pragma map( aImportTab , "_aImportTab" )
     105    #pragma map( szUsrSym   , "_szUsrSym"   )
     106    #pragma map( aKrnlSymDB , "_aKrnlSymDB" )
     107#endif
    100108
    101109#if defined(INCL_16) && defined(MAX_DISKDD_CMD) /* 16-bit only */
    102110int ProbeKernel(PRPINITIN pReqPack);
     111
     112#if 0 /*ndef CODE16_INIT*/
     113#pragma alloc_text(CODE16_INIT, ProbeKernel)
    103114#endif
    104115
    105116#endif
    106117
     118#endif
     119
  • trunk/src/win32k/include/rmalloc.h

    r2506 r4164  
    1 /* $Id: rmalloc.h,v 1.2 2000-01-24 01:44:08 bird Exp $
     1/* $Id: rmalloc.h,v 1.3 2000-09-02 21:08:04 bird Exp $
    22 *
    33 * Resident Heap.
     
    2020#endif
    2121/* XLATON */
     22/*******************************************************************************
     23*   Structures and Typedefs                                                    *
     24*******************************************************************************/
     25typedef struct HeapState_s  /* note: this is used by both swappable and resident heaps */
     26{
     27    ULONG       cbHeapSize;          /* Amount of memory used by the heap free and used++. */
     28    ULONG       cbHeapFree;          /* Amount of used space. */
     29    ULONG       cbHeapUsed;          /* Amount of free space reserved. */
     30    ULONG       cBlocksUsed;         /* Count of used blocks. */
     31    ULONG       cBlocksFree;         /* Count of free blocks. */
     32} HEAPSTATE, *PHEAPSTATE;
     33
    2234
    2335/*******************************************************************************
     
    3345int         _res_validptr2(void *, unsigned);
    3446unsigned    _res_memfree(void);
     47unsigned    _res_memused(void);
     48int         _res_state(PHEAPSTATE);
    3549int         _res_heap_check(void);
    3650void        _res_heapmin(void);
    3751void        _res_dump_subheaps(void);
    3852void        _res_dump_allocated(unsigned);
     53
     54extern unsigned cbResHeapMax;           /* Maximum amount of memory used by the heap. */
     55
    3956
    4057/* XLATOFF */
  • trunk/src/win32k/include/smalloc.h

    r2506 r4164  
    1 /* $Id: smalloc.h,v 1.1 2000-01-24 01:44:08 bird Exp $
     1/* $Id: smalloc.h,v 1.2 2000-09-02 21:08:04 bird Exp $
    22 *
    33 * Swappable Heap.
     
    2121/* XLATON */
    2222
     23struct HeapState_s;
     24
    2325/*******************************************************************************
    2426*   Exported Functions and Variables                                           *
     
    3335int         _swp_validptr2(void *, unsigned);
    3436unsigned    _swp_memfree(void);
     37unsigned    _swp_memused(void);
     38int         _swp_state(struct HeapState_s *);
    3539int         _swp_heap_check(void);
    3640void        _swp_heapmin(void);
    3741void        _swp_dump_subheaps(void);
    3842void        _swp_dump_allocated(unsigned);
     43
     44extern unsigned cbSwpHeapMax;   /* Maximum amount of memory used by the heap. */
    3945
    4046/* XLATOFF */
  • trunk/src/win32k/include/test.h

    r3829 r4164  
    1 /* $Id: test.h,v 1.1 2000-07-16 22:17:13 bird Exp $
     1/* $Id: test.h,v 1.2 2000-09-02 21:08:04 bird Exp $
    22 *
    33 * Definitions and declarations for test moduls.
     
    9393    PULONG  pulAddr,
    9494    PUSHORT pushPTDA);
    95 ULONG LDRCALL fakeldrOpenPath(PCHAR pachFilename, USHORT cchFilename, ldrlv_t *plv, PULONG pful);
    96 ULONG LDRCALL fakeLDRClearSem(void);
    97 ULONG KRNLCALL fakeKSEMRequestMutex(HKMTX hkmtx, ULONG ulTimeout);
    98 extern HKMTX        fakeLDRSem;
    99 ULONG KRNLCALL   fakeTKFuBuff(PVOID pv, PVOID pvUsr, ULONG cb, ULONG fl);
    100 ULONG KRNLCALL   fakeTKSuBuff(PVOID pvUsr, PVOID pv, ULONG cb, ULONG fl);
    101 ULONG KRNLCALL   fakeTKFuBufLen(PLONG pcch, PVOID pvUsr, ULONG cchMax, ULONG fl, BOOL fDblNULL);
    102 PMTE LDRCALL  fakeldrValidateMteHandle(HMTE hMTE);
    103 void _Optlink fakeg_tkExecPgm(void);    /* Not callable! (fakea.asm) */
    104 void _Optlink fakef_FuStrLenZ(void);    /* Not callable! (fakea.asm) */
    105 void _Optlink fakef_FuStrLen(void);     /* Not callable! (fakea.asm) */
    106 void _Optlink fakef_FuBuff(void);       /* Not callable! (fakea.asm) */
     95PMTE KRNLCALL fakeldrASMpMTEFromHandle(
     96    HMTE  hMTE);
     97ULONG LDRCALL   fakeldrOpenPath(PCHAR pachFilename, USHORT cchFilename, ldrlv_t *plv, PULONG pful);
     98ULONG LDRCALL   fakeLDRClearSem(void);
     99ULONG LDRCALL   fakeldrFindModule(PCHAR pachFilename, USHORT cchFilename, USHORT usClass, PPMTE ppMTE);
     100ULONG KRNLCALL  fakeKSEMRequestMutex(HKSEMMTX hkmtx, ULONG ulTimeout);
     101ULONG KRNLCALL  fakeKSEMReleaseMutex(HKSEMMTX hkmtx);
     102BOOL  KRNLCALL  fakeKSEMQueryMutex(HKSEMMTX hkmtx, PUSHORT pcusNest);
     103VOID  KRNLCALL  fakeKSEMInit(PKSEM pksem, ULONG fulType, ULONG fulFlags);
     104extern KSEMMTX  fakeLDRSem;
     105extern char *   fakeLDRLibPath;
     106ULONG KRNLCALL  fakeTKFuBuff(PVOID pv, PVOID pvUsr, ULONG cb, ULONG fl);
     107ULONG KRNLCALL  fakeTKSuBuff(PVOID pvUsr, PVOID pv, ULONG cb, ULONG fl);
     108ULONG KRNLCALL  fakeTKFuBufLen(PLONG pcch, PVOID pvUsr, ULONG cchMax, ULONG fl, BOOL fDblNULL);
     109PMTE LDRCALL    fakeldrValidateMteHandle(HMTE hMTE);
     110PSZ  SECCALL    fakeSecPathFromSFN(SFN hFile);
     111void _Optlink   fakeg_tkExecPgm(void);    /* Not callable! (fakea.asm) */
     112void _Optlink   fake_tkStartProcess(void);/* Not callable! (fakea.asm) */
     113void _Optlink   fakef_FuStrLenZ(void);    /* Not callable! (fakea.asm) */
     114void _Optlink   fakef_FuStrLen(void);     /* Not callable! (fakea.asm) */
     115void _Optlink   fakef_FuBuff(void);       /* Not callable! (fakea.asm) */
    107116extern PTCB     fakepTCBCur;
    108117extern PPTDA    fakepPTDACur;
    109118extern char     fakeptda_start;
    110119extern USHORT   fakeptda_environ;
     120extern KSEMMTX  fakeptda_ptdasem;
     121extern HMTE     fakeptda_module;
     122extern PSZ      fakeptda_pBeginLIBPATH;
     123extern PSZ      fakeldrpFileNameBuf;
    111124
    112125#endif /* INCL_NO_FAKE */
    113126
    114127#ifdef INCL_16
    115 extern USHORT  usFakeVerMajor;          /* define in probkrnl.c */
    116 extern USHORT  usFakeVerMinor;          /* define in probkrnl.c */
     128extern USHORT   usFakeVerMajor;         /* define in probkrnl.c */
     129extern USHORT   usFakeVerMinor;         /* define in probkrnl.c */
    117130#else
    118 extern USHORT  _usFakeVerMajor;
    119 extern USHORT  _usFakeVerMinor;
     131extern USHORT   _usFakeVerMajor;
     132extern USHORT   _usFakeVerMinor;
    120133#endif
    121134
    122 extern const char *pszInternalRevision; /* defined in win32ktst.c */
     135#ifdef _OS2Krnl_h_
     136extern int      cObjectsFake;           /* defined in win32ktst.c */
     137extern OTE      aKrnlOTE[24];           /* defined in win32ktst.c */
     138#endif
    123139
    124140#ifdef __cplusplus
  • trunk/src/win32k/include/vprntf16.h

    r2898 r4164  
    1 /* $Id: vprntf16.h,v 1.1 2000-02-25 18:15:06 bird Exp $
     1/* $Id: vprntf16.h,v 1.2 2000-09-02 21:08:04 bird Exp $
    22 *
    33 * printf/vprintf header file - 16bit.
     
    3030 * Function prototypes
    3131 */
    32 int printf16(const char *pszFormat, ...);
    33 int vprintf16(const char *pszFormat, va_list args);
     32int FAR printf16(const char *pszFormat, ...);
     33int FAR vprintf16(const char *pszFormat, va_list args);
     34
     35/*#pragma alloc_text(CODE16, printf16, vprintf16)*/
    3436
    3537
  • trunk/src/win32k/include/win32k.h

    r2918 r4164  
    1 /* $Id: win32k.h,v 1.4 2000-02-26 20:21:42 bird Exp $
     1/* $Id: win32k.h,v 1.5 2000-09-02 21:08:00 bird Exp $
    22 *
    33 * Top level make file for the Win32k library.
     
    2525 */
    2626#define K32_ALLOCMEMEX          0x01
    27 
     27#define K32_QUERYOTES           0x02
     28#define K32_QUERYOPTIONSSTATUS  0x03
     29#define K32_SETOPTIONS          0x04
    2830
    2931/*
     
    3638*   Structures and Typedefs                                                    *
    3739*******************************************************************************/
     40#pragma pack(1)
     41
     42/*
     43 * Object Table Entry buffer.
     44 */
     45typedef struct _QueryOTE
     46{
     47    ULONG   ote_size;                   /* Object virtual size */
     48    ULONG   ote_base;                   /* Object base virtual address */
     49    ULONG   ote_flags;                  /* Attribute flags */
     50    ULONG   ote_pagemap;                /* Object page map index */
     51    ULONG   ote_mapsize;                /* Num of entries in obj page map */
     52  /*ULONG   ote_reserved;*/
     53    USHORT  ote_sel;                    /* Object Selector */
     54    USHORT  ote_hob;                    /* Object Handle */
     55} QOTE, *PQOTE;
     56
     57typedef struct _QueryOTEBuffer
     58{
     59    ULONG   cOTEs;                      /* Number of entries in aOTE. */
     60    QOTE    aOTE[1];                    /* Array of OTEs. */
     61} QOTEBUFFER, *PQOTEBUFFER;
     62
     63
     64/*
     65 * Options struct.
     66 *
     67 * (The function of these members are described in options.h in
     68 *  the src\win32k\include directory.)
     69 * All members of this struct (except cb ofcourse) is changable.
     70 */
     71typedef struct _K32Options
     72{
     73    ULONG   cb;
     74
     75    /** @cat logging options */
     76    USHORT      usCom;                  /* Output port no. */
     77    ULONG       fLogging;               /* Logging. */
     78
     79    /** @cat Options affecting the generated LX executables */
     80    ULONG       fPE;                    /* Flags set the type of conversion. */
     81    ULONG       ulInfoLevel;            /* Pe2Lx InfoLevel. */
     82
     83    /** @cat Options affecting the generated ELF executables */
     84    ULONG       fElf;                   /* Elf flags. */
     85
     86    /** @cat Options affecting the UNIX script executables */
     87    ULONG       fUNIXScript;            /* UNIX script flags. */
     88
     89    /** @cat Options affecting the REXX script executables */
     90    ULONG       fREXXScript;            /* REXX script flags. */
     91
     92    /** @cat Options affecting the JAVA executables */
     93    ULONG       fJava;                  /* Java flags. */
     94
     95    /** @cat Options affecting the  executables */
     96    ULONG       fNoLoader;              /* No loader stuff. !FIXME! We should import / functions even if this flag is set!!! */
     97
     98    /** @cat Options affecting the heap. */
     99    ULONG       cbSwpHeapMax;           /* Maximum heapsize. */
     100    ULONG       cbResHeapMax;           /* Maxiumem residentheapsize. */
     101} K32OPTIONS, *PK32OPTIONS;
     102
     103
     104/*
     105 * Status struct.
     106 *
     107 */
     108typedef struct _K32Status
     109{
     110    ULONG   cb;
     111
     112    /** @cat Options status. */
     113    ULONG       fQuiet;                 /* Quiet initialization. */
     114
     115    /** @cat Kernel status. */
     116    ULONG       fKernel;                /* Smp or uni kernel. */
     117    ULONG       ulBuild;                /* Kernel build. */
     118    USHORT      usVerMajor;             /* OS/2 major ver - 20 */
     119    USHORT      usVerMinor;             /* OS/2 minor ver - 30,40 */
     120
     121    /** @cat Heap status. */
     122    ULONG       cbSwpHeapInit;          /* Initial heapsize. */
     123    ULONG       cbSwpHeapFree;          /* Amount of used space. */
     124    ULONG       cbSwpHeapUsed;          /* Amount of free space reserved. */
     125    ULONG       cbSwpHeapSize;          /* Amount of memory used by the heap free and used++. */
     126    ULONG       cSwpBlocksUsed;         /* Count of used blocks. */
     127    ULONG       cSwpBlocksFree;         /* Count of free blocks. */
     128
     129    ULONG       cbResHeapInit;          /* Initial heapsize. */
     130    ULONG       cbResHeapFree;          /* Amount of free space reserved. */
     131    ULONG       cbResHeapUsed;          /* Amount of used space. */
     132    ULONG       cbResHeapSize;          /* Amount of memory used by the heap free and used++. */
     133    ULONG       cResBlocksUsed;         /* Count of used blocks. */
     134    ULONG       cResBlocksFree;         /* Count of free blocks. */
     135
     136    /** @cat Win32k build, version and init stuff */
     137    CHAR        szBuildDate[12];        /* Date of the win32k build. (Sep 02 2000) */
     138    CHAR        szBuildTime[9];         /* Time of the win32k build. (11:44:21) */
     139    ULONG       ulVersion;              /* Win32k version */
     140    CHAR        szSymFile[CCHMAXPATH];  /* The name of the symbol file or sym database. */
     141
     142    /** @cat Statistics */
     143    ULONG       cPe2LxModules;          /* Number of Pe2Lx modules currently loaded. */
     144    ULONG       cElf2LxModules;         /* Number of Elf2Lx modules currently loaded. */
     145    /*...*/
     146} K32STATUS, *PK32STATUS;
     147
     148
     149
    38150/*
    39151 * K32 category parameter structs
     
    51163} K32ALLOCMEMEX, *PK32ALLOCMEMEX;
    52164
    53 
    54 
    55 
    56 #ifdef INCL_WIN32K_LIB
     165typedef struct _k32QueryOTEs
     166{
     167    HMODULE     hMTE;                   /* Module handle. */
     168    PQOTEBUFFER pQOte;                  /* Pointer to output buffer. */
     169    ULONG       cbQOte;                 /* Size of the buffer pointed to by pQOte  */
     170    ULONG       rc;                     /* Return code. */
     171} K32QUERYOTES, *PK32QUERYOTES;
     172
     173typedef struct _k32QueryOptionsStatus
     174{
     175    PK32OPTIONS     pOptions;           /* Pointer to option struct. (NULL allowed) */
     176    PK32STATUS      pStatus;            /* Pointer to status struct. (NULL allowed) */
     177    ULONG           rc;                 /* Return code. */
     178} K32QUERYOPTIONSSTATUS, *PK32QUERYOPTIONSSTATUS;
     179
     180typedef struct _k32SetOptions
     181{
     182    PK32OPTIONS     pOptions;           /* Pointer to option struct. (NULL allowed) */
     183    ULONG           rc;                 /* Return code. */
     184} K32SETOPTIONS, *PK32SETOPTIONS;
     185
     186
     187#pragma pack()
     188
     189#ifndef NO_WIN32K_LIB_FUNCTIONS
    57190/*******************************************************************************
    58191*   External Functions                                                         *
    59192*******************************************************************************/
     193/* Win32k APIs */
    60194APIRET APIENTRY  libWin32kInit(void);
    61195APIRET APIENTRY  libWin32kTerm(void);
     196BOOL   APIENTRY  libWin32kInstalled(void);
     197APIRET APIENTRY  libWin32kQueryOptionsStatus(PK32OPTIONS pOptions, PK32STATUS pStatus);
     198APIRET APIENTRY  libWin32kSetOptions(PK32OPTIONS pOptions);
     199
     200/* "Extra OS2 APIs" */
     201APIRET APIENTRY  DosAllocMemEx(PPVOID ppv, ULONG cb, ULONG flag);
     202APIRET APIENTRY  W32kQueryOTEs(HMODULE hMTE, PQOTEBUFFER pQOte, ULONG cbQOte);
     203
     204/* Helper function */
    62205USHORT APIENTRY  libHelperGetCS(void);
    63 APIRET APIENTRY  DosAllocMemEx(PPVOID ppv, ULONG cb, ULONG flag);
    64206
    65207
  • trunk/src/win32k/k32/k32AllocMemEx.cpp

    r2823 r4164  
    1 /* $Id: k32AllocMemEx.cpp,v 1.2 2000-02-18 19:27:30 bird Exp $
     1/* $Id: k32AllocMemEx.cpp,v 1.3 2000-09-02 21:08:05 bird Exp $
    22 *
    33 * k32AllocMemEx - Equivalent to DosAllocMem, but this one
     
    1818#define INCL_OS2KRNL_VM
    1919
     20#define NO_WIN32K_LIB_FUNCTIONS
     21
    2022#ifndef OBJ_SELMAPALL
    2123#define OBJ_SELMAPALL   0x00000800UL
     
    2729*******************************************************************************/
    2830#include <os2.h>
     31#include "devSegDf.h"                   /* Win32k segment definitions. */
    2932#include "OS2Krnl.h"
     33#include "win32k.h"
    3034#include "k32.h"
    3135#include "options.h"
    3236#include "dev32.h"
    3337#include "log.h"
     38#include "macros.h"
    3439
    3540
     
    95100APIRET k32AllocMemEx(PPVOID ppv, ULONG cb, ULONG flag, ULONG ulCS, ULONG ulEIP)
    96101{
     102    #if 0
    97103    APIRET  rc;
    98104    ULONG   flFlags2;
     
    133139
    134140    return rc;
     141    #else
     142    NOREF(ppv);
     143    NOREF(cb);
     144    NOREF(flag);
     145    NOREF(ulCS);
     146    NOREF(ulEIP);
     147    return ERROR_NOT_SUPPORTED;
     148    #endif
    135149}
    136150
  • trunk/src/win32k/ldr/ModuleBase.cpp

    r2926 r4164  
    1 /* $Id: ModuleBase.cpp,v 1.3 2000-02-27 02:17:06 bird Exp $
     1/* $Id: ModuleBase.cpp,v 1.4 2000-09-02 21:08:06 bird Exp $
    22 *
    33 * ModuleBase - Implementetation.
     
    1212*   Defined Constants And Macros                                               *
    1313*******************************************************************************/
    14 #define INCL_DOSERRORS                      /* DOS Error codes. */
     14#define INCL_DOSERRORS                  /* DOS Error codes. */
    1515#ifdef RING0
    16     #define INCL_NOAPI                      /* RING0: No apis. */
     16    #define INCL_NOAPI                  /* RING0: No apis. */
    1717#else /*RING3*/
    18     #define INCL_DOSFILEMGR                 /* RING3: DOS File api. */
     18    #define INCL_DOSFILEMGR             /* RING3: DOS File api. */
    1919#endif
    2020
     
    2323*   Header Files                                                               *
    2424*******************************************************************************/
    25 #include <os2.h>                            /* OS/2 header file. */
    26 
    27 #include "malloc.h"                         /* win32k malloc. Not C library! */
    28 
    29 #include <string.h>                         /* C library string.h. */
    30 #include <stdarg.h>                         /* C library stdarg.h. */
    31 
    32 #include "vprintf.h"                        /* win32k printf and vprintf. Not C library! */
    33 #include "dev32.h"                          /* 32-Bit part of the device driver. (SSToDS) */
    34 #include "OS2Krnl.h"                        /* kernel structs.  (SFN) */
    35 #include "modulebase.h"                     /* ModuleBase class definitions, ++. */
     25#include <os2.h>                        /* OS/2 header file. */
     26
     27#include "devSegDf.h"                   /* Win32k segment definitions. */
     28#include "malloc.h"                     /* Win32k malloc. Not C library! */
     29
     30#include <string.h>                     /* C library string.h. */
     31#include <stdarg.h>                     /* C library stdarg.h. */
     32
     33#include "vprintf.h"                    /* win32k printf and vprintf. Not C library! */
     34#include "dev32.h"                      /* 32-Bit part of the device driver. (SSToDS) */
     35#include "OS2Krnl.h"                    /* kernel structs.  (SFN) */
     36#include "ldrCalls.h"                   /* ldrOpenPath and ldrlv_t. */
     37#include "modulebase.h"                 /* ModuleBase class definitions, ++. */
    3638
    3739
     
    159161}
    160162
     163
     164/**
     165 * openPath - opens file eventually searching loader specific paths.
     166 *
     167 * This base implementation simply calls ldrOpenPath.
     168 * This method is only called for DLLs. DosLoadModule and Imports.
     169 *
     170 * @returns   OS2 return code.
     171 *            pLdrLv->lv_sfn  is set to filename handle.
     172 * @param     pachFilename  Pointer to filename. Not zero terminated!
     173 * @param     cchFilename   Filename length.
     174 * @param     pLdrLv        Loader local variables? (Struct from KERNEL.SDF)
     175 * @param     pful          Pointer to flags which are passed on to ldrOpen.
     176 * @sketch
     177 * This is roughly what the original ldrOpenPath does:
     178 *      if !CLASS_GLOBAL or miniifs then
     179 *          ldrOpen(pachModName)
     180 *      else
     181 *          loop until no more libpath elements
     182 *              get next libpath element and add it to the modname.
     183 *              try open the modname
     184 *              if successfull then break the loop.
     185 *          endloop
     186 *      endif
     187 */
     188ULONG  ModuleBase::openPath(PCHAR pachFilename, USHORT cchFilename, ldrlv_t *pLdrLv, PULONG pful) /* (ldrOpenPath) */
     189{
     190    #ifdef RING0
     191    printf("ModuleBase::openPath:\n");
     192    return ldrOpenPath(pachFilename, cchFilename, pLdrLv, pful);
     193    #else
     194    NOREF(pachFilename);
     195    NOREF(cchFilename);
     196    NOREF(pLdrLv);
     197    NOREF(pful);
     198    return ERROR_NOT_SUPPORTED;
     199    #endif
     200}
    161201
    162202
     
    232272
    233273/**
     274 * Gets the fullpath filename.
     275 * @returns     Const ("Readonly") pointer to the filename.
     276 * @author      knut st. osmundsen (knut.stange.osmundsen@mynd.no)
     277 */
     278PCSZ ModuleBase::getFilename()
     279{
     280    return pszFilename;
     281}
     282
     283
     284/**
     285 * Gets the modulename.
     286 * @returns     Const ("Readonly") pointer to the module name.
     287 * @author      knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     288 * @remark      Modulename is filename without path and extention.
     289 */
     290PCSZ ModuleBase::getModuleName()
     291{
     292    return pszModuleName;
     293}
     294
     295
     296/**
    234297 * Output function for Modules.
    235298 * @param     pszFormat    Pointer to format string.
     
    273336        rc = DosRead(hFile, pvBuffer, cbToRead, &cbRead);
    274337    else
    275         printErr(("DosSetFilePtr(hfile, %#8x(%d),..) failed with rc = %d.",
     338        printErr(("DosSetFilePtr(hfile, %#8x(%d),..) failed with rc = %d.\n",
    276339                  ulOffset, ulOffset, rc));
    277340
  • trunk/src/win32k/ldr/calltab.asm

    r3411 r4164  
    1 ; $Id: calltab.asm,v 1.12 2000-04-17 01:56:49 bird Exp $
    2 ;
    3 ; callTab - Call back again table - table with entry for each function which is overrided.
    4 ;           It holds the part of the prolog which was replaced by a jmp instruction.
    5 ;
    6 ; Copyright (c) 1998-1999 knut st. osmundsen
     1; $Id: calltab.asm,v 1.13 2000-09-02 21:08:06 bird Exp $
     2;
     3; callTab - Call back again table - table with entry for each function or
     4;           variable which is overrided.
     5;           It holds the part of the prolog which was replaced by the jmp
     6;           instruction (overridden functions).
     7;
     8; Copyright (c) 1998-2000 knut st. osmundsen
    79;
    810; Project Odin Software License can be found in LICENSE.TXT
     
    3537    public _VMGetOwner@8
    3638    public _g_tkExecPgm
     39    public _tkStartProcess
    3740    public _f_FuStrLenZ
    3841    public _f_FuBuff
    3942
     43    public _VMObjHandleInfo@12
     44    public _ldrASMpMTEFromHandle@4
     45    public _ldrOpenPath@16
     46    public _LDRClearSem@0
     47    public _ldrFindModule@16
     48    public _KSEMRequestMutex@8
     49    public _KSEMReleaseMutex@4
     50    public _KSEMQueryMutex@8
     51    public _KSEMInit@12
     52
     53    public pLDRSem
     54    public LDRSem_offObject
     55    public _fpLDRSem
     56    public LDRSem_sel
     57
     58    public pLDRLibPath
     59    public LDRLibPath_offObject
     60    public _fpLDRLibPath
     61    public LDRLibPath_sel
     62
     63    public _TKSuBuff@16
     64    public _TKFuBuff@16
     65    public _TKFuBufLen@20
     66    public _ldrValidateMteHandle@4
     67
     68    public ppTCBCur
     69    public pTCBCur_offObject
     70    public _fppTCBCur
     71    public pTCBCur_sel
     72
     73    public ppPTDACur
     74    public pPTDACur_offObject
     75    public _fppPTDACur
     76    public pPTDACur_sel
     77
     78    public pptda_start
     79    public ptda_start_offObject
     80    public _fpptda_start
     81    public ptda_start_sel
     82
     83    public pptda_environ
     84    public ptda_environ_offObject
     85    public _fpptda_environ
     86    public ptda_environ_sel
     87
     88    public pptda_ptdasem
     89    public ptda_ptdasem_offObject
     90    public _fpptda_ptdasem
     91    public ptda_ptdasem_sel
     92
     93    public pptda_module
     94    public ptda_module_offObject
     95    public _fpptda_module
     96    public ptda_module_sel
     97
     98    public pptda_pBeginLIBPATH
     99    public ptda_pBeginLIBPATH_offObject
     100    public _fpptda_pBeginLIBPATH
     101    public pptda_pBeginLIBPATH_sel
     102
     103    public pldrpFileNameBuf
     104    public pldrpFileNameBuf_offObject
     105    public _fpldrpFileNameBuf
     106    public pldrpFileNameBuf_sel
     107
     108    public SecPathFromSFN
     109
    40110
    41111;
     
    47117
    48118CALLTAB segment
    49     assume cs:CALLTAB, ds:flat, ss:nothing
     119    ;assume cs:CALLTAB, ds:flat, ss:nothing
     120    assume ds:flat, ss:nothing
    50121;
    51122; callTab is an array of evt. function prologs with a jump to the real function.
     
    56127;
    57128callTab:
     129
     130; 0
    58131_ldrRead@24 PROC NEAR
    59132    db MAXSIZE_PROLOG dup(0cch)
    60133_ldrRead@24 ENDP
    61134
     135; 1
    62136_ldrOpen@12 PROC NEAR
    63137    db MAXSIZE_PROLOG dup(0cch)
    64138_ldrOpen@12 ENDP
    65139
     140; 2
    66141_ldrClose@4 PROC NEAR
    67142    db MAXSIZE_PROLOG dup(0cch)
    68143_ldrClose@4 ENDP
    69144
     145; 3
    70146_LDRQAppType@8 PROC NEAR
    71147    db MAXSIZE_PROLOG dup(0cch)
    72148_LDRQAppType@8 ENDP
    73149
     150; 4
    74151_ldrEnum32bitRelRecs@24 PROC NEAR
    75152    db MAXSIZE_PROLOG dup(0cch)
    76153_ldrEnum32bitRelRecs@24 ENDP
    77154
    78 
     155; 5
    79156_IOSftOpen@20 PROC NEAR
    80157    db MAXSIZE_PROLOG dup(0cch)
    81158_IOSftOpen@20 ENDP
    82159
     160; 6
    83161_IOSftClose@4 PROC NEAR
    84162    db MAXSIZE_PROLOG dup(0cch)
    85163_IOSftClose@4 ENDP
    86164
     165; 7
    87166_IOSftTransPath@4 PROC NEAR
    88167    db MAXSIZE_PROLOG dup(0cch)
    89168_IOSftTransPath@4 ENDP
    90169
     170; 8
    91171_IOSftReadAt@20 PROC NEAR
    92172    db MAXSIZE_PROLOG dup(0cch)
    93173_IOSftReadAt@20 ENDP
    94174
     175; 9
    95176_IOSftWriteAt@20 PROC NEAR
    96177    db MAXSIZE_PROLOG dup(0cch)
    97178_IOSftWriteAt@20 ENDP
    98179
     180; 10
    99181_SftFileSize@8 PROC NEAR
    100182    db MAXSIZE_PROLOG dup(0cch)
    101183_SftFileSize@8 ENDP
    102184
    103 
     185; 11
    104186_VMAllocMem@36 PROC NEAR
    105187    db MAXSIZE_PROLOG dup(0cch)
    106188_VMAllocMem@36 ENDP
    107189
     190; 12
    108191_VMGetOwner@8 PROC NEAR
    109192    db MAXSIZE_PROLOG dup(0cch)
    110193_VMGetOwner@8 ENDP
    111194
     195; 13
    112196_g_tkExecPgm PROC NEAR
    113197    db MAXSIZE_PROLOG dup(0cch)
    114198_g_tkExecPgm ENDP
    115199
    116 
     200; 14
     201_tkStartProcess PROC NEAR
     202    db MAXSIZE_PROLOG dup(0cch)
     203_tkStartProcess ENDP
     204
     205; 15
    117206_f_FuStrLenZ PROC FAR
    118207    db MAXSIZE_PROLOG dup(0cch)
    119208_f_FuStrLenZ ENDP
    120209
     210; 16
    121211_f_FuStrLen PROC FAR
    122212    db MAXSIZE_PROLOG dup(0cch)
    123213_f_FuStrLen ENDP
    124214
     215; 17
    125216_f_FuBuff PROC FAR
    126217    db MAXSIZE_PROLOG dup(0cch)
    127218_f_FuBuff ENDP
    128219
     220; 18
    129221_VMObjHandleInfo@12 PROC NEAR
    130222    db MAXSIZE_PROLOG dup(0cch)
    131223_VMObjHandleInfo@12 ENDP
    132224
     225; 19
     226_ldrASMpMTEFromHandle@4 PROC NEAR
     227    db MAXSIZE_PROLOG dup(0cch)
     228_ldrASMpMTEFromHandle@4 ENDP
     229
     230; 20
     231_ldrOpenPath@16 PROC NEAR
     232    db MAXSIZE_PROLOG dup(0cch)
     233_ldrOpenPath@16 ENDP
     234
     235; 21
     236_LDRClearSem@0 PROC NEAR
     237    db MAXSIZE_PROLOG dup(0cch)
     238_LDRClearSem@0 ENDP
     239
     240; 22
     241_ldrFindModule@16 PROC NEAR
     242    db MAXSIZE_PROLOG dup(0cch)
     243_ldrFindModule@16 ENDP
     244
     245; 23
     246_KSEMRequestMutex@8 PROC NEAR
     247    db MAXSIZE_PROLOG dup(0cch)
     248_KSEMRequestMutex@8 ENDP
     249
     250; 24
     251_KSEMReleaseMutex@4 PROC NEAR
     252    db MAXSIZE_PROLOG dup(0cch)
     253_KSEMReleaseMutex@4 ENDP
     254
     255; 25
     256_KSEMQueryMutex@8 PROC NEAR
     257    db MAXSIZE_PROLOG dup(0cch)
     258_KSEMQueryMutex@8 ENDP
     259
     260; 26
     261_KSEMInit@12 PROC NEAR
     262    db MAXSIZE_PROLOG dup(0cch)
     263_KSEMInit@12 ENDP
     264
     265; 27
     266pLDRSem          dd  0
     267LDRSem_offObject dd  0
     268_fpLDRSem        dd  0
     269LDRSem_sel       dw  0
     270    db (MAXSIZE_PROLOG - 14) dup(0cch)
     271
     272
     273; 28
     274pLDRLibPath          dd  0
     275LDRLibPath_offObject dd  0
     276_fpLDRLibPath        dd  0
     277LDRLibPath_sel       dw  0
     278    db (MAXSIZE_PROLOG - 14) dup(0cch)
     279
     280; 29
     281_TKSuBuff@16 PROC NEAR
     282    db MAXSIZE_PROLOG dup(0cch)
     283_TKSuBuff@16 ENDP
     284
     285; 30
     286_TKFuBuff@16 PROC NEAR
     287    db MAXSIZE_PROLOG dup(0cch)
     288_TKFuBuff@16 ENDP
     289
     290; 31
     291_TKFuBufLen@20 PROC NEAR
     292    db MAXSIZE_PROLOG dup(0cch)
     293_TKFuBufLen@20 ENDP
     294
     295; 32
     296_ldrValidateMteHandle@4 PROC NEAR
     297    db MAXSIZE_PROLOG dup(0cch)
     298_ldrValidateMteHandle@4 ENDP
     299
     300; 33
     301ppTCBCur           dd  0
     302pTCBCur_offObject  dd  0
     303_fppTCBCur         dd  0
     304pTCBCur_sel        dw  0
     305    db (MAXSIZE_PROLOG - 14) dup(0cch)
     306
     307; 34
     308ppPTDACur          dd  0
     309pPTDACur_offObject dd  0
     310_fppPTDACur        dd  0
     311pPTDACur_sel       dw  0
     312    db (MAXSIZE_PROLOG - 14) dup(0cch)
     313
     314; 35
     315pptda_start          dd  0
     316ptda_start_offObject dd  0
     317_fpptda_start        dd  0
     318ptda_start_sel       dw  0
     319    db (MAXSIZE_PROLOG - 14) dup(0cch)
     320
     321; 36
     322pptda_environ          dd  0
     323ptda_environ_offObject dd  0
     324_fpptda_environ        dd  0
     325ptda_environ_sel       dw  0
     326    db (MAXSIZE_PROLOG - 14) dup(0cch)
     327
     328; 37
     329pptda_ptdasem          dd  0
     330ptda_ptdasem_offObject dd  0
     331_fpptda_ptdasem        dd  0
     332ptda_ptdasem_sel       dw  0
     333    db (MAXSIZE_PROLOG - 14) dup(0cch)
     334
     335; 38
     336pptda_module          dd  0
     337ptda_module_offObject dd  0
     338_fpptda_module        dd  0
     339ptda_module_sel       dw  0
     340    db (MAXSIZE_PROLOG - 14) dup(0cch)
     341
     342; 39
     343pptda_pBeginLIBPATH           dd  0
     344ptda_pBeginLIBPATH_offObject  dd  0
     345_fpptda_pBeginLIBPATH         dd  0
     346pptda_pBeginLIBPATH_sel       dw  0
     347    db (MAXSIZE_PROLOG - 14) dup(0cch)
     348
     349; 40
     350pldrpFileNameBuf              dd  0
     351pldrpFileNameBuf_offObject    dd  0
     352_fpldrpFileNameBuf            dd  0
     353pldrpFileNameBuf_sel          dw  0
     354    db (MAXSIZE_PROLOG - 14) dup(0cch)
     355
     356; 41
     357SecPathFromSFN PROC NEAR
     358    db MAXSIZE_PROLOG dup(0cch)
     359SecPathFromSFN ENDP
     360
     361
    133362CALLTAB ENDS
    134363
  • trunk/src/win32k/ldr/ldr.cpp

    r2501 r4164  
    1 /* $Id: ldr.cpp,v 1.7 2000-01-22 18:21:01 bird Exp $
     1/* $Id: ldr.cpp,v 1.8 2000-09-02 21:08:06 bird Exp $
    22 *
    33 * ldr.cpp - Loader helpers.
     
    1414#define INCL_DOSERRORS
    1515#define INCL_NOPMAPI
    16 
     16#define INCL_OS2KRNL_SEM
     17#define INCL_OS2KRNL_PTDA
    1718
    1819/*******************************************************************************
     
    2122#include <os2.h>
    2223
     24#include "devSegDf.h"
    2325#include "malloc.h"
    2426#include "new.h"
     
    2628#include <stdlib.h>
    2729#include <stddef.h>
     30#include <string.h>
    2831
    2932#include "log.h"
     33#include "avl.h"
    3034#include <peexe.h>
    3135#include <exe386.h>
    3236#include "OS2Krnl.h"
     37#include "ldr.h"
     38#include "ldrCalls.h"
    3339#include "ModuleBase.h"
    3440#include "pe2lx.h"
    35 #include "avl.h"
    36 #include "ldr.h"
    3741#include "options.h"
    3842
     
    4145*   Global Variables                                                           *
    4246*******************************************************************************/
    43 PAVLNODECORE    pSFNRoot = NULL;
    44 PAVLNODECORE    pMTERoot = NULL;
    45 
     47static PAVLNODECORE    pSFNRoot = NULL;
     48static PAVLNODECORE    pMTERoot = NULL;
     49
     50
     51/*
     52 * Loader State. (See ldr.h for more info.)
     53 */
     54ULONG          ulLdrState = LDRSTATE_UNKNOWN;
     55
     56
     57/*
     58 * Pointer to the executable module being loaded.
     59 * This pointer is set by ldrOpen and cleared by tkExecPgm.
     60 * It's hence only valid at tkExecPgm time. (isLdrStateExecPgm() == TRUE).
     61 */
     62PMODULE         pExeModule = NULL;
     63
     64
     65/*
     66 * Filehandle bitmap.
     67 */
    4668unsigned char   achHandleStates[MAX_FILE_HANDLES/8];
     69
     70
    4771
    4872
     
    6488 * Gets a module by the MTE.
    6589 * @returns   Pointer to module node. If not found NULL.
    66  * @param     pMTE  Pointer an Module Table Entry.
     90 * @param     pMTE  Pointer a Module Table Entry.
    6791 * @sketch    Try find it in the MTE tree.
    6892 *            IF not found THEN
     
    124148
    125149/**
     150 * Gets a module by the hMTE.
     151 * @returns   Pointer to module node. If not found NULL.
     152 * @param     hMTE  Handle to a Module Table Entry.
     153 * @sketch    Convert hMte to an pMTE (pointer to MTE).
     154 *            Call getModuleByMTE with MTE pointer.
     155 * @status    completely implemented.
     156 * @author    knut st. osmundsen
     157 */
     158PMODULE     getModuleByhMTE(HMTE hMTE)
     159{
     160    PMTE pMTE;
     161
     162    pMTE = ldrValidateMteHandle(hMTE);
     163    if (pMTE != NULL)
     164        return getModuleByMTE(pMTE);
     165
     166    return NULL;
     167}
     168
     169
     170/**
    126171 * Get a module by filename.
    127172 * @returns   Pointer to module node. If not found NULL.
     
    236281            delete pMod->Data.pPe2Lx;
    237282            break;
    238 
     283/*
    239284        case MOD_TYPE_ELF2LX:
    240         case MOD_TYPE_SCRIPT:
    241         case MOD_TYPE_PE:
     285            break;
     286*/
     287#ifdef DEBUG
    242288        default:
    243289            kprintf(("removeModule: Unknown type, %#x\n", pMod->fFlags & MOD_TYPE_MASK));
     290#endif
    244291    }
    245292
     
    248295
    249296    return NO_ERROR;
     297}
     298
     299
     300/**
     301 * Gets the path of the executable being executed.
     302 * @returns     Pointer to pszPath on success. Path has _NOT_ a trailing slash.
     303 *              NULL pointer on error.
     304 * @param       pszPath     Pointer to path buffer. Expects CCHMAXPATH length.
     305 * @param       fExecChild  Use hMTE of the PTDAExecChild if present.
     306 * @sketch
     307 * @status      completely implemented.
     308 * @author      knut st. osmundsen (knut.stange.osmundsen@mynd.no)
     309 * @remark      The path from the pExeModule might not be fully qualified.
     310 */
     311PSZ ldrGetExePath(PSZ pszPath, BOOL fExecChild)
     312{
     313    PCSZ    pszFilename;
     314    PCSZ    psz;
     315
     316    #if 0 /* getFilename not implemented */
     317    if (pExeModule != NULL)
     318        /*
     319         * We have the executable object pointer. Let's use it!
     320         */
     321        pszFilename = pExeModule->Data.pModule->getFilename();
     322    else
     323    #endif
     324    {
     325        /*
     326         * Get the hMTE for the executable using the pPTDAExecChild
     327         * Then get the pMTE, and access the smte_path to get a pointer to the executable path.
     328         */
     329        PPTDA   pPTDACur;               /* Pointer to the current (system context) PTDA */
     330        PPTDA   pPTDA;                  /* PTDA in question. */
     331        HMTE    hMTE = NULLHANDLE;      /* Modulehandle of the executable module. */
     332        PMTE    pMTE;                   /* Pointer to ModuleTableEntry of the executable module. */
     333
     334        /*
     335         *  Get the current PTDA. (Fail if this call failes.)
     336         *  IF pPTDAExecChild isn't NULL THEN get hMTE for that.
     337         *  IF no pPTDAExecChild THEN  get hMte for the current PTDA.
     338         */
     339        pPTDACur = ptdaGetCur();
     340        if (pPTDACur != NULL)
     341        {
     342            pPTDA = ptdaGet_pPTDAExecChild(pPTDACur);
     343            if (pPTDA != NULL && fExecChild)
     344                hMTE = ptdaGet_ptda_module(pPTDA);
     345            if (hMTE == NULLHANDLE)
     346                hMTE = ptdaGet_ptda_module(pPTDACur);
     347        }
     348        else
     349        {   /* Not called at task time? No current task! */
     350            kprintf(("ldrGetExePath: Failed to get current PTDA.\n"));
     351            return NULL;
     352        }
     353
     354        /* fail if hMTE is NULLHANDLE ie. not found / invalid */
     355        if (hMTE == NULLHANDLE)
     356        {
     357            kprintf(("ldrGetExePath: Failed to get hMTE from the PTDAs.\n"));
     358            return NULL;
     359        }
     360
     361        /* get the pMTE for this hMTE */
     362        pMTE = ldrASMpMTEFromHandle(hMTE);
     363        if (pMTE == NULL)
     364        {
     365            kprintf(("ldrGetExePath: ldrASMpMTEFromHandle failed for hMTE=0x%04.\n", hMTE));
     366            return NULL;
     367        }
     368        if (pMTE->mte_swapmte == NULL) /* paranoia */
     369        {
     370            kprintf(("ldrGetExePath: mte_swapmte is NULL.\n"));
     371            return NULL;
     372        }
     373
     374        /* take the filename from the swappable MTE */
     375        pszFilename = pMTE->mte_swapmte->smte_path;
     376        if (pszFilename == NULL)
     377        {
     378            kprintf(("ldrGetExePath: smte_path is NULL.\n"));
     379            return NULL;
     380        }
     381    }
     382
     383    /* paranoia... */
     384    if (*pszFilename == '\0')
     385    {
     386        kprintf(("ldrGetExePath: pszFilename is empty!\n"));
     387        return NULL;
     388    }
     389
     390    /*
     391     * Skip back over the filename. (stops pointing at the slash or ':')
     392     */
     393    psz = pszFilename + strlen(pszFilename)-1;
     394    while (psz >= pszFilename && *psz != '\\' && *psz != '/' && *psz != ':')
     395        psz--;
     396
     397    /*
     398     * If no path the fail.
     399     */
     400    if (psz <= pszFilename)
     401    {
     402        kprintf(("ldrGetExePath: Exepath is empty.\n"));
     403        return NULL;
     404    }
     405
     406    /*
     407     * Copy path and return.
     408     */
     409    memcpy(pszPath, pszFilename, psz - pszFilename);
     410    pszPath[psz - pszFilename] = '\0';
     411    return pszPath;
    250412}
    251413
  • trunk/src/win32k/ldr/myLDRQAppType.cpp

    r2501 r4164  
    1 /* $Id: myLDRQAppType.cpp,v 1.3 2000-01-22 18:21:02 bird Exp $
     1/* $Id: myLDRQAppType.cpp,v 1.4 2000-09-02 21:08:07 bird Exp $
    22 *
    33 * _myLDRQAppType - _LDRQAppType overload.
     
    1515#define INCL_NOPMAPI
    1616
     17#define INCL_OS2KRNL_PTDA
     18#define INCL_OS2KRNL_SEM
     19
    1720/*******************************************************************************
    1821*   Header Files                                                               *
     
    2023#include <os2.h>
    2124
     25#include "devSegDf.h"                   /* Win32k segment definitions. */
    2226#include "OS2Krnl.h"
     27#include "avl.h"
     28#include "ldr.h"
    2329#include "ldrCalls.h"
    2430#include "log.h"
    2531
    26 BOOL fQAppType = FALSE;
    2732
    2833/**
    29  * LDRQAppType - Loader Query Application Type.
    30  * We set a flag while we're executing this function. Just to speed up processing.
    31  * If a PE file is queried, a dummy LX header is presented.
     34 * LDRQAppType - Loader Query Application Type - DosQueryAppType worker.
     35 *
     36 * We overrides this be able to determin if a convertion is only for a
     37 * LDRQAppType call.
     38 *
     39 * isLdrStateQAppType() returns TRUE when this procedure is on the stack.
     40 *
    3241 * @returns   return code.
    3342 * @param     p1
     
    3847    APIRET rc;
    3948
    40     kprintf(("_LDRQAppType: entry\n"));
    41     fQAppType = 1;
     49    kprintf(("myLDRQAppType: entry\n"));
     50    rc = KSEMRequestMutex(ptda_ptda_ptdasem(ptdaGetCur()), KSEM_INDEFINITE_WAIT);
     51    if (rc != NO_ERROR)
     52    {
     53        kprintf(("myLDRQAppType: failed to get intra-process semaphore.\n"));
     54        return rc;
     55    }
     56    rc = LDRRequestSem();
     57    if (rc != NO_ERROR)
     58    {
     59        kprintf(("myLDRQAppType: failed to get loader semaphore.\n"));
     60        return rc;
     61    }
     62
     63    ASSERT_LdrStateUnknown("myLDRQAppType")
     64    setLdrStateQAppType();
    4265
    4366    rc = LDRQAppType(p1, p2);
    4467
    45     fQAppType = 0;
    46     kprintf(("_LDRQAppType: exit\n"));
     68    ASSERT_LdrStateQAppType("myLDRQAppType")
     69    setLdrStateUnknown();
     70
     71    LDRClearSem();
     72    KSEMReleaseMutex(ptda_ptda_ptdasem(ptdaGetCur()));
     73    kprintf(("myLDRQAppType: exit\n"));
    4774
    4875    return rc;
  • trunk/src/win32k/ldr/myldrClose.cpp

    r2501 r4164  
    1 /* $Id: myldrClose.cpp,v 1.5 2000-01-22 18:21:02 bird Exp $
     1/* $Id: myldrClose.cpp,v 1.6 2000-09-02 21:08:07 bird Exp $
    22 *
    33 * myldrClose - ldrClose
     
    2323#include <stdlib.h>
    2424
     25#include "devSegDf.h"                   /* Win32k segment definitions. */
    2526#include "log.h"
     27#include "avl.h"
    2628#include <peexe.h>
    2729#include <exe386.h>
    2830#include "OS2Krnl.h"
    29 #include "avl.h"
    30 #include "ModuleBase.h"
    3131#include "ldr.h"
    3232#include "ldrCalls.h"
     33#include "ModuleBase.h"
     34#include "Pe2Lx.h"
    3335
    3436
     
    4244{
    4345    /* closes handle */
    44     kprintf(("ldrClose: hFile = %.4x\n", hFile));
     46    kprintf(("myldrClose: hFile = %.4x\n", hFile));
    4547    if (GetState(hFile) == HSTATE_OUR)
    4648    {
     
    5254            pMod->Data.pModule->dumpVirtualLxFile();
    5355        else
    54             kprintf(("ldrClose: getModuleBySFN failed!!!"));
     56            kprintf(("myldrClose: getModuleBySFN failed!!!"));
    5557        #endif
    5658
    5759        rc = removeModule(hFile);
    5860        if (rc != NO_ERROR)
    59             kprintf(("ldrClose: removeModule retured rc=%d\n", rc));
     61            kprintf(("myldrClose: removeModule retured rc=%d\n", rc));
    6062
    6163        #pragma info(notrd)
     
    6365        #pragma info(restore)
    6466    }
     67    /*
     68     * Invalidate the odin32path if kernel32 is closed.
     69     *  (Might possible not be needed as Pe2Lx does invalides
     70     *   the odin32path on object destruction.)
     71     */
     72    else if (Pe2Lx::getKernel32SFN() == hFile)
     73        Pe2Lx::invalidateOdin32Path();
    6574
     75    /*
     76     * Finally call the real close function.
     77     */
    6678    return ldrClose(hFile);
    6779}
  • trunk/src/win32k/ldr/myldrEnum32bitRelRecs.cpp

    r2537 r4164  
    1 /* $Id: myldrEnum32bitRelRecs.cpp,v 1.2 2000-01-27 23:43:07 bird Exp $
     1/* $Id: myldrEnum32bitRelRecs.cpp,v 1.3 2000-09-02 21:08:08 bird Exp $
    22 *
    33 * myldrEnum32bitRelRecs - ldrEnum32bitRelRecs
     
    2424#include <stdlib.h>
    2525
     26#include "devSegDf.h"                   /* Win32k segment definitions. */
     27#include "avl.h"
    2628#include "log.h"
    2729#include <peexe.h>
    2830#include <exe386.h>
    2931#include "OS2Krnl.h"
    30 #include "avl.h"
    31 #include "ModuleBase.h"
    3232#include "ldr.h"
    3333#include "ldrCalls.h"
     34#include "ModuleBase.h"
    3435
    3536
     
    6364        APIRET rc;
    6465        #if 1
    65         kprintf(("ldrEnum32BitRelRecs: pMTE=0x%08x iObject=0x%02x iPageTable=0x%03x pvPage=0x%08x\n"
     66        kprintf(("myldrEnum32BitRelRecs: pMTE=0x%08x iObject=0x%02x iPageTable=0x%03x pvPage=0x%08x\n"
    6667                 "                     ulPageAddress=0x%08x pvPTDA=0x%08x\n",
    6768                 pMTE, iObject, iPageTable, pvPage, ulPageAddress, pvPTDA
  • trunk/src/win32k/ldr/myldrOpen.cpp

    r2838 r4164  
    1 /* $Id: myldrOpen.cpp,v 1.10 2000-02-21 09:24:01 bird Exp $
     1/* $Id: myldrOpen.cpp,v 1.11 2000-09-02 21:08:09 bird Exp $
    22 *
    33 * myldrOpen - ldrOpen.
    44 *
    5  * Copyright (c) 1998-1999 knut st. osmundsen
     5 * Copyright (c) 1998-2000 knut st. osmundsen
    66 *
    77 * Project Odin Software License can be found in LICENSE.TXT
     
    1717
    1818#define INCL_OS2KRNL_IO
     19#define INCL_OS2KRNL_TCB
     20#define INCL_OS2KRNL_SEM
     21#define INCL_OS2KRNL_SEC
    1922
    2023/*******************************************************************************
     
    2326#include <os2.h>
    2427
     28#include "devSegDf.h"                   /* Win32k segment definitions. */
    2529#include "rmalloc.h"
    2630#include "malloc.h"
     
    2832#include <stdlib.h>
    2933#include <string.h>
     34#include <stdarg.h>
    3035
    3136#include "log.h"
     37#include "avl.h"
     38#include "options.h"
    3239#include <peexe.h>
    3340#include <exe386.h>
     41#include "elf.h"
    3442#include "OS2Krnl.h"
    3543#include "dev32.h"
     44#include "ldr.h"
     45#include "ldrCalls.h"
    3646#include "ModuleBase.h"
    3747#include "pe2lx.h"
    38 #include "elf.h"
    39 #include "avl.h"
    40 #include "ldr.h"
    41 #include "ldrCalls.h"
    42 #include "options.h"
    4348#include "myExecPgm.h"
    44 
    45 /*******************************************************************************
    46 *   Global Variables                                                           *
    47 *******************************************************************************/
    48 extern BOOL fQAppType;                  /* From LDRQAppType */
     49#include "env.h"
     50#include "vprintf.h"                    /* Make 100% sure we have va_start.  */
     51
     52
    4953
    5054/*******************************************************************************
    5155*   Internal Functions                                                         *
    5256*******************************************************************************/
    53 static unsigned getArgsLength(const char *pachArgs);
     57/* static */ APIRET     AddArgsToFront(int cArgs,  ...);
     58/* static */ APIRET     SetExecName(const char *pszExeName);
     59/* static */ APIRET     OpenPATH(PSFN phFile, char *pszFilename, PULONG pfl);
    5460
    5561
     
    5965 * @param     phFile       Pointer to file handler. Holds filehandle on output.
    6066 * @param     pszFilename  Pointer to filename.
    61  * @parma     param3       Probably some flags.
     67 * @parma     pfl          Pointer to some flags.
    6268 */
    63 ULONG LDRCALL myldrOpen(PSFN phFile, char *pszFilename, ULONG param3)
     69ULONG LDRCALL myldrOpen(PSFN phFile, PSZ pszFilename, PULONG pfl)
    6470{
    65     ULONG rc;
    66 
    67     /*
    68      * Try open the file (thats why this function is called anyway)
     71    static  int cNesting = 0;           /* This is an variable which hold the nesting */
     72                                        /* level of this function. This is useful     */
     73                                        /* when we call it recurcively.               */
     74                                        /* The maximum nesting level is currently 3.  */
     75                                        /* When the maximum depth has been reached    */
     76                                        /* we'll not intercept loading any longer!    */
     77    ULONG rc;                           /* Return value. */
     78
     79    /** @sketch
     80     * Try open the file (that's why this function is called anyway)
    6981     */
    70     rc = ldrOpen(phFile, pszFilename, param3);
    71 
    72     /* log sucesses */
     82    rc = ldrOpen(phFile, pszFilename, pfl);
    7383    if (rc == NO_ERROR)
    74         kprintf(("ldrOpen:  phFile=%#.4x, flags=%#.8x, pszFn=%s\n", *phFile, param3, pszFilename));
    75 
    76     /*
     84        kprintf(("myldrOpen-%d:  phFile=%#.4x, flags=%#.8x, pszFn=%s\n", cNesting, *phFile, pfl, pszFilename));
     85
     86
     87    /** @sketch
    7788     * Are we to intercept the loading?
    78      * - Only if open were succesful and one of the loaders are enabled.
     89     * - If open were successful.
     90     * - And Not too deep nesting.
     91     * - And that this isn't an unsupported load.
     92     * - And one of the loaders are enabled.
    7993     */
    80     if (rc == NO_ERROR && (options.fElf || options.fPE != FLAGS_PE_NOT || options.fScript))
    81     {
    82         char               *pszBuffer = (char*)rmalloc(640);        /* Read buffer. */
    83         PIMAGE_DOS_HEADER   pMzHdr = (PIMAGE_DOS_HEADER)pszBuffer;  /* Pointer to the buffer as it were a dosheader. */
    84         PIMAGE_NT_HEADERS   pNtHdrs = (PIMAGE_NT_HEADERS)pszBuffer; /* Pointer to the buffer as if it were an NT header. */
    85         char               *pach = pszBuffer;                       /* Finally an pointer to the buffer as if it were chars.. (which it is!) */
    86         PEXECPGMBUFFER      pBuffer;                                /* Pointer to a buffer containing the programname and arguments. */
    87                                                                     /* For scripts and PE.EXE this has to be changed to have correct */
    88                                                                     /* parameters sendt in to the program. */
    89         unsigned            cchRead = sizeof(IMAGE_DOS_HEADER);     /* Amount of the buffer which contains valid data. */
    90         unsigned            cbFile;                                 /* Filesize (0xffffffff if call to SftFileSize failed - should _never_ happen though)  */
    91 
    92         /*
    93          * Verify that rmalloc completed successfully.
    94          */
    95         if (pszBuffer == NULL)
     94    if (rc == NO_ERROR
     95        && cNesting < 3
     96        && !isLdrStateLoadingUnsupported()
     97        && isAnyLoaderEnabled()
     98        )
     99    {
     100        union _u_ReadBufferPointers         /* Read buffer pointer(s). */
    96101        {
    97             kprintf(("ldrOpen: rmalloc(1024) failed\n"));
    98             return NO_ERROR;
     102            char               *pach;       /* Pointer to the buffer as char. */
     103            unsigned long      *pul;        /* Pointer to the buffer as unsigned long. */
     104            PIMAGE_DOS_HEADER   pMzHdr;     /* Use the buffer as a dosheader. */
     105            PIMAGE_NT_HEADERS   pNtHdrs;    /* Use the buffer as a NT header. */
     106        } u1;
     107        unsigned            cbFile;         /* Filesize (0xffffffff if call to SftFileSize failed - should _never_ happen though) */
     108        unsigned            cbRead;         /* Amount of the buffer which contains valid data. */
     109        char *              psz;            /* Multipurpose string pointer no.1. */
     110        char *              psz2;           /* Multipurpose string pointer no.2. */
     111        char *              psz3;           /* Multipurpose string pointer no.3. */
     112
     113        /** @sketch
     114         * Allocate read buffer from resident heap.
     115         * IF this fails THEN we'll simply return NO_ERROR.
     116         */
     117        u1.pach = (char*)rmalloc(640);
     118        if (u1.pach == NULL)
     119        {
     120            kprintf(("myldrOpen-%d: rmalloc(640) failed\n", cNesting));
     121            goto ret;
    99122        }
    100123
    101         /*
    102          * Try get the filesize
     124
     125        /** @sketch
     126         * Increment nesting level.
     127         */
     128        cNesting++;
     129
     130
     131        /** @sketch
     132         * Get the filesize. On failure filesize is set to ~0.
    103133         */
    104134        rc = SftFileSize(*phFile, (PULONG)SSToDS(&cbFile));
    105135        if (rc != NO_ERROR)
    106136        {
    107             kprintf(("ldrOpen: SftFileSize failed with rc=%d\n", rc));
     137            kprintf(("myldrOpen-%d: SftFileSize failed with rc=%d\n", cNesting, rc));
    108138            cbFile = (unsigned)~0;
    109139        }
    110140
    111         /*
    112          * See if this is an recognizable module format.
    113          * This costs up to two disk reads!
    114          */
    115         rc = ldrRead(*phFile, 0UL, pMzHdr, 0UL, cchRead, NULL);
    116         if (rc == NO_ERROR)
     141
     142        /** @sketch
     143         *  Read the size of a DOS (ie. MZ) header.
     144         *  IF successful and more stuff in file THEN
     145         *      See if this is an recognizable module binary format:
     146         */
     147        cbRead = min(sizeof(IMAGE_DOS_HEADER), cbFile);
     148        rc = ldrRead(*phFile, 0UL, u1.pMzHdr, 0UL, cbRead, NULL);
     149        if (rc == NO_ERROR && cbRead < cbFile)
    117150        {
    118             /*
    119              * PE header?
    120              *  - If DOS Magic is found AND a valid e_lfanew (offset of NE/LX/LE/PE header) is found
    121              *  - OR if PE siganture is found.
     151            /** @sketch
     152             * If LX header just give up at once.
    122153             */
    123             if ((pMzHdr->e_magic == IMAGE_DOS_SIGNATURE &&
    124                  pMzHdr->e_lfanew > sizeof(IMAGE_DOS_HEADER) && pMzHdr->e_lfanew < 0x04000000UL) /* Larger than 64 bytes and less that 64MB. */
    125                 || *(PULONG)pach == IMAGE_NT_SIGNATURE)
    126             {   /*
    127                  * MZ or PE header found
     154            if (u1.pMzHdr->e_magic == E32MAGIC)
     155                goto cleanup;
     156
     157            /** @sketch
     158             * IF PE or MZ header THEN
     159             */
     160            if (u1.pMzHdr->e_magic == IMAGE_DOS_SIGNATURE
     161                || u1.pNtHdrs->Signature == IMAGE_NT_SIGNATURE)
     162            {
     163                ULONG   offPe;          /* Offset to PE header. */
     164
     165                /** @sketch
     166                 * ---
     167                 * We now known that this is file has a MZ or a PE header. If it's
     168                 * a MZ header, we might end up with no "New" header or the "New"
     169                 * header might turn out to be a NE, LE, or LX header. I any of
     170                 * these non PE headers occur OS/2 will take care of it, we'll do nothing.
     171                 * ---
     172                 * IF PE loading is disable or MZ header and e_lfanew is invalid THEN
     173                 *     return (successfully) to the caller.
     174                 * ENDIF
     175                 * (Find the offset of the PE header while testing (offPe).)
    128176                 */
    129 
    130                 /* if PE loading is diable return to the caller */
    131                 if (options.fPE == FLAGS_PE_NOT)
     177                if (isPELoaderDisabled())
     178                    goto cleanup;
     179                if (u1.pMzHdr->e_magic == IMAGE_DOS_SIGNATURE)
    132180                {
    133                     rfree(pszBuffer);
    134                     return NO_ERROR;
     181                    offPe = u1.pMzHdr->e_lfanew;
     182                    if (offPe < sizeof(IMAGE_DOS_HEADER) || offPe > 0x04000000UL)
     183                        goto cleanup;
    135184                }
    136 
    137                 /*
    138                  * Read the PE header if it isn't what we allready have!
     185                else
     186                    offPe = 0;
     187
     188
     189                /** @sketch
     190                 * Read the PE header.
     191                 * If the read failes or not PE signature, there isn't anything for us to do.
    139192                 */
    140                 cchRead = sizeof(IMAGE_NT_HEADERS);
    141                 if (*(PULONG)pach != IMAGE_NT_SIGNATURE)
    142                     rc = ldrRead(*phFile, pMzHdr->e_lfanew, pach, 0UL, cchRead, NULL);
    143                 else
    144                     rc = ldrRead(*phFile, 0UL, pach, 0UL, cchRead, NULL);
    145 
    146                 /*
    147                  * If successfully read, and a PE signature is present the continue and try load it!
    148                  * Else don't do anything, simply return NO_ERROR to the caller. (probably NE or LX exec)
     193                rc = ldrRead(*phFile, offPe, u1.pach, 0UL, sizeof(IMAGE_NT_HEADERS), NULL);
     194                if (rc != NO_ERROR || u1.pNtHdrs->Signature != IMAGE_NT_SIGNATURE)
     195                    goto cleanup_noerror;
     196
     197
     198                /** @sketch
     199                 * PE signature found!
    149200                 */
    150                 if (rc == NO_ERROR && *(PULONG)pach == IMAGE_NT_SIGNATURE)
    151                 {   /*
    152                      * PE signature found.
    153                      */
    154                     kprintf(("ldrOpen: PE executable...\n"));
    155 
    156                     /*
    157                      * PE2LX?
    158                      *  - When PE2LX flag is set
    159                      *  - OR when the MIXED flag is set and the image is with the first 64MB of memory.
    160                      */
    161                     if (options.fPE == FLAGS_PE_PE2LX
    162                         || (options.fPE == FLAGS_PE_MIXED
    163                             && !((pNtHdrs->FileHeader.Characteristics & IMAGE_FILE_DLL == 0UL)
    164                                  && pNtHdrs->OptionalHeader.ImageBase >= 0x04000000UL /* 64MB */
    165                                  )
     201                kprintf(("myldrOpen-%d: PE executable...\n", cNesting));
     202
     203
     204                /** @sketch
     205                 * Use Pe2Lx?
     206                 *  - When Pe2Lx flag is set
     207                 *  - When the MIXED flag is set and the image isn't an executable
     208                 *    above the first 64MB private limit without relocations
     209                 */
     210                if (isPe2LxLoaderEnabled()
     211                    || (isMixedPeLoaderEnabled()
     212                        && ((u1.pNtHdrs->FileHeader.Characteristics & IMAGE_FILE_DLL)
     213                            || !(u1.pNtHdrs->FileHeader.Characteristics & IMAGE_FILE_RELOCS_STRIPPED)
     214                            || u1.pNtHdrs->OptionalHeader.ImageBase < 0x04000000UL /* 64MB */
    166215                            )
    167216                        )
    168                     {   /*
    169                          * Pe2Lx (Ring0 of course)
    170                          * - Create a Pe2Lx class,
    171                          * - initiate it
    172                          * - Add the module to the module tree so we may find it later...
    173                          * - Set the handle state to 'our'.
    174                          */
    175                         Pe2Lx * pPe2Lx = new Pe2Lx(*phFile);
    176                         if (pPe2Lx != NULL)
     217                    )
     218                {   /** @sketch
     219                     *  Pe2Lx (Ring0 of course)
     220                     *      - Create a Pe2Lx class,
     221                     *      - initiate it
     222                     *      - Add the module to the module tree so we may find it later...
     223                     *      - Set the (file)handle state to 'our'.
     224                     *      - Set pExeModule to module pointer and loaderstate to our exe.
     225                     */
     226                    Pe2Lx * pPe2Lx = new Pe2Lx(*phFile);
     227                    if (pPe2Lx != NULL)
     228                    {
     229                        rc = pPe2Lx->init(pszFilename);
     230                        if (rc == NO_ERROR)
    177231                        {
    178                             rc = pPe2Lx->init(pszFilename);
     232                            kprintf(("myldrOpen-%d: Successfully init of Pe2Lx object.\n", cNesting));
     233                            rc = addModule(*phFile, NULL, MOD_TYPE_PE2LX, pPe2Lx);
    179234                            if (rc == NO_ERROR)
    180235                            {
    181                                 kprintf(("ldrOpen: Successfully init of Pe2Lx object.\n"));
    182                                 rc = addModule(*phFile, NULL, MOD_TYPE_PE2LX, pPe2Lx);
    183                                 if (rc == NO_ERROR)
    184                                     #pragma info(notrd)
    185                                     SetState(*phFile, HSTATE_OUR);
    186                                     #pragma info(restore)
    187                                 else
    188                                     kprintf(("ldrOpen: Failed to add the module. rc=%d\n"));
     236                                #pragma info(notrd)
     237                                SetState(*phFile, HSTATE_OUR);
     238                                #pragma info(restore)
     239                                if (pPe2Lx->isExe())
     240                                {
     241                                    setLdrStateLoadingOurEXE();
     242                                    pExeModule = getModuleBySFN(*phFile);
     243                                    #ifdef DEBUG
     244                                    if (pExeModule == NULL)
     245                                        kprintf(("myldrOpen-%d: getModuleBySFN failed when setting pExeModule! FATAL!\n", cNesting));
     246                                    #endif
     247                                }
    189248                            }
    190249                            else
    191                                 kprintf(("ldrOpen: Failed to init Pe2Lx object. rc=%d\n"));
    192                             if (rc != NO_ERROR)
    193                                 delete pPe2Lx;
     250                                kprintf(("myldrOpen-%d: Failed to add the module. rc=%d\n", cNesting));
    194251                        }
    195252                        else
    196                             kprintf(("ldrOpen: Failed to allocate Pe2Lx object.\n"));
     253                            kprintf(("myldrOpen-%d: Failed to init Pe2Lx object. rc=%d\n", cNesting));
     254                        if (rc != NO_ERROR)
     255                            delete pPe2Lx;
    197256                    }
    198257                    else
    199258                    {
    200                         /*
    201                          * Starting of PE.EXE enable?
     259                        kprintf(("myldrOpen-%d: Failed to allocate Pe2Lx object.\n", cNesting));
     260                        rc = ERROR_NOT_ENOUGH_MEMORY;
     261                    }
     262
     263                    goto cleanup;
     264                }
     265
     266
     267                /** @sketch
     268                 *  Using PE.EXE to start EXE?
     269                 *      - When the file is an EXE file and PE.EXE is enabled.
     270                 */
     271                if ((u1.pNtHdrs->FileHeader.Characteristics & IMAGE_FILE_DLL) == 0UL
     272                    && (options.fPE == FLAGS_PE_PE || options.fPE == FLAGS_PE_MIXED)
     273                    && (isLdrStateExecPgm() || isLdrStateQAppType())
     274                    )
     275                {
     276                    /** @sketch
     277                     * PE.EXE:
     278                     * Find pe.exe - look in current directory and thru the PATH.
     279                     * Note! We use the read buffer (u1.p*) as a storage for the
     280                     * pe.exe filename and path.
     281                     */
     282                    kprintf(("myldrOpen-%d: pe.exe - opening\n", cNesting));
     283                    ldrClose(*phFile);
     284                    strcpy(u1.pach, "PE.EXE");
     285                    rc = ldrOpen(phFile, u1.pach, pfl); /* This isn't recusive! */
     286                    if (rc != NO_ERROR)
     287                        rc = OpenPATH(phFile, u1.pach, pfl);
     288                    if (rc == NO_ERROR)
     289                    {
     290                        /** @sketch
     291                         * If we're in tkExecPgm state we'll have to shuffle the parameters
     292                         * and executable filename tkExecPgm were called with.
     293                         * If not tkExecPgm we can't do anything about parameters (and there is
     294                         * probably nothing to do either).
    202295                         */
    203                         if (options.fPE == FLAGS_PE_PE || options.fPE == FLAGS_PE_MIXED)
    204                         {   /*
    205                              * pe.exe - need the path!
    206                              */
    207                             kprintf(("ldrOpen: pe.exe - opening\n"));
    208                             ldrClose(*phFile);
    209                             rc = ldrOpen(phFile, "pe.exe", param3);  /* path....! problems! */
    210                             kprintf(("ldrOpen: pe.exe - open returned with rc = %d\n", rc));
    211                             rfree(pszBuffer);
    212                             return rc;
     296                        kprintf(("myldrOpen-%d: pe.exe - %s\n", cNesting, u1.pach));
     297                        if (isLdrStateExecPgm() && fTkExecPgm)
     298                        {
     299                            rc = AddArgsToFront(2, ldrpFileNameBuf, achTkExecPgmFilename);
     300                            if (rc == NO_ERROR)
     301                            {
     302                                rc = SetExecName(ldrpFileNameBuf);
     303                                if (rc != NO_ERROR)
     304                                    kprintf(("myldrOpen-%d: pe.exe - failed to set pe.exe as execname. rc=%d\n", cNesting));
     305                            }
     306                            else
     307                                kprintf(("myldrOpen-%d: pe.exe - failed to add programname as argument. rc=%d\n", cNesting, rc));
     308                            goto cleanup_noerror;
    213309                        }
    214310                    }
     311                    else
     312                        kprintf(("myldrOpen-%d: pe.exe - couldn't find/open pe.exe\n", cNesting));
    215313                }
    216                 rfree(pszBuffer);
    217                 return NO_ERROR;
     314                goto cleanup;
    218315            }
    219             else
     316            /** @sketch End of PE Loading. */
     317
     318
     319            /** @sketch
     320             * ELF image?
     321             */
     322            if (*u1.pul == ELFMAGICLSB)
    220323            {
     324                if (isELFDisabled())
     325                    goto cleanup_noerror;
     326
    221327                /*
    222                  * ELF image?
     328                 * ELF signature found.
    223329                 */
    224                 if (pach[0] == ELFMAG0 && pach[1] == ELFMAG1 && pach[2] == ELFMAG2 && pach[3] == ELFMAG3)
     330                kprintf(("myldrOpen-%d: ELF image! - not implemented yet!\n", cNesting));
     331
     332                /*
     333                 * Do nothing more yet. NEED AN ELF LOADER!!!
     334                 */
     335                goto cleanup;
     336            }
     337
     338
     339            /** @sketch
     340             * Java image?
     341             */
     342            if (*u1.pul == 0xBEBAFECAUL) //CAh FEh BAh BEh
     343            {
     344                char *pszName = NULL;
     345                int   cchName;
     346
     347                if (isJAVADisabled())
     348                    goto cleanup_noerror;
     349
     350                /** @sketch
     351                 * Java signature found.
     352                 * Copy the name to a temporary buffer. (only if necessary)
     353                 * Remove the extention (.class) and insert a space between the name and the path.
     354                 *  (This is the needed processing of the class filename to make it a classpath
     355                 *   entry (path) and a class name (filename).)
     356                 * Try find the java executor in current dir or PATH: java.exe
     357                 */
     358                kprintf(("myldrOpen-%d: Jave image!\n", cNesting));
     359
     360                if (isLdrStateExecPgm() && fTkExecPgm)
    225361                {
    226                     /*
    227                      * ELF signature found.
     362                    /* Ooops we had to get the file name from the MFT. ldrpFileNameBuf is allways uppercased... */
     363                    /* MFT seems to hold uppercased filenames! ARG! But (by pure luck?) achTkExecPgmArguments is
     364                     * not uppercased (yet). Nothing could be simpler!
    228365                     */
    229                     kprintf(("ldrOpen: ELF executable! - not implemented yet!\n"));
    230 
    231                     /*
    232                      * Do nothing more yet. NEED AN ELF LOADER!!!
     366                    #if 1
     367                    psz3 = achTkExecPgmArguments;
     368                    #elif 0
     369                    psz3 = SecPathFromSFN(*phFile);
     370                    if (psz3 == NULL)
     371                        psz3 = ldrpFileNameBuf;
     372                    #else
     373                    psz3 = ldrpFileNameBuf;
     374                    #endif
     375                    cchName = strlen(psz3);
     376                    pszName = (char*)rmalloc(cchName + 2);
     377                    if (pszName == NULL)
     378                    {
     379                        rc = ERROR_NOT_ENOUGH_MEMORY;
     380                        goto cleanup;
     381                    }
     382                    memcpy(pszName, psz3, cchName+1);
     383
     384                    psz = pszName + strlen(pszName) - 1;
     385                    while (psz > pszName && *psz != '.' && *psz != '\\' && *psz != '/')
     386                        psz--;
     387                    if (*psz == '.')
     388                    {
     389                        cchName = psz - pszName;
     390                        *psz-- = '\0';
     391                        while (psz > pszName && *psz != '\\' && *psz != '/')
     392                            psz--;
     393
     394                        /* check for root and evt. make room for an extra slash. */
     395                        if (psz - pszName == 2)
     396                        {
     397                            memmove(psz + 1, psz, cchName - 1);
     398                            *psz++ = '\\';
     399                        }
     400                    }
     401                    /* check if no path */
     402                    if (psz == pszName)
     403                        memmove(pszName + 1, pszName, cchName + 1);
     404                    *psz = ' ';
     405                }
     406
     407                ldrClose(*phFile);
     408                rc = ldrOpen(phFile, ".\\JAVA.EXE", pfl);
     409                if (rc != NO_ERROR)
     410                    rc = OpenPATH(phFile, "JAVA.EXE", pfl);
     411                if (rc == NO_ERROR)
     412                {
     413                    kprintf(("myldrOpen-%d: java - %s\n", cNesting, ldrpFileNameBuf));
     414
     415                    /** @sketch
     416                     * To be able to execute any given class name we'll have to pass in the
     417                     * directory as -classpath. But -classpath seems to override the default
     418                     * and environmental CLASSPATHs. So, we'll have to pass in the value of
     419                     * the CLASSPATH env.var. or generate the default class path (what ever that is).
     420                     *
    233421                     */
    234                     rfree(pszBuffer);
    235                     return NO_ERROR;
     422                    if (isLdrStateExecPgm() && fTkExecPgm)
     423                    {
     424                        psz = u1.pach;
     425
     426                        /*
     427                         * Get classpath and add it as a parameter
     428                         */
     429                        strcpy(u1.pach, "-classpath ");
     430                        psz = u1.pach + strlen(u1.pach);
     431
     432                        psz3 = (char*)ScanEnv(GetEnv(TRUE), "CLASSPATH");
     433                        if (psz3 != NULL)
     434                        {   /* environment variable set */
     435                            if (strlen(psz3) > 640 - 11 - 1 - cchName) //check for overflow
     436                            {   // TODO? should reallocate...
     437                                memcpy(psz, psz3, 640 - 11 - 1 - cchName);
     438                                psz[640 - 11 - 1 - cchName] = '\0';
     439                            }
     440                            else
     441                                strcpy(psz, psz3);
     442                            psz += strlen(psz);
     443                        }
     444                        else
     445                        {
     446                            /* Make default classpath by taking the java.exe path + '..\lib\classes.zip' */
     447                            strcpy(psz, ldrpFileNameBuf);
     448                            psz3 = psz + strlen(psz) - 1;
     449                            while (psz3 > psz && *psz3 != '\\' && *psz3 != '/')
     450                                psz3--;
     451                            strcpy(++psz3, "..\\lib\\classes.zip");
     452                            psz = psz3 + strlen(psz3);
     453                        }
     454
     455                        /*
     456                         * Add the class directory (as the last classpath entry) and the class name.
     457                         * (Note. I may happen that there is no directory, but that don't matter
     458                         *        a space is allways preceding the class name.)
     459                         */
     460                        *psz++ = ';';
     461                        strcpy(psz, pszName);
     462                        if (pszName != NULL)
     463                            rfree(pszName);
     464
     465                        /*
     466                         * Setup JAVA.EXE as executable with the parameters we've build.
     467                         */
     468                        rc = AddArgsToFront(2, ldrpFileNameBuf, u1.pach);
     469                        kprintf(("myldrOpen-%d: java - Exe: %s  Args: %s\n", cNesting, ldrpFileNameBuf, u1.pach));
     470                        if (rc == NO_ERROR)
     471                        {
     472                            rc = SetExecName(ldrpFileNameBuf);
     473                            if (rc != NO_ERROR)
     474                                kprintf(("myldrOpen-%d: java - failed to set java.exe as execname. rc=%d\n", cNesting, rc));
     475                        }
     476                        else
     477                            kprintf(("myldrOpen-%d: java - failed to setup the parameters. rc=%d\n", cNesting, rc));
     478
     479                        goto cleanup_noerror;
     480                    }
    236481                }
     482                else
     483                    kprintf(("myldrOpen-%d: java - couldn't find/open java.exe\n", cNesting));
     484
     485
     486                /** @sketch
     487                 *  End of Java loading. (return)
     488                 */
     489                if (pszName != NULL)
     490                    rfree(pszName);
     491                goto cleanup;
    237492            }
     493
    238494        }
     495        else
     496        {
     497            /** @sketch
     498             *  ELSE - the reading size of a DOS header failed or file is smaller than the dos header.
     499             *      IF read failed or filesize is less than 4 bytes THEN
     500             *          return no_error to the caller.
     501             *      ENDIF
     502             */
     503            #ifdef DEBUG
     504            if (rc != NO_ERROR)
     505            {
     506                kprintf(("myldrOpen-%d: ldrRead failed cbRead=%d, cbFile=%d,  rc=%d\n", cNesting, cbRead, cbFile, rc));
     507                goto cleanup_noerror;
     508            }
     509            if (cbRead < 4)
     510            {
     511                kprintf(("myldrOpen-%d: File too small! cbFile=%d\n", cNesting, cbFile));
     512                goto cleanup_noerror;
     513            }
     514            #else
     515            if (rc != NO_ERROR || cbRead < 4) //just forget files less than 4 bytes!
     516                goto cleanup_noerror;
     517            #endif
     518        }
     519        /** @sketch ENDIF (dos header read) */
     520
     521
    239522
    240523        /*
    241          * Only unreconized files and readerror passes this point!
     524         * Only unreconized files passes this point!
    242525         *
    243526         * * Fileformats with lower priority should reside here. *
     
    245528         */
    246529
    247         /*
    248          * If the initial readoperation failed try to read a smaller amount, in case it is a small script...
    249          * 4 bytes is a small amount isn't it?
    250          */
    251         if (rc != NO_ERROR)
     530        /** @sketch
     531         *  UNIX styled script?
     532         *      - Starts with a hash (#)
     533         *      - And we're loading an EXE
     534         *      - And we're either in QAppType or ExecPgm state.
     535         *      - And that a bang (!) is the first char after the hash (ignoring blanks).
     536         */
     537        if (*u1.pach == '#'
     538            && isLdrStateLoadingEXE()
     539            && (isLdrStateQAppType() || isLdrStateExecPgm())
     540            )
    252541        {
    253             kprintf(("ldrOpen: first ldrread failed with rc=%d. tries to read 4 byte.\n", rc));
    254             cchRead = 4;
    255             if ((rc = ldrRead(*phFile, 0UL, pach, 0UL, cchRead, NULL)) != NO_ERROR)
    256                 kprintf(("ldrOpen: second ldrread failed with rc=%d.\n ", rc));
    257         }
    258 
    259         /*
    260          * Now we'll try again, UNIX styled script?
    261          */
    262         if (rc == NO_ERROR && *pach == '#' && pach[1] == '!')
    263         {
     542            if (isUNIXScriptDisabled())
     543                goto cleanup_noerror;
    264544            /*
    265              * UNIX styled script?
    266              * FIXME! Must be more than 64 bytes long?
    267              *        No options!
    268              *        Firstline < 64 bytes!
     545             * Look for a bang (!). Tabs and spaces are skipped, anything else result in error.
    269546             */
    270             kprintf(("ldrOpen: unix script?\n"));
    271             cchRead = min(cbFile, 256);
    272             rc = ldrRead(*phFile, 0UL, pach, 0UL, cchRead, NULL);
    273             if (rc == NO_ERROR)
     547            psz = u1.pach + 1;
     548            while ((*psz == ' ' || *psz == '\t') && psz - u1.pach < cbRead)
     549                psz++;
     550            if (*psz == '!')
    274551            {
    275                 char *pszStart = pach+2;
    276                 kprintf(("ldrOpen: script debug 1\n"));
    277 
    278                 /* Make sure we don't read to much... */
    279                 pszBuffer[cchRead] = '\0';
    280 
    281                 /*
    282                  * Skip blanks
     552                /** @sketch Found UNIX styled script! */
     553
     554                /** @sketch
     555                 * Read more of the script if necessary. (max is 256 chars (- Linux max is 127))
     556                 * Terminate the string read from the file to make sure with stop somewhere!
    283557                 */
    284                 pszStart = pszBuffer + 2; /* skips the "#!" stuff. */
    285                 while (*pszStart != '\0' && (*pszStart == ' ' || *pszStart == '\t'))
    286                     pszStart++;
    287                 kprintf(("ldrOpen: script debug 2\n"));
    288 
    289                 /* anything left on the line? */
    290                 if (*pszStart != '\0' && *pszStart != '\r' && *pszStart != '\n')
     558                if (cbRead < cbFile /*&& cbRead != 256*/)
    291559                {
    292                     char *      pszEnd;         /* Pointer to the end of the string(s) when the next step is finished. */
    293                     unsigned    cchToAdd = 1;   /* Chars to add */
    294                     BOOL        fFirst = TRUE;  /* Set if a '\0' has not been set yet.
    295                                                  * If this is clear, there are one or more parameters after the interpreter name. */
    296 
    297                     /*
    298                      * find linesize and make parameters ready for copying
     560                    cbRead = min(256, cbFile);
     561                    rc = ldrRead(*phFile, 0UL, u1.pach, 0UL, cbRead, NULL);
     562                }
     563                u1.pach[cbRead] = '\0';
     564
     565                if (rc == NO_ERROR)
     566                {
     567                    /** @sketch
     568                     * Parse out filename and optional arguments (if any).
     569                     * The result of the parsing is that:
     570                     *      psz will point at the executable name.
     571                     *      psz2 will point at the arguments.
     572                     *  Both strings are trimmed.
    299573                     */
    300                     pszEnd = pszStart;
    301                     kprintf(("ldrOpen: script debug 3\n"));
    302                     while (*pszEnd != '\0' && *pszEnd != '\r' && *pszEnd != '\n')
     574                    psz++;                                                  /* psz points to the bang, skip it. */
     575                    while (*psz == ' ' || *psz == '\t')                     /* skip blanks after bang */
     576                        psz++;
     577                    if (*psz == '\r' || *psz == '\n' || *psz == '\0')       /* End-of-line? */
    303578                    {
    304                         if (fFirst && (*pszEnd == ' ' || *pszEnd == '\t'))
     579                        kprintf(("myldrOpen-%d: script no executable name.\n", cNesting));
     580                        goto cleanup_noerror; /* other error code? */
     581                    }
     582                    psz2 = psz + 1;                                         /* Not end-of-line, so add 1 before searching for args. */
     583                    while (*psz2 != '\0' && *psz2 != '\n' && *psz2 != '\r'  /* skip executable name. */
     584                           && *psz2 != ' ' && *psz2 != '\t')
     585                        psz2++;
     586                    while (*psz2 == ' ' || *psz2 == '\t')                    /* skip blanks after executable - pad them with '\0'! */
     587                        *psz2++ = '\0';
     588
     589                    psz3 = psz2;
     590                    while (*psz3 != '\n' && *psz3 != '\r' && *psz3 != '\0') /* find end of parameters and terminate the string. */
     591                        psz3++;
     592                    *psz3 = '\0';
     593                    while (psz3 >= psz2 && (*psz3 == '\0' || *psz3 == ' ' || *psz3 == '\t')) /* trim args */
     594                        *psz3-- = '\0';
     595
     596
     597                    /** @sketch
     598                     *  IF tkExecPgm THEN
     599                     *      Correct parameters - ie. add exec name (as argv[0]),
     600                     *        arguments (psz2) as argv[1+], old exec name, and finally
     601                     *        the existing parameters (current argv[1+]).
     602                     *      Set the executable name.
     603                     *  ENDIF
     604                     *  Open the new executable file recursively. (psz)
     605                     */
     606                    if (isLdrStateExecPgm())
     607                    {
     608                        if (*psz2)
     609                           rc = AddArgsToFront(3, psz, psz2, achTkExecPgmFilename);
     610                        else
     611                           rc = AddArgsToFront(2, psz, achTkExecPgmFilename);
     612                        if (rc != NO_ERROR)
    305613                        {
    306                             *pszEnd = '\0';
    307                             fFirst = FALSE;
    308                             if (pszEnd[1] == '\0' || pszEnd[1] == '\r' || pszEnd[1] == '\n')
    309                                 fFirst = TRUE;
     614                            kprintf(("myldrOpen-%d: AddArgsToFront failed with rc=%d\n", cNesting));
     615                            goto cleanup_noerror;
    310616                        }
    311 
    312                         /* next */
    313                         pszEnd++;
    314                         cchToAdd++;
     617                        rc = SetExecName(psz);
     618                        if (rc != NO_ERROR)
     619                            kprintf(("myldrOpen-%d: SetExecName failed with rc=%d\n", cNesting));
    315620                    }
    316                     *pszEnd = '\0';
    317                     kprintf(("ldrOpen: script debug 4\n"));
    318 
    319                     /*
    320                      * If ldrQueryApp type we don't have any ExecPgm buffer we need to mess with.
    321                      * We'll simply try open the the interpreter.
    322                      */
    323                     if (fQAppType)
     621                    ldrClose(*phFile);
     622                    rc = myldrOpen(phFile, psz, pfl);
     623                    if (rc != NO_ERROR)
    324624                    {
    325                         rc = ldrClose(*phFile);
    326                         rc = ldrOpen(phFile, pszStart, param3); /* FIXME, recusion! check that name not equal! Use flags to prevent race? */
    327                     }
    328                     else
    329                     {
    330                         /*
    331                          * Find the ExecPgm buffer.
    332                          */
    333                         pBuffer = QueryBufferPointerFromFilename(pszFilename);
    334                         kprintf(("ldrOpen: script debug 5\n"));
    335                         if (pBuffer != NULL)
     625                        psz2 = psz + strlen(psz);
     626                        if (psz + 4 >= psz2 || strcmp(psz2 - 4, ".EXE") != 0)
    336627                        {
    337                             unsigned cchArguments = getArgsLength(pBuffer->achArgs); /* minus the first argument. */
    338                             unsigned cchScriptnameDelta = strlen(pBuffer->szFilename) - strlen(pBuffer->achArgs); /* scriptname size difference. */
    339 
    340                             kprintf(("ldrOpen: script debug 6\n"));
    341 
    342                             /*
    343                              * Is there enough space in the struct?
    344                              */
    345                             if (cchArguments + cchToAdd + cchScriptnameDelta < sizeof(pBuffer->achArgs))
    346                             {
    347                                 kprintf(("ldrOpen: script debug 7\n"));
    348                                 /*
    349                                  * Open the interpreter.
    350                                  */
    351                                 rc = ldrClose(*phFile);
    352                                 rc = ldrOpen(phFile, pszStart, param3); /* FIXME, recusion! check that name not equal! Use flags to prevent race? */
    353                                 if (rc == NO_ERROR)
    354                                 {
    355                                     kprintf(("ldrOpen: script debug 8\n"));
    356                                     /* Make space for the addition arguments. */
    357                                     #ifdef DEBUG
    358                                     char *psz = &pBuffer->achArgs[0];
    359                                     int   i = 0;
    360                                     while (*psz != '\0')
    361                                     {
    362                                         kprintf(("Arg %d: %s\n", i++, psz));
    363                                         psz += 1 + strlen(psz);
    364                                     }
    365                                     #endif
    366                                     memmove(&pBuffer->achArgs[cchToAdd + cchScriptnameDelta],
    367                                             &pBuffer->achArgs[0], cchArguments);
    368 
    369                                     /*
    370                                      * Copy the arguments.
    371                                      */
    372                                     kprintf(("ldrOpen: script debug 8\n"));
    373                                     memcpy(&pBuffer->achArgs[0], pszStart, cchToAdd); /* Interpreter with arguments */
    374                                     if (!fFirst)
    375                                         pBuffer->achArgs[cchToAdd - 1] = ' ';
    376                                     strcpy(&pBuffer->achArgs[cchToAdd], pszFilename); /* Scriptname */
    377                                     kprintf(("ldrOpen: script debug a\n"));
    378 
    379                                     #ifdef DEBUG
    380                                     psz = &pBuffer->achArgs[0];
    381                                     i = 0;
    382                                     while (*psz != '\0')
    383                                     {
    384                                         kprintf(("Arg %d: %s\n", i++, psz));
    385                                         psz += 1 + strlen(psz);
    386                                     }
    387                                     #endif
    388                                 }
    389                                 else
    390                                     kprintf(("ldrOpen: failed to open interpreter (%s), rc=%d\n", pszStart, rc));
    391                             }
    392                             else
    393                             {
    394                                 kprintf(("ldrOpen: Argument buffer too small, %d\n", cchArguments + cchToAdd));
    395                                 rc = ERROR_BAD_EXE_FORMAT;
    396                             }
     628                            strcpy(psz2, ".EXE");
     629                            rc = myldrOpen(phFile, psz, pfl);
     630                            *psz2 = '\0';
    397631                        }
    398632                        else
     633                            psz2 = NULL;
     634
     635                        //should we search the PATH??? For a starting, we'll do it.
     636                        if (rc != NO_ERROR
     637                            && (rc = OpenPATH(phFile, psz, pfl)) != NO_ERROR
     638                            && psz2 != NULL)
    399639                        {
    400                             kprintf(("ldrOpen: QueryBufferPointerFromFilename failed.\n"));
    401                             rc = ERROR_BAD_EXE_FORMAT; /*?*/
     640                            *psz2 = '.';
     641                            rc = OpenPATH(phFile, psz, pfl);
    402642                        }
    403643                    }
     
    405645                else
    406646                {
    407                     kprintf(("ldrOpen: no interpereter on the first line.\n"));
    408                     rc = ERROR_BAD_EXE_FORMAT; /*?*/
     647                    kprintf(("myldrOpen-%d: script - failed to read more of the script!, rc=%d cbRead=%d cbFile=%d.\n",
     648                             cNesting, rc, cbRead, cbFile));
    409649                }
     650
     651                goto cleanup;
    410652            }
    411653            else
    412654            {
    413                 kprintf(("ldrOpen: read of min(cbFile, 256) = %d failed, rc = %d\n", cchRead, rc));
     655                kprintf(("myldrOpen-%d: script - hash found but no bang (!).\n", cNesting));
    414656            }
    415         } /* else inn other formats here. */
    416         rfree(pszBuffer);
    417     }
     657        } /**@sketch ENDIF - UNIX styled script. */
     658
     659
     660
     661        /** @sketch
     662         *  REXX script?
     663         *      - Starts with a REXX start comment ('/','*')
     664         *      - And we're loading an EXE
     665         *      - And we're either in QAppType or ExecPgm state.
     666         *      - Extention:
     667         *          .RX and .REX are known to be pure REXX scripts.
     668         *          While .CMD has to invoked used the commandline OS2_SHELL or COMSPEC variable.
     669         */
     670        psz2 = pszFilename + strlen(pszFilename) - 1;
     671        while (psz2 > pszFilename && *psz2 != '.')
     672            psz2--;
     673        if (*psz2 == '.'
     674            && *u1.pach == '/' && u1.pach[1] == '*'
     675            && isLdrStateLoadingEXE()
     676            && (isLdrStateQAppType() || isLdrStateExecPgm())
     677            && (stricmp(psz2, ".RX") == 0 || stricmp(psz2, ".REX") == 0)
     678            )
     679        {
     680            if (isREXXScriptDisabled())
     681                goto cleanup_noerror;
     682
     683            /** @sketch
     684             * Found REXX styled script!
     685             * Find the REXX interpreter. We'll use kRx.exe to execute the REXX scripts.
     686             * (This interpreter could be embedded as a child of ModuleBase as it turned out
     687             * to be quite small about 700 bytes.)
     688             */
     689            kprintf(("myldrOpen-%d: Found REXX script\n", cNesting));
     690            ldrClose(*phFile);
     691            psz = "KRX.EXE";
     692            rc = ldrOpen(phFile, psz, pfl);
     693            if (rc != NO_ERROR)
     694                rc = OpenPATH(phFile, psz, pfl);
     695
     696            /** @sketch
     697             *  IF tkExecPgm THEN
     698             *      Correct parameters - ie. add exec name (as argv[0]), old exec name,
     699             *        and finally the existing parameters (current argv[1+]).
     700             *      Set the executable name.
     701             *  ENDIF
     702             */
     703             if (rc == NO_ERROR && isLdrStateExecPgm())
     704             {
     705                 rc = AddArgsToFront(2, ldrpFileNameBuf, achTkExecPgmFilename);
     706                 if (rc != NO_ERROR)
     707                 {
     708                     kprintf(("myldrOpen-%d: AddArgsToFront failed with rc=%d\n", cNesting));
     709                     goto cleanup_noerror;
     710                 }
     711                 rc = SetExecName(ldrpFileNameBuf);
     712                 if (rc != NO_ERROR)
     713                     kprintf(("myldrOpen-%d: SetExecName failed with rc=%d\n", cNesting));
     714
     715                 goto cleanup_noerror;
     716             }
     717             goto cleanup;
     718        } /**@sketch ENDIF - REXX styled script. */
     719
     720
     721        /*
     722         * Cleanup with rc set to NO_ERROR.
     723         */
     724    cleanup_noerror:
     725        rc = NO_ERROR;
     726
     727        /*
     728         * Cleanup without having rc set to NO_ERROR.
     729         * Decrement the nesting count.
     730         */
     731    cleanup:
     732        rfree(u1.pach);
     733        cNesting--;
     734    }
     735    #ifdef DEBUG
     736    else if (cNesting >= 3)
     737        kprintf(("myldrOpen-%d: cNesting = %d, which is too deep!\n", cNesting, cNesting));
     738    #endif
     739
     740ret:
     741    /** @sketch
     742     *  Return rc.
     743     */
    418744    return rc;
    419745}
     
    421747
    422748/**
    423  * Get the lenght of the arguments.
    424  * @returns   Lenght in char, includes the two '\0's.
    425  * @param     pachArgs  Pointer to the ASCIIZs which makes up the arguments.
    426  * @status    completely implemented.
     749 * Adds new arguments to the front of the startup arguments for the program about to be
     750 * executed.
     751 *
     752 * @returns   OS/2 return code.
     753 * @param     cArgs     Count of arguments to add. At least 1!!!
     754 * @param     ...       Pointers to the arguments to add.
     755 *                      The first argument have to be the executable name. This have to the
     756 *                        the only argument in the first string.
     757 *                      The other arguements are space separated, so you could add a bunch
     758 *                        of arguments in a single string!
     759 *                      The last argument should be the old first parameter if this is to be
     760 *                        preserved. The old first parameter is overwritten since it's
     761 *                        normally the executable name.
     762 *
     763 * @status    completly implemented.
    427764 * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     765 * @remark    Implementation note:
     766 *  The arguments convention is as follows:
     767 *      First argument, which should be the executable name, is terminated with a '\0'.
     768 *        It starts at offset 0 into the argument buffer, of course.
     769 *      All other arguemnts are separated by a space and follows the immediately after the
     770 *        first argument.
     771 *      The arguments are terminated by a double nulltermination: '\0\0'.
    428772 */
    429 static unsigned getArgsLength(const char *pachArgs)
     773APIRET AddArgsToFront(int cArgs,  ...)
    430774{
    431     unsigned    cch = 1;
    432     const char *psz = pachArgs;
    433 
     775    va_list     vaarg;                  /* Variable length argument list. */
     776    int         cchOldArgs;             /* Length of the old arguments (including the first argument). */
     777                                        /* cchOldArgs = 1 means no arguments. It don't include the very last '\0' */
     778                                        /* (remember argumets are terminated with two '\0's). */
     779    int         iSecondArg;             /* Index of the second argument. (Used to skip the first argument.) */
     780                                        /* Used first on the original arguments and them when adding the first */
     781                                        /* new argument. */
     782    int         cchNewArgs;             /* Length of the new arguments to be inserted. */
     783    int         i;                      /* Loop variable. Current function argument. */
     784    char *      psz;                    /* General string pointer. */
     785
     786
     787    /** @sketch
     788     *  Assert that we're in the right state.
     789     *  Calc the length of the existing parameters.
     790     *  Calc the length of the new arguments to determin.
     791     *  Assert that the new arguments have length > 0.
     792     */
     793    #ifdef DEBUG
     794    if (!isLdrStateExecPgm())
     795    {
     796        kprintf(("AddArgsToFront: not in tkExecPgm state.\n"));
     797        return ERROR_INVALID_PARAMETER;
     798    }
     799    #endif
     800    if (!fTkExecPgm)
     801    {
     802        kprintf(("AddArgsToFront: called when not in tkExecPgm data is invalid!\n"));
     803        return ERROR_INVALID_PARAMETER;
     804    }
     805
     806    iSecondArg = strlen(&achTkExecPgmArguments[0]) + 1;
     807    psz = &achTkExecPgmArguments[iSecondArg];
    434808    while (*psz != '\0')
    435     {
    436         register unsigned cch2 = strlen(psz);
    437         cch += cch2;
    438         psz += cch2 + 1;
    439     }
    440 
    441     return cch;
     809        psz += strlen(psz) + 1;
     810    cchOldArgs = psz - &achTkExecPgmArguments[iSecondArg];
     811
     812    va_start(vaarg, cArgs);
     813    for (cchNewArgs = i = 0; i < cArgs; i++)
     814        cchNewArgs += strlen(va_arg(vaarg, char *)) + 1; /* 1 is for space or '\0'. */
     815    va_end(vaarg);
     816    #ifdef DEBUG
     817    if (cchNewArgs == 0)
     818    {
     819        kprintf(("AddArgsToFront: the size of the arguments to add is zero!\n"));
     820        return ERROR_INVALID_PARAMETER;
     821    }
     822    #endif
     823
     824
     825    /** @sketch
     826     *  Check if we have enough room for the new arguments. Fail if not enough.
     827     *  Move the existing arguments to make room for the new ones.
     828     *    !IMPORTANT! The first existing arguments (executable name) is skipped !IMPORTANT!
     829     *    !IMPORTANT! in this move as this have to be re-added in this call!    !IMPORTANT!
     830     */
     831    if (cchOldArgs + cchNewArgs + 1 > CCHARGUMENTS)
     832    {
     833        kprintf(("AddArgsToFront: argument buffer is too small to hold the arguments to add, cchOldArgs=%d, cchNewArgs=%d\n",
     834                 cchOldArgs, cchNewArgs));
     835        return ERROR_BAD_ARGUMENTS;
     836    }
     837
     838    if (cchOldArgs > 0)
     839    {
     840        memmove(&achTkExecPgmArguments[cchNewArgs], &achTkExecPgmArguments[iSecondArg],
     841                cchOldArgs + 1);
     842    }
     843    else
     844        achTkExecPgmArguments[cchNewArgs] = '\0';
     845
     846
     847    /** @sketch
     848     *  Copy new arguments.
     849     *  Since the first argument is special case we'll do it separately. (Uses '\0' as separator.)
     850     *    We assume that the entire first argument passed into this function should be the first argument!
     851     *    (This don't have to be true for the other arguments since these are space separated. You could
     852     *     pass in more than argument in a single string.)
     853     *  Loop thru the rest of the new arguments and add them with space as separator.
     854     */
     855    va_start(vaarg, cArgs);
     856    psz = va_arg(vaarg, char *);
     857    memcpy(&achTkExecPgmArguments[0], psz, (i = strlen(psz) + 1));
     858    psz = &achTkExecPgmArguments[i];
     859
     860    for (i = 1; i < cArgs; i++)
     861    {
     862        if (i > 1) *psz++ = ' ';    //Add space if not second argument.
     863        strcpy(psz, va_arg(vaarg, char *));
     864        psz += strlen(psz);
     865    }
     866    va_end(vaarg);
     867    if (cchOldArgs > 0) *psz++ = ' ';    //Add space if old arguments
     868
     869    #ifdef DEBUG /* assertion */
     870    if (psz != &achTkExecPgmArguments[cchNewArgs])
     871    {
     872        kprintf(("AddArgsToFront: !Assertion failed! psz didn't end up where it should! (psz -> %d should be %d)\n",
     873                 psz - &achTkExecPgmArguments[0], cchNewArgs));
     874        if (cchOldArgs <= 1)
     875            psz[0] = psz[1] = '\0';
     876    }
     877    #endif
     878
     879    return NO_ERROR;
    442880}
     881
     882
     883/**
     884 * Sets the executable name of the module.
     885 * This function is normally invoked after a different executable than the one requested was
     886 * opened. It does _NOT_ set the new executable name as the first argument, since it is more
     887 * convenient to this while calling AddArgsToFront to add other arguments.
     888 *
     889 * @returns   OS/2 return code.
     890 * @param     pszExecName   Pointer to new executable name.
     891 * @status    completly implemented.
     892 * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     893 * @remark    .
     894 */
     895APIRET SetExecName(const char *pszExecName)
     896{
     897    #ifdef DEBUG
     898    int cch;
     899    cch = strlen(pszExecName);
     900    if (cch > CCHMAXPATH)
     901    {
     902        kprintf(("ChangeExecName: filename is too long! cch=%d. name=%s\n", cch, pszExecName));
     903        return ERROR_FILENAME_EXCED_RANGE;
     904    }
     905    if (!isLdrStateExecPgm())
     906    {
     907        kprintf(("ChangeExecName: called when not in tkExecPgm state!!! FATAL ERROR!\n"));
     908        return ERROR_INVALID_PARAMETER;
     909    }
     910    #endif
     911    if (!fTkExecPgm)
     912    {
     913        kprintf(("ChangeExecName: called when not in tkExecPgm data is invalid!!! FATAL ERROR!\n"));
     914        return ERROR_INVALID_PARAMETER;
     915    }
     916
     917    strcpy(achTkExecPgmFilename, pszExecName);
     918
     919    return 0;
     920}
     921
     922
     923/**
     924 * Opens a file using the PATH environment variable of the current process.
     925 * @returns   OS2 return code.
     926 * @param     phFile        Pointer to filehandle. The filehandle is set to the SFN for the opened
     927 *                          file on successful return.
     928 *                          The filehandle is 0 on failure.
     929 * @param     pszFilename   Pointer to filename buffer. This will hold the filename on input.
     930 *                          On successful return it holds the filepath found.
     931 *                          On failiure it's undefined.
     932 * @param     pfl           Some flags set by ldrOpen.
     933 * @sketch    stub
     934 * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     935 * @remark
     936 */
     937APIRET OpenPATH(PSFN phFile, char *pszFilename, PULONG pfl)
     938{
     939    APIRET      rc;
     940    USHORT      TCBFailErr_save;
     941    int         cchFile;                /* Filename length + 1. */
     942    const char *pszFile;                /* Pointer to filename portion. */
     943    const char *pszPath = ScanEnv(GetEnv(FALSE), "PATH"); /* Current Process environment? */
     944
     945    /**@sketch
     946     *  No PATH environment.
     947     */
     948    if (pszPath == NULL)
     949        return ERROR_FILE_NOT_FOUND;
     950
     951    /**@sketch
     952     * Skip any paths in the filename.
     953     */
     954    pszFile = pszFilename + (cchFile = strlen(pszFilename));
     955    while (pszFile >= pszFilename && *pszFile != '\\' && *pszFile != '/')
     956        pszFile--;
     957    cchFile -= pszFile - pszFilename;
     958    pszFile++;
     959
     960    /**@sketch
     961     * We'll have to save the TCBFailErr since we don't want to cause
     962     * Hard Errors while searching invalid paths, etc. (ldrOpenPath does this!)
     963     */
     964    TCBFailErr_save = tcbGetTCBFailErr(tcbGetCur());
     965
     966    /**@ sketch
     967     *  Loop thru the PATH trying to open the specified file in each
     968     *  directory.
     969     */
     970    while (*pszPath != '\0')
     971    {
     972        const char *  pszNext;
     973        int           cchPath;
     974        char          chEnd;
     975        register char ch;
     976
     977        /*
     978         * Find end of this path.
     979         */
     980        while (*pszPath == ' ') pszPath++; //skip leading spaces.
     981        if (*pszPath == '"')
     982        {
     983            chEnd = '"';
     984            pszPath++;
     985        }
     986        else
     987            chEnd = ';';
     988        pszNext = pszPath;
     989        while ((ch = *pszNext) != chEnd && ch != '\0')
     990            pszNext++;
     991
     992        cchPath = pszNext - pszPath;
     993        if (chEnd == '"')
     994        {
     995            /* Skip anything between the " and the ; or string end. */
     996            while ((ch = *pszNext) != ';' && ch != '\0')
     997                pszNext++;
     998        }
     999        else
     1000        {
     1001            /* Trim the string. */
     1002            while (cchPath > 0 && pszPath[cchPath-1] == ' ') //??
     1003                cchPath--;
     1004        }
     1005
     1006        /*
     1007         *  No length? No Path! Or path'\'filename too long? => Next
     1008         */
     1009        if (cchPath > 0 && cchPath + cchFile + 1 < CCHMAXPATH)
     1010        {
     1011            static char     achFilename[CCHMAXPATH];
     1012            /*
     1013             * Build filename
     1014             */
     1015            memcpy(achFilename, pszPath, cchPath);
     1016            if ((ch = achFilename[cchPath - 1]) == '\\' || ch == '/')
     1017                cchPath--;
     1018            else
     1019                achFilename[cchPath] = '\\';
     1020             memcpy(&achFilename[cchPath + 1], pszFile, cchFile); /* cchFile = length + 1; hence we copy the terminator too. */
     1021
     1022            /*
     1023             * Try open the file.
     1024             */
     1025            rc = myldrOpen(phFile, achFilename, pfl);
     1026            switch (rc)
     1027            {
     1028                case ERROR_FILE_NOT_FOUND:          case ERROR_PATH_NOT_FOUND:          case ERROR_ACCESS_DENIED:           case ERROR_INVALID_ACCESS:
     1029                case ERROR_INVALID_DRIVE:           case ERROR_NOT_DOS_DISK:            case ERROR_REM_NOT_LIST:            case ERROR_BAD_NETPATH:
     1030                case ERROR_NETWORK_BUSY:            case ERROR_DEV_NOT_EXIST:           case ERROR_TOO_MANY_CMDS:           case ERROR_ADAP_HDW_ERR:
     1031                case ERROR_UNEXP_NET_ERR:           case ERROR_BAD_REM_ADAP:            case ERROR_NETNAME_DELETED:         case ERROR_BAD_DEV_TYPE:
     1032                case ERROR_NETWORK_ACCESS_DENIED:   case ERROR_BAD_NET_NAME:            case ERROR_TOO_MANY_SESS:           case ERROR_REQ_NOT_ACCEP:
     1033                case ERROR_INVALID_PASSWORD:        case ERROR_OPEN_FAILED:             case ERROR_INVALID_NAME:            case ERROR_FILENAME_EXCED_RANGE:
     1034                case ERROR_VC_DISCONNECTED:
     1035                    break;
     1036
     1037                case NO_ERROR:
     1038                    strcpy(pszFilename, achFilename);
     1039                default:
     1040                    tcbSetTCBFailErr(tcbGetCur(), TCBFailErr_save);
     1041                    return rc;
     1042            }
     1043        }
     1044        #ifdef DEBUG
     1045        else if (cchPath > 0)   kprintf(("OpenPATH: Path component is too long\n"));
     1046        #endif
     1047
     1048        /*
     1049         * Next
     1050         */
     1051        if (*pszNext == '\0')
     1052            break;
     1053        pszPath = pszNext + 1;
     1054    }
     1055
     1056
     1057    /*
     1058     * File is not found.
     1059     */
     1060    *phFile = 0;
     1061    tcbSetTCBFailErr(tcbGetCur(), TCBFailErr_save);
     1062    return ERROR_FILE_NOT_FOUND;
     1063}
  • trunk/src/win32k/ldr/myldrOpenPath.cpp

    r3829 r4164  
    1 /* $Id: myldrOpenPath.cpp,v 1.1 2000-07-16 22:21:16 bird Exp $
     1/* $Id: myldrOpenPath.cpp,v 1.2 2000-09-02 21:08:10 bird Exp $
    22 *
    33 * myldrOpenPath - ldrOpenPath used to open executables we'll override
     
    1616#define INCL_NOPMAPI
    1717#define INCL_OS2KRNL_TCB
     18#define INCL_OS2KRNL_PTDA
    1819
    1920/*******************************************************************************
     
    2526#include <stdlib.h>
    2627
     28#include "devSegDf.h"                   /* Win32k segment definitions. */
    2729#include "log.h"
    2830#include "dev32.h"
     
    134136        else
    135137        {
    136             struct InfoSegLDT *pInfoSeg;
    137             pInfoSeg = (struct InfoSegLDT *)D32Hlp_GetDOSVar(DHGETDOSV_SYSINFOSEG, 0);
    138             if (pInfoSeg == NULL)
     138            PPTDA   pPTDA = ptdaGetCur();
     139            if (pPTDA)
    139140            {
    140                 pExe = getModuleByhMTE(pInfoSeg->LIS_DI); /* LIS_DI is the same as hmod in LINFOSEG from bsedos16.h.  */
     141                pExe = getModuleByhMTE(ptdaGet_ptda_module(pPTDA));
    141142                #ifdef DEBUG            /* While testing! */
    142                 kprintf(("myldrOpenPath: getModuleByhMTE returned 0x%x08 for hmod=0x%04\n",
    143                          pExe, pInfoSeg->LIS_DI));
     143                kprintf(("myldrOpenPath: getModuleByhMTE returned 0x%08x for hmod=0x%04x\n",
     144                         pExe, ptdaGet_ptda_module(pPTDA)));
    144145                #endif
    145146            }
    146             #ifdef DEBUG                /* While testing! */
    147             else
    148                 dprintf(("myldrOpenPath: D32Hlp_GetDOSVar(DHGETDOSV_SYSINFOSEG) failed.\n"));
    149             #endif
    150147        }
    151148
  • trunk/src/win32k/ldr/myldrRead.cpp

    r2501 r4164  
    1 /* $Id: myldrRead.cpp,v 1.6 2000-01-22 18:21:02 bird Exp $
     1/* $Id: myldrRead.cpp,v 1.7 2000-09-02 21:08:10 bird Exp $
    22 *
    33 * myldrRead - ldrRead.
    44 *
    5  * Copyright (c) 1998-1999 knut st. osmundsen
     5 * Copyright (c) 1998-2000 knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    66 *
    77 * Project Odin Software License can be found in LICENSE.TXT
     
    2323#include <stdlib.h>
    2424
     25#include "devSegDf.h"                   /* Win32k segment definitions. */
    2526#include "log.h"
     27#include "avl.h"
    2628#include "dev32.h"
    2729#include <peexe.h>
    2830#include <exe386.h>
    2931#include "OS2Krnl.h"
     32#include "ldrCalls.h"
     33#include "ldr.h"
    3034#include "ModuleBase.h"
    3135#include "pe2lx.h"
    32 #include "avl.h"
    33 #include "ldrCalls.h"
    34 #include "ldr.h"
    3536
    3637
     38/**
     39 * Overloads ldrRead.
     40 * @returns   OS/2 return code.
     41 * @param     hFile     Filehandle to read from.
     42 * @param     pvBuffer  Buffer to read into.
     43 * @param     fpBuffer  This is not flags as I first though, but probably a far 16-bit pointer
     44 *                      to the buffer.
     45 * @param     cbToRead  Count of bytes to read.
     46 * @param     pMTE
     47 * @sketch    IF it's our module THEN
     48 *                Get module pointer. (complain if this failes and backout to ldrRead.)
     49 *                Currently - verify that it's a Pe2Lx module. (complain and fail if not.)
     50 *                Invoke the read method of the module do the requested read operation.
     51 *                Save pMTE if present and not save allready.
     52 *            ENDIF
     53 *            - backout or not our module -
     54 *            forward request to the original ldrRead.
     55 * @status    Completely implemented.
     56 * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     57 */
    3758ULONG LDRCALL myldrRead(
    38                        SFN hFile,
    39                        ULONG ulOffset,
    40                        PVOID pBuffer,
    41                        ULONG ulFlags ,
    42                        ULONG ulBytesToRead,
    43                        PMTE pMTE
    44                        )
     59    SFN    hFile,
     60    ULONG  ulOffset,
     61    PVOID   pvBuffer,
     62    ULONG   fpBuffer,
     63    ULONG   cbToRead,
     64    PMTE    pMTE
     65    )
    4566{
    4667    ULONG   rc;
     
    5071    {
    5172        PMODULE pMod;
    52         kprintf(("ldrRead+: hF=%+04x off=%+08x pB=%+08x fl=%+08x cb=%+04x pMTE=%+08x\n",hFile,ulOffset,pBuffer,ulFlags,ulBytesToRead,pMTE));
     73        kprintf(("myldrRead: hF=%+04x off=%+08x pB=%+08x fp=%+08x cb=%+04x pMTE=%+08x\n",
     74                 hFile, ulOffset, pvBuffer, fpBuffer, cbToRead, pMTE));
    5375
    5476        pMod = getModuleBySFN(hFile);
     
    5981                pMod->pMTE = pMTE;
    6082
    61             /* debug */
    62             if (ulFlags != 0)
    63                 kprintf(("ldrRead: Warning ulFlags = 0x%x (!= 0)\n", ulFlags));
    64 
    6583            if ((pMod->fFlags & MOD_TYPE_MASK) == MOD_TYPE_PE2LX)
    66                 rc = pMod->Data.pModule->read(ulOffset, pBuffer, ulBytesToRead, ulFlags, pMTE);
     84                rc = pMod->Data.pModule->read(ulOffset, pvBuffer, fpBuffer, cbToRead, pMTE);
    6785            else
    6886            {
    69                 kprintf(("ldrRead: Invalid module type, %#x\n", pMod->fFlags & MOD_TYPE_MASK));
     87                kprintf(("myldrRead: Invalid module type, %#x\n", pMod->fFlags & MOD_TYPE_MASK));
    7088                rc = ERROR_READ_FAULT;
    7189            }
    72             return rc;
    7390        }
    7491        else
    75             kprintf(("ldrRead:  DON'T PANIC! - but I can't get Node ptr! - This is really an IPE!\n"));
     92        {
     93            kprintf(("myldrRead:  DON'T PANIC! - but I can't get Node ptr! - This is really an IPE!\n"));
     94            rc = ERROR_READ_FAULT;
     95        }
    7696    }
    77 
    78     rc = ldrRead(hFile, ulOffset, pBuffer, ulFlags, ulBytesToRead, pMTE);
    79 
     97    else
     98    {
     99        rc = ldrRead(hFile, ulOffset, pvBuffer, fpBuffer, cbToRead, pMTE);
     100    }
    80101    #if 0
    81     kprintf(("ldrRead:  hF=%+04x off=%+08x pB=%+08x fl=%+08x cb=%+04x pMTE=%+08x rc=%d\n",
    82              hFile,ulOffset,pBuffer,ulFlags,ulBytesToRead,pMTE,rc));
     102    kprintf(("myldrRead:  hF=%+04x off=%+08x pB=%+08x fp=%+08x cb=%+04x pMTE=%+08x rc=%d\n",
     103             hFile, ulOffset, pvBuffer, fpBuffer, cbToRead, pMTE, rc));
    83104    #endif
    84105
  • trunk/src/win32k/ldr/mytkExecPgm.asm

    r2872 r4164  
    1 ; $Id: mytkExecPgm.asm,v 1.10 2000-02-23 16:53:04 bird Exp $
     1; $Id: mytkExecPgm.asm,v 1.11 2000-09-02 21:08:10 bird Exp $
    22;
    33; mytkExecPgm - tkExecPgm overload
     
    1010
    1111;
     12;   Defined Constants And Macros
     13;
     14CCHFILENAME     EQU 261                 ; The size of the filename buffer
     15CCHARGUMENTS    EQU 1536                ; The size of the argument buffer
     16CCHMAXPATH      EQU CCHFILENAME - 1     ; Max path length
     17
     18;
    1219;   Include files
    1320;
    1421    include devsegdf.inc
    1522
    16 ;
    17 ;   Imported Functions
     23
     24;
     25;   Imported Functions and variables.
    1826;
    1927    extrn  _g_tkExecPgm:PROC
    20     extrn  AcquireBuffer:PROC
    21     extrn  ReleaseBuffer:PROC
    22     extrn  QueryBufferSegmentOffset:PROC
    2328
    2429    ; Scans strings until empy-string is reached.
     
    4550    extrn  _f_FuBuff:PROC
    4651
     52
     53    ; 32-bit memcpy. (see OS2KTK.h)
     54    extrn _TKFuBuff@16:PROC
     55
     56    ;
     57    ; LDR semaphore
     58    ;
     59    extrn pLdrSem:DWORD
     60    extrn _LDRClearSem@0:PROC
     61    extrn _KSEMRequestMutex@8:PROC
     62    extrn _KSEMQueryMutex@8:PROC
     63
     64    ;
     65    ; Loader State
     66    ;
     67    extrn ulLDRState:DWORD
     68
     69    ;
     70    ; Pointer to current executable module.
     71    ;
     72    extrn pExeModule:DWORD
     73
     74    ;
     75    ; DevHlp32
     76    ;
     77    extrn D32Hlp_VirtToLin:PROC
     78
     79    ;
     80    ; TKSSBase (32-bit)
     81    ;
     82    extrn pulTKSSBase32:DWORD
     83
    4784;
    4885;   Exported symbols
    4986;
    5087    public mytkExecPgm
    51 
     88    public tkExecPgmCopyEnv
     89
     90    public fTkExecPgm
     91    public achTkExecPgmFilename
     92    public achTkExecPgmArguments
     93
     94
     95
     96;
     97; Global data
     98;
     99
     100; Filename and arguments buffers + environment pointer
     101; from the tkExecPgm call.
     102;
     103; This data is only valid at isLdrStateExecPgm time
     104; (and you'll have to be behind the loader semaphore of course!)
     105DATA16 SEGMENT
     106fTkExecPgm              db 0            ; 0 - achTkExecPgmFilename and achTkExecPgmArguments is INVALID
     107                                        ; 1 - achTkExecPgmFilename and achTkExecPgmArguments is VALID.
     108achTkExecPgmFilename    db CCHFILENAME dup (0)  ; The filename  passed in to tkExecPgm if (fTkExec is TRUE)
     109achTkExecPgmArguments   db CCHARGUMENTS dup (0) ; The arguments passed in to tkExecPgm if (fTkExec is TRUE)
     110fpachTkExecPgmEnv       dd 0            ; Far pointer to environment passed in to tkExecPgm.
     111                                        ; Valid at isLdrStateExecPgm time.
     112                                        ; NOTE! User data, don't touch it directly!
     113DATA16 ENDS
    52114
    53115
    54116CODE32 SEGMENT
    55 
    56117;;
    57 ;
     118; New implementation.
    58119; @returns   same as tkExecPgm: eax, edx and carry flag
    59120; @param     ax     Exec flag
     
    65126;            may modify later if this is a UNIX shellscript or
    66127;            a PE-file started by pe.exe.
    67 ; @status
     128; @status    completely implemented.
    68129; @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
    69 ; @remark
    70 ;
    71 ;   The buffer we are using is a C struct as follows.
    72 ;   struct Buffer
    73 ;   {
    74 ;       char szFilename[261];  /* offset 0   */
    75 ;       char achArg[1536-261]; /* offset 261 */
    76 ;   };
     130;
    77131;
    78132mytkExecPgm PROC FAR
    79 pBuffer     = dword ptr -04h
    80 SegBuffer   = -08h
    81 OffBuffer   = -0Ch
    82 cchFilename = dword ptr -10h
    83 cchArgs     = dword ptr -14h
    84 ;usExecFlag  = -18h
    85 ;SegFilename = -1ch
    86 ;OffFilename = -1eh
    87 ;SegEnv      = -20h
    88 ;OffEnv      = -22h
    89 ;SegArg      = -24h
    90 ;OffArg      = -26h
    91 
    92     ASSUME CS:CODE32, DS:NOTHING, SS:NOTHING
    93 ;    int     3
    94     push    ebp
    95     mov     ebp, esp
    96     lea     esp, [ebp + cchArgs]
    97 
    98     push    eax
    99     push    ecx
    100     push    ds
    101     push    es
    102     push    edi
    103 
    104     ; parameter validations
    105     mov     ax, ds                      ; pointer to filename
    106     cmp     ax, 4
    107     jb      mytkExecPgm_CalltkExecPgm_X1
    108 
    109     ;
    110     ; filename length
    111     ;
    112     mov     ax, ds
    113     mov     es, ax
    114     pushad
    115     push    es
    116     push    ds
    117     mov     bx, ds
    118     mov     di, dx                      ; es:di is now filename address (ds:dx).
    119     push    cs                          ; Problem calling far into the calltab segement.
    120     call    near ptr FLAT:_f_FuStrLen
    121     movzx   ecx, cx
    122     mov     [ebp+cchFilename], ecx
    123     pop     ds
    124     pop     es
    125     popad
    126     jc      mytkExecPgm_CalltkExecPgm_X1; If the FuStrLen call failed we bail out!
    127 
    128     ;
    129     ; if filename length is more that CCHMAXPATH then we don't do anything!.
    130     ;
    131     cmp     [ebp+cchFilename], 260
    132     jae     mytkExecPgm_CalltkExecPgm_X1; length >= 260
    133 
    134     ;
    135     ; args length
    136     ; Note: the arguments are a series of ASCIIZs ended by an empty string (ie. '\0').
    137     ;
    138     pop     edi
    139     push    edi
    140     xor     ecx, ecx
    141     cmp     di, 4                       ; The argument might me a invalid pointer...
    142     jb      mytkExecPgm_CalltkExecPgm_1
    143 
    144     pushad
    145     push    es
    146     push    ds
    147     mov     bx, di                      ;
    148     mov     di, si                      ; bx:di -> arguments
    149     push    cs                          ; Problem calling far into the calltab segement.
    150     call    near ptr FLAT:_f_FuStrLenZ
    151     movzx   ecx, cx
    152     mov     [ebp+cchArgs], ecx
    153     pop     ds
    154     pop     es
    155     popad
    156     jc      mytkExecPgm_CalltkExecPgm_X1
    157 
    158 mytkExecPgm_CalltkExecPgm_1:
    159     mov     ecx, [ebp+cchArgs]
    160     add     ecx, [ebp+cchFilename]      ; filename
    161     add     ecx, 3 + 260                ;  260 = new argument from a scrip file or something.
    162                                         ;    3 = two '\0's and a space after added argument.
    163     cmp     ecx, 1536                   ; 1536 = Buffersize.  FIXME! Define this!!!
    164     jae     mytkExecPgm_CalltkExecPgm_X1; jmp if argument + file + new file > buffer size
    165 
    166     ;
    167     ; Aquire a buffer
    168     ;
    169     call    AcquireBuffer
    170     or      eax, eax
    171     jz      mytkExecPgm_CalltkExecPgm_X1; Failed to get buffer.
    172     mov     [ebp+pBuffer], eax
    173 
    174     ;
    175     ; Get Segment and offset for the buffer
    176     ;
    177     call    QueryBufferSegmentOffset
    178     mov     cx, es
    179     mov     [ebp+OffBuffer], ax
    180     mov     [ebp+SegBuffer], es
    181     test    eax, 000570000h
    182     jnz     mytkExecPgm_CalltkExecPgm_X2
    183 
    184     ;
    185     ; Copy filename to pBuffer.
    186     ;
    187     pushad
    188     push    es
    189     push    ds
    190     mov     di, ax                      ; es:di  pBuffer
    191     mov     si, dx
    192     mov     bx, ds                      ; bx:si  Filename pointer (input ds:dx)
    193     mov     ecx, [ebp+cchFilename]
    194     push    cs                          ; Problem calling far into the calltab segement.
    195     call    near ptr FLAT:_f_FuBuff
    196     pop     ds
    197     pop     es
    198     popad
    199     jc      mytkExecPgm_CalltkExecPgm_X2
    200 
    201     ;
    202     ; Copy Args to pBuffer + 261
    203     ;
    204     ; stack: edi, es, ds, ecx, eax
    205     pop     edi
    206     push    edi
    207     add     eax, 261                    ; we'll use eax in the branch
    208     cmp     di, 4
    209     jb      mytkExecPgm_CalltkExecPgm_2
    210     pushad
    211     push    es
    212     push    ds
    213     mov     ecx, [ebp+cchArgs]
    214     mov     bx, di                      ; ds:si -> arguments
    215     mov     di, ax                      ; es:di -> buffer + 261
    216     push    cs                          ; Problem calling far into the calltab segement.
    217     call    near ptr FLAT:_f_FuBuff
    218     pop     ds
    219     pop     es
    220     popad
    221     jc      mytkExecPgm_CalltkExecPgm_X2
    222     jmp     mytkExecPgm_CalltkExecPgm_3
    223 
    224 mytkExecPgm_CalltkExecPgm_2:
    225     mov     word ptr es:[eax], 0        ; Terminate the empty string!
    226 
    227     ;
    228     ; Restore variables pushed on the stack
    229     ;
    230     ; stack: edi, es, ds, ecx, eax
    231 mytkExecPgm_CalltkExecPgm_3:
    232     pop     edi
    233     pop     es
    234     pop     ds
    235     pop     ecx
    236     pop     eax
    237 
    238     ;
    239     ; Set new input parameters (call _g_tkExecPgm)
    240     ;
    241     ; ds:dx is to become SegBuffer:OffBuffer
    242     ; di:si is to become SegBuffer:OffBuffer+261
    243     ;
    244     ; The some of the old values are stored on the stack (for the time being)
    245     push    ds
    246     push    edi
    247     push    esi
    248 
    249     mov     di, [ebp+SegBuffer]
    250     mov     ds, di
    251     mov     si, [ebp+OffBuffer]
    252     mov     dx, si                      ; ds:dx  SegBuffer:OffBuffer
    253     add     si, 261                     ; di:si  SegBuffer:OffBuffer+261
    254 
    255     ;
    256     ; Call _g_tkExecPgm
    257     ;
    258     push    cs                          ; Problem calling far into the calltab segement.
    259     call    near ptr FLAT:_g_tkExecPgm
    260     pushfd
    261 
    262     ;
    263     ; Release buffer
    264     ;
    265     push    eax
    266     mov     eax, [ebp + pBuffer]
    267     call    ReleaseBuffer
    268     mov     [ebp + pBuffer], 0
    269     pop     eax
    270 
    271     ;
    272     ; Return
    273     ;
    274     popfd
    275     pop     esi
    276     pop     edi
    277     pop     ds
    278     leave
    279     retf
    280 
    281 mytkExecPgm_CalltkExecPgm_X2:
    282     ;
    283     ; Release buffer
    284     ;
    285     mov     eax, [ebp + pBuffer]
    286     call    ReleaseBuffer
    287     mov     [ebp + pBuffer], 0
    288 
    289 mytkExecPgm_CalltkExecPgm_X1:
    290     pop     edi
    291     pop     es
    292     pop     ds
    293     pop     ecx
    294     pop     eax
    295 
    296 mytkExecPgm_CalltkExecPgm:
    297     push    cs
    298     call    near ptr FLAT:_g_tkExecPgm
    299     leave
    300     retf
    301 mytkExecPgm ENDP
    302 
    303 
    304 
    305 CODE32 ENDS
    306 
    307 if 0 ; alternate implementation.
    308 mytkExecPgm PROC FAR
    309 pBuffer     = dword ptr -04h
    310 SegBuffer   = -08h
    311 OffBuffer   = -0Ch
    312 cchFilename = -10h
    313 cchArgs     = -14h
    314 usExecFlag  = -18h
    315 SegFilename = -1ch
    316 OffFilename = -1eh
    317 SegEnv      = -20h
    318 OffEnv      = -22h
    319 SegArg      = -24h
    320 OffArg      = -26h
     133cchFilename = -4h
     134cchArgs     = -08h
     135usExecFlag  = -0ch
     136SegFilename = -10h
     137OffFilename = -12h
     138SegEnv      = -14h
     139OffEnv      = -16h
     140SegArg      = -18h
     141OffArg      = -1ah
    321142
    322143    ASSUME CS:CODE32, DS:NOTHING, SS:NOTHING
     
    325146    lea     esp, [ebp + OffArg]
    326147
    327     ; save input parameters
     148    ;
     149    ; Save input parameters
     150    ;
    328151    mov     [ebp + usExecFlag], ax
    329152    mov     ax, es
     
    332155    mov     [ebp + SegArg], di
    333156    mov     [ebp + OffArg], si
    334     mov     ax, ds
    335     mov     [ebp + SegFilename], ax
     157    mov     bx, ds
     158    mov     [ebp + SegFilename], bx
    336159    mov     [ebp + OffFilename], dx
    337160
    338     ; parameter validations
    339     cmp     ax, 4                       ; pointer to filename
    340     jb      mytkExecPgm_CalltkExecPgm_X1
    341 
    342     ;
    343     ; filename length
    344     ;
    345     mov     bx, ax
     161    ;
     162    ; Parameter validations - if any of these fail we'll just pass on to
     163    ; the real tkExecPgm without setting up any buffers stuff.
     164    ; 1) validate the file pointer.
     165    ; 2) validate the file name length < 260
     166    ; 3) validate that the arguments aren't larger than the buffer.
     167    ;
     168
     169    ; Validate filename pointer
     170    ;
     171    cmp     bx, 4                       ; pointer to filename
     172    jb      tkepgm_backout
     173
     174    ; Validate filename length
     175    ;
    346176    mov     di, dx                      ; bx:di is now filename address
    347177    push    cs                          ; Problem calling far into the calltab segement.
    348178    call    near ptr FLAT:_f_FuStrLen
    349     jc      mytkExecPgm_CalltkExecPgm_X1; If the FuStrLen call failed we bail out!
    350 
    351     ;
     179    jc      tkepgm_backout              ; If the FuStrLen call failed we bail out!
     180
    352181    ; if filename length is more that CCHMAXPATH then we don't do anything!.
    353     ;
    354     cmp     cx, 260
    355     jae     mytkExecPgm_CalltkExecPgm_X1; length >= 260
    356     mov     [ebp+cchFilename], cx
     182    cmp     cx, CCHMAXPATH
     183    jae     tkepgm_backout              ; length >= CCHMAXPATH
     184    mov     [ebp + cchFilename], cx
    357185
    358186    ;
     
    360188    ; Note: the arguments are a series of ASCIIZs ended by an empty string (ie. '\0').
    361189    ;
    362     mov     bx, [ebp+SegArg]
     190    xor     cx, cx                      ; Set length to zero.
     191    mov     bx, [ebp + SegArg]
    363192    cmp     bx, 4                       ; The argument might me an NULL pointer
    364     xor     cx, cx
    365     jb      mytkExecPgm_CalltkExecPgm_1
    366 
    367     mov     di, [ebp+OffArg]            ; bx:di -> arguments
     193    jb      tkepgm1
     194
     195    mov     di, [ebp + OffArg]          ; bx:di -> arguments
    368196    push    cs                          ; Problem calling far into the calltab segement.
    369197    call    near ptr FLAT:_f_FuStrLenZ
    370     mov     [ebp+cchArgs], cx
    371     jc      mytkExecPgm_CalltkExecPgm_X1
    372 
    373 mytkExecPgm_CalltkExecPgm_1:
    374     add     cx, [ebp+cchFilename]       ; filename length
    375     add     cx, 3 + 260                 ;  260 = new argument from a scrip file or something.
     198    jc      tkepgm_backout
     199
     200tkepgm1:
     201    mov     [ebp + cchArgs], cx
     202    add     cx, [ebp + cchFilename]     ; filename length
     203    add     cx, 3 + 260                 ;  260 = additional arguments from a script file or something.
    376204                                        ;    3 = two '\0's and a space after added argument.
    377     cmp     ecx, 1536                   ; 1536 = Buffersize.  FIXME! Define this!!!
    378     jae     mytkExecPgm_CalltkExecPgm_X1; jmp if argument + file + new file > buffer size
    379 
    380     ;
    381     ; Aquire a buffer
    382     ;
    383     call    AcquireBuffer
    384     mov     [ebp+pBuffer], eax
    385     or      eax, eax
    386     jz      mytkExecPgm_CalltkExecPgm_X1; Failed to get buffer.
    387 
    388     ;
    389     ; Get Segment and offset for the buffer
    390     ;
    391     call    QueryBufferSegmentOffset
    392     mov     cx, es
    393     mov     [ebp+OffBuffer], ax
    394     mov     [ebp+SegBuffer], es
    395     test    eax, 000570000h
    396     jnz     mytkExecPgm_CalltkExecPgm_X2
    397 
    398     ;
    399     ; Copy filename to pBuffer.
    400     ;
    401     mov     di, ax                      ; es:di  pBuffer
    402     mov     si, dx
    403     mov     bx, ds                      ; bx:si  Filename pointer (input ds:dx)
    404     mov     cx, [ebp+cchFilename]       ; cx = length of area to copy
     205    cmp     cx, CCHARGUMENTS            ; argument Buffersize.
     206    jae     tkepgm_backout              ; jmp if argument + file + additional arguments >= buffer size
     207
     208
     209    ;
     210    ; Aquire the OS/2 loader semaphore
     211    ;   Since parameters looks good, we're ready for getting the loader semaphore.
     212    ;   We use the loader semaphore to serialize access to the win32k.sys loader
     213    ;   subsystem.
     214    ;   Before we can get the loader semaphore, we'll need to set ds and es to
     215    ;   flat R0 context.
     216    ;   The loader semaphore is later requested by the original tkExecPgm so
     217    ;   this shouldn't break anything.
     218    ;
     219    mov     ax, seg FLAT:DATA32
     220    mov     ds, ax
     221    mov     es, ax
     222    ASSUME  DS:FLAT, ES:FLAT
     223
     224    mov     eax, pLdrSem                ; Get pointer to the loader semaphore.
     225    or      eax, eax                    ; Check if null. (paranoia)
     226    jz      tkepgm_backout              ; Fail if null.
     227
     228    push    0ffffffffh                  ; Wait indefinitely.
     229    push    eax                         ; Push LdrSem address (which is the handle).
     230    call    near ptr FLAT:_KSEMRequestMutex@8
     231    or      eax, eax                    ; Check if failed.
     232    jnz     tkepgm_backout              ; Backout on failure.
     233
     234
     235    ;
     236    ; From here on we won't backout to the tkepgm_backout lable but
     237    ; the tkepgm_backout2 lable. (This will restore the parameters
     238    ; and jump in at the call to tkExecPgm behind the Loader Sem.)
     239    ;
     240
     241
     242    ;
     243    ; Set global data:
     244    ;   Zeros pointer to exemodule to NULL (a bit paranoia).
     245    ;   Mark global data valid.
     246    ;   Store Environment pointer.
     247    ;   Set loader state.
     248    ;
     249    mov     pExeModule, 0               ; Sets the exemodule pointer to NULL.
     250    mov     fTkExecPgm, 1               ; Optimistic, mark the global data valid.
     251    mov     eax, [ebp + OffEnv]         ; Environment FAR pointer.
     252    mov     fpachTkExecPgmEnv, eax      ; Store the Environment pointer. This will
     253                                        ; later permit us to get the passed in
     254                                        ; environment in for ex. ldrOpenPath.
     255    mov     ulLDRState, 1               ; Set the loader state to LDRSTATE_TKEXECPGM!
     256    ASSUME  DS:NOTHING, ES:NOTHING
     257
     258
     259    ;
     260    ; Copy filename to achBuffer.
     261    ;
     262    mov     di, seg achTkExecPgmFilename
     263    mov     es, di
     264    mov     edi, offset achTkExecPgmFilename
     265                                        ; es:(e)di -> &achTkExecPgmFilename[0]
     266    mov     si, [ebp + OffFilename]
     267    mov     bx, [ebp + SegFilename]     ; bx:si  Filename pointer (input ds:dx)
     268    ASSUME DS:NOTHING
     269    mov     cx, [ebp + cchFilename]     ; cx = length of area to copy
    405270    push    cs                          ; Problem calling far into the calltab segement.
    406271    call    near ptr FLAT:_f_FuBuff
    407     jc      mytkExecPgm_CalltkExecPgm_X2
    408 
    409     ;
    410     ; Copy Args to pBuffer + 261
    411     ;
    412     mov     si, [ebp+SegArg]
    413     cmp     si, 4
    414     jb      mytkExecPgm_CalltkExecPgm_2
    415     mov     ds, si
    416     mov     si, [ebp+OffArg]            ; ds:si -> arguments
    417     mov     di, [ebp+SegBuffer]
     272    jc      tkepgm_backout2             ; In case of error back (quite unlikely).
     273
     274
     275    ;
     276    ; Copy Args to achTkExecPgmArguments
     277    ;
     278    mov     di, seg achTkExecPgmArguments
    418279    mov     es, di
    419     mov     di, [ebp+OffBuffer]
    420     add     di, 261                     ; es:di -> buffer + 261
    421     mov     cx, [ebp+cchArgs]           ; cx = length of area to copy
     280    mov     edi, offset achTkExecPgmArguments
     281                                        ; es:(e)di -> &achTkExecPgmArguments[0]
     282    mov     word ptr es:[edi], 0        ; Terminate the argument string in case
     283                                        ; there aren't any arguments.('\0\0')
     284                                        ; (We're just about to find that out.)
     285    mov     bx, [ebp + SegArg]
     286    cmp     bx, 4                       ; Is the argument pointer a null-pointer?
     287    jb      tkepgm_setup_parms          ; Skip copy if null pointer.
     288                                        ; Argument string is '\0\0'.
     289    mov     si, [ebp + OffArg]          ; bx:si -> arguments
     290    mov     cx, [ebp + cchArgs]         ; cx = length of area to copy
    422291    push    cs                          ; Problem calling far into the calltab segement.
    423292    call    near ptr FLAT:_f_FuBuff
    424     jc      mytkExecPgm_CalltkExecPgm_X2
    425     jmp     mytkExecPgm_CalltkExecPgm_3
    426 
    427 mytkExecPgm_CalltkExecPgm_2:
    428     mov     word ptr es:[eax], 0        ; Terminate the empty string!
    429 
    430     ;
    431     ; Set new input parameters (call _g_tkExecPgm)
    432     ;
    433     ; ds:dx is to become SegBuffer:OffBuffer
    434     ; di:si is to become SegBuffer:OffBuffer+261
    435     ;
    436 mytkExecPgm_CalltkExecPgm_3:
    437     mov     di, [ebp+SegBuffer]
    438     mov     ds, di
    439     mov     si, [ebp+OffBuffer]
    440     mov     dx, si                      ; ds:dx  SegBuffer:OffBuffer
    441     add     si, 261                     ; di:si  SegBuffer:OffBuffer+261
    442     mov     bx, [ebp+SegEnv]
     293    jc      tkepgm_backout2             ; In case of error back (quite unlikely).
     294
     295
     296    ;
     297    ; Setup new input parameters (call _g_tkExecPgm)
     298    ;
     299    ; ds:dx is to become &achTkExecPgmFilename[0]
     300    ; di:si is to become &achTkExecPgmArguments[0]
     301    ;
     302tkepgm_setup_parms:
     303    mov     ax, [ebp + usExecFlag]
     304    mov     di, seg achTkExecPgmArguments
     305    mov     esi, offset achTkExecPgmArguments ; di:si  &achTkExecPgmArguments[0]
     306    mov     ds, di                            ; Assumes same segment (which of course is true).
     307    mov     edx, offset achTkExecPgmFilename  ; ds:dx  &achTkExecPgmFilename[0]
     308    mov     bx, [ebp + SegEnv]
    443309    mov     es, bx
    444     mov     bx, [ebp+SegEnv]
     310    mov     bx, [ebp + OffEnv]                ; es:bx  Environment
     311
    445312
    446313    ;
    447314    ; Call _g_tkExecPgm
    448315    ;
     316tkepgm_callbehind:
    449317    push    cs                          ; Problem calling far into the calltab segement.
    450318    call    near ptr FLAT:_g_tkExecPgm
    451     pushfd
    452 
    453     ;
    454     ; Release buffer
    455     ;
    456     push    eax
    457     mov     eax, [ebp + pBuffer]
    458     call    ReleaseBuffer
    459     mov     [ebp + pBuffer], 0
    460     pop     eax
    461 
    462     ;
    463     ; Return
    464     ;
    465     push    [ebp + SegFilename]
     319    pushfd                              ; preserve flags
     320    push    eax                         ; preserve result.
     321    push    ecx                         ; preserve ecx just in case
     322    push    edx                         ; preserve edx just in case
     323    mov     ax, seg FLAT:DATA32
     324    mov     ds, ax
     325    mov     es, ax
     326    ASSUME  ds:FLAT, es:FLAT            ; both ds and es are now FLAT
     327
     328
     329    ;
     330    ; Clear loader semaphore?
     331    ; and clear loader state, current exe module and tkExecPgm global data flag.
     332    ;
     333    push    0                           ; Usage count variable.
     334    mov     eax, pulTKSSBase32          ; Get TKSSBase
     335    mov     eax, [eax]
     336    add     eax, esp                    ; Added TKSSBase to the usage count pointer
     337    push    eax                         ; Push address of usage count pointer.
     338    push    pLdrSem                     ; Push pointer to loader semaphore ( = handle).
     339    call    near ptr FLAT:_KSEMQueryMutex@8
     340    or      eax, eax                    ; Check return code. (1 = our / free; 0 = not our but take)
     341    pop     eax                         ; Pops usage count.
     342    je      tkepgm_callbehindret        ; jmp if not taken by us (rc=FALSE).
     343    or      eax, eax                    ; Check usage count.
     344    jz      tkepgm_callbehindret        ; jmp if 0 (=free).
     345    mov     ulLDRState, 0               ; Clears loaderstate. (LDRSTATE_UNKNOWN)
     346    mov     pExeModule, 0               ; Sets the exemodule pointer to NULL.
     347    mov     fTkExecPgm, 0               ; Marks global data invalid.
     348    call    near ptr FLAT:_LDRClearSem@0
     349
     350    ;
     351    ; Restore ds and es (probably unecessary but...) and Return
     352    ;
     353tkepgm_callbehindret:
     354    push    dword ptr [ebp + SegFilename]
    466355    pop     ds
    467     push    [ebp + SegEnv]
     356    push    dword ptr [ebp + SegEnv]
    468357    pop     es
    469     popfd
     358    pop     edx                         ; restore edx
     359    pop     ecx                         ; restore ecx
     360    pop     eax                         ; restore result.
     361    popfd                               ; restore flags
    470362    leave
    471363    retf
    472364
    473 mytkExecPgm_CalltkExecPgm_X2:
    474     ;
    475     ; Release buffer
    476     ;
    477     mov     eax, [ebp + pBuffer]
    478     call    ReleaseBuffer
    479     mov     [ebp + pBuffer], 0
    480 
    481 mytkExecPgm_CalltkExecPgm_X1:
    482     pop     ds
     365
     366;
     367; This is a backout were tkExecPgm probably will backout and we're
     368; allready behind the loader semaphore.
     369;
     370tkepgm_backout2:
     371    ;
     372    ; Set Flat context and invalidate buffer.
     373    ;
     374    mov     ax, seg FLAT:DATA32
     375    mov     ds, ax
     376    ASSUME ds:FLAT
     377    mov     fTkExecPgm, 0               ; Marks global data invalid.
     378
     379    ;
     380    ; Restore parameters. and call the original tkExecPgm
     381    ;
     382    mov     ax, [ebp + usExecFlag]
     383    mov     dx, [ebp + SegFilename]
     384    mov     ds, dx
     385    mov     dx, [ebp + OffFilename]
     386    mov     bx, [ebp + SegEnv]
     387    mov     es, bx
     388    mov     bx, [ebp + OffEnv]
     389    mov     di, [ebp + SegArg]
     390    mov     si, [ebp + OffArg]
     391    jmp     tkepgm_callbehind
     392
     393
     394;
     395; This is a backout were tkExecPgm too is exspected to back out.
     396;
     397tkepgm_backout:
     398    ;
     399    ; Restore parameters. and call the original tkExecPgm
     400    ;
     401    mov     ax, [ebp + usExecFlag]
     402    mov     dx, [ebp + SegFilename]
     403    mov     ds, dx
     404    mov     dx, [ebp + OffFilename]
     405    mov     bx, [ebp + SegEnv]
     406    mov     es, bx
     407    mov     bx, [ebp + OffEnv]
     408    mov     di, [ebp + SegArg]
     409    mov     si, [ebp + OffArg]
    483410
    484411mytkExecPgm_CalltkExecPgm:
    485     push    cs
     412    push    cs                          ; Problem calling far into the calltab segement.
    486413    call    near ptr FLAT:_g_tkExecPgm
    487414    leave
     
    489416mytkExecPgm ENDP
    490417
     418
     419
     420;;
     421; Function which copies the environment data passed into tkExecPgm
     422; to a given buffer.
     423; @cproto    ULONG _Optlink tkExecPgmCopyEnv(char *pachBuffer, unsigned cchBuffer);
     424; @returns   OS/2 return code - NO_ERROR on success.
     425;            0 on error or no data.
     426; @param     pachBuffer     Pointer to buffer which the environment data is
     427;                           to be copied to.
     428;                           (eax)
     429; @param     cchBuffer      Size of the buffer.
     430;                           (edx)
     431; @uses      eax, edx, ecx
     432; @sketch
     433; @status
     434; @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     435; @remark
     436tkExecPgmCopyEnv PROC NEAR
     437cchEnv  = -04h
     438    ASSUME ds:FLAT, es:FLAT, ss:NOTHING
     439    push    ebp
     440    mov     ebp, esp
     441    lea     esp, [ebp + cchEnv]
     442
     443    push    ebx
     444    mov     ebx, eax                    ; ebx now holds the buffer pointer.
     445
     446    ;
     447    ; Call tkExecPgmEnvLength to get length and check that pointer is valid.
     448    ;
     449    push    edx
     450    call    tkExecPgmEnvLength
     451    pop     ecx                         ; ecx now holds the buffer length.
     452
     453    cmp     eax, 0
     454    ja      tkepce_ok1
     455    mov     eax, 232                    ; ERROR_NO_DATA
     456    jmp     tkepce_ret                  ; Fail if no data or any other error.
     457
     458tkepce_ok1:
     459    cmp     eax, ecx                    ; (ecx is the buffer size.)
     460    jbe     tkepce_ok2                  ; Fail if buffer too small.
     461    mov     eax, 111                    ; ERROR_BUFFER_OVERFLOW
     462    jmp     tkepce_ret
     463
     464tkepce_ok2:
     465    mov     [ebp + cchEnv], eax         ; Save environment length.
     466
     467
     468    ;
     469    ; Thunk the environment 16-bit far pointer to 32-bit.
     470    ;
     471    mov     eax, fpachTkExecPgmEnv
     472    call    D32Hlp_VirtToLin
     473    or      eax, eax                    ; check if thunking were successful.
     474    jnz     tkepce_ok3                  ; Jump if success.
     475    mov     eax, edx                    ; A special feature for D32Hlp_VirtToLin is that edx
     476                                        ; have the error code in case on failure.
     477    jmp tkepce_ret
     478
     479tkepce_ok3:
     480    ;
     481    ; Copy the environment data.
     482    ;
     483    push    3                           ; Fatal if error.
     484    push    dword ptr [ebp + cchEnv]    ; Number of bytes to copy
     485    push    eax                         ; Source buffer pointer. (user)
     486    push    ebx                         ; Target buffer pointer.
     487    call    near ptr FLAT:_TKFuBuff@16
     488
     489tkepce_ret:
     490    pop     ebx
     491    leave
     492    ret
     493tkExecPgmCopyEnv ENDP
     494
     495
     496
     497;;
     498; This function gets the length of the tkExecPgm environment data.
     499; @cproto    ULONG _Optlink tkExecPgmEnvLength(void);
     500; @returns   Environment data length in bytes.
     501; @uses      eax, edx, ecx
     502; @sketch
     503; @status
     504; @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     505; @remark
     506tkExecPgmEnvLength PROC NEAR
     507    ASSUME ds:FLAT, es:FLAT, ss:NOTHING
     508    push    ebp
     509    mov     ebp, esp
     510
     511    ;
     512    ; Push register which needs to be presered.
     513    ;
     514    push    es
     515    push    ds
     516    push    esi
     517    push    edi
     518    push    ebx
     519
     520
     521    ;
     522    ; Check that the data is valid.
     523    ;
     524    cmp     ulLDRState, 1               ; LDRSTATE_TKEXECPGM
     525    jnz     tkepel_err_ret
     526
     527
     528    ;
     529    ; Check if the environment pointer is NULL.
     530    ;
     531    mov     ebx, fpachTkExecPgmEnv
     532    ror     ebx, 16
     533    cmp     bx, 4
     534    jb      tkepel_err_ret
     535
     536
     537tkepel1:
     538    ;
     539    ; Get the environment length
     540    ;
     541    mov     edi, ebx
     542    ror     edi, 16                     ; bx:di -> [fpachTkExecPgmEnv]
     543    xor     ecx, ecx
     544    push    cs                          ; Problem calling far into the calltab segement.
     545    call    near ptr FLAT:_f_FuStrLenZ
     546    jc      tkepel_err_ret
     547    movzx   eax, cx
     548    jmp     tkepel_ret
     549
     550
     551; Failure
     552tkepel_err_ret:
     553    xor     eax, eax
     554
     555
     556; Return
     557tkepel_ret:
     558    pop     ebx                         ; restore registers
     559    pop     edi
     560    pop     esi
     561    pop     ds
     562    pop     es
     563    leave
     564    ret
     565tkExecPgmEnvLength ENDP
     566
     567
     568
     569
     570
    491571CODE32 ENDS
    492 endif
    493572
    494573
  • trunk/src/win32k/lib/libDosAllocMemEx.c

    r2914 r4164  
    1 /* $Id: libDosAllocMemEx.c,v 1.3 2000-02-26 19:59:55 bird Exp $
     1/* $Id: libDosAllocMemEx.c,v 1.4 2000-09-02 21:08:11 bird Exp $
    22 *
    33 * DosAllocMemEx - Extened Edition of DosAllocMem.
     
    1717#define INCL_DOSFILEMGR
    1818#define INCL_DOSDEVICES
    19 #define INCL_WIN32K_LIB
    2019
    2120
  • trunk/src/win32k/lib/libTest.c

    r2915 r4164  
    1 /* $Id: libTest.c,v 1.1 2000-02-26 20:19:26 bird Exp $
     1/* $Id: libTest.c,v 1.2 2000-09-02 21:08:11 bird Exp $
    22 *
    33 * Test program for the win32k library.
     
    1212*   Defined Constants And Macros                                               *
    1313*******************************************************************************/
    14 #define INCL_WIN32K_LIB
    1514#define INCL_BASE
    1615
  • trunk/src/win32k/lib/makefile

    r3146 r4164  
    11##############################################################################
    2 # $Id: makefile,v 1.3 2000-03-17 17:38:27 bird Exp $
     2# $Id: makefile,v 1.4 2000-09-02 21:08:12 bird Exp $
    33#
    44# PD-Win32 API
     
    4949OBJS     =  $(WIN32KOBJ)\libInit.$(OBJEXT)         \
    5050            $(WIN32KOBJ)\libTerm.$(OBJEXT)     \
     51            $(WIN32KOBJ)\libWin32kInstalled.$(OBJEXT) \
     52            $(WIN32KOBJ)\libWin32kQueryOptionsStatus.$(OBJEXT) \
     53            $(WIN32KOBJ)\libWin32kSetOptions.$(OBJEXT) \
    5154            $(WIN32KOBJ)\libDosAllocMemEx.$(OBJEXT) \
     55            $(WIN32KOBJ)\libW32kQueryOTEs.$(OBJEXT) \
    5256            $(WIN32KOBJ)\libGetCS.obj
    5357
     
    8690##############################################################################
    8791dep:
    88     $(DEPEND) -obj$(OBJEXT) -o$(WIN32KOBJ) $(CINCLUDES) $(WIN32KBASE)\include\*.h
     92    $(DEPEND) -obj$(OBJEXT) -o$(WIN32KOBJ) $(CINCLUDES) \
     93        $(WIN32KBASE)\include\*.h *.c* *.asm
    8994
    9095!if [$(EXISTS) .depend] == 0
  • trunk/src/win32k/libconv.c

    r1678 r4164  
    1 /* $Id: libconv.c,v 1.2 1999-11-10 01:45:29 bird Exp $
     1/* $Id: libconv.c,v 1.3 2000-09-02 21:07:53 bird Exp $
    22 *
    33 * Very simple OMF/LIB dumper.
     
    2121
    2222int fCodeToCode16 = 0;
     23int fRemoveExtra = 0;
    2324
    2425/*@IntFunc**********************************************************************
     
    2627*******************************************************************************/
    2728int processFile(const char *pszFilename, const char *pszFilenameOut);
    28 void *processRecord(void *pvRecord, void *pvBase, FILE *phNew);
     29void *processRecord(void *pvRecord, void *pvBase, FILE *phNew, unsigned short *ausTrans);
    2930
    3031
     
    3536    int argi = 1;
    3637
     38    if (argc == 4)
     39    {
     40        argi = 2;
     41        fRemoveExtra = 1;
     42    }
    3743    if (argc != 3)
    3844        printf("syntax error - requires two filename, in.lib and out.lib\n");
     
    7884                if (fread(pvFile, cbFile, 1, phFile) == 1)
    7985                {
     86                    unsigned short * ausTrans = calloc(sizeof(unsigned short), cbFile / 16 ); /* Assumes page size of 16 FIXME! */
    8087                    void *pvNew = pvFile;
     88
    8189
    8290                    /*  main loop */
    8391                    while (pvNew < (void*)(cbFile + (int)pvFile))
    84                         pvNew = processRecord(pvNew, pvFile, phNew);
     92                        pvNew = processRecord(pvNew, pvFile, phNew, ausTrans);
    8593                }
    8694                else
     
    103111
    104112
    105 void *processRecord(void *pvRecord, void *pvBase, FILE *phNew)
     113void *processRecord(void *pvRecord, void *pvBase, FILE *phNew, unsigned short *ausTrans)
    106114{
    107115    static char *apszLNames[256];
    108116    static int   cpszLNames = 0;
    109117    static int   iCode16 = 0;
     118    static int   cbPage = 16;       /* fixme todo TODO FIXME ASSUMES: pagesize = 16 */
    110119    void *pvRet = pvRecord;
    111120    int  cbRecord;
     
    116125    {
    117126       case LIBHDR:
    118             fChanged = 1;
    119             fwrite(pvRecord, 1, 3, phNew);
    120127            if (*(unsigned short*)((int)pvRecord+1) < 6)
    121                 fwrite((char*)pvRecord+3, 1, *(unsigned short*)((int)pvRecord+1), phNew);
    122             else
    123             {
    124                 i = 0;
    125                 fwrite(&i, 1, 2, phNew);
    126                 fwrite(&i, 1, 2, phNew);
    127                 fwrite(&i, 1, 2, phNew);
    128                 fwrite((char*)pvRecord+3+6, 1, *(unsigned short*)((int)pvRecord+1) - 6, phNew);
    129             }
    130             cbRecord = *((unsigned short*)((int)pvRecord+1)) + 3;
    131             break;
    132 
    133         case 0x98: /* 16-bit segdef */
    134             cbRecord = *((unsigned short*)((int)pvRecord+1)) + 3;
     128                fprintf(stderr, "error: not supported LIBHDR\n");
     129            cbRecord = *((unsigned short*)((int)pvRecord+1)) + 3;
     130            break;
     131
     132        case THEADR:
     133            /* Add entry to the translation table - used to translate block numbers in the dictionary */
     134            ausTrans[((char*)pvRecord - (char*)pvBase) / cbPage] = (unsigned short)(ftell(phNew) / cbPage);
     135            cbRecord = *((unsigned short*)((int)pvRecord+1)) + 3;
     136            break;
     137
     138        case SEGDEF: /* 16-bit segdef */
     139            cbRecord = *((unsigned short*)((int)pvRecord+1)) + 3;
     140            *((char*)pvRecord + 9) =  0;
    135141            i = *(char*)((int)pvRecord + 6);
    136142            if (cbRecord == 10 && i <= cpszLNames && strcmp(apszLNames[i-1], "CODE") == 0)
    137                 {
     143            {
    138144                *(char*)((int)pvRecord + 6) = iCode16+1;
    139                 }
     145            }
     146            i = *(char*)((int)pvRecord + 6);
     147            if (cbRecord == 10 &&  (*((char *)pvRecord + 3) & 0xE0) == 0x20 && i <= cpszLNames && strcmp(apszLNames[i-1], "CODE16_IOSEG") == 0)
     148            {   /* change alignment of this segment... */
     149                /* fprintf(stderr, "debug %s 0x%02x\n", apszLNames[*(char*)((int)pvRecord + 6) - 1], (*((char *)pvRecord + 3) & 0xFF)); */
     150                *((char*)pvRecord + 3) =  0x40 | (*((char*)pvRecord + 3) & 0x1F);
     151            }
    140152            break;
    141153
     
    148160            /* it seems to be somthing funny here! - lets try aligning it to on a 16 bytes boundrary... */
    149161            /* PS. I know this I have a wrong approch to the lib files, not using the directory... */
     162            /* Aug 13 2000 4:24am: The alignment of modules are found in the library header.
     163             *    It's the size of the library header.
     164             *    Not implemented yet. TODO FIXME BUGBUG ASSUMES
     165             */
    150166            fChanged = 1;
    151167            fwrite(pvRecord, 1, cbRecord, phNew);
     
    153169            if (*((unsigned char*)((int)pvRecord+cbRecord)) == 0x00)
    154170            {
    155                 if ((ul % 16) > 0)
    156                     cbRecord += 16 - (ul % 16);
     171                if ((ul % cbPage) > 0)
     172                    cbRecord += cbPage - (ul % cbPage);
    157173            }
    158174            /*if (*((unsigned char*)pvRecord + cbRecord) != LIBEND)*/
    159175            {
    160176                ul = ftell(phNew);
    161                 while (ul++ % 16 != 0)
     177                while (ul++ % cbPage != 0)
    162178                    fputc(0, phNew);
    163179            }
     
    166182        } break;
    167183
     184        case PUBDEF:
     185        {
     186            cbRecord = *((unsigned short*)((int)pvRecord+1)) + 3;
     187            *((char*)pvRecord + cbRecord - 1) = 0;
     188            break;
     189        }
     190
    168191        case LNAMES:
    169             {
     192        {
    170193            char *apszConv[] =
    171194            {
    172                 "CODE",     "CODE",
    173                 "_CODE",    "CODE16",
    174                 "TEXT",     "CODE16",
    175                 "_TEXT",    "CODE16",
    176                 "DATA",     "FAR_DATA",
    177                 "_DATA",    "DATA16",
    178                 "DGROUP",   "DATA16_GROUP",
    179                 "_BSS",     "DATA16BSS",
    180                 "BSS",      "DATA16BSS",
    181                 "_CONST",   "DATA16CONST",
    182                 "CONST",    "DATA16CONST",
     195                /* classes */
     196                "CODE",         "CODE",
     197                "IOSEG_CODE",   "CODE",
     198                "DATA",         "FAR_DATA",
     199                "BSS",          "DATA16BSS",
     200                "CONST",        "DATA16CONST",
     201                /* segment names */
     202                "_TEXT",        "CODE16",
     203                "_IOSEG",       "CODE16_IOSEG",
     204                "_CODE",        "CODE16",           /* dhcalls */
     205                "_DATA",        "DATA16",
     206                "_BSS",         "DATA16BSS",
     207                "_CONST",       "DATA16CONST",
     208                /* groups */
     209                "DGROUP",       "DATA16_GROUP",
    183210                NULL, NULL
    184211            };
     
    242269            fputc(0, phNew);
    243270            break;
    244             }
     271        }
    245272
    246273        case LIBEND:
    247             cbRecord = *((unsigned short*)((int)pvRecord+1)) + 3;
    248             fwrite(pvRecord, 1, cbRecord, phNew);
     274        {
     275            /* align dictionary at 512 byte (3 is min size of this record) */
     276            int cBlocks;
     277            unsigned short int cbSize  = (((ftell(phNew) + 3 + 0x1ff) & ~0x1ff) - ftell(phNew)) - 3;
     278            unsigned long int  offDict = ftell(phNew) + cbSize + 3;
     279            cbRecord = cbSize + 3;
     280            fwrite(pvRecord, 1, 1, phNew);
     281            fwrite(&cbSize, 1, sizeof(cbSize), phNew);
     282            while (cbSize-- > 0)
     283                fwrite("\0", 1, 1, phNew);
     284
     285            /* update header record. */
     286            fseek(phNew, 3, SEEK_SET);
     287            fwrite(&offDict, 1, sizeof(offDict), phNew);
     288            fseek(phNew, offDict, SEEK_SET);
     289
     290            /* Translate the dictionary */
     291            pvRecord = (void*)((char*)pvRecord + *(unsigned short*)((char*)pvRecord + 1) + 3);
     292            cBlocks = *(unsigned short *)((char*)pvBase + 7);
     293            for (i = 0; i < cBlocks; i++)
     294            {
     295                int j;
     296                char *pchBlock = (char*)pvRecord + i * 512;
     297                for (j = 0; j < 37; j++)
     298                {
     299                    if (pchBlock[j] > 19 && pchBlock[j] < 0xff)
     300                    {
     301                        unsigned short *pusBlock = (unsigned short*)&pchBlock[pchBlock[j] * 2];
     302                        pusBlock = (unsigned short *) ((char*)pusBlock + *(char*)pusBlock + 1);
     303                        if (ausTrans[*pusBlock] == 0)
     304                            fprintf(stderr, "error: dictionary entry don't point to a THEADR page!\n");
     305                        else
     306                            *pusBlock = ausTrans[*pusBlock];
     307                    }
     308                }
     309
     310            }
     311
     312            /* Write the dictionary */
     313            fwrite(pvRecord, 512, cBlocks, phNew);
    249314            return (void*)0xffffffff; /* FINE */
    250             break;
     315        }
     316
     317        case COMENT:
     318        {
     319            cbRecord = *((unsigned short*)((int)pvRecord+1)) + 3;
     320            switch (*((unsigned char*)((int)pvRecord+4)))
     321            {
     322                /* remove "Link Pass Separator" */
     323                case 0xA2:
     324                /* remove "LIBMOD" - The VAC 3.6.5 Linker don't like these! */
     325                case 0xA3:
     326                    fChanged = fRemoveExtra;
     327                    break;
     328            }
     329            break;
     330        }
     331
     332        /*
     333         * Remove checksum
     334         */
     335        /*
     336        case GRPDEF:
     337        case FIXUPP:
     338        case FIXUPP2:
     339        case LEDATA:
     340        {
     341            cbRecord = *((unsigned short*)((int)pvRecord+1)) + 3;
     342            *((char*)pvRecord + cbRecord - 1) = 0;
     343            break;
     344        }
     345        */
    251346
    252347        default:
  • trunk/src/win32k/misc/OS2KPTDA.c

    r3829 r4164  
    1 /* $Id: OS2KPTDA.c,v 1.1 2000-07-16 22:21:17 bird Exp $
     1/* $Id: OS2KPTDA.c,v 1.2 2000-09-02 21:08:12 bird Exp $
    22 *
    33 * PTDA access functions.
     
    99 */
    1010
     11/*******************************************************************************
     12*   Defined Constants And Macros                                               *
     13*******************************************************************************/
     14#define INCL_OS2KRNL_SEM
     15#define INCL_OS2KRNL_PTDA
    1116
    1217/*******************************************************************************
     
    1419*******************************************************************************/
    1520#include <os2.h>
    16 #include <OS2KPTDA.h>
     21#include <OS2Krnl.h>
    1722
    1823
     
    2833extern ULONG    pptda_start;
    2934extern ULONG    pptda_environ;
     35extern ULONG    pptda_ptdasem;
     36extern ULONG    pptda_module;
    3037
    3138
     
    3542 * @returns     Content of the pPTDA->ptda_environ member.
    3643 * @param       pPTDA   PTDA Pointer. (NULL is not allowed!)
    37  * @sketch
    3844 */
    3945USHORT  ptdaGet_ptda_environ(PPTDA pPTDA)
     
    4248}
    4349
     50
     51/**
     52 * Gets the ptda_module PTDA member. This member holds the MTE handle of the process's
     53 * executable image.
     54 * @returns     Content of the pPTDA->ptda_module member.
     55 * @param       pPTDA   PTDA Pointer. (NULL is not allowed!)
     56 */
     57USHORT  ptdaGet_ptda_module(PPTDA pPTDA)
     58{
     59    return *(PUSHORT)(void*)(((char*)(void*)pPTDA) + (pptda_module - pptda_start));
     60}
     61
     62
     63/**
     64 * Gets the ptda_ptdasem PTDA member. This member holds the intra-process semaphore which
     65 * for example is used to serialize _LDRQAppType.
     66 * @returns     Content of the pPTDA->ptda_ptdasem member.
     67 * @param       pPTDA   PTDA Pointer. (NULL is not allowed!)
     68 */
     69HKSEMMTX    ptda_ptda_ptdasem(PPTDA pPTDA)
     70{
     71    return (HKSEMMTX)(void*)(((char*)(void*)pPTDA) + (pptda_ptdasem - pptda_start));
     72}
     73
     74
     75
  • trunk/src/win32k/misc/OS2KTCB.c

    r3829 r4164  
    1 /* $Id: OS2KTCB.c,v 1.1 2000-07-16 22:21:17 bird Exp $
     1/* $Id: OS2KTCB.c,v 1.2 2000-09-02 21:08:13 bird Exp $
    22 *
    33 * TCB - Thread Control Block access methods.
     
    1515#include <os2.h>
    1616#include <OS2KTCB.h>
     17#include "devSegDf.h"                   /* Win32k segment definitions. */
    1718#include "options.h"
    1819
  • trunk/src/win32k/misc/avl.c

    r3168 r4164  
    1 /* $Id: avl.c,v 1.4 2000-03-19 16:00:11 bird Exp $
     1/* $Id: avl.c,v 1.5 2000-09-02 21:08:13 bird Exp $
    22 *
    33 * AVL-Tree (lookalike) implementation.
     
    2424*******************************************************************************/
    2525#include <os2.h>
     26#include "devSegDf.h"                   /* Win32k segment definitions. */
    2627#include "avl.h"
    2728#if defined(RING0) || defined(RING3)
  • trunk/src/win32k/misc/buffer.asm

    r2838 r4164  
    1 ; $Id: buffer.asm,v 1.5 2000-02-21 09:24:02 bird Exp $
    2 ;
    3 ; Simple resident buffer for use when overloading tkExecPgm.
     1; $Id: buffer.asm,v 1.6 2000-09-02 21:08:13 bird Exp $
     2;
     3; Simple resident buffer for use when overloading tkExecPgm - obsolete!
    44;
    55; Copyright (c) 2000 knut st. osmundsen
     
    1313;   Defined Constants And Macros
    1414;
    15 NBR_BUFFERS     EQU 20
     15NBR_BUFFERS     EQU 2
    1616BUFFER_SIZE     EQU 1536
    1717
  • trunk/src/win32k/misc/cout.cpp

    r1467 r4164  
    1 /* $Id: cout.cpp,v 1.2 1999-10-27 02:02:59 bird Exp $
     1/* $Id: cout.cpp,v 1.3 2000-09-02 21:08:13 bird Exp $
    22 *
    33 * cout - cout replacement.
     
    2525#include <stdarg.h>
    2626
     27#include "devSegDf.h"                   /* Win32k segment definitions. */
    2728#include "cout.h"
    2829#include "options.h"
  • trunk/src/win32k/misc/env.c

    r3412 r4164  
    1 /* $Id: env.c,v 1.2 2000-04-17 02:26:04 bird Exp $
     1/* $Id: env.c,v 1.3 2000-09-02 21:08:13 bird Exp $
    22 *
    33 * Environment access functions
     
    1414#define INCL_DOSERRORS                  /* Error codes */
    1515#define INCL_OS2KRNL_VM                 /* OS2KRNL: Virtual Memory Management */
    16 
     16#define INCL_OS2KRNL_PTDA               /* OS2KNRL: (per)ProcessTaskDataArea */
    1717
    1818/*******************************************************************************
     
    2121#include <os2.h>
    2222
     23#include "devSegDf.h"                   /* Win32k segment definitions. */
    2324#include "dev32.h"
    2425#include "dev32hlp.h"
    2526#include "log.h"
    26 #include "ptda.h"
    2727#include "OS2Krnl.h"
    2828#include <string.h>
    29 
     29#include "macros.h"
    3030#include "env.h"
    3131
     
    3939 * @param     paszEnv   Pointer to the environment data to search.
    4040 *                      The environment data is a list of zero-strings terminated
    41  *                      by an empty string. The strings are paired, that means
    42  *                      that the first string is the variable name and the
    43  *                      following string is the value of the variable.
    44  *                      AFAIK a variable can't have an empty value string!
    45  * @param     pszVar    Name of the environment variable to find.
     41 *                      by an empty string. The strings consists of two parts which
     42 *                      are separated by a euqal char ('='). The first part is the
     43 *                      variable name. The second part is the value of the variable.
     44 *
     45 *                      IF this is NULL we'll simply return NULL.
     46 * @param     pszVar    Name of the environment variable to find. (NULL not allowed.)
    4647 */
    4748const char *ScanEnv(const char *paszEnv, const char *pszVar)
    4849{
     50    int     cchVar;
     51    /*
     52     * Return if environment not found.
     53     */
     54    #ifdef DEBUG
     55    if (pszVar < (const char *)0x10000 || *pszVar == '\0')
     56        kprintf(("ScanEnv: Invalid parameter pszVar (%p)\n", pszVar));
     57    #endif
     58    if (paszEnv == NULL)
     59        return NULL;
     60    #ifdef DEBUG
     61    if (paszEnv < (const char *)0x10000)
     62        kprintf(("ScanEnv: Invalid parameter paszEnv (%p)\n", paszEnv));
     63    #endif
     64
    4965    /*
    5066     * Loop thru the environment data until an empty string is reached.
    5167     */
     68    cchVar = strlen(pszVar);
    5269    while (*paszEnv != '\0')
    5370    {
    54         register int i;                 /* Variable use to store the compare result. */
    55 
    5671        /*
    57          * Variable name.
    58          * Check if it's matching the name we're searching for and skip the variable name.
     72         * Check if the variable name is it's matching the one we're searching for.
    5973         */
    60         i = stricmp(paszEnv, pszVar);
    61         paszEnv += strlen(paszEnv) + 1;
    62         if (i == 0)
    63         {   /* Variable was found. Return pointer to the value. */
    64             return paszEnv;
     74        const char *pszEqual = strchr(paszEnv, '=');
     75        if (pszEqual != NULL && (pszEqual - paszEnv) == cchVar
     76            && memcmp(paszEnv, pszVar, cchVar) == 0
     77            )
     78        {
     79            /*
     80             * Variable was found. Return pointer to the value.
     81             */
     82            return pszEqual + 1;
    6583        }
    6684
    6785        /*
    68          * !Paranoia!
    69          * If no value string we'll quit. This may be an IPE, if not it might
    70          * cause one if we continue processing the environment data.
     86         * Skip this variable. (Don't use pszEqual since it might be NULL)
    7187         */
    72         if (*paszEnv == '\0')
    73             break;
    74 
    75         /* Skip value */
    7688        paszEnv += strlen(paszEnv) + 1;
    7789    }
     
    8294
    8395/**
    84  * Get the linear pointer to the environment data.
     96 * Get the linear pointer to the environment data for the current
     97 * process or the process being started (EXECed).
    8598 *
    86  * @returns   Pointer to environment data.
    87  *            NULL on failure.
     99 * @param       fExecChild      TRUE:  Get exec child environment.
     100 *                                     (Not supported by method 2)
     101 *                              FALSE: Get current process environment.
     102 * @returns     Pointer to environment data.
     103 *              NULL on failure.
    88104 */
    89 const char *GetEnv(void)
     105const char *GetEnv(BOOL fExecChild)
    90106{
    91     /*  There is probably two ways of getting the environment data for a the
     107    /*  There are probably two ways of getting the environment data for the
    92108     *  current process: 1) get it from the PTDA->ptda_environ
    93109     *                   2) Local infosegment (LIS from GetDosVar devhlp)
    94      *  I am not sure which one of these works best. What I know is that
     110     *  I am not sure which one of these which works best. What I know is that
    95111     *  method 1) is used by the w_GetEnv API worker. This API is called at
    96112     *  Ring-0 from some delete file operation. (Which uses it to get the
     
    98114     *  I don't want to thunk around using that. There for I'll implement
    99115     *  my own GetEnv. So, currently I'll write the code for both 1) and
    100      *  2), testing will show which one of them are most handy.
     116     *  2), testing will show which one of them are the better.
    101117     */
    102118
     
    116132     */
    117133    pPTDACur = ptdaGetCur();
    118     if (pPTDA != NULL)
     134    if (pPTDACur != NULL)
    119135    {
    120         pPTDA = ptdaGet_pPTDAExecChild(pPTDA);
    121         if (pPTDA != NULL)
     136        pPTDA = ptdaGet_pPTDAExecChild(pPTDACur);
     137        if (pPTDA != NULL && fExecChild)
    122138        {
    123139            hobEnviron = ptdaGet_ptda_environ(pPTDA);
     
    127143                if (rc == NO_ERROR)
    128144                    return (const char *)ulAddr;
    129                 kprintf(("GetEnv: VMObjHandleInfo failed with rc=%d for hob=0x%04x\n", rc, hobEnviron));
     145                kprintf(("GetEnv: (1) VMObjHandleInfo failed with rc=%d for hob=0x%04x \n", rc, hobEnviron));
    130146            }
    131147        }
     
    135151        {
    136152            rc = VMObjHandleInfo(hobEnviron, SSToDS(&ulAddr), SSToDS(&ushPTDA));
    137             if (rc != NO_ERROR)
    138             {
    139                 kprintf(("GetEnv: VMObjHandleInfo failed with rc=%d for hob=0x%04x\n", rc, hobEnviron));
    140             }
     153            if (rc == NO_ERROR)
     154                return (const char *)ulAddr;
     155            kprintf(("GetEnv: (2) VMObjHandleInfo failed with rc=%d for hob=0x%04x\n", rc, hobEnviron));
    141156        }
    142157    }
    143158    else
    144     {
     159    {   /* Not called at task time? No current task! */
    145160        kprintf(("GetEnv: Failed to get current PTDA.\n"));
    146161    }
    147162
    148     return (const char *)ulAddr;
     163    return NULL;
     164
    149165
    150166    #else
     167
    151168
    152169    struct InfoSegLDT * pLIS;           /* Pointer to local infosegment. */
     
    162179    {
    163180        kprintf(("GetEnv: Failed to get local info segment\n"));
     181        NOREF(fExecChild);
    164182        return NULL;
    165183    }
  • trunk/src/win32k/misc/log.c

    r847 r4164  
    1 /* $Id: log.c,v 1.1 1999-09-06 02:20:02 bird Exp $
     1/* $Id: log.c,v 1.2 2000-09-02 21:08:13 bird Exp $
    22 *
    33 * log - C-style logging - kprintf.
     
    2323#include <builtin.h>
    2424
     25#include "devSegDf.h"                   /* Win32k segment definitions. */
    2526#include "dev32.h"
    2627#include "options.h"
  • trunk/src/win32k/misc/malloc.c

    r2511 r4164  
    1 /* $Id: malloc.c,v 1.6 2000-01-24 18:19:00 bird Exp $
     1/* $Id: malloc.c,v 1.7 2000-09-02 21:08:14 bird Exp $
    22 *
    33 * Common Heap - this forwards to the swappable heap!
     
    2020******************************************************************************/
    2121#include <os2.h>
     22#include "devSegDf.h"                   /* Win32k segment definitions. */
    2223#include "smalloc.h"
    2324#include "rmalloc.h"
     
    2829*  Global data
    2930******************************************************************************/
    30 #ifndef RING0
     31#if !defined(RING0) || defined(R3TST)
    3132    char           fInited;       /* init flag */
    3233#endif
     
    5354    if (rc != 0)
    5455        return rc;
    55     #ifdef RING3
     56    #if !defined(RING0) || defined(R3TST)
    5657        fInited = TRUE;
    5758    #endif
     
    6970void * malloc(unsigned cbSize)
    7071{
     72    #ifdef R3TST
     73    if (!fInited)
     74    {
     75        PVOID pv;
     76        if (!DosAllocMem(&pv, cbSize, PAG_WRITE | PAG_READ | PAG_COMMIT)) /* no SSToDS! */
     77            return pv;
     78        else
     79            return NULL;
     80    }
     81    #endif
    7182    return smalloc(cbSize);
    7283}
     
    8192void *realloc(void *pv, unsigned cbNew)
    8293{
     94    #ifdef R3TST
     95    if (!fInited)
     96        Int3();
     97    #endif
    8398    return srealloc(pv, cbNew);
    8499}
     
    91106void free(void *pv)
    92107{
     108    #ifdef R3TST
     109    if (!fInited) /* controlled leak! */
     110       return;
     111    #endif
    93112    sfree(pv);
    94113}
     
    154173
    155174
     175
    156176#if !defined(RING0) && defined(__IBMC__)
    157177
     
    162182int _rmem_init(void)
    163183{
    164     int rc = heapInit(CB_RES_INIT, CB_RES_MAX, CB_SWP_INIT, CB_SWP_MAX);
     184    int rc;
     185    rc = heapInit(CB_RES_INIT, CB_RES_MAX, CB_SWP_INIT, CB_SWP_MAX);
    165186    return rc;
    166187}
  • trunk/src/win32k/misc/new.cpp

    r2540 r4164  
    1 /* $Id: new.cpp,v 1.4 2000-01-27 23:46:57 bird Exp $
     1/* $Id: new.cpp,v 1.5 2000-09-02 21:08:14 bird Exp $
    22 *
    33 * new - new and delete operators.
     
    2121#include <os2.h>
    2222
     23#include "devSegDf.h"                   /* Win32k segment definitions. */
    2324#include "new.h"
    2425#include "rmalloc.h"
  • trunk/src/win32k/misc/rmalloc.c

    r2507 r4164  
    1 /* $Id: rmalloc.c,v 1.3 2000-01-24 01:45:20 bird Exp $
     1/* $Id: rmalloc.c,v 1.4 2000-09-02 21:08:14 bird Exp $
    22 *
    33 * Resident Heap.
     
    5050******************************************************************************/
    5151#include <os2.h>
     52#include "devSegDf.h"                   /* Win32k segment definitions. */
    5253#ifdef RING0
    5354    #include "dev32hlp.h"
  • trunk/src/win32k/misc/rmalloc_avl.c

    r2511 r4164  
    1 /* $Id: rmalloc_avl.c,v 1.5 2000-01-24 18:19:00 bird Exp $
     1/* $Id: rmalloc_avl.c,v 1.6 2000-09-02 21:08:14 bird Exp $
    22 *
    33 * Resident Heap - AVL.
     
    4747******************************************************************************/
    4848#include <os2.h>
     49#include "devSegDf.h"                   /* Win32k segment definitions. */
    4950#ifdef RING0
    5051    #include "dev32hlp.h"
     
    120121static PHEAPANCHOR  phaFirst;           /* Pointer to the first anchor block.*/
    121122static PHEAPANCHOR  phaLast;            /* Pointer to the last anchor block.*/
    122 static unsigned     cbResHeapMax;       /* Maximum amount of memory used by the heap. */
     123unsigned            cbResHeapMax;       /* Maximum amount of memory used by the heap. */
    123124
    124125#ifndef RING0
     
    898899
    899900/**
     901 * Get amount of used memory (in bytes)
     902 * @returns  Amount of used memory (in bytes).
     903 */
     904unsigned    _res_memused(void)
     905{
     906    PHEAPANCHOR pha = phaFirst;
     907    unsigned    cb;
     908
     909    #ifdef ALLWAYS_HEAPCHECK
     910    if (!_res_heap_check())
     911        kprintf(("_res_memused: _res_heap_check failed!\n"));
     912    #endif
     913
     914    for (cb = 0; pha != NULL; pha = pha->pNext)
     915        cb += pha->cbUsed;
     916
     917    return cb;
     918}
     919
     920
     921/**
     922 * Collects the heap state.
     923 * @returns     0 on success.
     924 *              -1 on error.
     925 * @param       pState  Pointer to a RES_HEAPSTATE structure which is
     926 *                      filled upon successful return.
     927 */
     928int         _res_state(PHEAPSTATE pState)
     929{
     930    PHEAPANCHOR pha;
     931
     932    #ifdef ALLWAYS_HEAPCHECK
     933    if (!_res_heap_check())
     934    {
     935        kprintf(("_res_state: _res_heap_check failed!\n"));
     936        return -1;
     937    }
     938    #endif
     939
     940    if (pState == NULL)
     941        return -1;
     942
     943    /*
     944     * Loop thru all the anchor blocks and all memory blocks
     945     * building the stats.
     946     */
     947    memset(pState, 0, sizeof(HEAPSTATE));
     948    for (pha = phaFirst; pha != NULL; pha = pha->pNext)
     949    {
     950        AVLENUMDATA     EnumData;
     951        PAVLENUMDATA    pEnumData = SSToDS(&EnumData);
     952        PMEMBLOCK       pmb;
     953
     954        /* count of free blocks */
     955        pmb = (PMEMBLOCK)AVLBeginEnumTree((PPAVLNODECORE)&pha->pmbFree, pEnumData, TRUE);
     956        while (pmb)
     957        {
     958            pState->cBlocksFree++;
     959            pmb = (PMEMBLOCK)AVLGetNextNode(pEnumData);
     960        }
     961
     962        /* count of used blocks */
     963        pmb = (PMEMBLOCK)AVLBeginEnumTree((PPAVLNODECORE)&pha->pmbUsed, pEnumData, TRUE);
     964        while (pmb)
     965        {
     966            pState->cBlocksUsed++;
     967            pmb = (PMEMBLOCK)AVLGetNextNode(pEnumData);
     968        }
     969
     970        /* sizes */
     971        pState->cbHeapSize  += pha->cbSize;
     972        pState->cbHeapFree  += pha->cbFree;
     973        pState->cbHeapUsed  += pha->cbUsed;
     974    }
     975
     976    return 0;
     977}
     978
     979
     980/**
    900981 * Checks heap integrety.
    901982 * @returns  TRUE  when ok.
  • trunk/src/win32k/misc/smalloc_avl.c

    r2511 r4164  
    1 /* $Id: smalloc_avl.c,v 1.3 2000-01-24 18:19:00 bird Exp $
     1/* $Id: smalloc_avl.c,v 1.4 2000-09-02 21:08:15 bird Exp $
    22 *
    33 * Swappable Heap - AVL.
     
    5959******************************************************************************/
    6060#include <os2.h>
     61#include "devSegDf.h"                   /* Win32k segment definitions. */
    6162#ifdef RING0
    6263    #include "dev32hlp.h"
     
    140141static PHEAPANCHOR  phaFirst;           /* Pointer to the first anchor block.*/
    141142static PHEAPANCHOR  phaLast;            /* Pointer to the last anchor block.*/
    142 static unsigned     cbSwpHeapMax;       /* Maximum amount of memory used by the heap. */
    143 static PMEMBLOCKCHUNK pmcFirst;          /* Pointer to the first memblock chunk. */
     143unsigned            cbSwpHeapMax;       /* Maximum amount of memory used by the heap. */
     144static PMEMBLOCKCHUNK pmcFirst;         /* Pointer to the first memblock chunk. */
    144145
    145146#ifndef RING0
     
    10661067
    10671068    return cb;
     1069}
     1070
     1071
     1072/**
     1073 * Get amount of used memory (in bytes)
     1074 * @returns  Amount of used memory (in bytes).
     1075 */
     1076unsigned    _swp_memused(void)
     1077{
     1078    PHEAPANCHOR pha = phaFirst;
     1079    unsigned    cb;
     1080
     1081    #ifdef ALLWAYS_HEAPCHECK
     1082    if (!_swp_heap_check())
     1083        kprintf(("_swp_memused: _swp_heap_check failed!\n"));
     1084    #endif
     1085
     1086    for (cb = 0; pha != NULL; pha = pha->pNext)
     1087        cb += pha->cbUsed;
     1088
     1089    return cb;
     1090}
     1091
     1092
     1093/**
     1094 * Collects the heap state.
     1095 * @returns     0 on success.
     1096 *              -1 on error.
     1097 * @param       pState  Pointer to a HEAPSTATE structure which is
     1098 *                      filled upon successful return.
     1099 */
     1100int         _swp_state(PHEAPSTATE pState)
     1101{
     1102    PHEAPANCHOR pha;
     1103
     1104    #ifdef ALLWAYS_HEAPCHECK
     1105    if (!_res_heap_check())
     1106    {
     1107        kprintf(("_res_state: _res_heap_check failed!\n"));
     1108        return -1;
     1109    }
     1110    #endif
     1111
     1112    if (pState == NULL)
     1113        return -1;
     1114
     1115    /*
     1116     * Loop thru all the anchor blocks and all memory blocks
     1117     * building the stats.
     1118     */
     1119    memset(pState, 0, sizeof(HEAPSTATE));
     1120    for (pha = phaFirst; pha != NULL; pha = pha->pNext)
     1121    {
     1122        AVLENUMDATA     EnumData;
     1123        PAVLENUMDATA    pEnumData = SSToDS(&EnumData);
     1124        PMEMBLOCK       pmb;
     1125
     1126        /* count of free blocks */
     1127        pmb = (PMEMBLOCK)AVLBeginEnumTree((PPAVLNODECORE)&pha->pcoreFree, pEnumData, TRUE);
     1128        while (pmb)
     1129        {
     1130            pState->cBlocksFree++;
     1131            pmb = (PMEMBLOCK)AVLGetNextNode(pEnumData);
     1132        }
     1133
     1134        /* count of used blocks */
     1135        pmb = (PMEMBLOCK)AVLBeginEnumTree((PPAVLNODECORE)&pha->pcoreUsed, pEnumData, TRUE);
     1136        while (pmb)
     1137        {
     1138            pState->cBlocksUsed++;
     1139            pmb = (PMEMBLOCK)AVLGetNextNode(pEnumData);
     1140        }
     1141
     1142        /* sizes */
     1143        pState->cbHeapSize  += pha->cbSize;
     1144        pState->cbHeapFree  += pha->cbFree;
     1145        pState->cbHeapUsed  += pha->cbUsed;
     1146    }
     1147
     1148    return 0;
    10681149}
    10691150
  • trunk/src/win32k/misc/vprintf.c

    r2501 r4164  
    1 /* $Id: vprintf.c,v 1.7 2000-01-22 18:21:03 bird Exp $
     1/* $Id: vprintf.c,v 1.8 2000-09-02 21:08:15 bird Exp $
    22 *
    33 * vprintf and printf
     
    2525
    2626
    27 #ifdef RING0
     27
     28#if defined(RING0) && !defined(R3TST)
     29    #define COMOUTPUT
     30#endif
     31#if !defined(RING0) || defined(R3TST)
     32    #define DOSWRITEOUTPUT
     33#endif
     34
     35#ifndef DOSWRITEOUTPUT
    2836    #define INCL_NOAPI
    2937#else
     
    3947#include <stdarg.h>
    4048
     49#include "devSegDf.h"                   /* Win32k segment definitions. */
    4150#include "dev32.h"
    4251#include "vprintf.h"
     52#ifdef COMOUTPUT
     53    #include <builtin.h>
     54#endif
    4355#ifdef RING0
    44     #include <builtin.h>
    4556    #include "options.h"
    4657#endif
     
    222233int vprintf(const char *pszFormat, va_list args)
    223234{
    224     #ifdef RING0
     235    #if defined(RING0) && !defined(R3TST)
    225236    if (!options.fLogging)
    226237        return 0;
     
    239250int vprintf2(const char *pszFormat, va_list args)
    240251{
    241     #ifndef RING0
    242         int cch = 0;
    243     #endif
     252    int cch = 0;
    244253
    245254    while (*pszFormat != '\0')
     
    247256        if (*pszFormat == '%')
    248257        {
    249             #ifndef RING0
    250                 if (cch > 0)
    251                 {
    252                     strout((char*)(pszFormat - cch), cch);
    253                     cch = 0;
    254                 }
    255             #endif
     258            if (cch > 0)
     259            {
     260                strout((char*)(pszFormat - cch), cch);
     261                cch = 0;
     262            }
    256263
    257264            pszFormat++;  /* skip '%' */
     
    396403        else
    397404        {
    398             #ifdef RING0
    399                 chout(*pszFormat++);
    400             #else
    401                 cch++;
    402                 pszFormat++;
    403             #endif
    404         }
    405     }
    406 
    407     #ifndef RING0
    408         if (cch > 0)
    409         {
    410             strout((char*)(pszFormat - cch), cch);
    411             cch = 0;
    412         }
    413     #endif
     405            cch++;
     406            pszFormat++;
     407        }
     408    }
     409
     410    if (cch > 0)
     411    {
     412        strout((char*)(pszFormat - cch), cch);
     413        cch = 0;
     414    }
    414415
    415416    return 0UL;
     
    479480static void chout(int ch)
    480481{
    481     #ifndef RING0
    482         ULONG ulWrote;
    483     #endif
     482#ifdef DOSWRITEOUTPUT
     483    ULONG ulWrote;
     484#endif
    484485
    485486    if (ch != '\r')
     
    487488        if (ch == '\n')
    488489        {
    489             #ifdef RING0
    490                 #pragma info(noeff)
    491                 while (!(_inp(options.usCom + 5) & 0x20));  /* Waits for the port to be ready. */
    492                 _outp(options.usCom, chReturn);             /* Put the char. */
    493                 #pragma info(restore)
    494             #else
    495                 DosWrite(1, (void*)&chReturn, 1, &ulWrote);
    496             #endif
    497         }
    498         #ifdef RING0
     490        #ifdef COMOUTPUT
    499491            #pragma info(noeff)
    500492            while (!(_inp(options.usCom + 5) & 0x20));  /* Waits for the port to be ready. */
    501             _outp(options.usCom, ch);                   /* Put the char. */
     493            _outp(options.usCom, chReturn);             /* Put the char. */
    502494            #pragma info(restore)
    503             Yield();
    504         #else
    505             DosWrite(1, (void*)&ch, 1, &ulWrote);
    506495        #endif
     496        #ifdef DOSWRITEOUTPUT
     497            DosWrite(1, (void*)&chReturn, 1, SSToDS(&ulWrote));
     498        #endif
     499        }
     500    #ifdef COMOUTPUT
     501        #pragma info(noeff)
     502        while (!(_inp(options.usCom + 5) & 0x20));  /* Waits for the port to be ready. */
     503        _outp(options.usCom, ch);                   /* Put the char. */
     504        #pragma info(restore)
     505        Yield();
     506    #endif
     507    #ifdef DOSWRITEOUTPUT
     508        DosWrite(1, SSToDS(&ch), 1, SSToDS(&ulWrote));
     509    #endif
    507510    }
    508511}
     
    529532
    530533        /* write string part */
    531         #ifdef RING0
    532             for (ul = 0; ul < cch; ul++)
    533             {
    534                 #pragma info(noeff)
    535                 while (!(_inp(options.usCom + 5) & 0x20));  /* Waits for the port to be ready. */
    536                 _outp(options.usCom, psz[ul]);              /* Put the char. */
    537                 #pragma info(restore)
    538             }
    539         #else
    540             DosWrite(1, (void*)psz, cch, &ul);
    541         #endif
     534    #ifdef COMOUTPUT
     535        for (ul = 0; ul < cch; ul++)
     536        {
     537            #pragma info(noeff)
     538            while (!(_inp(options.usCom + 5) & 0x20));  /* Waits for the port to be ready. */
     539            _outp(options.usCom, psz[ul]);              /* Put the char. */
     540            #pragma info(restore)
     541        }
     542    #endif
     543    #ifdef DOSWRITEOUTPUT
     544        DosWrite(1, psz, cch, SSToDS(&ul));
     545    #endif
    542546
    543547        /* cr and lf check + skip */
    544         if (psz[cch] == '\n' || psz[cch] == '\r')
     548        if (cch < cchMax && (psz[cch] == '\n' || psz[cch] == '\r'))
    545549        {
    546550            if (psz[cch] == '\n')
    547551            {
    548             #ifdef RING0
     552            #ifdef COMOUTPUT
    549553                #pragma info(noeff)
    550554                while (!(_inp(options.usCom + 5) & 0x20));  /* Waits for the port to be ready. */
     
    552556                while (!(_inp(options.usCom + 5) & 0x20));  /* Waits for the port to be ready. */
    553557                _outp(options.usCom, chNewLine);            /* Put the char. */
    554                 cchYield ++;
     558                cchYield++;
    555559                #pragma info(restore)
    556             #else
    557                 DosWrite(1, (void*)&chReturn, 1, &ul);
    558                 DosWrite(1, (void*)&chNewLine, 1, &ul);
     560            #endif
     561            #ifdef DOSWRITEOUTPUT
     562                DosWrite(1, (void*)&chReturn, 1, SSToDS(&ul));
     563                DosWrite(1, (void*)&chNewLine, 1, SSToDS(&ul));
    559564            #endif
    560565
  • trunk/src/win32k/pe2lx/makefile

    r3041 r4164  
    11##############################################################################
    2 # $Id: makefile,v 1.20 2000-03-08 09:22:21 bird Exp $
     2# $Id: makefile,v 1.21 2000-09-02 21:08:16 bird Exp $
    33#
    44# PD-Win32 API
     
    2020OBJEXT          = pe_obj
    2121
    22 
    2322##############################################################################
    2423# Tools and Flags Addjustments
    2524##############################################################################
     25OBJDIR     = $(WIN32KOBJ)
    2626CINCLUDES  = -I$(WIN32KINCLUDE)
    2727
    2828CFLAGS     = $(CINCLUDES) $(CFLAGS) -DRING3 -DPE2LX \
    29              -Ge+ -Wall+ppt-ppc-inl-cnv-gnr-vft-gen-uni-ext- -Gm- -Gn- -Ti+ -Rn
     29             -Ge+ -Gm- -Gn- -Ti+ -Rn -Wall+ppt-ppc-inl-cnv-gnr-vft-gen-uni-ext-
    3030CXXFLAGS   = $(CINCLUDES) $(CXXFLAGS) -DRING3 -DPE2LX \
    31              -Ge+ -Wall+ppt-ppc-inl-cnv-gnr-vft- -Gm- -Gn- -Ti+ -Gx -Rn
     31             -Ge+ -Gm- -Gn- -Ti+ -Rn -Gx -Wall+ppt-ppc-inl-cnv-gnr-vft-
    3232
    33 LD         = ilink
    34 LDFLAGS    = /nologo /NOI /A:16 /NOE /packcode /packdata /pmtype:vio /Stack:4096 \
     33LD2FLAGS   = /nologo /NOI /A:16 /NOE /NOD /packcode /packdata /pmtype:vio /Stack:4096 \
    3534!ifdef DEBUG
    3635!ifndef NODEBUGINFO
     
    8584# Main targets.
    8685##############################################################################
    87 TARGET   = pe2lx
     86TARGET = pe2lx
    8887
    89 OBJS     =  $(OBJDIR)\pe2lx.$(OBJEXT)         \
    90             $(OBJDIR)\pe2lxmain.$(OBJEXT)     \
    91             $(OBJDIR)\modulebase.$(OBJEXT)    \
    92             $(OBJDIR)\malloc.$(OBJEXT)        \
    93             $(OBJDIR)\smalloc_avl.$(OBJEXT)   \
    94             $(OBJDIR)\avl.$(OBJEXT)           \
    95             $(OBJDIR)\rmalloc_avl.$(OBJEXT)   \
    96             $(OBJDIR)\new.$(OBJEXT)           \
    97             $(OBJDIR)\stricmp.$(OBJEXT)       \
    98             $(OBJDIR)\vprintf.$(OBJEXT)
     88OBJS =\
     89$(OBJDIR)\pe2lx.$(OBJEXT)\
     90$(OBJDIR)\pe2lxmain.$(OBJEXT)\
     91$(OBJDIR)\modulebase.$(OBJEXT)\
     92$(OBJDIR)\malloc.$(OBJEXT)\
     93$(OBJDIR)\smalloc_avl.$(OBJEXT)\
     94$(OBJDIR)\avl.$(OBJEXT)\
     95$(OBJDIR)\rmalloc_avl.$(OBJEXT)\
     96$(OBJDIR)\new.$(OBJEXT)\
     97$(OBJDIR)\stricmp.$(OBJEXT)\
     98$(OBJDIR)\vprintf.$(OBJEXT)
     99
     100LIBS =\
     101!if "$(CCENV)" == "VAC36"
     102    $(VACPATH)\lib\cpprni36.lib \
     103!else
     104    $(VACPATH)\lib\cppon30.lib  \
     105!endif
    99106
    100107
    101 
    102 all:      $(OBJDIR) $(OBJDIR)\$(TARGET).exe
     108all:    $(WIN32KBIN)\$(TARGET).exe
    103109
    104110
    105 $(OBJDIR)\$(TARGET).exe: $(OBJS)
     111$(WIN32KBIN)\$(TARGET).exe: $(OBJS) makefile
    106112    @echo linking $@
    107     $(LD) $(LDFLAGS) /OUT:$@ /MAP:$*.map $**
     113    $(LD2) @<<$(OBJDIR)\$(@B).lnk
     114$(LD2FLAGS)
     115/OUT:$@
     116/MAP:$*.map
     117$(OBJS: =^
     118)
     119$(LIBS)
     120os2386.lib
     121<<KEEP
    108122    $(CP) $@ $(PDWIN32_BIN)
    109123
     
    113127##############################################################################
    114128dep:
    115     $(DEPEND) -obj$(OBJEXT) -o$$(OBJDIR) $(CINCLUDES) ..\misc\*.c* ..\include\*.h
     129    $(DEPEND) -obj$(OBJEXT) -o$$(OBJDIR) $(CINCLUDES) \
     130        *.c* ..\misc\*.c* ..\include\*.h
    116131
    117132
  • trunk/src/win32k/pe2lx/pe2lx.cpp

    r2927 r4164  
    1 /* $Id: pe2lx.cpp,v 1.18 2000-02-27 02:18:10 bird Exp $
     1/* $Id: pe2lx.cpp,v 1.19 2000-09-02 21:08:16 bird Exp $
    22 *
    33 * Pe2Lx class implementation. Ring 0 and Ring 3
     
    8181#include <exe386.h>                     /* OS/2 LX structs and definitions. */
    8282
     83#include "devSegDf.h"                   /* Win32k segment definitions. */
     84
    8385#include "malloc.h"                     /* win32k malloc (resident). Not C library! */
    8486#include "smalloc.h"                    /* win32k swappable heap. */
     
    9597#ifdef RING0
    9698    #include "ldrCalls.h"               /* ldr* calls. (ldrRead) */
     99    #include "avl.h"                    /* AVL tree. (ldr.h need it) */
     100    #include "ldr.h"                    /* ldr helpers. (ldrGetExePath) */
     101    #include "env.h"                    /* Environment helpers. */
    97102#endif
    98103#include "modulebase.h"                 /* ModuleBase class definitions, ++. */
     
    100105#include <versionos2.h>                 /* Pe2Lx version. */
    101106#include "yield.h"                      /* Yield CPU. */
     107#include "options.h"                    /* Win32k options. */
    102108
    103109
     
    169175    {NULL,                                 NULL} /* end-of-list entry */
    170176};
     177
     178LONG            Pe2Lx::cLoadedModules;  /* Count of existing objects. Updated by constructor and destructor. */
     179const char *    Pe2Lx::pszOdin32Path;   /* Odin32 base path (include a slash). */
     180ULONG           Pe2Lx::cchOdin32Path;   /* Odin32 base path length. */
     181SFN             Pe2Lx::sfnKernel32;     /* Odin32 Kernel32 filehandle. */
    171182
    172183
     
    205216    LXHdr.e32_pagesize  = PAGESIZE;
    206217    LXHdr.e32_objtab    = sizeof(LXHdr);
     218    cLoadedModules++;
    207219}
    208220
     
    277289    _res_heapmin();
    278290    _swp_heapmin();
     291
     292    /*
     293     * If no Pe2Lx objects left, then invalidate the Odin32Path.
     294     *  We'll have to do this since we may (theoretically) not receive
     295     *  a close on a kernel32 handle if loading failes before kernel32
     296     *  is loaded and the odin32path is determined using ldrOpenPath.
     297     *  (Ie. no sfnKernel32.)
     298     */
     299    if (--cLoadedModules <= 0)
     300        invalidateOdin32Path();
     301#ifdef DEBUG
     302    if (cLoadedModules < 0)
     303        printIPE(("Pe2Lx::cLoadedModules is %d which is less that zero!\n", cLoadedModules));
     304#endif
    279305}
    280306
     
    457483        dumpSectionHeader(&paSections[i]);
    458484
    459         /* 8a. Convert characteristics to flags */
     485        /* 8a. Convert characteristics to flags and check/fix incompatible flags! */
    460486        for (j = 0; j < (sizeof(paSecChars2Flags)/sizeof(paSecChars2Flags[0])); j++)
    461487            if ((paSections[i].Characteristics & paSecChars2Flags[j].Characteristics) == paSecChars2Flags[j].Characteristics)
    462488                flFlags |= paSecChars2Flags[j].flFlags;
     489        if ((flFlags & (OBJEXEC | OBJWRITE)) == (OBJEXEC | OBJWRITE))
     490            flFlags &= (ULONG)~OBJEXEC;
    463491
    464492        /* 8b. Virtual/physical size */
     
    529557    /* 11.Align section. (Fix which is applied to EXEs/Dlls which contain no fixups and has an
    530558     *    alignment which is not a multiple of 64Kb. The sections are concatenated into one big object. */
     559    /* TODO! this test has to be enhanced a bit. WWPack32, new Borland++ depends on image layout. */
    531560    fAllInOneObject = (pNtHdrs->FileHeader.Characteristics & IMAGE_FILE_RELOCS_STRIPPED) == IMAGE_FILE_RELOCS_STRIPPED;
    532561    if (fAllInOneObject)
     
    657686    Yield();
    658687    _res_heapmin();
    659     #if 0 /* testing */
     688    #ifndef RING0
     689    #if 1 /* testing */
    660690    testApplyFixups();
     691    #endif
    661692    #endif
    662693
     
    670701 * @param     pvBuffer   Pointer to buffer where data is to be put.
    671702 * @param     cbToRead   Bytes to be read.
    672  * @param     flFlag     Flags which was spesified to the ldrRead call.
     703 * @param     fpBuffer   Flags which was spesified to the ldrRead call.
    673704 * @parma     pMTE       Pointer to MTE which was specified to the ldrRead call.
    674705 * @return    NO_ERROR if successful something else if not.
     
    676707 * @author    knut st. osmundsen
    677708 */
    678 ULONG Pe2Lx::read(ULONG offLXFile, PVOID pvBuffer, ULONG cbToRead, ULONG flFlags, PMTE pMTE)
     709ULONG Pe2Lx::read(ULONG offLXFile, PVOID pvBuffer, ULONG fpBuffer, ULONG cbToRead, PMTE pMTE)
    679710{
    680711    APIRET rc = NO_ERROR;   /* Return code. */
     
    696727    #endif
    697728
    698     printInf(("read(%d, 0x%08x, %d, 0x%08x)\n", offLXFile, pvBuffer, cbToRead, flFlags));
     729    printInf(("Pe2Lx::read(%d, 0x%08x, 0x%08x, %d)\n", offLXFile, pvBuffer, fpBuffer, cbToRead));
    699730
    700731    /* Could we skip right to the datapages? */
     
    931962            /* calc PE offset and size of read. */
    932963            cbReadVar = min(paObjects[iObj].cbPhysical - offObject, cbToRead);
    933             rc = ReadAtF(hFile, offPEFile, pvBuffer, cbReadVar, flFlags, pMTE);
     964            rc = ReadAtF(hFile, offPEFile, pvBuffer, fpBuffer, cbReadVar, pMTE);
    934965        }
    935966        else
     
    938969            {   /* before TIBFix code. */
    939970                cbReadVar = min(paObjects[iObj].Misc.offTIBFix - offObject, cbToRead);
    940                 rc = ReadAtF(hFile, offPEFile, pvBuffer, cbReadVar, flFlags, pMTE);
     971                rc = ReadAtF(hFile, offPEFile, pvBuffer, fpBuffer, cbReadVar, pMTE);
    941972            }
    942973            else
     
    959990    }
    960991
    961     NOREF(flFlags);
     992    NOREF(fpBuffer);
    962993    NOREF(pMTE);
    963994    return rc;
     
    10771108
    10781109        while ((unsigned)pbr - (unsigned)pBaseRelocs + 8 < cbBaseRelocs /* 8= VirtualAddress and SizeOfBlock members */
     1110               && pbr->SizeOfBlock >= 8
    10791111               && pbr->VirtualAddress < ulRVAPage + PAGESIZE)
    10801112        {
     
    12811313
    12821314
     1315/**
     1316 * openPath - opens file eventually searching loader specific paths.
     1317 * This method is only called for DLLs. (DosLoadModule and Imports.)
     1318 *
     1319 *
     1320 * @returns   OS2 return code.
     1321 *            pLdrLv->lv_sfn  is set to filename handle.
     1322 * @param     pachFilename  Pointer to filename. Not zero terminated!
     1323 * @param     cchFilename   Filename length.
     1324 * @param     pLdrLv        Loader local variables? (Struct from KERNEL.SDF)
     1325 * @param     pful          Pointer to flags which are passed on to ldrOpen.
     1326 * @sketch
     1327 * This is roughly what the original ldrOpenPath does:
     1328 *      if !CLASS_GLOBAL or miniifs then
     1329 *          ldrOpen(pachModName)
     1330 *      else
     1331 *          loop until no more libpath elements
     1332 *              get next libpath element and add it to the modname.
     1333 *              try open the modname
     1334 *              if successfull then break the loop.
     1335 *          endloop
     1336 *      endif
     1337 */
     1338ULONG  Pe2Lx::openPath(PCHAR pachFilename, USHORT cchFilename, ldrlv_t *pLdrLv, PULONG pful) /* (ldrOpenPath) */
     1339{
     1340    #ifdef RING0
     1341
     1342    /*
     1343     * Mark the SFN invalid in the case of error.
     1344     * Initiate the Odin32 Path static variable and call worker.
     1345     */
     1346    return openPath2(pachFilename, cchFilename, pLdrLv, pful, initOdin32Path());
     1347
     1348    #else
     1349    NOREF(pachFilename);
     1350    NOREF(cchFilename);
     1351    NOREF(pLdrLv);
     1352    NOREF(pful);
     1353    return ERROR_NOT_SUPPORTED;
     1354    #endif
     1355}
     1356
     1357
     1358/**
     1359 * openPath2 - Worker for openPath which is also used by initOdin32Path.
     1360 *
     1361 * @returns   OS2 return code.
     1362 *            pLdrLv->lv_sfn  is set to filename handle.
     1363 * @param     pachFilename      Pointer to filename. Not zero terminated!
     1364 * @param     cchFilename       Filename length.
     1365 * @param     pLdrLv            Loader local variables? (Struct from KERNEL.SDF)
     1366 * @param     pful              Pointer to flags which are passed on to ldrOpen.
     1367 * @param     fOdin32PathValid  Flag indicating that the pszOdin32Path is valid or not.
     1368 * @sketch
     1369 * This is roughly what the original ldrOpenPath does:
     1370 *      if !CLASS_GLOBAL or miniifs then
     1371 *          ldrOpen(pachModName)
     1372 *      else
     1373 *          loop until no more libpath elements
     1374 *              get next libpath element and add it to the modname.
     1375 *              try open the modname
     1376 *              if successfull then break the loop.
     1377 *          endloop
     1378 *      endif
     1379 * @remark      cchFilename has to be ULONG due to an optimization bug in VA 3.08.
     1380 *              (cchFilename should have been USHORT. But, then the compiler would
     1381 *               treat it as an ULONG.)
     1382 */
     1383ULONG  Pe2Lx::openPath2(PCHAR pachFilename, ULONG cchFilename, ldrlv_t *pLdrLv, PULONG pful, BOOL fOdin32PathValid)
     1384{
     1385    #ifdef RING0
     1386
     1387    APIRET  rc;                         /* Returncode. */
     1388    ULONG   cchExt;                     /* Count of chars in additional extention. (0 if extention exists.) */
     1389
     1390    /* These defines sets the order the paths and pathlists are examined. */
     1391    #define FINDDLL_EXECUTABLEDIR   1
     1392    #define FINDDLL_CURRENTDIR      2
     1393    #define FINDDLL_SYSTEM32DIR     3
     1394    #define FINDDLL_SYSTEM16DIR     4
     1395    #define FINDDLL_WINDIR          5
     1396    #define FINDDLL_PATH            6
     1397    #define FINDDLL_BEGINLIBPATH    7   /* uses ldrOpenPath */
     1398    #define FINDDLL_LIBPATH         8   /* uses ldrOpenPath */
     1399    #define FINDDLL_ENDLIBPATH      9   /* uses ldrOpenPath */
     1400    #define FINDDLL_FIRST           FINDDLL_EXECUTABLEDIR
     1401    #define FINDDLL_LAST            FINDDLL_PATH
     1402
     1403    struct _LocalVars
     1404    {
     1405        char    sz[CCHMAXPATH];
     1406        char    szPath[CCHMAXPATH];
     1407    } *pVars;
     1408
     1409
     1410    /** @sketch
     1411     * Mark the SFN invalid in the case of error.
     1412     * Allocate memory for local variables.
     1413     * Check for extention.
     1414     */
     1415    pLdrLv->lv_sfn = 0xffff;
     1416    pVars = (struct _LocalVars*)rmalloc(sizeof(struct _LocalVars));
     1417    if (pVars == NULL)
     1418        return ERROR_NOT_ENOUGH_MEMORY;
     1419
     1420    cchExt = cchFilename - 1;
     1421    while (cchExt != 0 && pachFilename[cchExt] != '.')
     1422        cchExt--;
     1423    cchExt = cchExt != 0 ? 0 : 4;
     1424
     1425
     1426    /** @sketch
     1427     * Loop thru the paths and pathlists searching them for the filename.
     1428     */
     1429    for (int iPath = FINDDLL_FIRST; iPath <= FINDDLL_LAST; iPath++)
     1430    {
     1431        char  * pszPath;                /* Pointer to the path being examined. */
     1432
     1433        /** @sketch
     1434         * Get the path/dir to examin. (This is determined by the value if iPath.)
     1435         */
     1436        switch (iPath)
     1437        {
     1438            case FINDDLL_EXECUTABLEDIR:
     1439                if ((pszPath = ldrGetExePath(pVars->szPath, TRUE)) == NULL)
     1440                    continue;
     1441                break;
     1442
     1443            case FINDDLL_CURRENTDIR:
     1444                pszPath = ".";
     1445                break;
     1446
     1447            case FINDDLL_SYSTEM32DIR:
     1448                if (!fOdin32PathValid)
     1449                    continue;
     1450                pszPath = pVars->szPath;
     1451                strcpy(pszPath, pszOdin32Path);
     1452                strcpy(pszPath + cchOdin32Path, "System32");
     1453                break;
     1454
     1455            case FINDDLL_SYSTEM16DIR:
     1456                if (!fOdin32PathValid)
     1457                    continue;
     1458                pszPath = pVars->szPath;
     1459                strcpy(pszPath, pszOdin32Path);
     1460                strcpy(pszPath + cchOdin32Path, "System");
     1461                break;
     1462
     1463            case FINDDLL_WINDIR:
     1464                if (!fOdin32PathValid)
     1465                    continue;
     1466                pszPath = pVars->szPath;
     1467                strcpy(pszPath, pszOdin32Path);
     1468                pszPath[cchOdin32Path - 1] = '\0'; /* remove slash */
     1469                break;
     1470
     1471            case FINDDLL_PATH:
     1472                pszPath = (char*)GetEnv(TRUE);
     1473                if (pszPath == NULL)
     1474                    continue;
     1475                pszPath = (char*)ScanEnv(pszPath, "PATH");
     1476                break;
     1477
     1478            #if 0
     1479            case FINDDLL_BEGINLIBPATH:
     1480                pszPath = ptda_GetBeginLibpath()...  ;
     1481                if (pszPath == NULL)
     1482                    continue;
     1483                break;
     1484
     1485            case FINDDLL_LIBPATH:
     1486                pszPath = *pLdrLibPath;
     1487                break;
     1488
     1489            case FINDDLL_ENDLIBPATH:
     1490                pszPath = ptda_GetEndLibpath()...  ;
     1491                if (pszPath == NULL)
     1492                    continue;
     1493                break;
     1494            #endif
     1495            default: /* !internalerror! */
     1496                printIPE(("Pe2Lx::openPath(%.*s,..): iPath is %d which is invalid.\n", cchFilename, pachFilename, iPath));
     1497                rfree(pVars);
     1498                return ERROR_FILE_NOT_FOUND;
     1499        }
     1500
     1501
     1502        /** @sketch
     1503         * pszPath is now set to the pathlist to be searched.
     1504         * So we'll loop thru all the paths in the list.
     1505         */
     1506        while (pszPath != NULL && *pszPath != '\0')
     1507        {
     1508            char *  pszNext;            /* Pointer to the next pathlist path */
     1509            int     cch;                /* Length of path (including the slash after the slash is added). */
     1510
     1511            /** @sketch
     1512             * Find the end of the path and set pszNext.
     1513             * Uncount any trailing slash.
     1514             * Check that the filename fits within the buffer (and OS/2 filelength limits).
     1515             */
     1516            pszNext = strchr(pszPath, ';');
     1517            if (pszNext != NULL)
     1518            {
     1519                cch = pszNext - pszPath;
     1520                pszNext++;
     1521            }
     1522            else
     1523                cch = strlen(pszPath);
     1524
     1525            if (pszPath[cch - 1] == '\\' || pszPath[cch-1] == '/')
     1526                cch--;
     1527
     1528            if (cch == 0 || cch + cchFilename + 2 + cchExt > sizeof(pVars->sz)) /* assertion */
     1529            {
     1530                printErr(("Pe2Lx::openPath(%.*s,..): cch (%d) + cchFilename (%d) + 2 + cchExt (%d) > sizeof(pVars->sz) (%d) - path's too long!, iPath=%d",
     1531                          cchFilename, pachFilename, cch, cchExt, cchFilename, sizeof(pVars->sz), iPath));
     1532
     1533                pszPath = pszNext;
     1534                continue;
     1535            }
     1536
     1537
     1538            /** @sketch
     1539             * Copy the path into the pVars->sz buffer.
     1540             * Add a '\\' and the filename (pszFullname) to the path;
     1541             * then we'll have a fullpath.
     1542             */
     1543            memcpy(pVars->sz, pszPath, cch);
     1544            pVars->sz[cch++] = '\\';
     1545            memcpy(&pVars->sz[cch], pachFilename, (size_t)cchFilename);
     1546            if (cchExt != 0)
     1547                memcpy(&pVars->sz[cch + cchFilename], ".DLL", 5);
     1548            else
     1549                pVars->sz[cch + cchFilename] = '\0';
     1550
     1551
     1552            /** @sketch
     1553             * Try open the file using myLdrOpen.
     1554             * Return if successfully opened or if fatal error.
     1555             */
     1556            rc = myldrOpen(&pLdrLv->lv_sfn, pVars->sz, pful);
     1557            switch (rc)
     1558            {
     1559                /* these errors are ignored (not fatal) */
     1560                case ERROR_FILE_NOT_FOUND:          case ERROR_PATH_NOT_FOUND:          case ERROR_ACCESS_DENIED:           case ERROR_INVALID_ACCESS:
     1561                case ERROR_INVALID_DRIVE:           case ERROR_NOT_DOS_DISK:            case ERROR_REM_NOT_LIST:            case ERROR_BAD_NETPATH:
     1562                case ERROR_NETWORK_BUSY:            case ERROR_DEV_NOT_EXIST:           case ERROR_TOO_MANY_CMDS:           case ERROR_ADAP_HDW_ERR:
     1563                case ERROR_UNEXP_NET_ERR:           case ERROR_BAD_REM_ADAP:            case ERROR_NETNAME_DELETED:         case ERROR_BAD_DEV_TYPE:
     1564                case ERROR_NETWORK_ACCESS_DENIED:   case ERROR_BAD_NET_NAME:            case ERROR_TOO_MANY_SESS:           case ERROR_REQ_NOT_ACCEP:
     1565                case ERROR_INVALID_PASSWORD:        case ERROR_OPEN_FAILED:             case ERROR_INVALID_NAME:            case ERROR_FILENAME_EXCED_RANGE:
     1566                case ERROR_VC_DISCONNECTED:
     1567                    rc = ERROR_FILE_NOT_FOUND;
     1568                    pszPath = pszNext;
     1569                    break;
     1570
     1571                /* all errors and success is let out here */
     1572                case NO_ERROR:
     1573                default:
     1574                    rfree(pVars);
     1575                    return rc;
     1576            }
     1577
     1578            /** @sketch
     1579             * Advance to the next path part
     1580             */
     1581            pszPath = pszNext;
     1582        }
     1583    } /* for iPath */
     1584
     1585
     1586    /*
     1587     * Cleanup: free local variables.
     1588     * Since we haven't found the file yet we'll return thru ldrOpenPath.
     1589     */
     1590    rfree(pVars);
     1591    return ldrOpenPath(pachFilename, (USHORT)cchFilename, pLdrLv, pful);
     1592
     1593    #else
     1594    NOREF(pachFilename);
     1595    NOREF(cchFilename);
     1596    NOREF(pLdrLv);
     1597    NOREF(pful);
     1598    NOREF(fOdin32PathValid);
     1599    return ERROR_NOT_SUPPORTED;
     1600    #endif
     1601}
     1602
     1603
    12831604#ifndef RING0
    12841605/**
     
    13131634    }
    13141635
    1315     rc = readAtRVA(0x00000000, &achPage[0], PAGESIZE);
    1316     if (rc != NO_ERROR)
    1317     {
    1318         printErr(("readAtRVA failed with rc=%d\n"));
    1319         return rc;
    1320     }
    1321     rc = applyFixups(&mte, 0, ~0UL, &achPage[0], 0x125D0000, NULL);
    1322 
    1323     rc = readAtRVA(0x00001000, &achPage[0], PAGESIZE);
    1324     if (rc != NO_ERROR)
    1325     {
    1326         printErr(("readAtRVA failed with rc=%d\n"));
    1327         return rc;
    1328     }
    1329     rc = applyFixups(&mte, 1, 1, &achPage[0], 0x125E0000, NULL);
     1636    /*
     1637     * Test load and apply all (internal) fixups.
     1638     */
     1639    for (i = 0; i < cObjects; i++)
     1640    {
     1641        ULONG ulAddress = smte.smte_objtab[i].ote_base;
     1642        ULONG ulRVA = paObjects[i].ulRVA;
     1643        LONG  cbObject = paObjects[i].cbVirtual;
     1644        for (i=i; cbObject > 0; cbObject -= PAGESIZE, ulAddress += PAGESIZE, ulRVA += PAGESIZE)
     1645        {
     1646            rc = readAtRVA(ulRVA, &achPage[0], PAGESIZE);
     1647            if (rc != NO_ERROR)
     1648            {
     1649                printErr(("readAtRVA failed with rc=%d\n"));
     1650                return rc;
     1651            }
     1652            rc = applyFixups(&mte, 1, 1, &achPage[0], ulAddress, NULL);
     1653            if (rc != NO_ERROR)
     1654            {
     1655                printErr(("applyFixups failed with rc=%d\n"));
     1656                return rc;
     1657            }
     1658        }
     1659    }
    13301660
    13311661    return rc;
     
    13811711        {
    13821712            ULONG cbToRead = min(cbLXFile, sizeof(achReadBuffer));
    1383             rc = read(offLXFile, &achReadBuffer[0], cbToRead, 0UL, NULL);
     1713            rc = read(offLXFile, &achReadBuffer[0], 0UL, cbToRead, NULL);
    13841714            if (rc != NO_ERROR)
    13851715            {
     
    14111741}
    14121742#endif
     1743
     1744
     1745/**
     1746 * Is this module an executable?
     1747 * @returns   TRUE if executable.
     1748 *            FALSE if not an executable.
     1749 * @sketch
     1750 * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     1751 */
     1752BOOL    Pe2Lx::isExe()
     1753{
     1754    return ((this->LXHdr.e32_mflags & E32MODMASK) == E32MODEXE);
     1755}
     1756
     1757
     1758/**
     1759 * Is this module an dynamic link library.
     1760 * @returns   TRUE if dynamic link library.
     1761 *            FALSE if not a dynamic link library.
     1762 * @sketch
     1763 * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     1764 */
     1765BOOL    Pe2Lx::isDll()
     1766{
     1767    return ((this->LXHdr.e32_mflags & E32MODMASK) == E32MODDLL);
     1768}
     1769
     1770
     1771/**
     1772 * Invalidates the odin32path.
     1773 * Called by ldrClose when the kernel32 handle is closed.
     1774 * @sketch      Free path
     1775 *              nullify path pointer and kernel32 handle.
     1776 * @author      knut st. osmundsen (knut.stange.osmundsen@mynd.no)
     1777 */
     1778VOID Pe2Lx::invalidateOdin32Path()
     1779{
     1780    if (pszOdin32Path != NULL)
     1781    {
     1782        rfree((void*)pszOdin32Path);
     1783        pszOdin32Path = NULL;
     1784    }
     1785    sfnKernel32 = NULLHANDLE;
     1786}
    14131787
    14141788
     
    27553129            {
    27563130                PIMAGE_BASE_RELOCATION pbrCur = pBaseRelocs;
    2757                 while ((void*)pbrCur < (void*)((unsigned)pBaseRelocs + cbBaseRelocs))
     3131                while ((void*)pbrCur < (void*)((unsigned)pBaseRelocs + cbBaseRelocs)
     3132                       && pbrCur->SizeOfBlock >= 8)
    27583133                {
    27593134                    if ((unsigned)pbrCur->SizeOfBlock + (unsigned)pbrCur > (unsigned)pBaseRelocs + cbBaseRelocs)
     
    43324707
    43334708
     4709
     4710/**
     4711 * Initiates the odin32path.
     4712 * @returns     Success indicator.
     4713 * @sketch      If allready inited ok Then do nothing return TRUE.
     4714 *
     4715 *              Check if KERNEL32 is loaded using ldrFindModule.
     4716 *              If loaded then set path according to the smte_path and return.
     4717 *
     4718 *              If the path is set to something then return TRUE. (ie. the following method is allready applied.)
     4719 *
     4720 *              Use odinPath2 to locate the KERNEL32 module in the LIBPATHs. The
     4721 *                win32k loaders are temporarily disabled. Path is returned in
     4722 *                the ldrpFileNameBuf buffer.
     4723 *              If found the Then set path according to ldrpFileNameBuf and return
     4724 *
     4725 *              Fail returning FALSE.
     4726 * @status
     4727 * @author      knut st. osmundsen (knut.stange.osmundsen@mynd.no)
     4728 * @remark
     4729 */
     4730BOOL Pe2Lx::initOdin32Path()
     4731{
     4732    #ifdef RING0
     4733    APIRET rc;
     4734    PMTE   pMTE;
     4735
     4736
     4737    if (sfnKernel32 != NULLHANDLE)
     4738        return TRUE;
     4739
     4740    /*
     4741     * Try find it using ldrFindModule.
     4742     */
     4743    pMTE = NULL;
     4744    rc = ldrFindModule("KERNEL32", 8, CLASS_GLOBAL, (PPMTE)SSToDS(&pMTE));
     4745    if (rc == NO_ERROR && pMTE != NULL && pMTE->mte_swapmte != NULL)
     4746    {
     4747        /*
     4748         * We now take the smte_path. Start at the end and skip the filename,
     4749         * and one directory up. We assume a fully qualified path is found in
     4750         * smte_path.
     4751         */
     4752        if (pMTE->mte_swapmte->smte_path != NULL)//paranoia
     4753        {
     4754            sfnKernel32 = pMTE->mte_sfn;
     4755            return setOdin32Path(pMTE->mte_swapmte->smte_path);
     4756        }
     4757    }
     4758
     4759
     4760    /*
     4761     * KERNEL32 isn't loaded. We'll only search the paths if
     4762     */
     4763    if (pszOdin32Path != NULL)
     4764        return TRUE;
     4765
     4766
     4767    /*
     4768     * Try find it searching the LIBPATHs.
     4769     *
     4770     * For the time being:
     4771     *  We'll use odinPath2 to do this, but we'll have to
     4772     *  disable the win32k.sys overloading temporarily.
     4773     */
     4774    ldrlv_t lv = {0};
     4775    ULONG   ful = 0;
     4776    ULONG   ul;
     4777
     4778    ul = options.fNoLoader;
     4779    options.fNoLoader = TRUE;
     4780    lv.lv_class = CLASS_GLOBAL;
     4781    rc = openPath2("KERNEL32", 8, (ldrlv_t*)SSToDS(&lv), (PULONG)SSToDS(&ful), FALSE);
     4782    options.fNoLoader = ul;
     4783    if (rc == NO_ERROR)
     4784    {
     4785        /*
     4786         * Set the odin32path according to the kernel32 path we've found.
     4787         * (ldrOpen sets ldrpFileNameBuf to the fully qualified path of
     4788         *  the last opended filed, which in this case is kernel32.dll.)
     4789         * We'll close the file handle first of course.
     4790         */
     4791        rc = setOdin32Path(ldrpFileNameBuf);
     4792        ldrClose(lv.lv_sfn);
     4793        return rc;
     4794    }
     4795
     4796    #endif
     4797    return FALSE;
     4798}
     4799
     4800
     4801
     4802/**
     4803 * Sets the Odin32Path to the given fully qualified filename of kernel32.
     4804 * @returns     Success indicator.
     4805 * @param       psz     Fully qualified filename of kernel32 with path.
     4806 * @sketch
     4807 * @status
     4808 * @author      knut st. osmundsen (knut.stange.osmundsen@mynd.no)
     4809 * @remark
     4810 */
     4811BOOL Pe2Lx::setOdin32Path(const char *psz)
     4812{
     4813    const char * psz2;
     4814
     4815    /*
     4816     * We now take the psz. Start at the end and skip the filename,
     4817     * and one directory up. We assume a fully qualified path.
     4818     */
     4819    psz2 = psz + strlen(psz) - 1;
     4820    while (psz2 > psz && *psz2 != '\\' && *psz2 != '/' && *psz2 != ':')
     4821        psz2--;
     4822    psz2--;
     4823    while (psz2 > psz && *psz2 != '\\' && *psz2 != '/' && *psz2 != ':')
     4824        psz2--;
     4825    if (psz2 > psz)
     4826    {
     4827        char *pszPath;
     4828        /*
     4829         * Free old path (if any) and allocate space for a new path.
     4830         * Copy the path including the slash.
     4831         * Remember the kernel32 filehandle (to be able to invalidate the path).
     4832         */
     4833        if (pszOdin32Path)
     4834            rfree((void*)pszOdin32Path);
     4835        if (*psz2 == ':') //in case someone installed odin in a root directory.
     4836            psz2++;
     4837        psz2++;       //include the slash
     4838        cchOdin32Path = psz2 - psz;
     4839        pszPath = (char*)rmalloc((size_t)cchOdin32Path);
     4840        if (pszPath == NULL) return FALSE;
     4841        memcpy(pszPath, psz, (size_t)cchOdin32Path);
     4842        pszPath[cchOdin32Path] = '\0';
     4843        pszOdin32Path = pszPath;
     4844
     4845        return TRUE;
     4846    }
     4847
     4848    return FALSE;
     4849}
     4850
     4851
     4852
     4853
    43344854/**
    43354855 * Static method which dumps a set of nt headers.
  • trunk/src/win32k/test/dos.c

    r3829 r4164  
    1 /* $Id: dos.c,v 1.1 2000-07-16 22:18:14 bird Exp $
     1/* $Id: dos.c,v 1.2 2000-09-02 21:08:20 bird Exp $
    22 *
    33 * Thunkers for OS/2 APIs.
     
    2222*******************************************************************************/
    2323#include <os2.h>
     24
     25#include "devSegDf.h"                   /* Win32k segment definitions. */
    2426
    2527#include "test.h"
  • trunk/src/win32k/test/fake.c

    r3829 r4164  
    1 /* $Id: fake.c,v 1.1 2000-07-16 22:18:14 bird Exp $
     1/* $Id: fake.c,v 1.2 2000-09-02 21:08:20 bird Exp $
    22 *
    33 * Fake stubs for the ldr and kernel functions we imports or overloads.
     
    2929#include <string.h>
    3030
     31#include "devSegDf.h"                   /* Win32k segment definitions. */
     32
    3133#include "log.h"
    3234#include "OS2Krnl.h"
     
    6062 * Pointer to the loader semaphore.
    6163 */
    62 static LONG     lfakeLDRSem = 0;        /* Used as a counter. */
    63 HKMTX           fakeLDRSem = (HKMTX)&lfakeLDRSem;
     64KSEMMTX         fakeLDRSem;
     65
     66CHAR            szBeginLibPath[1024];
     67CHAR            szEndLibPath[1024];
     68CHAR            szLibPath[1024];
     69PSZ             fakeLDRLibPath = &szLibPath[0];
     70
     71CHAR            szldrpFileNameBuf[CCHMAXPATH];
     72PSZ             fakeldrpFileNameBuf = &szldrpFileNameBuf[0];
    6473
    6574static CHAR     achHeaderBuffer[256];   /* Buffer to read exe header into. */
    6675PVOID           pheaderbuf = &achHeaderBuffer[0];
     76
    6777
    6878/*
     
    112122VOID  LDRCALL   fakeldrUCaseString(PCHAR pachString, USHORT cchString);
    113123ULONG LDRCALL   fakeldrMTEValidatePtrs(PSMTE psmte, ULONG ulMaxAddr, ULONG off);
     124unsigned short  getSlot(void);
     125
     126
     127
     128/**
     129 * Initiate workers (imported kernel functions / vars)
     130 * @status    partially implemented.
     131 * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     132 */
     133void  workersinit(void)
     134{
     135    APIRET rc;
     136
     137    /*
     138     * Make code writable.
     139     */
     140    DosSetMem(&CODE16START, &CODE16END - &CODE16START, PAG_WRITE | PAG_READ);
     141    DosSetMem(&CODE32START, &CODE32END - &CODE32START, PAG_WRITE | PAG_READ);
     142
     143    /*
     144     * Loader semaphore
     145     */
     146    fakeKSEMInit((PKSEM)(void*)&fakeLDRSem, KSEM_MUTEX, KSEM_DEFAULT);
     147
     148    /*
     149     * Intra process semaphore.
     150     */
     151    fakeKSEMInit((PKSEM)(void*)&fakeptda_ptdasem, KSEM_MUTEX, KSEM_DEFAULT);
     152
     153    /*
     154     * LIBPaths
     155     */
     156    rc = DosQueryExtLIBPATH(szBeginLibPath, BEGIN_LIBPATH);
     157    rc = DosQueryHeaderInfo(NULLHANDLE, 0, szLibPath, sizeof(szLibPath), QHINF_LIBPATH);
     158    rc = DosQueryExtLIBPATH(szEndLibPath, END_LIBPATH);
     159
     160    rc = rc;
     161}
    114162
    115163
     
    169217        if (pfl != NULL)
    170218            *pfl = 0;
     219        rc = DosQueryPathInfo(pszFilename, FIL_QUERYFULLNAME, fakeldrpFileNameBuf, CCHMAXPATH);
     220        rc = NO_ERROR;
    171221    }
    172222
     
    712762ULONG LDRCALL fakeLDRClearSem(void)
    713763{
    714     if (lfakeLDRSem == 0)
    715         kprintf(("fakeLDRClearSem: lfakeLDRSem is 0 allready\n"));
    716     else
    717         lfakeLDRSem--;
    718 
    719     printf("fakeLDRClearSem:                usage count = %d, rc = %d\n", lfakeLDRSem, NO_ERROR);
    720 
    721     return NO_ERROR;
     764    return fakeKSEMReleaseMutex(&fakeLDRSem);
    722765}
    723766
     
    730773 * @remark
    731774 */
    732 ULONG KRNLCALL fakeKSEMRequestMutex(HKMTX hkmtx, ULONG ulTimeout)
    733 {
    734     (*(PLONG)hkmtx)++;
    735 
    736     printf("fakeKSEMRequestMutex:           hkmtx = %p, ulTimeout = 0x%x, usage count = %d, rc = %d\n",
    737            hkmtx, ulTimeout, *(PLONG)hkmtx, NO_ERROR);
    738 
    739     return NO_ERROR;
     775ULONG KRNLCALL fakeKSEMRequestMutex(HKSEMMTX hkmtx, ULONG ulTimeout)
     776{
     777    unsigned short usSlot = getSlot();
     778    ULONG          rc = NO_ERROR;
     779
     780    if (memcmp(&hkmtx->debug.ksem_achSignature[0], "KSEM", 4) != 0)
     781    {
     782        printf("fakeKSEMQueryMutex:             hkmtx = %p, invalid signature (%.4s)\n", hkmtx, hkmtx->debug.ksem_achSignature);
     783        return FALSE;
     784    }
     785
     786    if (hkmtx->debug.ksem_Owner == 0)
     787    {
     788        hkmtx->debug.ksem_Owner = usSlot;
     789        hkmtx->debug.ksem_cusNest = 1;
     790    }
     791    else if (hkmtx->debug.ksem_Owner == usSlot)
     792        hkmtx->debug.ksem_cusNest++;
     793    else
     794        rc = ERROR_SEM_BUSY;
     795
     796    printf("fakeKSEMRequestMutex:           hkmtx = %p, ulTimeout = 0x%x, owner = %d, usage count = %d, rc = %d\n",
     797           hkmtx, ulTimeout, hkmtx->debug.ksem_cusNest, hkmtx->debug.ksem_Owner, ERROR_SEM_BUSY);
     798
     799    return rc;
     800}
     801
     802
     803/**
     804 * KSEMReleaseMutex faker.
     805 * @returns   NO_ERROR
     806 * @param     hkmtx
     807 * @param     ulTimeout
     808 * @status    completely implemented.
     809 * @remark
     810 */
     811ULONG KRNLCALL fakeKSEMReleaseMutex(HKSEMMTX hkmtx)
     812{
     813    unsigned int    usSlot = getSlot();
     814    int rc = NO_ERROR;
     815
     816    if (memcmp(&hkmtx->debug.ksem_achSignature[0], "KSEM", 4) != 0)
     817    {
     818        printf("fakeKSEMQueryMutex:             hkmtx = %p, invalid signature (%.4s)\n", hkmtx, hkmtx->debug.ksem_achSignature);
     819        return FALSE;
     820    }
     821
     822    if (hkmtx->debug.ksem_Owner == usSlot)
     823    {
     824        if (--hkmtx->debug.ksem_cusNest == 0)
     825            hkmtx->debug.ksem_Owner = 0;
     826    }
     827    else
     828        rc = ERROR_NOT_OWNER;
     829
     830    printf("fakeKSEMReleaseMutex:           hkmtx = %p, usage count = %d, owner = %d, rc = %d\n",
     831           hkmtx, hkmtx->debug.ksem_cusNest, hkmtx->debug.ksem_Owner, rc);
     832
     833    return rc;
     834}
     835
     836
     837
     838/**
     839 * KSEMQueryMutex faker.
     840 * @returns     TRUE if owner or clear. Clear if *pcusNest is 0.
     841 *              FALSE if other owner.
     842 * @param       hkmtx       Handle to kernel mutex.
     843 * @param       pcusNest    Pointer to variable which is to receive the nesting count.
     844 *                          (ie. the number of times we have taken this semaphore.)
     845 * @status      completely implemented.
     846 * @author      knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     847 */
     848BOOL KRNLCALL  fakeKSEMQueryMutex(HKSEMMTX hkmtx, PUSHORT pcusNest)
     849{
     850    unsigned int    usSlot = getSlot();
     851    BOOL            fRc = TRUE;
     852
     853    if (memcmp(&hkmtx->debug.ksem_achSignature[0], "KSEM", 4) != 0)
     854    {
     855        printf("fakeKSEMQueryMutex:             hkmtx = %p, invalid signature (%.4s)\n", hkmtx, hkmtx->debug.ksem_achSignature);
     856        return FALSE;
     857    }
     858
     859    if (hkmtx->debug.ksem_Owner == 0)
     860    {
     861        if (pcusNest)
     862            *pcusNest = 0;
     863        fRc = FALSE;
     864    }
     865    else
     866    {
     867        fRc = (hkmtx->debug.ksem_Owner == usSlot);
     868        if (pcusNest)
     869            *pcusNest = hkmtx->debug.ksem_cusNest;
     870    }
     871
     872    printf("fakeKSEMQueryMutex:             hkmtx = %p, usage count = %d, owner = %d, *pcusNest = %d, rc = %d\n",
     873           hkmtx, hkmtx->debug.ksem_cusNest, hkmtx->debug.ksem_Owner, pcusNest ? *pcusNest : -1, fRc);
     874
     875    return fRc;
     876}
     877
     878
     879/**
     880 * KSEMInit faker.
     881 * @param       pksem       Pointer to the semaphore struct to initiate.
     882 * @param       fulType     Semaphore type. (only KSEM_MUTEX is supported)
     883 * @param       fulFlags    Semaphore flags. (not validated)
     884 * @status      partially implemented.
     885 * @author      knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     886 */
     887VOID  KRNLCALL  fakeKSEMInit(PKSEM pksem, ULONG fulType, ULONG fulFlags)
     888{
     889    if (fulType != KSEM_MUTEX)
     890    {
     891        printf("fakeKSEMInit:                   Invalid fulType parameter (%d).\n", fulType);
     892        return; /*ERROR_INVALID_PARAMETER;*/
     893    }
     894
     895    memcpy(pksem->mtx.debug.ksem_achSignature, "KSEM", 4);
     896    pksem->mtx.debug.ksem_bFlags = (char)fulFlags;
     897    pksem->mtx.debug.ksem_bType = KSEM_MUTEX;
     898    pksem->mtx.debug.ksem_cusNest = 0;
     899    pksem->mtx.debug.ksem_cusPendingWriters = 0;
     900    pksem->mtx.debug.ksem_Owner = 0;
     901
     902    printf("fakeKSEMInit:                   pksem=%p, fulType=%d, fulFlags=0x%x.\n", pksem, fulType, fulFlags);
     903}
     904
     905
     906/**
     907 * Gets the thread slot number.
     908 * @returns     Thread slot number.
     909 * @status      completely implemented.
     910 * @author      knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     911 */
     912unsigned short getSlot(void)
     913{
     914    PPIB ppib;
     915    PTIB ptib;
     916    BOOL            f32Stack = ((int)&ppib > 0x10000);
     917
     918    if (!f32Stack) ThunkStack16To32();
     919
     920    DosGetInfoBlocks(&ptib, &ppib);
     921
     922    if (!f32Stack) ThunkStack32To16();
     923
     924    return (unsigned short)ptib->tib_ordinal;
    740925}
    741926
     
    8631048
    8641049    printf("tkExecPgmWorker:                execFlag = %d, pArg = %p, pEnv = %p, pszFilename = %s\n", execFlag, pArg, pEnv, pszFilename);
     1050
     1051    /*
     1052     * Take loader semaphore.
     1053     */
     1054    rc = KSEMRequestMutex(&fakeLDRSem, KSEM_INDEFINITE_WAIT);
     1055    if (rc != NO_ERROR)
     1056    {
     1057        return rc;
     1058    }
    8651059
    8661060    /*
     
    14791673         i++, psz += 1 + *psz)
    14801674    {
    1481         if (!memcmp(psz+1, "DOSCALLS", *psz))
     1675        if (*psz == 8 && !strnicmp(psz+1, "DOSCALLS", 8))
    14821676            continue;
    14831677
     
    15631757}
    15641758
     1759
     1760PMTE KRNLCALL fakeldrASMpMTEFromHandle(HMTE  hMTE)
     1761{
     1762    PMTE pMte = (PMTE)hMTE;
     1763
     1764    pMte += 10; //just do something!
     1765
     1766    return NULL;
     1767}
     1768
     1769ULONG LDRCALL   fakeldrFindModule(PCHAR pachFilename, USHORT cchFilename, USHORT usClass, PPMTE ppMTE)
     1770{
     1771    APIRET rc = NO_ERROR;
     1772    usClass = usClass;
     1773    cchFilename = cchFilename;
     1774    pachFilename = pachFilename;
     1775    *ppMTE = NULL;
     1776    return rc;
     1777}
     1778
     1779
     1780/**
     1781 * Gets the path (name with fully qualified path) from a SFN.
     1782 * @returns     Pointer to the path of hFile.
     1783 * @param       hFile   SFN filehandle.
     1784 */
     1785PSZ SECCALL fakeSecPathFromSFN(SFN hFile)
     1786{
     1787    APIRET  rc;
     1788    BOOL    f32Stack = ((int)&hFile > 0x10000);
     1789
     1790    if (!f32Stack) ThunkStack16To32();
     1791
     1792    rc = ERROR_NOT_SUPPORTED;
     1793
     1794    if (!f32Stack) ThunkStack32To16();
     1795
     1796    printf("fakeSecPathFromSFN:                    - not implemented - hFile = 0x%04x, rc = %d\n", hFile, rc);
     1797
     1798    return rc;
     1799}
     1800
  • trunk/src/win32k/test/fakea.asm

    r3829 r4164  
    1 ; $Id: fakea.asm,v 1.1 2000-07-16 22:18:15 bird Exp $
     1; $Id: fakea.asm,v 1.2 2000-09-02 21:08:21 bird Exp $
    22;
    33; Fake assembly imports.
     
    3030    public fakeptda_start
    3131    public fakeptda_environ
     32    public fakeptda_module
     33    public fakeptda_ptdasem
     34    public fakeptda_pBeginLIBPATH
    3235    public fakef_FuStrLenZ
    3336    public fakef_FuStrLen
    3437    public fakef_FuBuff
    3538    public fakeg_tkExecPgm
     39    public fake_tkStartProcess
    3640    public CalltkExecPgm
    3741
    3842
    3943;
    40 ;   Imported Functions
     44;   Imported Functions and Variables.
    4145;
    4246    extrn tkExecPgmWorker:PROC          ; fake.c
    43 
     47    extrn _fakeLDRClearSem@0:PROC       ; fake.c
     48    extrn _fakeKSEMRequestMutex@8:PROC  ; fake.c
     49    extrn fakeLDRSem:BYTE               ; fake.c
    4450
    4551DATA16 SEGMENT
     
    5662fakeptda_dummy              db  123 dup (0)
    5763fakeptda_environ            dw      1   ; 1 is the hardcoded HOB of the win32ktst.exe's environment.
     64fakeptda_ptdasem            db  20  dup (0) ; PTDA semaphore - Intra-Process serialisation mutex KSEM (sg244640).
     65fakeptda_module             dw      1   ; 1 is the hardcoded HMTE of the current executable module.
     66fakeptda_pBeginLIBPATH      dd      0   ; BEGINLIBPATH not implemented.
     67                            dd      0   ; ENDLIBPATH not implemented.
    5868
    5969
     
    249259
    250260CODE32 SEGMENT
     261;;
     262; Faker of which simply clears the loader semaphore.
     263; @cproto    none! (void _Optlink   fake_tkStartProcess(void))
     264; @returns
     265; @param
     266; @uses
     267; @equiv
     268; @time
     269; @sketch
     270; @status
     271; @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     272; @remark
     273fake_tkStartProcess PROC NEAR
     274    push    ebp
     275    mov     ebp, esp
     276
     277    push    ebx
     278    push    ecx
     279
     280    call    _fakeLDRClearSem@0
     281
     282    pop     ecx
     283    pop     ebx
     284
     285    xor     eax, eax
     286    leave
     287    ret
     288fake_tkStartProcess ENDP
     289
     290
    251291;;
    252292; Fake g_tkExecPgm implementation.
     
    270310
    271311    ;
    272     ; We just have to make some common code...
     312    ; Call C worker
    273313    ;
    274314    sub     esp, 10h
     
    302342                                        ;     ebp+8, ebp+c, ebp+10, ebp+14
    303343                                        ;     esp+0, esp+4, esp+08, esp+0c
    304 
     344    or      eax, eax
     345    jnz     ftkep_ret
     346    call    fake_tkStartProcess         ; If succesfully so far. call start process.
     347    jmp     ftkep_ret2                  ; <Currently no parameters are implemented.>
     348
     349ftkep_ret:
     350    push    eax
     351    call    _fakeLDRClearSem@0          ; clear the semaphore.
     352    pop     eax
     353
     354ftkep_ret2:
    305355    leave
    306356    ret
  • trunk/src/win32k/test/win32ktst.c

    r3829 r4164  
    1 /* $Id: win32ktst.c,v 1.1 2000-07-16 22:18:16 bird Exp $
     1/* $Id: win32ktst.c,v 1.2 2000-09-02 21:08:21 bird Exp $
    22 *
    33 * Win32k test module.
     
    2626    (PVOID)( ( (((unsigned)(flataddr) << 3) & 0xfff80000) | (SEL_LDT_RPL3 << 16) ) | ((unsigned)(flataddr) & 0xffff) )
    2727
     28#define DWORD   ULONG
     29#define WORD    USHORT
     30
    2831/*******************************************************************************
    2932*   Internal Functions                                                         *
    3033*******************************************************************************/
    3134#include <os2.h>
     35#include <exe386.h>
     36
     37#include "devSegDf.h"                   /* Win32k segment definitions. */
    3238
    3339#include "malloc.h"
     
    4248#include "devcmd.h"
    4349#include "os2krnl.h"
     50#include "avl.h"
     51#include "ldr.h"
    4452#include "ldrCalls.h"
    4553#include "test.h"
     
    4755#include "macros.h"
    4856#include "log.h"
     57
     58
     59
    4960
    5061
     
    133144
    134145/*******************************************************************************
     146*   Structures and Typedefs                                                    *
     147*******************************************************************************/
     148#ifndef QS_MTE
     149   /* From OS/2 Toolkit v4.5 (BSEDOS.H) */
     150
     151   /* Global Record structure
     152    * Holds all global system information. Placed first in user buffer
     153    */
     154   typedef struct qsGrec_s {  /* qsGrec */
     155           ULONG         cThrds;
     156           ULONG         c32SSem;
     157           ULONG         cMFTNodes;
     158   }qsGrec_t;
     159
     160   /*
     161    *      System wide MTE information
     162    *      ________________________________
     163    *      |       pNextRec                |----|
     164    *      |-------------------------------|    |
     165    *      |       hmte                    |    |
     166    *      |-------------------------------|    |
     167    *      |       ctImpMod                |    |
     168    *      |-------------------------------|    |
     169    *      |       ctObj                   |    |
     170    *      |-------------------------------|    |
     171    *      |       pObjInfo                |----|----------|
     172    *      |-------------------------------|    |          |
     173    *      |       pName                   |----|----|     |
     174    *      |-------------------------------|    |    |     |
     175    *      |       imported module handles |    |    |     |
     176    *      |          .                    |    |    |     |
     177    *      |          .                    |    |    |     |
     178    *      |          .                    |    |    |     |
     179    *      |-------------------------------| <--|----|     |
     180    *      |       "pathname"              |    |          |
     181    *      |-------------------------------| <--|----------|
     182    *      |       Object records          |    |
     183    *      |       (if requested)          |    |
     184    *      |_______________________________|    |
     185    *                                      <-----
     186    *      NOTE that if the level bit is set to QS_MTE, the base Lib record will be followed
     187    *      by a series of object records (qsLObj_t); one for each object of the
     188    *      module.
     189    */
     190
     191   typedef struct qsLObjrec_s {  /* qsLOrec */
     192           ULONG         oaddr;  /* object address */
     193           ULONG         osize;  /* object size */
     194           ULONG         oflags; /* object flags */
     195   } qsLObjrec_t;
     196
     197   typedef struct qsLrec_s {     /* qsLrec */
     198           void  FAR        *pNextRec;      /* pointer to next record in buffer */
     199           USHORT           hmte;           /* handle for this mte */
     200           USHORT           fFlat;          /* true if 32 bit module */
     201           ULONG            ctImpMod;       /* # of imported modules in table */
     202           ULONG            ctObj;          /* # of objects in module (mte_objcnt)*/
     203           qsLObjrec_t FAR  *pObjInfo;      /* pointer to per object info if any */
     204           UCHAR     FAR    *pName;         /* -> name string following struc */
     205   } qsLrec_t;
     206
     207
     208
     209   /* Pointer Record Structure
     210    *      This structure is the first in the user buffer.
     211    *      It contains pointers to heads of record types that are loaded
     212    *      into the buffer.
     213    */
     214
     215   typedef struct qsPtrRec_s {   /* qsPRec */
     216           qsGrec_t        *pGlobalRec;
     217           void            *pProcRec;      /* ptr to head of process records */
     218           void            *p16SemRec;     /* ptr to head of 16 bit sem recds */
     219           void            *p32SemRec;     /* ptr to head of 32 bit sem recds */
     220           void            *pMemRec;       /* ptr to head of shared mem recs */
     221           qsLrec_t        *pLibRec;       /* ptr to head of mte records */
     222           void            *pShrMemRec;    /* ptr to head of shared mem records */
     223           void            *pFSRec;        /* ptr to head of file sys records */
     224   } qsPtrRec_t;
     225
     226#endif
     227
     228
     229/*******************************************************************************
     230*   Global Variables                                                           *
     231*******************************************************************************/
     232extern BOOL     fInited;                /* malloc.c */
     233int             cObjectsFake = 14;
     234OTE             aKrnlOTE[24];
     235
     236
     237/*******************************************************************************
     238*   External Functions                                                         *
     239*******************************************************************************/
     240#ifndef QS_MTE
     241   /* from OS/2 Toolkit v4.5 */
     242
     243   APIRET APIENTRY DosQuerySysState(ULONG EntityList, ULONG EntityLevel, PID pid,
     244                                    TID tid, PVOID pDataBuf, ULONG cbBuf);
     245    #define QS_MTE         0x0004
     246#endif
     247
     248
     249/*******************************************************************************
    135250*   Internal Functions                                                         *
    136251*******************************************************************************/
    137252void    syntax(void);
     253int     kernelInit(int iTest, int argc, char **argv);
    138254void    workersinit(void);
    139255void    initRPInit(RP32INIT *pRpInit, char *pszInitArgs);
    140256int     tests(int iTest, int argc, char **argv);
    141 int     TestCase1(void);
     257int     TestCase1(int argc, char **argv);
    142258int     TestCase2(void);
    143259int     TestCase3(void);
    144260int     TestCase4(void);
    145261int     TestCase5(void);
     262int     TestCase6(void);
    146263int     CompareOptions(struct options *pOpt);
    147 int     TestCaseExeLoad1(void);
    148 
    149 
    150 /*******************************************************************************
    151 *   Global Variables                                                           *
    152 *******************************************************************************/
    153 extern BOOL     fInited;                /* malloc.c */
    154 const char *    pszInternalRevision = "\r\nInternal revision 14.040_W4";
    155 int             cObjectsFake = 14;
    156 
     264int     TestCaseExeLoad2(void);
    157265
    158266
     
    186294    workersinit();
    187295
     296    /*
     297     * Init Kernel
     298     */
     299    if (!kernelInit(iTest, argc, argv))
     300        return -2;
    188301
    189302    /*
     
    219332{
    220333    printf(
    221         "Win32kTst.exe v%d.%d.%d - Ring 3 testing of win32k.sys\n"
    222         "syntax: Win32kTst.exe <testcase number> [optional arguments]\n",
    223         0,0,4
     334           "Win32kTst.exe v%d.%d.%d - Ring 3 testing of win32k.sys\n"
     335           "syntax: Win32kTst.exe <testcase number> [optional arguments]\n",
     336           0,0,4
    224337           );
    225338}
     
    227340
    228341/**
    229  * Initiate workers (imported kernel functions / vars)
    230  * @status    partially implemented.
    231  * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
    232  */
    233 void  workersinit(void)
     342 * test case 1: Load the specified kernel
     343 * other cases: Load running kernel.
     344 * @returns Success indicator. (true/false)
     345 * @param   iTest   Testcase number.
     346 * @param   argc    main argc
     347 * @param   argv    main argv
     348 * @status  completely implemented.
     349 * @author  knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     350 */
     351int     kernelInit(int iTest, int argc, char **argv)
    234352{
    235     DosSetMem(&CODE16START, &CODE16END - &CODE16START, PAG_WRITE | PAG_READ);
    236     DosSetMem(&CODE32START, &CODE32END - &CODE32START, PAG_WRITE | PAG_READ);
     353    static char     achBuffer[1024*256];
     354    char            szError[256];
     355    HMODULE         hmod = NULLHANDLE;
     356    int             rc;
     357    char            szName[CCHMAXPATH];
     358    char *          pszSrcName;
     359    char *          pszTmp;
     360    ULONG           ulAction;
     361    HFILE           hFile;
     362    struct e32_exe* pe32 = (struct e32_exe*)(void*)&achBuffer[0];
     363    qsPtrRec_t *    pPtrRec = (qsPtrRec_t*)(void*)&achBuffer[0];
     364    qsLrec_t *      pLrec;
     365    int             i;
     366    FILESTATUS3     fsts3;
     367
     368    /*
     369     * If not testcase 1, use the running kernel.
     370     */
     371    if (iTest != 1)
     372    {
     373        ULONG   ulBootDrv = 3;
     374        pszSrcName = "c:\\os2krnl";
     375        DosQuerySysInfo(QSV_BOOT_DRIVE, QSV_BOOT_DRIVE, SSToDS(&ulBootDrv), sizeof(ulBootDrv));
     376        pszSrcName[0] = (char)(ulBootDrv + 'a' - 1);
     377    }
     378    else
     379    {
     380        if (argc < 3)
     381        {
     382            printf("Missing parameter!\n");
     383            return FALSE;
     384        }
     385        pszSrcName = argv[2];
     386    }
     387
     388    /*
     389     * Make a temporary copy of the kernel.
     390     */
     391    if (DosScanEnv("TMP", &pszTmp) != NO_ERROR || pszTmp == NULL)
     392    {
     393        printf("Environment variable TMP is not set.\n");
     394        return FALSE;
     395    }
     396    strcpy(szName, pszTmp);
     397    if (szName[strlen(pszTmp) - 1] != '\\' && szName[strlen(pszTmp) - 1] != '/')
     398        strcat(szName, "\\");
     399    strcat(szName, "os2krnl");
     400    rc = DosCopy(pszSrcName, szName, DCPY_EXISTING);
     401    if (rc != NO_ERROR)
     402    {
     403        printf("Failed to copy %s to %s.\n", pszSrcName, szName);
     404        return FALSE;
     405    }
     406    if (DosQueryPathInfo(szName, FIL_STANDARD, &fsts3, sizeof(fsts3)) != NO_ERROR
     407        ||  !(fsts3.attrFile = FILE_ARCHIVED)
     408        ||  DosSetPathInfo(szName, FIL_STANDARD, &fsts3, sizeof(fsts3), 0) != NO_ERROR
     409        )
     410    {
     411        printf("Failed to set attributes for %s.\n", szName);
     412        return FALSE;
     413    }
     414
     415    /*
     416     * Patch the kernel.
     417     *      Remove the entrypoint.
     418     */
     419    ulAction = 0;
     420    rc = DosOpen(szName, &hFile, &ulAction, 0, FILE_NORMAL,
     421                 OPEN_ACTION_FAIL_IF_NEW | OPEN_ACTION_OPEN_IF_EXISTS,
     422                 OPEN_SHARE_DENYNONE | OPEN_ACCESS_READWRITE,
     423                 NULL);
     424    if (rc != NO_ERROR)
     425    {
     426        printf("Failed to open temporary kernel file. rc = %d\n", rc);
     427        return FALSE;
     428    }
     429    rc = DosRead(hFile, &achBuffer[0], 0x200, &ulAction);
     430    if (rc != NO_ERROR)
     431    {
     432        DosClose(hFile);
     433        printf("Failed to read LX header from temporary kernel file.\n");
     434        return FALSE;
     435    }
     436    pe32 = (struct e32_exe*)(void*)&achBuffer[*(unsigned long*)(void*)&achBuffer[0x3c]];
     437    if (*(PUSHORT)pe32->e32_magic != E32MAGIC)
     438    {
     439        DosClose(hFile);
     440        printf("Failed to read LX header from temporary kernel file (2).\n");
     441        return FALSE;
     442    }
     443    pe32->e32_eip = 0;
     444    pe32->e32_startobj = 0;
     445    pe32->e32_mflags &= ~(E32LIBTERM | E32LIBINIT);
     446    if ((rc = DosSetFilePtr(hFile, *(unsigned long*)(void*)&achBuffer[0x3c], FILE_BEGIN, &ulAction)) != NO_ERROR
     447        || (rc = DosWrite(hFile, pe32, sizeof(struct e32_exe), &ulAction)) != NO_ERROR)
     448    {
     449        DosClose(hFile);
     450        printf("Failed to write patched LX header to temporary kernel file.\n");
     451        return FALSE;
     452    }
     453    DosClose(hFile);
     454
     455    /*
     456     * Load the module.
     457     */
     458    rc = DosLoadModule(szError, sizeof(szError), szName, SSToDS(&hmod));
     459    if (rc != NO_ERROR && (rc != ERROR_INVALID_PARAMETER && hmod == NULLHANDLE))
     460    {
     461        printf("Failed to load OS/2 kernel image %s.");
     462        return FALSE;
     463    }
     464
     465    /*
     466     * Get object information.
     467     */
     468    rc = DosQuerySysState(QS_MTE, QS_MTE, 0L, 0L, pPtrRec, sizeof(achBuffer));
     469    if (rc != NO_ERROR)
     470    {
     471        printf("DosQuerySysState failed with rc=%d.\n", rc);
     472        return FALSE;
     473    }
     474
     475    pLrec = pPtrRec->pLibRec;
     476    while (pLrec != NULL)
     477    {
     478        /*
     479         * Bug detected in OS/2 FP13. Probably a problem which occurs
     480         * in _LDRSysMteInfo when qsCheckCache is calle before writing
     481         * object info. The result is that the cache flushed and the
     482         * attempt of updating the qsLrec_t next and object pointer is
     483         * not done. This used to work earlier and on Aurora AFAIK.
     484         *
     485         * The fix for this problem is to check if the pObjInfo is NULL
     486         * while the number of objects isn't 0 and correct this. pNextRec
     487         * will also be NULL at this time. This will be have to corrected
     488         * before we exit the loop or moves to the next record.
     489         * There is also a nasty alignment of the object info... Hope
     490         * I got it right. (This aligment seems new to FP13.)
     491         */
     492        if (pLrec->pObjInfo == NULL /*&& pLrec->pNextRec == NULL*/ && pLrec->ctObj > 0)
     493            {
     494            pLrec->pObjInfo = (qsLObjrec_t*)(void*)(
     495                (char*)(void*)pLrec
     496                + ((sizeof(qsLrec_t)                            /* size of the lib record */
     497                   + pLrec->ctImpMod * sizeof(short)            /* size of the array of imported modules */
     498                   + strlen((char*)(void*)pLrec->pName) + 1     /* size of the filename */
     499                   + 3) & ~3));                                 /* the size is align on 4 bytes boundrary */
     500            pLrec->pNextRec = (qsLrec_t*)(void*)((char*)(void*)pLrec->pObjInfo
     501                                                 + sizeof(qsLObjrec_t) * pLrec->ctObj);
     502            }
     503        if (pLrec->hmte == hmod)
     504            break;
     505
     506        /*
     507         * Next record
     508         */
     509        pLrec = (qsLrec_t*)pLrec->pNextRec;
     510    }
     511
     512    if (pLrec == NULL)
     513    {
     514        printf("DosQuerySysState(os2krnl): not found\n");
     515        return FALSE;
     516    }
     517    if (pLrec->pObjInfo == NULL)
     518    {
     519        printf("DosQuerySysState(os2krnl): no object info\n");
     520        return FALSE;
     521    }
     522
     523    /*
     524     * Fill the aKrnlOTE array.
     525     */
     526    for (i = 0; i < pLrec->ctObj; i++)
     527    {
     528        aKrnlOTE[i].ote_size    = pLrec->pObjInfo[i].osize;
     529        aKrnlOTE[i].ote_base    = pLrec->pObjInfo[i].oaddr;
     530        aKrnlOTE[i].ote_flags   = pLrec->pObjInfo[i].oflags;
     531        aKrnlOTE[i].ote_pagemap = i > 0 ? aKrnlOTE[i-1].ote_pagemap + aKrnlOTE[i-1].ote_mapsize : 0;
     532        aKrnlOTE[i].ote_mapsize = (pLrec->pObjInfo[i].osize + 0x0FFF) / 0x1000;
     533        aKrnlOTE[i].ote_sel     = (USHORT)FlatToSel(pLrec->pObjInfo[i].oaddr);
     534        aKrnlOTE[i].ote_hob     = 0;
     535    }
     536    cObjectsFake = pLrec->ctObj;
     537
     538    return TRUE;
    237539}
    238540
     
    273575    switch (iTest)
    274576    {
    275         case 1:     rc = TestCase1();   break;
     577        case 1:     rc = TestCase1(argc, argv);   break;
    276578        case 2:     rc = TestCase2();   break;
    277579        case 3:     rc = TestCase3();   break;
    278         case 4:     rc = TestCase4();   break;
    279         case 5:     rc = TestCase5();   break;
    280580
    281581        default:
     
    294594/**
    295595 * Test case 1.
    296  * Checks that default initiation works fine for Aurora SMP kernels.
     596 * Checks that default initiation works fine for a given kernel.
     597 *
     598 * Syntax:  win32ktst.exe 1 <os2krnl> <majorver> <minorver> <build> <kerneltype: S|U|4> <buildtype: A|H|R> [os2krnl.sym]
    297599 *
    298600 * @sketch  Create init packet with no arguments.
     
    305607 * @author  knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
    306608 */
    307 int TestCase1(void)
     609int TestCase1(int argc, char **argv)
    308610{
     611    static char szInitArgs[CCHMAXPATH + 10];
    309612    int         rc = 1;
    310613    RP32INIT    rpinit;
    311614
     615    /* verify argument count */
     616    if (argc < 8 || argc > 9)
     617    {
     618        printf("Invalid parameter count for testcase 1.\n");
     619        return ERROR_INVALID_PARAMETER;
     620    }
     621
    312622    /* init fake variabels */
    313     pszInternalRevision ="\r\nInternal revision 14.040_SMP";
    314     cObjectsFake = 15;
    315     _usFakeVerMajor = 20;
    316     _usFakeVerMinor = 45;
     623    _usFakeVerMajor = (USHORT)atoi(argv[3]);
     624    _usFakeVerMinor = (USHORT)atoi(argv[4]);
     625
     626    /* make init string */
     627    strcpy(szInitArgs, "-w3");
     628    if (argc >= 9)
     629        strcat(strcat(szInitArgs, " -S:"), argv[8]);
    317630
    318631    /* $elf */
    319     initRPInit(SSToDS(&rpinit), "-w3");
     632    initRPInit(SSToDS(&rpinit), szInitArgs);
    320633    rc = InitElf(&rpinit);              /* no SSToDS! */
    321634    printf("InitElf returned status=0x%04x\n", rpinit.rph.Status);
     
    323636    {
    324637        /* $win32k */
    325         initRPInit(SSToDS(&rpinit), "-w3");
     638        initRPInit(SSToDS(&rpinit), szInitArgs);
    326639        rc = InitWin32k(&rpinit);       /* no SSToDS! */
    327640        printf("InitWin32k returned status=0x%04x\n", rpinit.rph.Status);
     
    329642        {
    330643            struct options opt = DEFAULT_OPTION_ASSIGMENTS;
    331             opt.fKernel = KF_SMP;
    332             opt.ulBuild = 14040;
    333             opt.usVerMajor = 20;
    334             opt.usVerMinor = 45;
    335644            opt.ulInfoLevel = 3;
     645            opt.fKernel = (argv[6][0] == 'S' ? KF_SMP : (argv[6][0] == '4' ? KF_W4 | KF_UNI : KF_UNI))
     646                            | (argv[7][0] == 'A' || argv[7][0] == 'H' ? KF_DEBUG : 0);
     647            opt.ulBuild = atoi(argv[5]);
     648            opt.usVerMajor = (USHORT)atoi(argv[3]);
     649            opt.usVerMinor = (USHORT)atoi(argv[4]);
    336650
    337651            rc = CompareOptions(SSToDS(&opt));
    338             if (rc == NO_ERROR)
    339             {
    340                 rc = TestCaseExeLoad1();
    341             }
    342652        }
    343653        else
     
    350660}
    351661
    352 
    353662/**
    354663 * Test case 2.
    355  * Checks that default initiation works fine for Aurora UNI kernels.
     664 * Checks that all parameters are read correctly (1).
    356665 *
    357666 * @sketch  Create init packet with no arguments.
     
    368677    int         rc = 1;
    369678    RP32INIT    rpinit;
    370 
    371     /* init fake variabels */
    372     pszInternalRevision ="\r\nInternal revision 14.040_UNI";
    373     cObjectsFake = 14;
    374     _usFakeVerMajor = 20;
    375     _usFakeVerMinor = 45;
     679    char *      pszInitArgs = "-C1 -L:E -Verbose -Elf:Yes -Pe:Mixed -Script:Yes -W4 -Heap:512000 -ResHeap:0256000 -HeapMax:4096000 -ResHeapMax:0x100000";
     680
     681    options.fLogging = TRUE;
    376682
    377683    /* $elf */
    378     initRPInit(SSToDS(&rpinit), "");
     684    initRPInit(SSToDS(&rpinit), pszInitArgs);
    379685    rc = InitElf(&rpinit);              /* no SSToDS! */
    380686    printf("InitElf returned status=0x%04x\n", rpinit.rph.Status);
     
    382688    {
    383689        /* $win32k */
    384         initRPInit(SSToDS(&rpinit), "");
     690        initRPInit(SSToDS(&rpinit), pszInitArgs);
    385691        rc = InitWin32k(&rpinit);       /* no SSToDS! */
    386692        printf("InitWin32k returned status=0x%04x\n", rpinit.rph.Status);
     
    388694        {
    389695            struct options opt = DEFAULT_OPTION_ASSIGMENTS;
    390             opt.fKernel = KF_UNI;
    391             opt.ulBuild = 14040;
    392             opt.usVerMajor = 20;
    393             opt.usVerMinor = 45;
     696            opt.cbSwpHeapInit   = 512000;
     697            opt.cbSwpHeapMax    = 4096000;
     698            opt.cbResHeapInit   = 0256000;
     699            opt.cbResHeapMax    = 0x100000;
     700            opt.fElf            = TRUE;
     701            opt.fUNIXScript     = TRUE;
     702            opt.fPE             = FLAGS_PE_MIXED;
     703            opt.fQuiet          = FALSE;
     704            opt.fLogging        = TRUE;
     705            opt.usCom           = OUTPUT_COM1;
     706            opt.ulInfoLevel     = INFOLEVEL_INFOALL;
    394707
    395708            rc = CompareOptions(SSToDS(&opt));
     709            if (rc == NO_ERROR)
     710            {
     711                 rc = TestCaseExeLoad2();
     712            }
    396713        }
    397714        else
     
    404721}
    405722
    406 
    407723/**
    408724 * Test case 3.
    409  * Checks that default initiation works fine for Warp FP13 kernel.
     725 * Checks that all parameters are read correctly (1).
    410726 *
    411727 * @sketch  Create init packet with no arguments.
     
    422738    int         rc = 1;
    423739    RP32INIT    rpinit;
    424 
    425     /* init fake variabels */
    426     pszInternalRevision ="\r\nInternal revision 14.040_W4";
    427     cObjectsFake = 14;
    428     _usFakeVerMajor = 20;
    429     _usFakeVerMinor = 45;
    430 
    431     /* $elf */
    432     initRPInit(SSToDS(&rpinit), "");
    433     rc = InitElf(&rpinit);              /* no SSToDS! */
    434     printf("InitElf returned status=0x%04x\n", rpinit.rph.Status);
    435     if ((rpinit.rph.Status & (STDON | STERR)) == STDON)
    436     {
    437         /* $win32k */
    438         initRPInit(SSToDS(&rpinit), "");
    439         rc = InitWin32k(&rpinit);       /* no SSToDS! */
    440         printf("InitWin32k returned status=0x%04x\n", rpinit.rph.Status);
    441         if ((rpinit.rph.Status & (STDON | STERR)) == STDON)
    442         {
    443             struct options opt = DEFAULT_OPTION_ASSIGMENTS;
    444             opt.fKernel = KF_UNI | KF_W4;
    445             opt.ulBuild = 14040;
    446             opt.usVerMajor = 20;
    447             opt.usVerMinor = 45;
    448 
    449             rc = CompareOptions(SSToDS(&opt));
    450         }
    451         else
    452             printf("!failed!\n");
    453     }
    454     else
    455         printf("!failed!\n");
    456 
    457     return rc;
    458 }
    459 
    460 
    461 /**
    462  * Test case 4.
    463  * Checks that default initiation works fine for Aurora SMP kernels.
    464  *
    465  * @sketch  Create init packet with no arguments.
    466  *          Initiate elf$
    467  *          Create init packet with no arguments.
    468  *          Initiate win32k$
    469  * @returns 0 on success.
    470  *          1 on failure.
    471  * @status  completely implemented.
    472  * @author  knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
    473  */
    474 int TestCase4(void)
    475 {
    476     int         rc = 1;
    477     RP32INIT    rpinit;
    478 
    479     /* init fake variabels */
    480     pszInternalRevision ="\r\nInternal revision 9.036";
    481     cObjectsFake = 14;
    482     _usFakeVerMajor = 20;
    483     _usFakeVerMinor = 40;
    484 
    485     /* $elf */
    486     initRPInit(SSToDS(&rpinit), "");
    487     rc = InitElf(&rpinit);              /* no SSToDS! */
    488     printf("InitElf returned status=0x%04x\n", rpinit.rph.Status);
    489     if ((rpinit.rph.Status & (STDON | STERR)) == STDON)
    490     {
    491         /* $win32k */
    492         initRPInit(SSToDS(&rpinit), "");
    493         rc = InitWin32k(&rpinit);       /* no SSToDS! */
    494         printf("InitWin32k returned status=0x%04x\n", rpinit.rph.Status);
    495         if ((rpinit.rph.Status & (STDON | STERR)) == STDON)
    496         {
    497             struct options opt = DEFAULT_OPTION_ASSIGMENTS;
    498             opt.fKernel     = KF_UNI;
    499             opt.ulBuild     = 9036;
    500             opt.usVerMajor  = 20;
    501             opt.usVerMinor  = 40;
    502 
    503             rc = CompareOptions(SSToDS(&opt));
    504         }
    505         else
    506             printf("!failed!\n");
    507     }
    508     else
    509         printf("!failed!\n");
    510 
    511     return rc;
    512 }
    513 
    514 
    515 /**
    516  * Test case 5.
    517  * Checks that all parameters are read correctly (1) (Warp FP13 kernel).
    518  *
    519  * @sketch  Create init packet with no arguments.
    520  *          Initiate elf$
    521  *          Create init packet with no arguments.
    522  *          Initiate win32k$
    523  * @returns 0 on success.
    524  *          1 on failure.
    525  * @status  completely implemented.
    526  * @author  knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
    527  */
    528 int TestCase5(void)
    529 {
    530     int         rc = 1;
    531     RP32INIT    rpinit;
    532     char *      pszInitArgs = "-C1 -L:N -Verbose -Quiet -Elf:Yes -Pe:Mixed -Script:No -W4 -Heap:512000 -ResHeap:0256000 -HeapMax:4096000 -ResHeapMax:0x100000";
    533 
    534     /* init fake variabels */
    535     pszInternalRevision ="\r\nInternal revision 14.040_W4";
    536     cObjectsFake = 14;
    537     _usFakeVerMajor = 20;
    538     _usFakeVerMinor = 45;
     740    char *      pszInitArgs = "-C1 -L:N -Verbose -Quiet -Elf:Yes -Pe:PE -Script:Yes -Rexx:NES -Java:NYes -W4 -Heap:512000 -ResHeap:0256000 -HeapMax:4096000 -ResHeapMax:0x100000";
    539741
    540742    /* $elf */
     
    551753        {
    552754            struct options opt = DEFAULT_OPTION_ASSIGMENTS;
    553             opt.fKernel         = KF_UNI | KF_W4;
    554             opt.ulBuild         = 14040;
    555             opt.usVerMajor      = 20;
    556             opt.usVerMinor      = 45;
    557755            opt.cbSwpHeapInit   = 512000;
    558756            opt.cbSwpHeapMax    = 4096000;
     
    560758            opt.cbResHeapMax    = 0x100000;
    561759            opt.fElf            = TRUE;
    562             opt.fUNIXScript     = FALSE;
    563             opt.fPE             = FLAGS_PE_MIXED;
     760            opt.fUNIXScript     = TRUE;
     761            opt.fJava           = FALSE;
     762            opt.fREXXScript     = FALSE;
     763            opt.fPE             = FLAGS_PE_PE;
    564764            opt.fQuiet          = TRUE;
    565765            opt.fLogging        = FALSE;
     
    568768
    569769            rc = CompareOptions(SSToDS(&opt));
     770            if (rc == NO_ERROR)
     771            {
     772                 rc = TestCaseExeLoad2();
     773            }
    570774        }
    571775        else
     
    577781    return rc;
    578782}
     783
    579784
    580785/**
     
    598803    if (options.fLogging != pOpt->fLogging)
    599804        printf("fLogging = %d - should be %d\n", options.fLogging, pOpt->fLogging, rc++);
    600     if (options.fKernel != pOpt->fKernel)
    601         printf("fKernel = %d - should be %d\n", options.fKernel, pOpt->fKernel, rc++);
    602     if (options.ulBuild != pOpt->ulBuild)
    603         printf("ulBuild = %d - should be %d\n", options.ulBuild, pOpt->ulBuild, rc++);
    604     if (options.usVerMajor != pOpt->usVerMajor)
    605         printf("usVerMajor = %d - should be %d\n", options.usVerMajor, pOpt->usVerMajor, rc++);
    606     if (options.usVerMinor != pOpt->usVerMinor)
    607         printf("usVerMinor = %d - should be %d\n", options.usVerMinor, pOpt->usVerMinor, rc++);
     805    if (pOpt->ulBuild != ~0UL)
     806    {
     807        if (options.fKernel != pOpt->fKernel)
     808            printf("fKernel = %d - should be %d\n", options.fKernel, pOpt->fKernel, rc++);
     809        if (options.ulBuild != pOpt->ulBuild)
     810            printf("ulBuild = %d - should be %d\n", options.ulBuild, pOpt->ulBuild, rc++);
     811        if (options.usVerMajor != pOpt->usVerMajor)
     812            printf("usVerMajor = %d - should be %d\n", options.usVerMajor, pOpt->usVerMajor, rc++);
     813        if (options.usVerMinor != pOpt->usVerMinor)
     814            printf("usVerMinor = %d - should be %d\n", options.usVerMinor, pOpt->usVerMinor, rc++);
     815    }
    608816    if (options.fPE != pOpt->fPE)
    609817        printf("fPE = %d - should be %d\n", options.fPE, pOpt->fPE, rc++);
     
    633841
    634842
    635 
    636 
    637843/**
    638844 * Simulates a executable loading (no errors).
     
    647853 * @remark
    648854 */
    649 int TestCaseExeLoad1(void)
     855int TestCaseExeLoad2(void)
    650856{
    651857    APIRET rc;
     858    int    cch;
     859    char * psz;
    652860
    653861    /*
     
    658866     * Do the real execution.
    659867     */
    660     printf("--- TestcaseExeLoad1 - loading win32ktst.exe (LX image) ----\n");
     868    printf("--- TestcaseExeLoad2 - loading win32ktst.exe (LX image) ----\n");
    661869    rc = CalltkExecPgm(EXEC_LOAD, NULL, NULL, "win32ktst.exe");
    662870    if (rc == NO_ERROR)
    663871    {
    664         printf("--- TestcaseExeLoad1 - loading libconv.exe (LX image) ----\n");
     872        psz = "BIN\\DEBUG\\LIBCONV.EXE\0";
     873        printf("--- TestcaseExeLoad2 - loading libconv.exe (LX image) ----\n");
    665874        rc = CalltkExecPgm(EXEC_LOAD, NULL, NULL, "bin\\debug\\libconv.exe");
     875        if (rc == NO_ERROR)
     876        {
     877            #if 0 //not implemented by CalltkExecPgm...???
     878            /* check result */
     879            if (memcmp(achTkExecPgmArguments, psz, strlen(psz) + 1) != 0)
     880            {
     881                rc  = ERROR_BAD_ARGUMENTS;
     882                printf("Bad Arguments! (%s)\n", achTkExecPgmArguments);
     883            }
     884            #else
     885            psz = psz;
     886            #endif
     887        }
    666888    }
    667889
    668890    if (rc == NO_ERROR)
    669891    {
    670         printf("--- TestcaseExeLoad1 - loading rexx\\tst.cmd (REXX script) ----\n");
    671         rc = CalltkExecPgm(EXEC_LOAD, NULL, NULL, "rexx\\tst.cmd");
     892        psz = "REXX\\TST.RX\0OriginalArgument1 OriginalArgument2\0OriginalArgument3\0";
     893        printf("--- TestcaseExeLoad2 - loading rexx\\tst.rx (REXX script) ----\n");
     894        rc = CalltkExecPgm(EXEC_LOAD, psz, NULL, "rexx\\tst.rx");
     895        if (rc == NO_ERROR)
     896        {
     897            /* check result */
     898            psz = "REXX\\TST.RX OriginalArgument1 OriginalArgument2\0OriginalArgument3\0";
     899            cch = strlen(psz);
     900            if (memcmp(achTkExecPgmArguments + strlen(achTkExecPgmArguments) + 1, psz, cch) != 0)
     901            {
     902                rc  = ERROR_BAD_ARGUMENTS;
     903                printf("Bad Arguments! (achTkExecPgmArguments=%s).\n", achTkExecPgmArguments + strlen(achTkExecPgmArguments) + 1);
     904            }
     905        }
    672906    }
    673907
    674908    if (rc == NO_ERROR)
    675909    {
    676         printf("--- TestcaseExeLoad1 - loading SOL.EXE (PE image) ----\n");
    677         rc = CalltkExecPgm(EXEC_LOAD, NULL, NULL, "e:\\Win32Prog\\Sol\\Sol.exe");
     910        psz = "TEST\\TST.SH\0OrgArg1 OrgArg2\0OrgArg3\0";
     911        printf("--- TestcaseExeLoad2 - loading test\\tst.sh (UNIX shell script) ----\n");
     912        rc = CalltkExecPgm(EXEC_LOAD, psz, NULL, "test\\tst.sh");
     913        if (rc == NO_ERROR)
     914        {
     915            /* check result */
     916            psz = "TEST\\TST.SH OrgArg1 OrgArg2\0OrgArg3\0";
     917            cch = strlen(psz);
     918            if (memcmp(achTkExecPgmArguments + strlen(achTkExecPgmArguments) + 1, psz, cch) != 0)
     919            {
     920                rc  = ERROR_BAD_ARGUMENTS;
     921                printf("Bad Arguments! (achTkExecPgmArguments=%s).\n", achTkExecPgmArguments + strlen(achTkExecPgmArguments) + 1);
     922            }
     923        }
     924    }
     925
     926    if (rc == NO_ERROR)
     927    {
     928        psz = "TEST\\TST2.SH\0OrgArg1 OrgArg2\0OrgArg3\0";
     929        printf("--- TestcaseExeLoad2 - loading test\\tst2.sh (UNIX shell script) ----\n");
     930        rc = CalltkExecPgm(EXEC_LOAD, psz, NULL, "test\\tst2.sh");
     931        if (rc == NO_ERROR)
     932        {
     933            /* check result */
     934            psz = "-arg1 -arg2 -arg3 TEST\\TST2.SH OrgArg1 OrgArg2\0OrgArg3\0";
     935            cch = strlen(psz) + 1;
     936            if (memcmp(achTkExecPgmArguments + strlen(achTkExecPgmArguments) + 1, psz, cch) != 0)
     937            {
     938                rc  = ERROR_BAD_ARGUMENTS;
     939                printf("Bad Arguments! (achTkExecPgmArguments=%s).\n", achTkExecPgmArguments + strlen(achTkExecPgmArguments) + 1);
     940            }
     941        }
     942    }
     943
     944    if (rc == NO_ERROR)
     945    {
     946        psz = "E:\\WIN32PROG\\SOL\\SOL.EXE\0";
     947        printf("--- TestcaseExeLoad2 - loading SOL.EXE (PE image) ----\n");
     948        rc = CalltkExecPgm(EXEC_LOAD, psz, NULL, "e:\\Win32Prog\\Sol\\Sol.exe");
     949        if (rc == NO_ERROR)
     950        {
     951            /* check result */
     952            cch = strlen(psz) + 1 + 1;
     953            if (memcmp(achTkExecPgmArguments, psz, cch) != 0)
     954            {
     955                rc  = ERROR_BAD_ARGUMENTS;
     956                printf("Bad Arguments! (achTkExecPgmArguments=%s).\n", achTkExecPgmArguments + strlen(achTkExecPgmArguments) + 1);
     957            }
     958        }
    678959    }
    679960
     
    683964    return rc;
    684965}
     966
  • trunk/src/win32k/win32k.def

    r2838 r4164  
    1111
    1212SEGMENTS
    13     DATA16          class 'FAR_DATA'
    14     DATA16_BSS      class 'FAR_DATA'
    15     DATA16_CONST    class 'FAR_DATA'
    16     CODE16          class 'CODE'
    17     CODE32          class 'CODE'
    18     DATA32          class 'DATA'
    19     c_common        class 'DATA'
    20     BSS32           class 'BSS'
    21     _VFT            class 'CONST'
    22     CONST32_RO      class 'CONST'
    23     CALLTAB         class 'DATA'
     13    DATA16              class 'FAR_DATA'
     14    DATA16_BSS          class 'FAR_DATA'
     15    DATA16_CONST        class 'FAR_DATA'
     16    DATA16_GLOBAL       class 'FAR_DATA'
     17    DATA16_INIT         class 'FAR_DATA'
     18    DATA16_INIT_BSS     class 'FAR_DATA'
     19    DATA16_INIT_CONST   class 'FAR_DATA'
    2420
     21    CODE16              class 'CODE'
     22    CODE16_IOSEG        class 'CODE'
     23    CODE16_INIT         class 'CODE'
     24
     25    CODE32              class 'CODE'
     26
     27    DATA32              class 'DATA'
     28    c_common            class 'DATA'
     29    BSS32               class 'BSS'
     30    _VFT                class 'CONST'
     31    CONST32_RO          class 'CONST'
     32    CALLTAB             class 'DATA'
     33
  • trunk/src/win32k/win32ktst.def

    r3829 r4164  
    1212
    1313SEGMENTS
    14     DATA16          class 'FAR_DATA'
    15     DATA16_BSS      class 'FAR_DATA'
    16     DATA16_CONST    class 'FAR_DATA'
    17     CODE16          class 'CODE'
    18     CODE32          class 'CODE'
    19     CALLTAB         class 'DATA'
    20     DATA32          class 'DATA'
    21     c_common        class 'DATA'
    22     DDE4_DATA32     class 'DATA'
    23     CTOR_DTOR1      class 'DATA'
    24     CTOR_DTOR2      class 'DATA'
    25     CTOR_DTOR3      class 'DATA'
    26     _VFT            class 'CONST'
    27     CONST32_RO      class 'CONST'
    28     EH_DATA         class 'CONST'
    29     BSS32           class 'BSS'
     14    DATA16              class 'FAR_DATA'
     15    DATA16_BSS          class 'FAR_DATA'
     16    DATA16_CONST        class 'FAR_DATA'
     17    DATA16_GLOBAL       class 'FAR_DATA'
     18    DATA16_INIT         class 'FAR_DATA'
     19    DATA16_INIT_BSS     class 'FAR_DATA'
     20    DATA16_INIT_CONST   class 'FAR_DATA'
     21
     22    CODE16              class 'CODE'
     23    CODE16_IOSEG        class 'CODE'
     24    CODE16_INIT         class 'CODE'
     25
     26    CODE32              class 'CODE'
     27    CALLTAB             class 'DATA'
     28    DATA32              class 'DATA'
     29    c_common            class 'DATA'
     30    DDE4_DATA32         class 'DATA'
     31    CTOR_DTOR1          class 'DATA'
     32    CTOR_DTOR2          class 'DATA'
     33    CTOR_DTOR3          class 'DATA'
     34    _VFT                class 'CONST'
     35    CONST32_RO          class 'CONST'
     36    EH_DATA             class 'CONST'
     37    BSS32               class 'BSS'
    3038
    3139IMPORTS
     
    3341     _DOS16OPEN       = DOSCALL1.70
    3442     _DOS16CLOSE      = DOSCALL1.59
    35 
     43     DosQuerySysState = DOSCALL1.368
Note: See TracChangeset for help on using the changeset viewer.