Changeset 3834 for branches/GRACE/src


Ignore:
Timestamp:
Jul 17, 2000, 12:43:41 AM (25 years ago)
Author:
bird
Message:

Checkin of current code in the Grace brance for backup purpose.

Location:
branches/GRACE/src/win32k
Files:
23 edited

Legend:

Unmodified
Added
Removed
  • branches/GRACE/src/win32k/Makefile

    r3605 r3834  
    11################################################################################
    2 # $Id: Makefile,v 1.43 2000-05-25 22:12:49 bird Exp $
     2# $Id: Makefile,v 1.43.4.1 2000-07-16 22:39:00 bird Exp $
    33#
    44# Win32k makefile.
     
    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 -Fo$@ -Fa
    5151CPPFLAGS    = -q -Ge -Gs- -Gr+ -Rn -Ss+ -Mp -Gx -Wall+ppt-ppc-inl-cnv-gnr-vft-
    5252ASFLAGS     = -Sv:ALP -Mb -Li
    5353LFLAGS      = /nologo /MAP /NOI /NOE /NOD /A:16
    54 CDEFINES    = -DWIN32K -DRING0 -D__WIN32OS2__ -D__WINE__
    55 CDEFINES16 = -DRING0
    56 ADEFINES    = -D:WIN32K
     54CDEFINESB   = -DWIN32K -DRING0 -D__WIN32OS2__ -D__WINE__
     55CDEFINESB16 = -DRING0
     56ASDEFINES   = -D:WIN32K
    5757
    5858
     
    6565CPPFLAGS    = $(CPPFLAGS)   -G5 -O+
    6666LFLAGS      = $(LFLAGS)     /EXEPACK:2 /NODEBUG /PACKC /PACKD
    67 CDEFINES    = $(CDEFINES)   -DRELEASE
    68 CDEFINES16  = $(CDEFINES16) -DRELEASE
     67CDEFINES    = $(CDEFINESB)  -DRELEASE
     68CDEFINES16  = $(CDEFINESB16) -DRELEASE
    6969ASDEFINES   = $(ASDEFINES)  -D:RELEASE
    7070
     
    7777LFLAGS      = $(LFLAGS)     /NOEXEPACK /DEBUG  /NODEB
    7878ASFLAGS     = $(ASFLAGS)    -Od+
    79 CDEFINES    = $(CDEFINES)   -DDEBUG
    80 CDEFINES16  = $(CDEFINES16) -DDEBUG
     79CDEFINES    = $(CDEFINESB)  -DDEBUG
     80CDEFINES16  = $(CDEFINESB16) -DDEBUG
    8181ASDEFINES   = $(ASDEFINES)  -D:DEBUG
    8282!endif
     
    8888CPPFLAGS    = $(CPPFLAGS)   -O+ -Oi-
    8989!endif
     90
     91CDEFINES_TST    = $(CDEFINES)   -DR3TST
     92CDEFINES16_TST  = $(CDEFINES16) -DR3TST
     93
    9094
    9195################################################################################
     
    124128    @$(CC16) $(CFLAGS16) $(CDEFINES16) -Fa$(WIN32KLIST)\$(*B).s -Fo$(WIN32KOBJ)\$(@F) $(CINCLUDES16) $<
    125129
     130{dev16}.c{$(WIN32KOBJ)}.obj_tst:
     131    @$(ECHO) compiling 16bit: $<
     132    @$(CC16) $(CFLAGS16) $(CDEFINES16_TST) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES16) $<
     133    @$(CP) $@ $@.obj
     134{dev16}.c.obj_tst:
     135    @$(ECHO) compiling 16bit: $<
     136    @$(CC16) $(CFLAGS16) $(CDEFINES16_TST) -Fa$(WIN32KLIST)\$(*B).s -Fo$(WIN32KOBJ)\$(@F) $(CINCLUDES16) $<
     137    @$(CP) $@ $@.obj
     138
    126139
    127140{dev32}.asm{$(WIN32KOBJ)}.obj:
     
    139152    @$(CC) -c $(CFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$(WIN32KOBJ)\$(@F) $(CINCLUDES) $<
    140153
     154{dev32}.c{$(WIN32KOBJ)}.obj_tst:
     155    @$(ECHO) compiling 32bit: $<
     156    @$(CC) -c $(CFLAGS) $(CDEFINES_TST) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $<
     157    @$(CP) $@ $@.obj
     158{dev32}.c.obj_tst:
     159    @$(ECHO) compiling 32bit: $<
     160    @$(CC) -c $(CFLAGS) $(CDEFINES_TST) -Fa$(WIN32KLIST)\$(*B).s -Fo$(WIN32KOBJ)\$(@F) $(CINCLUDES) $<
     161    @$(CP) $@ $@.obj
     162
    141163{dev32}.cpp{$(WIN32KOBJ)}.obj:
    142164    @$(ECHO) compiling 32bit: $<
     
    147169
    148170
     171{test}.asm{$(WIN32KOBJ)}.obj:
     172    @$(ECHO) assembling:      $<
     173    @$(AS) $(ASFLAGS) $(ADEFINES) $(AINCLUDES) $< -Fo:$@ -Fl:$(WIN32KLIST)\$(*B).lst
     174{test}.asm.obj:
     175    @$(ECHO) assembling:      $<
     176    @$(AS) $(ASFLAGS) $(ADEFINES) $(AINCLUDES) $< -Fo:$(WIN32KOBJ)\$(@F) -Fl:$(WIN32KLIST)\$(*B).lst
     177
     178{test}.c{$(WIN32KOBJ)}.obj:
     179    @$(ECHO) compiling 32bit: $<
     180    @$(CC) -c $(CFLAGS) -Ge+ $(CDEFINES_TST) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $<
     181{test}.c.obj:
     182    @$(ECHO) compiling 32bit: $<
     183    @$(CC) -c $(CFLAGS) -Ge+ $(CDEFINES_TST) -Fa$(WIN32KLIST)\$(*B).s -Fo$(WIN32KOBJ)\$(@F) $(CINCLUDES) $<
     184
     185{test}.cpp{$(WIN32KOBJ)}.obj:
     186    @$(ECHO) compiling 32bit: $<
     187    @$(CC) -c $(CPPFLAGS) -Ge+ $(CDEFINES_TST) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $<
     188{test}.cpp.obj:
     189    @$(ECHO) compiling 32bit: $<
     190    @$(CC) -c $(CPPFLAGS) -Ge+ $(CDEFINES_TST) -Fa$(WIN32KLIST)\$(*B).s -Fo$(WIN32KOBJ)\$(@F) $(CINCLUDES) $<
     191
     192
    149193{k32}.asm{$(WIN32KOBJ)}.obj:
    150194    @$(ECHO) assembling:      $<
     
    204248    @$(ECHO) compiling 32bit: $<
    205249    @$(CC) -c $(CFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$(WIN32KOBJ)\$(@F) $(CINCLUDES) $<
     250
     251{misc}.c{$(WIN32KOBJ)}.obj_tst:
     252    @$(ECHO) compiling 32bit: $<
     253    $(CC) -c $(CFLAGS) $(CDEFINES_TST) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $<
     254    @$(CP) $@ $@.obj
     255{misc}.c.obj_tst:
     256    @$(ECHO) compiling 32bit: $<
     257    $(CC) -c $(CFLAGS) $(CDEFINES_TST) -Fa$(WIN32KLIST)\$(*B).s -Fo$(WIN32KOBJ)\$(@F) $(CINCLUDES) $<
     258    @$(CP) $@ $@.obj
    206259
    207260{misc}.cpp{$(WIN32KOBJ)}.obj:
     
    258311# OBJECTS and LIBRARIES - Don't mess with the order or objects and libraries!
    259312################################################################################
    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 = \
     313OBJS  =\
     314    $(WIN32KOBJ)\devfirst.obj \
     315    $(WIN32KOBJ)\d16strat.obj \
     316    $(WIN32KOBJ)\d32hlp.obj \
     317    $(WIN32KOBJ)\d32globals.obj \
     318    $(WIN32KOBJ)\d16globl.obj \
     319    $(WIN32KOBJ)\asmutils.obj \
     320    $(WIN32KOBJ)\calltab.obj \
     321    $(WIN32KOBJ)\malloc.obj \
     322    $(WIN32KOBJ)\smalloc_avl.obj \
     323    $(WIN32KOBJ)\avl.obj \
     324    $(WIN32KOBJ)\rmalloc_avl.obj \
     325    $(WIN32KOBJ)\new.obj \
     326    $(WIN32KOBJ)\env.obj \
     327    $(WIN32KOBJ)\stricmp.obj \
     328    $(WIN32KOBJ)\yield.obj \
     329    $(WIN32KOBJ)\vsprintf.obj \
     330    $(WIN32KOBJ)\vprintf.obj \
     331    $(WIN32KOBJ)\ldr.obj \
     332    $(WIN32KOBJ)\myldrClose.obj \
     333    $(WIN32KOBJ)\myldrOpen.obj \
     334    $(WIN32KOBJ)\myldrRead.obj \
     335    $(WIN32KOBJ)\myLDRQAppType.obj \
     336    $(WIN32KOBJ)\myldrEnum32bitRelRecs.obj \
     337    $(WIN32KOBJ)\myldrOpenPath.obj \
     338    $(WIN32KOBJ)\OS2KTCB.obj \
     339    $(WIN32KOBJ)\OS2KPTDA.obj \
     340    $(WIN32KOBJ)\pe2lx.obj \
     341    $(WIN32KOBJ)\ModuleBase.obj \
     342    $(WIN32KOBJ)\d32ElfIOCtl.obj \
     343    $(WIN32KOBJ)\d32Win32kIOCtl.obj \
     344    $(WIN32KOBJ)\k32AllocMemEx.obj \
     345    $(WIN32KOBJ)\mytkExecPgm.obj
     346
     347
     348OBJSINIT =\
     349    $(WIN32KOBJ)\d16init.obj \
     350    $(WIN32KOBJ)\d32init.obj \
     351    $(WIN32KOBJ)\ProbKrnl.obj \
     352    $(WIN32KOBJ)\SymDB.obj \
     353    $(WIN32KOBJ)\vprntf16.obj
     354
     355LIBS =\
    299356!if "$(CCENV)" == "VAC36"
    300         $(VACPATH)\lib\cpprni36.lib \
     357    $(VACPATH)\lib\cpprni36.lib \
    301358!else
    302         $(VACPATH)\lib\cppon30.lib  \
    303 !endif
    304         $(DDKPATH)\lib\os2286.lib
    305 
    306 LIBSINIT = \
    307         $(WIN32KOBJ)\devhelp.lib \
    308         $(WIN32KOBJ)\clib.lib
     359    $(VACPATH)\lib\cppon30.lib  \
     360!endif
     361    $(DDKPATH)\lib\os2386.lib
     362
     363LIBSINIT =\
     364    $(WIN32KOBJ)\devhelp.lib \
     365    $(WIN32KOBJ)\clib.lib
     366
     367#
     368# Win32ktst.exe object configuration
     369#
     370TSTOBJS =\
     371    $(WIN32KOBJ)\devfirst.obj \
     372    $(WIN32KOBJ)\$(NAME)tst.obj \
     373    $(WIN32KOBJ)\dh.obj \
     374    $(WIN32KOBJ)\dos.obj \
     375    $(WIN32KOBJ)\dosa.obj \
     376    $(WIN32KOBJ)\init.obj \
     377    $(WIN32KOBJ)\fake.obj \
     378    $(WIN32KOBJ)\fakea.obj \
     379    $(WIN32KOBJ)\d16strat.obj \
     380    $(WIN32KOBJ)\d32hlp.obj \
     381    $(WIN32KOBJ)\d32globals.obj \
     382    $(WIN32KOBJ)\d16globl.obj \
     383    $(WIN32KOBJ)\asmutils.obj \
     384    $(WIN32KOBJ)\calltab.obj \
     385    $(WIN32KOBJ)\malloc.obj_tst \
     386    $(WIN32KOBJ)\smalloc_avl.obj \
     387    $(WIN32KOBJ)\avl.obj \
     388    $(WIN32KOBJ)\rmalloc_avl.obj \
     389    $(WIN32KOBJ)\new.obj \
     390    $(WIN32KOBJ)\env.obj \
     391    $(WIN32KOBJ)\stricmp.obj \
     392    $(WIN32KOBJ)\yield.obj \
     393    $(WIN32KOBJ)\vsprintf.obj \
     394    $(WIN32KOBJ)\vprintf.obj_tst \
     395    $(WIN32KOBJ)\ldr.obj \
     396    $(WIN32KOBJ)\myldrClose.obj \
     397    $(WIN32KOBJ)\myldrOpen.obj \
     398    $(WIN32KOBJ)\myldrRead.obj \
     399    $(WIN32KOBJ)\myLDRQAppType.obj \
     400    $(WIN32KOBJ)\myldrEnum32bitRelRecs.obj \
     401    $(WIN32KOBJ)\myldrOpenPath.obj \
     402    $(WIN32KOBJ)\OS2KTCB.obj \
     403    $(WIN32KOBJ)\OS2KPTDA.obj \
     404    $(WIN32KOBJ)\pe2lx.obj \
     405    $(WIN32KOBJ)\ModuleBase.obj \
     406    $(WIN32KOBJ)\d32ElfIOCtl.obj \
     407    $(WIN32KOBJ)\d32Win32kIOCtl.obj \
     408    $(WIN32KOBJ)\k32AllocMemEx.obj \
     409    $(WIN32KOBJ)\mytkExecPgm.obj
     410
     411TSTOBJSINIT = \
     412    $(WIN32KOBJ)\d16init.obj_tst \
     413    $(WIN32KOBJ)\d32init.obj_tst \
     414    $(WIN32KOBJ)\ProbKrnl.obj_tst \
     415    $(WIN32KOBJ)\SymDB.obj \
     416    $(WIN32KOBJ)\vprntf16.obj_tst
     417
     418TSTLIBS = $(LIBS)
     419
     420TSTLIBSINIT = $(LIBSINIT)
     421
    309422
    310423
     
    313426################################################################################
    314427Probkrnl.exe: $(WIN32KBIN)\ProbKrnl.exe
     428    $(CP) $** $@
    315429$(WIN32KBIN)\ProbKrnl.exe: dev16\ProbKrnl.c dev16\symdb.c dev16\vprntf16.c \
    316430              $(WIN32KINCLUDE)\sym.h \
    317431              $(WIN32KINCLUDE)\probKrnl.h
    318     $(CC16) -c -W4 -Asfw -G2s -Zp -Zl -nologo -Fa -Zi -Od -Lp \
     432    $(CC16) -c -W3 -Asfw -G2s -Zp -Zl -nologo -Fa -Zi -Od -Lp \
    319433        -DDEBUG -DDEBUGR3 -Fa$(WIN32KLIST)\$(*B)_p.s     \
    320434        -Fo$(WIN32KOBJ)\probkrnl_p.obj $(CINCLUDES16) dev16\probkrnl.c
    321     $(CC16) -c -W4 -Asfw -G2s -Zp -Zl -nologo -Fa -Zi -Od -Lp \
     435    $(CC16) -c -W3 -Asfw -G2s -Zp -Zl -nologo -Fa -Zi -Od -Lp \
    322436        -DDEBUG -DDEBUGR3 -Fa$(WIN32KLIST)\$(*B)_p.s     \
    323437        -Fo$(WIN32KOBJ)\symdb_p.obj $(CINCLUDES16) dev16\symdb.c
    324     $(CC16) -c -W4 -Asfw -G2s -Zp -Zl -nologo -Fa -Zi -Od -Lp \
     438    $(CC16) -c -W3 -Asfw -G2s -Zp -Zl -nologo -Fa -Zi -Od -Lp \
    325439        -DDEBUG -DDEBUGR3 -Fa$(WIN32KLIST)\$(*B)_p.s     \
    326440        -Fo$(WIN32KOBJ)\vprntf16_p.obj $(CINCLUDES16) dev16\vprntf16.c
     
    329443        $@, $(WIN32KBIN)\probkrnl.map, \
    330444        $(TOOLKIT)\lib\os2286.lib + $(MSCPATH)\lib\clibcep.lib;
    331     $(CP) $@
    332445
    333446extract.exe: $(WIN32KBIN)\extract.exe
     447    $(CP) $** $@
    334448$(WIN32KBIN)\extract.exe: dev16\ProbKrnl.c dev16\vprntf16.c \
    335449             $(WIN32KINCLUDE)\sym.h \
    336450             $(WIN32KINCLUDE)\probKrnl.h
    337     $(CC16) -c -W4 -Asfw -G2s -Zp -Zl -nologo -Fo$@ -Fa -Zi -Od -Lp \
     451    $(CC16) -c -W3 -Asfw -G2s -Zp -Zl -nologo -Fo$@ -Fa -Zi -Od -Lp \
    338452        -DDEBUG -DEXTRACT -Fa$(WIN32KLIST)\$(*B)_e.s     \
    339453        -Fo$(WIN32KOBJ)\probkrnl_e.obj $(CINCLUDES16) dev16\probkrnl.c
    340     $(CC16) -c -W4 -Asfw -G2s -Zp -Zl -nologo -Fo$@ -Fa -Zi -Od -Lp \
     454    $(CC16) -c -W3 -Asfw -G2s -Zp -Zl -nologo -Fo$@ -Fa -Zi -Od -Lp \
    341455        -DDEBUG -DEXTRACT -Fa$(WIN32KLIST)\$(*B)_e.s     \
    342456        -Fo$(WIN32KOBJ)\vprntf16_e.obj $(CINCLUDES16) dev16\vprntf16.c
     457    $(CC16) -c -W3 -Asfw -G2s -Zp -Zl -nologo -Fo$@ -Fa -Zi -Od -Lp \
     458        -DDEBUG -DEXTRACT -Fa$(WIN32KLIST)\$(*B)_e.s     \
     459        -Fo$(WIN32KOBJ)\d16globl_e.obj $(CINCLUDES16) dev16\d16globl.c
    343460    link /NOD /MAP:FULL /CO /pmtype:vio \
    344         $(WIN32KOBJ)\probkrnl_e.obj + $(WIN32KOBJ)\vprntf16_e.obj, \
     461        $(WIN32KOBJ)\probkrnl_e.obj + $(WIN32KOBJ)\vprntf16_e.obj + $(WIN32KOBJ)\d16globl_e.obj, \
    345462        $@, $(WIN32KBIN)\$(*B).map, \
    346463        $(TOOLKIT)\lib\os2286.lib + $(MSCPATH)\lib\clibcep.lib;
    347     $(CP) $@
    348464
    349465d32init.exe: $(WIN32KBIN)\d32init.exe
     466    $(CP) $** $@
    350467$(WIN32KBIN)\d32init.exe: dev32\d32init.c
    351468    icc -Ti+ -Ss /Gr+ $(CINCLUDES) -DRING3 -DDEBUGR3 -DDEBUG \
    352469        -Fo$(WIN32KOBJ)\$(*B).r3obj -Fe$@ -Fm$(WIN32KBIN)\$(*B).map \
    353470        dev32\$(*B).c
    354     $(CP) $@
    355471
    356472
     
    363479            $(WIN32KOBJ)\last.lib \
    364480            $(WIN32KOBJ)\init.lib \
    365             $(LIBSINIT)
     481            $(LIBSINIT) \
     482            makefile
    366483    -@$(ECHO) linking: $@
    367     $(LD) $(LFLAGS) @<<ole
     484    $(LD) $(LFLAGS) @<<
    368485/OUT:$@
    369486/MAP:$(WIN32KBIN)\$(@B).map
    370 $(OBJS)
    371 $(LIBS)
     487$(OBJS:  =^
     488)
     489$(LIBS:  =^
     490)
    372491$(WIN32KOBJ)\last.lib
    373492$(WIN32KOBJ)\init.lib
    374493/IG $(LIBSINIT)
    375494$(NAME).def
    376 <<keep
     495<<
    377496    cd $(WIN32KBIN)
    378497    @mapsym $(*B).map > nul
     
    384503
    385504################################################################################
     505# Win32ktst.exe rule.
     506################################################################################
     507$(NAME)tst.exe: $(WIN32KBIN)\$(NAME)tst.exe
     508    $(CP) $(WIN32KBIN)\$@ $@
     509
     510$(WIN32KBIN)\$(NAME)tst.exe: \
     511            $(NAME)tst.def \
     512            $(TSTOBJS) \
     513            $(TSTLIBS) \
     514            $(WIN32KOBJ)\last.lib \
     515            $(WIN32KOBJ)\tstinit.lib \
     516            $(TSTLIBSINIT) \
     517            makefile
     518    -@$(ECHO) linking: $@
     519    $(LD) $(LFLAGS) /DEBUG @<<
     520/OUT:$@
     521/MAP:$(WIN32KBIN)\$(@B).map
     522$(TSTOBJS:  =^
     523)
     524$(TSTLIBS:  =^
     525)
     526$(WIN32KOBJ)\last.lib
     527$(WIN32KOBJ)\tstinit.lib
     528/IG $(TSTLIBSINIT)
     529$(NAME)tst.def
     530<<
     531
     532################################################################################
    386533# Pe2Lx.exe rule
    387534################################################################################
     
    404551$(WIN32KOBJ)\devhelp.lib: $(DDKPATH)\lib\dhcalls.lib $(WIN32KBIN)\libconv.exe
    405552    $(WIN32KBIN)\libconv $(DDKPATH)\lib\dhcalls.lib $@
    406     $(ILIB) /nologo /nobackup /convformat $@;
     553    $(ILIB) /nologo /nobackup /convformat /ignorecase $@;
    407554
    408555$(WIN32KOBJ)\clib.lib: $(MSCPATH)\lib\clibcep.lib $(WIN32KBIN)\libconv.exe
     
    418565    $(ILIB) /nologo /nobackup $@ $**;
    419566
     567$(WIN32KOBJ)\tstinit.lib: $(TSTOBJSINIT)
     568    -@$(RM) $@ > nul 2> nul
     569    $(ILIB) /nologo /nobackup $@ $**;
     570
    420571$(WIN32KBIN)\libconv.exe: libconv.c
    421572    icc -Q+ -Fe$@ -Fo$(WIN32KOBJ)\$(*B).obj libconv.c
     
    426577################################################################################
    427578lxdoc:
    428    exp cpp2sds -o DocsA\ -i include\lx.h pe2lx\lx*.cpp
    429    cd Docs
    430    exp sds2doc -ai *.sds
     579    cpp2sds -o DocsA\ -i include\modulebase.h include\pe2lx.h ldr\modulebase.cpp \
     580        pe2lx\pe2lx.cpp
     581    cd DocsA
     582    exp sds2doc -ai *.sds
    431583
    432584fulldoc:
    433    exp cpp2sds -o DocsA\ -i include\*.h *.cpp ldr\*.cpp misc\*.cpp pe2lx\*.cpp
    434    cd Docs
    435    exp sds2doc -ai *.sds
     585    exp cpp2sds -o DocsA\ -i include\*.h *.cpp ldr\*.cpp misc\*.cpp pe2lx\*.cpp
     586    cd DocsA
     587    exp sds2doc -ai *.sds
    436588
    437589#################################################################################
     
    454606!endif
    455607!if "$(WIN32KOBJ)" != ""
    456     $(RM) $(WIN32KOBJ)\*obj $(WIN32KOBJ)\*lib $(WIN32KOBJ)\*pch
     608    $(RM) $(WIN32KOBJ)\*obj $(WIN32KOBJ)\*lib $(WIN32KOBJ)\*pch \
     609        $(WIN32KOBJ)\*.obj_tst
    457610!endif
    458611!if "$(WIN32KLIST)" != ""
     
    472625dep:
    473626    $(PDWIN32_TOOLS)\fastdep -o$$(WIN32KOBJ) $(CINCLUDES) misc\*.c* ldr\*.c* \
    474         dev32\*.c* pe2lx\*.c* k32\*.c* lib\*.c elf2lx\*.c* \
     627        dev32\*.c* pe2lx\*.c* k32\*.c* lib\*.c elf2lx\*.c* test\*.c* \
    475628        $(WIN32KINCLUDE)\*.h
    476629    $(PDWIN32_TOOLS)\fastdep -a+ -o$$(WIN32KOBJ) $(CINCLUDES16) dev16\*.c*
    477630    $(PDWIN32_TOOLS)\fastdep -a+ -o$$(WIN32KOBJ) -I$(WIN32KINCLUDE) \
    478         -I$(DDKPATH)\inc dev32\*.asm ldr\*.asm misc\*.asm include\*.inc
     631        -I$(DDKPATH)\inc dev32\*.asm ldr\*.asm misc\*.asm test\*.asm include\*.inc
    479632    cd pe2lx
    480633    $(MAKE_CMD) dep
  • branches/GRACE/src/win32k/dev16/SymDB.c

    r3321 r3834  
    1 /* $Id: SymDB.c,v 1.3 2000-04-05 18:40:37 bird Exp $
     1/* $Id: SymDB.c,v 1.3.4.1 2000-07-16 22:43:20 bird Exp $
    22*
    33* Autogenerated kernel symbol database.
     
    1313#include <os2.h>
    1414#include "probkrnl.h"
     15#include "options.h"
     16
    1517KRNLDBENTRY aKrnlSymDB[] =
    1618{
     19#ifdef ALLKERNELS
     20    { /* 14039AS.SYM */
     21        14039, KF_SMP | KF_ALLSTRICT, 17,
     22        {
     23            {16, 0x0000a0b8}, /* _ldrRead */
     24            {16, 0x00075c40}, /* _ldrOpen */
     25            {16, 0x00077130}, /* _ldrClose */
     26            {16, 0x00077215}, /* _LDRQAppType */
     27            {16, 0x00072c10}, /* _ldrEnum32bitRelRecs */
     28            {16, 0x00006188}, /* _IOSftOpen */
     29            {16, 0x00006a90}, /* _IOSftClose */
     30            {16, 0x00006b8c}, /* _IOSftTransPath */
     31            {16, 0x0000666c}, /* _IOSftReadAt */
     32            {16, 0x00006673}, /* _IOSftWriteAt */
     33            {16, 0x00006cc4}, /* _SftFileSize */
     34            {16, 0x00070a40}, /* _VMAllocMem */
     35            {16, 0x0005e4b3}, /* _VMGetOwner */
     36            {16, 0x000824c0}, /* g_tkExecPgm */
     37            {13, 0x0000aca8}, /* f_FuStrLenZ */
     38            {13, 0x0000ac28}, /* f_FuStrLen */
     39            {13, 0x0000ae74}, /* f_FuBuff */
     40            {16, 0x00058490}, /* _VMObjHandleInfo */
     41            {16, 0x00075fc0}, /* _ldrOpenPath */
     42            {16, 0x000701d0}, /* _LDRClearSem */
     43            {16, 0x0000e470}, /* _KSEMRequestMutex */
     44            {11, 0x0002c940}, /* _LdrSem */
     45            {16, 0x00067924}, /* _TKSuBuff */
     46            {16, 0x00041620}, /* _TKFuBuff */
     47            {16, 0x00041371}, /* _TKFuBufLen */
     48            {16, 0x000701a0}, /* _ldrValidateMteHandle */
     49        }
     50    },
     51#endif
     52#ifdef ALLKERNELS
     53    { /* 14039AU.SYM */
     54        14039, KF_UNI | KF_ALLSTRICT, 16,
     55        {
     56            {15, 0x000087a8}, /* _ldrRead */
     57            {15, 0x0006a810}, /* _ldrOpen */
     58            {15, 0x0006bc40}, /* _ldrClose */
     59            {15, 0x0006bd25}, /* _LDRQAppType */
     60            {15, 0x00067ae0}, /* _ldrEnum32bitRelRecs */
     61            {15, 0x00005158}, /* _IOSftOpen */
     62            {15, 0x000059c4}, /* _IOSftClose */
     63            {15, 0x00005aa0}, /* _IOSftTransPath */
     64            {15, 0x000055f8}, /* _IOSftReadAt */
     65            {15, 0x000055ff}, /* _IOSftWriteAt */
     66            {15, 0x00005bc8}, /* _SftFileSize */
     67            {15, 0x00065af0}, /* _VMAllocMem */
     68            {15, 0x00052ef3}, /* _VMGetOwner */
     69            {15, 0x00076140}, /* g_tkExecPgm */
     70            {11, 0x0000f838}, /* f_FuStrLenZ */
     71            {11, 0x0000f7ec}, /* f_FuStrLen */
     72            {11, 0x0000f954}, /* f_FuBuff */
     73            {15, 0x0004d127}, /* _VMObjHandleInfo */
     74            {15, 0x0006ab90}, /* _ldrOpenPath */
     75            {15, 0x000652f0}, /* _LDRClearSem */
     76            {15, 0x0000c20c}, /* _KSEMRequestMutex */
     77            {10, 0x0002c63c}, /* _LdrSem */
     78            {15, 0x0005d6d4}, /* _TKSuBuff */
     79            {15, 0x00037c71}, /* _TKFuBuff */
     80            {15, 0x00037a10}, /* _TKFuBufLen */
     81            {15, 0x000652c0}, /* _ldrValidateMteHandle */
     82        }
     83    },
     84#endif
     85#ifdef ALLKERNELS
     86    { /* 14039HS.SYM */
     87        14039, KF_SMP | KF_HALFSTRICT, 17,
     88        {
     89            {16, 0x00008fd8}, /* _ldrRead */
     90            {16, 0x00063a80}, /* _ldrOpen */
     91            {16, 0x00064e20}, /* _ldrClose */
     92            {16, 0x00064f05}, /* _LDRQAppType */
     93            {16, 0x00061030}, /* _ldrEnum32bitRelRecs */
     94            {16, 0x00005308}, /* _IOSftOpen */
     95            {16, 0x00005c01}, /* _IOSftClose */
     96            {16, 0x00005cfc}, /* _IOSftTransPath */
     97            {16, 0x000057e0}, /* _IOSftReadAt */
     98            {16, 0x000057e7}, /* _IOSftWriteAt */
     99            {16, 0x00005e26}, /* _SftFileSize */
     100            {16, 0x0005f410}, /* _VMAllocMem */
     101            {16, 0x0004f30b}, /* _VMGetOwner */
     102            {16, 0x0006efde}, /* g_tkExecPgm */
     103            {13, 0x00009ef0}, /* f_FuStrLenZ */
     104            {13, 0x00009e70}, /* f_FuStrLen */
     105            {13, 0x0000a099}, /* f_FuBuff */
     106            {16, 0x0004b024}, /* _VMObjHandleInfo */
     107            {16, 0x00063dc0}, /* _ldrOpenPath */
     108            {16, 0x0005ee60}, /* _LDRClearSem */
     109            {16, 0x0000cf60}, /* _KSEMRequestMutex */
     110            {11, 0x0001d838}, /* _LdrSem */
     111            {16, 0x00057427}, /* _TKSuBuff */
     112            {16, 0x00038a10}, /* _TKFuBuff */
     113            {16, 0x000387a1}, /* _TKFuBufLen */
     114            {16, 0x0005ee30}, /* _ldrValidateMteHandle */
     115        }
     116    },
     117#endif
     118#ifdef ALLKERNELS
     119    { /* 14039HU.SYM */
     120        14039, KF_UNI | KF_HALFSTRICT, 16,
     121        {
     122            {15, 0x00007a54}, /* _ldrRead */
     123            {15, 0x00059380}, /* _ldrOpen */
     124            {15, 0x0005a650}, /* _ldrClose */
     125            {15, 0x0005a735}, /* _LDRQAppType */
     126            {15, 0x00056c10}, /* _ldrEnum32bitRelRecs */
     127            {15, 0x00004618}, /* _IOSftOpen */
     128            {15, 0x00004e74}, /* _IOSftClose */
     129            {15, 0x00004f4d}, /* _IOSftTransPath */
     130            {15, 0x00004aac}, /* _IOSftReadAt */
     131            {15, 0x00004ab3}, /* _IOSftWriteAt */
     132            {15, 0x00005066}, /* _SftFileSize */
     133            {15, 0x000551d0}, /* _VMAllocMem */
     134            {15, 0x000448eb}, /* _VMGetOwner */
     135            {15, 0x000639be}, /* g_tkExecPgm */
     136            {11, 0x0000e640}, /* f_FuStrLenZ */
     137            {11, 0x0000e5f6}, /* f_FuStrLen */
     138            {11, 0x0000e738}, /* f_FuBuff */
     139            {15, 0x00040813}, /* _VMObjHandleInfo */
     140            {15, 0x000596c0}, /* _ldrOpenPath */
     141            {15, 0x00054c80}, /* _LDRClearSem */
     142            {15, 0x0000b178}, /* _KSEMRequestMutex */
     143            {10, 0x0001e2ac}, /* _LdrSem */
     144            {15, 0x0004dee9}, /* _TKSuBuff */
     145            {15, 0x0002fa00}, /* _TKFuBuff */
     146            {15, 0x0002f7e0}, /* _TKFuBufLen */
     147            {15, 0x00054c50}, /* _ldrValidateMteHandle */
     148        }
     149    },
     150#endif
    17151    { /* 14039RS.SYM */
    18         14039, 'R', TYPE_SMP, 15,
     152        14039, KF_SMP, 15,
    19153        {
    20154            {14, 0x00008390}, /* _ldrRead */
     
    35169            {11, 0x00009d90}, /* f_FuStrLen */
    36170            {11, 0x00009fb9}, /* f_FuBuff */
     171            {14, 0x00048b64}, /* _VMObjHandleInfo */
     172            {14, 0x00061870}, /* _ldrOpenPath */
     173            {14, 0x0005c910}, /* _LDRClearSem */
     174            {14, 0x0000c20c}, /* _KSEMRequestMutex */
     175            {9 , 0x0000d298}, /* _LdrSem */
     176            {14, 0x00054ed3}, /* _TKSuBuff */
     177            {14, 0x00036680}, /* _TKFuBuff */
     178            {14, 0x00036411}, /* _TKFuBufLen */
     179            {14, 0x0005c8e0}, /* _ldrValidateMteHandle */
    37180        }
    38181    },
    39182    { /* 14039RU.SYM */
    40         14039, 'R', TYPE_UNI, 14,
     183        14039, KF_UNI, 14,
    41184        {
    42185            {13, 0x000070e4}, /* _ldrRead */
     
    54197            {13, 0x00042dcb}, /* _VMGetOwner */
    55198            {13, 0x00061dde}, /* g_tkExecPgm */
    56             {9, 0x0000e640}, /* f_FuStrLenZ */
    57             {9, 0x0000e5f6}, /* f_FuStrLen */
    58             {9, 0x0000e738}, /* f_FuBuff */
    59         }
    60     },
     199            {9 , 0x0000e640}, /* f_FuStrLenZ */
     200            {9 , 0x0000e5f6}, /* f_FuStrLen */
     201            {9 , 0x0000e738}, /* f_FuBuff */
     202            {13, 0x0003ecf3}, /* _VMObjHandleInfo */
     203            {13, 0x00057b10}, /* _ldrOpenPath */
     204            {13, 0x000530d0}, /* _LDRClearSem */
     205            {13, 0x0000a760}, /* _KSEMRequestMutex */
     206            {8 , 0x0000dd20}, /* _LdrSem */
     207            {13, 0x0004c335}, /* _TKSuBuff */
     208            {13, 0x0002e010}, /* _TKFuBuff */
     209            {13, 0x0002ddf0}, /* _TKFuBufLen */
     210            {13, 0x000530a0}, /* _ldrValidateMteHandle */
     211        }
     212    },
     213#ifdef ALLKERNELS
     214    { /* 14040A4.SYM */
     215        14040, KF_UNI | KF_W4 | KF_ALLSTRICT, 16,
     216        {
     217            {15, 0x00008744}, /* _ldrRead */
     218            {15, 0x0006a6d0}, /* _ldrOpen */
     219            {15, 0x0006bb00}, /* _ldrClose */
     220            {15, 0x0006bbe5}, /* _LDRQAppType */
     221            {15, 0x000679a0}, /* _ldrEnum32bitRelRecs */
     222            {15, 0x00005158}, /* _IOSftOpen */
     223            {15, 0x000059c4}, /* _IOSftClose */
     224            {15, 0x00005aa0}, /* _IOSftTransPath */
     225            {15, 0x000055f8}, /* _IOSftReadAt */
     226            {15, 0x000055ff}, /* _IOSftWriteAt */
     227            {15, 0x00005bc8}, /* _SftFileSize */
     228            {15, 0x000659d0}, /* _VMAllocMem */
     229            {15, 0x00052ee3}, /* _VMGetOwner */
     230            {15, 0x00076050}, /* g_tkExecPgm */
     231            {11, 0x0000f938}, /* f_FuStrLenZ */
     232            {11, 0x0000f8ec}, /* f_FuStrLen */
     233            {11, 0x0000fa54}, /* f_FuBuff */
     234            {15, 0x0004d0d7}, /* _VMObjHandleInfo */
     235            {15, 0x0006aa50}, /* _ldrOpenPath */
     236            {15, 0x000651d0}, /* _LDRClearSem */
     237            {15, 0x0000c31c}, /* _KSEMRequestMutex */
     238            {10, 0x0002b654}, /* _LdrSem */
     239            {15, 0x0005d6f4}, /* _TKSuBuff */
     240            {15, 0x00037c91}, /* _TKFuBuff */
     241            {15, 0x00037a30}, /* _TKFuBufLen */
     242            {15, 0x000651a0}, /* _ldrValidateMteHandle */
     243        }
     244    },
     245#endif
     246#ifdef ALLKERNELS
     247    { /* 14040AS.SYM */
     248        14040, KF_SMP | KF_ALLSTRICT, 17,
     249        {
     250            {16, 0x0000a054}, /* _ldrRead */
     251            {16, 0x00075c00}, /* _ldrOpen */
     252            {16, 0x000770f0}, /* _ldrClose */
     253            {16, 0x000771d5}, /* _LDRQAppType */
     254            {16, 0x00072be0}, /* _ldrEnum32bitRelRecs */
     255            {16, 0x00006188}, /* _IOSftOpen */
     256            {16, 0x00006a90}, /* _IOSftClose */
     257            {16, 0x00006b8c}, /* _IOSftTransPath */
     258            {16, 0x0000666c}, /* _IOSftReadAt */
     259            {16, 0x00006673}, /* _IOSftWriteAt */
     260            {16, 0x00006cc4}, /* _SftFileSize */
     261            {16, 0x00070a30}, /* _VMAllocMem */
     262            {16, 0x0005e583}, /* _VMGetOwner */
     263            {16, 0x000824c0}, /* g_tkExecPgm */
     264            {13, 0x0000aca0}, /* f_FuStrLenZ */
     265            {13, 0x0000ac20}, /* f_FuStrLen */
     266            {13, 0x0000ae6c}, /* f_FuBuff */
     267            {16, 0x000584f0}, /* _VMObjHandleInfo */
     268            {16, 0x00075f80}, /* _ldrOpenPath */
     269            {16, 0x000701c0}, /* _LDRClearSem */
     270            {16, 0x0000e580}, /* _KSEMRequestMutex */
     271            {11, 0x0002b9b0}, /* _LdrSem */
     272            {16, 0x00067a44}, /* _TKSuBuff */
     273            {16, 0x00041710}, /* _TKFuBuff */
     274            {16, 0x00041461}, /* _TKFuBufLen */
     275            {16, 0x00070190}, /* _ldrValidateMteHandle */
     276        }
     277    },
     278#endif
     279#ifdef ALLKERNELS
     280    { /* 14040AU.SYM */
     281        14040, KF_UNI | KF_ALLSTRICT, 16,
     282        {
     283            {15, 0x00008744}, /* _ldrRead */
     284            {15, 0x0006a740}, /* _ldrOpen */
     285            {15, 0x0006bb70}, /* _ldrClose */
     286            {15, 0x0006bc55}, /* _LDRQAppType */
     287            {15, 0x00067a10}, /* _ldrEnum32bitRelRecs */
     288            {15, 0x00005158}, /* _IOSftOpen */
     289            {15, 0x000059c4}, /* _IOSftClose */
     290            {15, 0x00005aa0}, /* _IOSftTransPath */
     291            {15, 0x000055f8}, /* _IOSftReadAt */
     292            {15, 0x000055ff}, /* _IOSftWriteAt */
     293            {15, 0x00005bc8}, /* _SftFileSize */
     294            {15, 0x00065a40}, /* _VMAllocMem */
     295            {15, 0x00052f53}, /* _VMGetOwner */
     296            {15, 0x000760c0}, /* g_tkExecPgm */
     297            {11, 0x0000f938}, /* f_FuStrLenZ */
     298            {11, 0x0000f8ec}, /* f_FuStrLen */
     299            {11, 0x0000fa54}, /* f_FuBuff */
     300            {15, 0x0004d147}, /* _VMObjHandleInfo */
     301            {15, 0x0006aac0}, /* _ldrOpenPath */
     302            {15, 0x00065240}, /* _LDRClearSem */
     303            {15, 0x0000c31c}, /* _KSEMRequestMutex */
     304            {10, 0x0002b68c}, /* _LdrSem */
     305            {15, 0x0005d764}, /* _TKSuBuff */
     306            {15, 0x00037d01}, /* _TKFuBuff */
     307            {15, 0x00037aa0}, /* _TKFuBufLen */
     308            {15, 0x00065210}, /* _ldrValidateMteHandle */
     309        }
     310    },
     311#endif
     312#ifdef ALLKERNELS
     313    { /* 14040HS.SYM */
     314        14040, KF_SMP | KF_HALFSTRICT, 17,
     315        {
     316            {16, 0x00008fd4}, /* _ldrRead */
     317            {16, 0x00063af0}, /* _ldrOpen */
     318            {16, 0x00064e90}, /* _ldrClose */
     319            {16, 0x00064f75}, /* _LDRQAppType */
     320            {16, 0x000610a0}, /* _ldrEnum32bitRelRecs */
     321            {16, 0x00005308}, /* _IOSftOpen */
     322            {16, 0x00005c01}, /* _IOSftClose */
     323            {16, 0x00005cfc}, /* _IOSftTransPath */
     324            {16, 0x000057e0}, /* _IOSftReadAt */
     325            {16, 0x000057e7}, /* _IOSftWriteAt */
     326            {16, 0x00005e26}, /* _SftFileSize */
     327            {16, 0x0005f4a0}, /* _VMAllocMem */
     328            {16, 0x0004f44b}, /* _VMGetOwner */
     329            {16, 0x0006f08e}, /* g_tkExecPgm */
     330            {13, 0x00009eec}, /* f_FuStrLenZ */
     331            {13, 0x00009e6c}, /* f_FuStrLen */
     332            {13, 0x0000a096}, /* f_FuBuff */
     333            {16, 0x0004b104}, /* _VMObjHandleInfo */
     334            {16, 0x00063e30}, /* _ldrOpenPath */
     335            {16, 0x0005eef0}, /* _LDRClearSem */
     336            {16, 0x0000d0d8}, /* _KSEMRequestMutex */
     337            {11, 0x0001d8d4}, /* _LdrSem */
     338            {16, 0x000575b7}, /* _TKSuBuff */
     339            {16, 0x00038b90}, /* _TKFuBuff */
     340            {16, 0x00038921}, /* _TKFuBufLen */
     341            {16, 0x0005eec0}, /* _ldrValidateMteHandle */
     342        }
     343    },
     344#endif
     345#ifdef ALLKERNELS
     346    { /* 14040HU.SYM */
     347        14040, KF_UNI | KF_HALFSTRICT, 16,
     348        {
     349            {15, 0x00007a4c}, /* _ldrRead */
     350            {15, 0x000592d0}, /* _ldrOpen */
     351            {15, 0x0005a5a0}, /* _ldrClose */
     352            {15, 0x0005a685}, /* _LDRQAppType */
     353            {15, 0x00056b60}, /* _ldrEnum32bitRelRecs */
     354            {15, 0x00004618}, /* _IOSftOpen */
     355            {15, 0x00004e74}, /* _IOSftClose */
     356            {15, 0x00004f4d}, /* _IOSftTransPath */
     357            {15, 0x00004aac}, /* _IOSftReadAt */
     358            {15, 0x00004ab3}, /* _IOSftWriteAt */
     359            {15, 0x00005066}, /* _SftFileSize */
     360            {15, 0x00055140}, /* _VMAllocMem */
     361            {15, 0x0004498b}, /* _VMGetOwner */
     362            {15, 0x0006395e}, /* g_tkExecPgm */
     363            {11, 0x0000e74c}, /* f_FuStrLenZ */
     364            {11, 0x0000e702}, /* f_FuStrLen */
     365            {11, 0x0000e845}, /* f_FuBuff */
     366            {15, 0x00040893}, /* _VMObjHandleInfo */
     367            {15, 0x00059610}, /* _ldrOpenPath */
     368            {15, 0x00054bf0}, /* _LDRClearSem */
     369            {15, 0x0000b2ec}, /* _KSEMRequestMutex */
     370            {10, 0x0001e348}, /* _LdrSem */
     371            {15, 0x0004dfb9}, /* _TKSuBuff */
     372            {15, 0x0002fb20}, /* _TKFuBuff */
     373            {15, 0x0002f900}, /* _TKFuBufLen */
     374            {15, 0x00054bc0}, /* _ldrValidateMteHandle */
     375        }
     376    },
     377#endif
    61378    { /* 14040R4.SYM */
    62         14040, 'R', TYPE_W4, 14,
     379        14040, KF_UNI | KF_W4, 14,
    63380        {
    64381            {13, 0x000070dc}, /* _ldrRead */
     
    76393            {13, 0x00042ecb}, /* _VMGetOwner */
    77394            {13, 0x00061dde}, /* g_tkExecPgm */
    78             {9, 0x0000e74c}, /* f_FuStrLenZ */
    79             {9, 0x0000e702}, /* f_FuStrLen */
    80             {9, 0x0000e845}, /* f_FuBuff */
     395            {9 , 0x0000e74c}, /* f_FuStrLenZ */
     396            {9 , 0x0000e702}, /* f_FuStrLen */
     397            {9 , 0x0000e845}, /* f_FuBuff */
     398            {13, 0x0003edd3}, /* _VMObjHandleInfo */
     399            {13, 0x00057ac0}, /* _ldrOpenPath */
     400            {13, 0x000530a0}, /* _LDRClearSem */
     401            {13, 0x0000a8d4}, /* _KSEMRequestMutex */
     402            {8 , 0x0000dd2c}, /* _LdrSem */
     403            {13, 0x0004c465}, /* _TKSuBuff */
     404            {13, 0x0002e190}, /* _TKFuBuff */
     405            {13, 0x0002df70}, /* _TKFuBufLen */
     406            {13, 0x00053070}, /* _ldrValidateMteHandle */
     407        }
     408    },
     409    { /* 14040RS.SYM */
     410        14040, KF_SMP, 15,
     411        {
     412            {14, 0x0000838c}, /* _ldrRead */
     413            {14, 0x00061650}, /* _ldrOpen */
     414            {14, 0x000629f0}, /* _ldrClose */
     415            {14, 0x00062ad5}, /* _LDRQAppType */
     416            {14, 0x0005ec00}, /* _ldrEnum32bitRelRecs */
     417            {14, 0x00005268}, /* _IOSftOpen */
     418            {14, 0x00005b61}, /* _IOSftClose */
     419            {14, 0x00005c5c}, /* _IOSftTransPath */
     420            {14, 0x00005740}, /* _IOSftReadAt */
     421            {14, 0x00005747}, /* _IOSftWriteAt */
     422            {14, 0x00005d86}, /* _SftFileSize */
     423            {14, 0x0005d000}, /* _VMAllocMem */
     424            {14, 0x0004d03b}, /* _VMGetOwner */
     425            {14, 0x0006cbde}, /* g_tkExecPgm */
     426            {11, 0x00009e0c}, /* f_FuStrLenZ */
     427            {11, 0x00009d8c}, /* f_FuStrLen */
     428            {11, 0x00009fb6}, /* f_FuBuff */
     429            {14, 0x00048cf4}, /* _VMObjHandleInfo */
     430            {14, 0x00061990}, /* _ldrOpenPath */
     431            {14, 0x0005ca50}, /* _LDRClearSem */
     432            {14, 0x0000c384}, /* _KSEMRequestMutex */
     433            {9 , 0x0000d2a4}, /* _LdrSem */
     434            {14, 0x00055113}, /* _TKSuBuff */
     435            {14, 0x000368b0}, /* _TKFuBuff */
     436            {14, 0x00036641}, /* _TKFuBufLen */
     437            {14, 0x0005ca20}, /* _ldrValidateMteHandle */
     438        }
     439    },
     440    { /* 14040RU.SYM */
     441        14040, KF_UNI, 14,
     442        {
     443            {13, 0x000070dc}, /* _ldrRead */
     444            {13, 0x000577f0}, /* _ldrOpen */
     445            {13, 0x00058ac0}, /* _ldrClose */
     446            {13, 0x00058ba5}, /* _LDRQAppType */
     447            {13, 0x00055080}, /* _ldrEnum32bitRelRecs */
     448            {13, 0x00004598}, /* _IOSftOpen */
     449            {13, 0x00004df4}, /* _IOSftClose */
     450            {13, 0x00004ecd}, /* _IOSftTransPath */
     451            {13, 0x00004a2c}, /* _IOSftReadAt */
     452            {13, 0x00004a33}, /* _IOSftWriteAt */
     453            {13, 0x00004fe6}, /* _SftFileSize */
     454            {13, 0x00053660}, /* _VMAllocMem */
     455            {13, 0x00042f3b}, /* _VMGetOwner */
     456            {13, 0x00061e4e}, /* g_tkExecPgm */
     457            {9 , 0x0000e74c}, /* f_FuStrLenZ */
     458            {9 , 0x0000e702}, /* f_FuStrLen */
     459            {9 , 0x0000e845}, /* f_FuBuff */
     460            {13, 0x0003ee43}, /* _VMObjHandleInfo */
     461            {13, 0x00057b30}, /* _ldrOpenPath */
     462            {13, 0x00053110}, /* _LDRClearSem */
     463            {13, 0x0000a8d4}, /* _KSEMRequestMutex */
     464            {8 , 0x0000dd2c}, /* _LdrSem */
     465            {13, 0x0004c4d5}, /* _TKSuBuff */
     466            {13, 0x0002e200}, /* _TKFuBuff */
     467            {13, 0x0002dfe0}, /* _TKFuBufLen */
     468            {13, 0x000530e0}, /* _ldrValidateMteHandle */
    81469        }
    82470    },
    83471    { /* 8255RS.SYM */
    84         8255, 'R', TYPE_SMP, 15,
     472        8255, KF_SMP, 15,
    85473        {
    86474            {14, 0x0000b434}, /* _ldrRead */
     
    101489            {11, 0x0000a0e8}, /* f_FuStrLen */
    102490            {11, 0x0000a311}, /* f_FuBuff */
     491            {14, 0x0002527b}, /* _VMObjHandleInfo */
     492            {14, 0x00045aba}, /* _ldrOpenPath */
     493            {14, 0x00042324}, /* _LDRClearSem */
     494            {14, 0x0000ca44}, /* _KSEMRequestMutex */
     495            {9 , 0x0000d0b4}, /* _LdrSem */
     496            {14, 0x0003242f}, /* _TKSuBuff */
     497            {14, 0x00031fc4}, /* _TKFuBuff */
     498            {14, 0x0003218e}, /* _TKFuBufLen */
     499            {14, 0x00042370}, /* _ldrValidateMteHandle */
    103500        }
    104501    },
    105502    { /* 8255RU.SYM */
    106         8255, 'R', TYPE_UNI, 13,
     503        8255, KF_UNI, 13,
    107504        {
    108505            {12, 0x0000932c}, /* _ldrRead */
     
    120517            {12, 0x0001ccde}, /* _VMGetOwner */
    121518            {12, 0x0004265e}, /* g_tkExecPgm */
    122             {9, 0x0000e124}, /* f_FuStrLenZ */
    123             {9, 0x0000e0da}, /* f_FuStrLen */
    124             {9, 0x0000e218}, /* f_FuBuff */
     519            {9 , 0x0000e124}, /* f_FuStrLenZ */
     520            {9 , 0x0000e0da}, /* f_FuStrLen */
     521            {9 , 0x0000e218}, /* f_FuBuff */
     522            {12, 0x0001c048}, /* _VMObjHandleInfo */
     523            {12, 0x0003a283}, /* _ldrOpenPath */
     524            {12, 0x00036cc8}, /* _LDRClearSem */
     525            {12, 0x0000a6b0}, /* _KSEMRequestMutex */
     526            {8 , 0x0000c7dc}, /* _LdrSem */
     527            {12, 0x00027845}, /* _TKSuBuff */
     528            {12, 0x0002747b}, /* _TKFuBuff */
     529            {12, 0x00027605}, /* _TKFuBufLen */
     530            {12, 0x00036d04}, /* _ldrValidateMteHandle */
    125531        }
    126532    },
    127533    { /* 8256RS.SYM */
    128         8256, 'R', TYPE_SMP, 15,
     534        8256, KF_SMP, 15,
    129535        {
    130536            {14, 0x0000b434}, /* _ldrRead */
     
    145551            {11, 0x0000a0e8}, /* f_FuStrLen */
    146552            {11, 0x0000a311}, /* f_FuBuff */
     553            {14, 0x00025457}, /* _VMObjHandleInfo */
     554            {14, 0x00045cd2}, /* _ldrOpenPath */
     555            {14, 0x00042538}, /* _LDRClearSem */
     556            {14, 0x0000cb04}, /* _KSEMRequestMutex */
     557            {9 , 0x0000d0b4}, /* _LdrSem */
     558            {14, 0x0003260b}, /* _TKSuBuff */
     559            {14, 0x000321a0}, /* _TKFuBuff */
     560            {14, 0x0003236a}, /* _TKFuBufLen */
     561            {14, 0x00042584}, /* _ldrValidateMteHandle */
    147562        }
    148563    },
    149564    { /* 8256RU.SYM */
    150         8256, 'R', TYPE_UNI, 13,
     565        8256, KF_UNI, 13,
    151566        {
    152567            {12, 0x0000932c}, /* _ldrRead */
     
    164579            {12, 0x0001ccde}, /* _VMGetOwner */
    165580            {12, 0x00042632}, /* g_tkExecPgm */
    166             {9, 0x0000e124}, /* f_FuStrLenZ */
    167             {9, 0x0000e0da}, /* f_FuStrLen */
    168             {9, 0x0000e218}, /* f_FuBuff */
     581            {9 , 0x0000e124}, /* f_FuStrLenZ */
     582            {9 , 0x0000e0da}, /* f_FuStrLen */
     583            {9 , 0x0000e218}, /* f_FuBuff */
     584            {12, 0x0001c048}, /* _VMObjHandleInfo */
     585            {12, 0x0003a26f}, /* _ldrOpenPath */
     586            {12, 0x00036cb4}, /* _LDRClearSem */
     587            {12, 0x0000a6b0}, /* _KSEMRequestMutex */
     588            {8 , 0x0000c7dc}, /* _LdrSem */
     589            {12, 0x00027845}, /* _TKSuBuff */
     590            {12, 0x0002747b}, /* _TKFuBuff */
     591            {12, 0x00027605}, /* _TKFuBufLen */
     592            {12, 0x00036cf0}, /* _ldrValidateMteHandle */
    169593        }
    170594    },
    171595    { /* 8257RS.SYM */
    172         8257, 'R', TYPE_SMP, 15,
     596        8257, KF_SMP, 15,
    173597        {
    174598            {14, 0x0000b434}, /* _ldrRead */
     
    189613            {11, 0x0000a0e8}, /* f_FuStrLen */
    190614            {11, 0x0000a311}, /* f_FuBuff */
     615            {14, 0x00025353}, /* _VMObjHandleInfo */
     616            {14, 0x00045c22}, /* _ldrOpenPath */
     617            {14, 0x00042488}, /* _LDRClearSem */
     618            {14, 0x0000cb04}, /* _KSEMRequestMutex */
     619            {9 , 0x0000d0b4}, /* _LdrSem */
     620            {14, 0x00032523}, /* _TKSuBuff */
     621            {14, 0x000320b8}, /* _TKFuBuff */
     622            {14, 0x00032282}, /* _TKFuBufLen */
     623            {14, 0x000424d4}, /* _ldrValidateMteHandle */
    191624        }
    192625    },
    193626    { /* 8257RU.SYM */
    194         8257, 'R', TYPE_UNI, 13,
     627        8257, KF_UNI, 13,
    195628        {
    196629            {12, 0x0000932c}, /* _ldrRead */
     
    208641            {12, 0x0001ccd6}, /* _VMGetOwner */
    209642            {12, 0x0004263e}, /* g_tkExecPgm */
    210             {9, 0x0000e124}, /* f_FuStrLenZ */
    211             {9, 0x0000e0da}, /* f_FuStrLen */
    212             {9, 0x0000e218}, /* f_FuBuff */
    213         }
    214     },
     643            {9 , 0x0000e124}, /* f_FuStrLenZ */
     644            {9 , 0x0000e0da}, /* f_FuStrLen */
     645            {9 , 0x0000e218}, /* f_FuBuff */
     646            {12, 0x0001c03c}, /* _VMObjHandleInfo */
     647            {12, 0x0003a267}, /* _ldrOpenPath */
     648            {12, 0x00036cac}, /* _LDRClearSem */
     649            {12, 0x0000a6b0}, /* _KSEMRequestMutex */
     650            {8 , 0x0000c7dc}, /* _LdrSem */
     651            {12, 0x00027839}, /* _TKSuBuff */
     652            {12, 0x0002746f}, /* _TKFuBuff */
     653            {12, 0x000275f9}, /* _TKFuBufLen */
     654            {12, 0x00036ce8}, /* _ldrValidateMteHandle */
     655        }
     656    },
     657#ifdef ALLKERNELS
     658    { /* 8258AS.SYM */
     659        8258, KF_SMP | KF_ALLSTRICT, 17,
     660        {
     661            {16, 0x0000d370}, /* _ldrRead */
     662            {16, 0x000583bc}, /* _ldrOpen */
     663            {16, 0x00058edc}, /* _ldrClose */
     664            {16, 0x00058f2c}, /* _LDRQAppType */
     665            {16, 0x00056674}, /* _ldrEnum32bitRelRecs */
     666            {16, 0x00006170}, /* _IOSftOpen */
     667            {16, 0x000066fc}, /* _IOSftClose */
     668            {16, 0x000067b4}, /* _IOSftTransPath */
     669            {16, 0x00006440}, /* _IOSftReadAt */
     670            {16, 0x0000660c}, /* _IOSftWriteAt */
     671            {16, 0x000068ec}, /* _SftFileSize */
     672            {16, 0x000539d4}, /* _VMAllocMem */
     673            {16, 0x0002f6e6}, /* _VMGetOwner */
     674            {16, 0x000637b8}, /* g_tkExecPgm */
     675            {13, 0x0000a68c}, /* f_FuStrLenZ */
     676            {13, 0x0000a60c}, /* f_FuStrLen */
     677            {13, 0x0000a854}, /* f_FuBuff */
     678            {16, 0x0002df0b}, /* _VMObjHandleInfo */
     679            {16, 0x00058656}, /* _ldrOpenPath */
     680            {16, 0x00054670}, /* _LDRClearSem */
     681            {16, 0x0000f060}, /* _KSEMRequestMutex */
     682            {11, 0x0002c45c}, /* _LdrSem */
     683            {16, 0x0003e460}, /* _TKSuBuff */
     684            {16, 0x0003dfaf}, /* _TKFuBuff */
     685            {16, 0x0003e1bb}, /* _TKFuBufLen */
     686            {16, 0x00054708}, /* _ldrValidateMteHandle */
     687        }
     688    },
     689#endif
     690#ifdef ALLKERNELS
     691    { /* 8258AU.SYM */
     692        8258, KF_UNI | KF_ALLSTRICT, 16,
     693        {
     694            {15, 0x0000a1fc}, /* _ldrRead */
     695            {15, 0x0004a160}, /* _ldrOpen */
     696            {15, 0x0004aaf8}, /* _ldrClose */
     697            {15, 0x0004ab48}, /* _LDRQAppType */
     698            {15, 0x00048088}, /* _ldrEnum32bitRelRecs */
     699            {15, 0x000044a0}, /* _IOSftOpen */
     700            {15, 0x00004918}, /* _IOSftClose */
     701            {15, 0x000049b0}, /* _IOSftTransPath */
     702            {15, 0x00004764}, /* _IOSftReadAt */
     703            {15, 0x0000476b}, /* _IOSftWriteAt */
     704            {15, 0x00004ad8}, /* _SftFileSize */
     705            {15, 0x00045a08}, /* _VMAllocMem */
     706            {15, 0x00023626}, /* _VMGetOwner */
     707            {15, 0x00053a84}, /* g_tkExecPgm */
     708            {11, 0x0000e9c8}, /* f_FuStrLenZ */
     709            {11, 0x0000e97c}, /* f_FuStrLen */
     710            {11, 0x0000eae0}, /* f_FuBuff */
     711            {15, 0x00022570}, /* _VMObjHandleInfo */
     712            {15, 0x0004a3eb}, /* _ldrOpenPath */
     713            {15, 0x000464bc}, /* _LDRClearSem */
     714            {15, 0x0000bb6c}, /* _KSEMRequestMutex */
     715            {10, 0x0002a1e8}, /* _LdrSem */
     716            {15, 0x000315ac}, /* _TKSuBuff */
     717            {15, 0x0003119e}, /* _TKFuBuff */
     718            {15, 0x0003136a}, /* _TKFuBufLen */
     719            {15, 0x00046544}, /* _ldrValidateMteHandle */
     720        }
     721    },
     722#endif
     723#ifdef ALLKERNELS
     724    { /* 8258HS.SYM */
     725        8258, KF_SMP | KF_HALFSTRICT, 17,
     726        {
     727            {16, 0x0000bee0}, /* _ldrRead */
     728            {16, 0x000488dc}, /* _ldrOpen */
     729            {16, 0x000492d8}, /* _ldrClose */
     730            {16, 0x00049328}, /* _LDRQAppType */
     731            {16, 0x00046dd4}, /* _ldrEnum32bitRelRecs */
     732            {16, 0x00005310}, /* _IOSftOpen */
     733            {16, 0x0000588e}, /* _IOSftClose */
     734            {16, 0x00005945}, /* _IOSftTransPath */
     735            {16, 0x000055d6}, /* _IOSftReadAt */
     736            {16, 0x0000579f}, /* _IOSftWriteAt */
     737            {16, 0x00005a6f}, /* _SftFileSize */
     738            {16, 0x000449c4}, /* _VMAllocMem */
     739            {16, 0x000289c2}, /* _VMGetOwner */
     740            {16, 0x00052956}, /* g_tkExecPgm */
     741            {13, 0x00009fdc}, /* f_FuStrLenZ */
     742            {13, 0x00009f5c}, /* f_FuStrLen */
     743            {13, 0x0000a185}, /* f_FuBuff */
     744            {16, 0x0002761b}, /* _VMObjHandleInfo */
     745            {16, 0x00048b5e}, /* _ldrOpenPath */
     746            {16, 0x00045388}, /* _LDRClearSem */
     747            {16, 0x0000d650}, /* _KSEMRequestMutex */
     748            {11, 0x0001d6c4}, /* _LdrSem */
     749            {16, 0x000347a7}, /* _TKSuBuff */
     750            {16, 0x0003433c}, /* _TKFuBuff */
     751            {16, 0x00034506}, /* _TKFuBufLen */
     752            {16, 0x000453d4}, /* _ldrValidateMteHandle */
     753        }
     754    },
     755#endif
     756#ifdef ALLKERNELS
     757    { /* 8258HU.SYM */
     758        8258, KF_UNI | KF_HALFSTRICT, 16,
     759        {
     760            {15, 0x00009238}, /* _ldrRead */
     761            {15, 0x0003be78}, /* _ldrOpen */
     762            {15, 0x0003c700}, /* _ldrClose */
     763            {15, 0x0003c750}, /* _LDRQAppType */
     764            {15, 0x0003a074}, /* _ldrEnum32bitRelRecs */
     765            {15, 0x00003a24}, /* _IOSftOpen */
     766            {15, 0x00003e90}, /* _IOSftClose */
     767            {15, 0x00003f25}, /* _IOSftTransPath */
     768            {15, 0x00003cde}, /* _IOSftReadAt */
     769            {15, 0x00003ce5}, /* _IOSftWriteAt */
     770            {15, 0x0000403e}, /* _SftFileSize */
     771            {15, 0x00038340}, /* _VMAllocMem */
     772            {15, 0x0001dfd2}, /* _VMGetOwner */
     773            {15, 0x000445e6}, /* g_tkExecPgm */
     774            {11, 0x0000d794}, /* f_FuStrLenZ */
     775            {11, 0x0000d74a}, /* f_FuStrLen */
     776            {11, 0x0000d888}, /* f_FuBuff */
     777            {15, 0x0001d334}, /* _VMObjHandleInfo */
     778            {15, 0x0003c0ef}, /* _ldrOpenPath */
     779            {15, 0x00038a88}, /* _LDRClearSem */
     780            {15, 0x0000a6ac}, /* _KSEMRequestMutex */
     781            {10, 0x0001c9ec}, /* _LdrSem */
     782            {15, 0x00028c95}, /* _TKSuBuff */
     783            {15, 0x000288cb}, /* _TKFuBuff */
     784            {15, 0x00028a55}, /* _TKFuBufLen */
     785            {15, 0x00038ac4}, /* _ldrValidateMteHandle */
     786        }
     787    },
     788#endif
    215789    { /* 8258RS.SYM */
    216         8258, 'R', TYPE_SMP, 15,
     790        8258, KF_SMP, 15,
    217791        {
    218792            {14, 0x0000bdd0}, /* _ldrRead */
     
    233807            {11, 0x00009f5c}, /* f_FuStrLen */
    234808            {11, 0x0000a185}, /* f_FuBuff */
     809            {14, 0x00025e03}, /* _VMObjHandleInfo */
     810            {14, 0x0004673e}, /* _ldrOpenPath */
     811            {14, 0x00042f68}, /* _LDRClearSem */
     812            {14, 0x0000d410}, /* _KSEMRequestMutex */
     813            {9 , 0x0000d12c}, /* _LdrSem */
     814            {14, 0x00032f8f}, /* _TKSuBuff */
     815            {14, 0x00032b24}, /* _TKFuBuff */
     816            {14, 0x00032cee}, /* _TKFuBufLen */
     817            {14, 0x00042fb4}, /* _ldrValidateMteHandle */
    235818        }
    236819    },
    237820    { /* 8258RU.SYM */
    238         8258, 'R', TYPE_UNI, 14,
     821        8258, KF_UNI, 14,
    239822        {
    240823            {13, 0x000091a4}, /* _ldrRead */
     
    252835            {13, 0x0001d16a}, /* _VMGetOwner */
    253836            {13, 0x00042d56}, /* g_tkExecPgm */
    254             {9, 0x0000d794}, /* f_FuStrLenZ */
    255             {9, 0x0000d74a}, /* f_FuStrLen */
    256             {9, 0x0000d888}, /* f_FuBuff */
    257         }
    258     },
     837            {9 , 0x0000d794}, /* f_FuStrLenZ */
     838            {9 , 0x0000d74a}, /* f_FuStrLen */
     839            {9 , 0x0000d888}, /* f_FuBuff */
     840            {13, 0x0001c4cc}, /* _VMObjHandleInfo */
     841            {13, 0x0003a7f7}, /* _ldrOpenPath */
     842            {13, 0x00037190}, /* _LDRClearSem */
     843            {13, 0x0000a4f0}, /* _KSEMRequestMutex */
     844            {8 , 0x0000c828}, /* _LdrSem */
     845            {13, 0x00027e2d}, /* _TKSuBuff */
     846            {13, 0x00027a63}, /* _TKFuBuff */
     847            {13, 0x00027bed}, /* _TKFuBufLen */
     848            {13, 0x000371cc}, /* _ldrValidateMteHandle */
     849        }
     850    },
     851#ifdef ALLKERNELS
     852    { /* 8259AS.SYM */
     853        8259, KF_SMP | KF_ALLSTRICT, 17,
     854        {
     855            {16, 0x0000d370}, /* _ldrRead */
     856            {16, 0x000584b4}, /* _ldrOpen */
     857            {16, 0x00058fd4}, /* _ldrClose */
     858            {16, 0x00059024}, /* _LDRQAppType */
     859            {16, 0x0005676c}, /* _ldrEnum32bitRelRecs */
     860            {16, 0x00006170}, /* _IOSftOpen */
     861            {16, 0x000066fc}, /* _IOSftClose */
     862            {16, 0x000067b4}, /* _IOSftTransPath */
     863            {16, 0x00006440}, /* _IOSftReadAt */
     864            {16, 0x0000660c}, /* _IOSftWriteAt */
     865            {16, 0x000068ec}, /* _SftFileSize */
     866            {16, 0x00053acc}, /* _VMAllocMem */
     867            {16, 0x0002f7de}, /* _VMGetOwner */
     868            {16, 0x00063960}, /* g_tkExecPgm */
     869            {13, 0x0000a68c}, /* f_FuStrLenZ */
     870            {13, 0x0000a60c}, /* f_FuStrLen */
     871            {13, 0x0000a854}, /* f_FuBuff */
     872            {16, 0x0002e003}, /* _VMObjHandleInfo */
     873            {16, 0x0005874e}, /* _ldrOpenPath */
     874            {16, 0x00054768}, /* _LDRClearSem */
     875            {16, 0x0000f060}, /* _KSEMRequestMutex */
     876            {11, 0x0002c45c}, /* _LdrSem */
     877            {16, 0x0003e558}, /* _TKSuBuff */
     878            {16, 0x0003e0a7}, /* _TKFuBuff */
     879            {16, 0x0003e2b3}, /* _TKFuBufLen */
     880            {16, 0x00054800}, /* _ldrValidateMteHandle */
     881        }
     882    },
     883#endif
     884#ifdef ALLKERNELS
     885    { /* 8259AU.SYM */
     886        8259, KF_UNI | KF_ALLSTRICT, 16,
     887        {
     888            {15, 0x0000a294}, /* _ldrRead */
     889            {15, 0x0004a1a0}, /* _ldrOpen */
     890            {15, 0x0004ab38}, /* _ldrClose */
     891            {15, 0x0004ab88}, /* _LDRQAppType */
     892            {15, 0x000480c8}, /* _ldrEnum32bitRelRecs */
     893            {15, 0x000044a0}, /* _IOSftOpen */
     894            {15, 0x00004918}, /* _IOSftClose */
     895            {15, 0x000049b0}, /* _IOSftTransPath */
     896            {15, 0x00004764}, /* _IOSftReadAt */
     897            {15, 0x0000476b}, /* _IOSftWriteAt */
     898            {15, 0x00004ad8}, /* _SftFileSize */
     899            {15, 0x00045a48}, /* _VMAllocMem */
     900            {15, 0x0002375e}, /* _VMGetOwner */
     901            {15, 0x00053ac4}, /* g_tkExecPgm */
     902            {11, 0x0000e9d4}, /* f_FuStrLenZ */
     903            {11, 0x0000e988}, /* f_FuStrLen */
     904            {11, 0x0000eaec}, /* f_FuBuff */
     905            {15, 0x000226a8}, /* _VMObjHandleInfo */
     906            {15, 0x0004a42b}, /* _ldrOpenPath */
     907            {15, 0x000464fc}, /* _LDRClearSem */
     908            {15, 0x0000bbc0}, /* _KSEMRequestMutex */
     909            {10, 0x0002a1e8}, /* _LdrSem */
     910            {15, 0x000316e4}, /* _TKSuBuff */
     911            {15, 0x000312d6}, /* _TKFuBuff */
     912            {15, 0x000314a2}, /* _TKFuBufLen */
     913            {15, 0x00046584}, /* _ldrValidateMteHandle */
     914        }
     915    },
     916#endif
     917#ifdef ALLKERNELS
     918    { /* 8259HS.SYM */
     919        8259, KF_SMP | KF_HALFSTRICT, 17,
     920        {
     921            {16, 0x0000bee0}, /* _ldrRead */
     922            {16, 0x000489d8}, /* _ldrOpen */
     923            {16, 0x000493d4}, /* _ldrClose */
     924            {16, 0x00049424}, /* _LDRQAppType */
     925            {16, 0x00046ed0}, /* _ldrEnum32bitRelRecs */
     926            {16, 0x00005310}, /* _IOSftOpen */
     927            {16, 0x0000588e}, /* _IOSftClose */
     928            {16, 0x00005945}, /* _IOSftTransPath */
     929            {16, 0x000055d6}, /* _IOSftReadAt */
     930            {16, 0x0000579f}, /* _IOSftWriteAt */
     931            {16, 0x00005a6f}, /* _SftFileSize */
     932            {16, 0x00044ac0}, /* _VMAllocMem */
     933            {16, 0x00028abe}, /* _VMGetOwner */
     934            {16, 0x00052afe}, /* g_tkExecPgm */
     935            {13, 0x00009fdc}, /* f_FuStrLenZ */
     936            {13, 0x00009f5c}, /* f_FuStrLen */
     937            {13, 0x0000a185}, /* f_FuBuff */
     938            {16, 0x00027717}, /* _VMObjHandleInfo */
     939            {16, 0x00048c5a}, /* _ldrOpenPath */
     940            {16, 0x00045484}, /* _LDRClearSem */
     941            {16, 0x0000d650}, /* _KSEMRequestMutex */
     942            {11, 0x0001d6c4}, /* _LdrSem */
     943            {16, 0x000348a3}, /* _TKSuBuff */
     944            {16, 0x00034438}, /* _TKFuBuff */
     945            {16, 0x00034602}, /* _TKFuBufLen */
     946            {16, 0x000454d0}, /* _ldrValidateMteHandle */
     947        }
     948    },
     949#endif
     950#ifdef ALLKERNELS
     951    { /* 8259HU.SYM */
     952        8259, KF_UNI | KF_HALFSTRICT, 16,
     953        {
     954            {15, 0x000092c8}, /* _ldrRead */
     955            {15, 0x0003bf00}, /* _ldrOpen */
     956            {15, 0x0003c788}, /* _ldrClose */
     957            {15, 0x0003c7d8}, /* _LDRQAppType */
     958            {15, 0x0003a0fc}, /* _ldrEnum32bitRelRecs */
     959            {15, 0x00003a24}, /* _IOSftOpen */
     960            {15, 0x00003e90}, /* _IOSftClose */
     961            {15, 0x00003f25}, /* _IOSftTransPath */
     962            {15, 0x00003cde}, /* _IOSftReadAt */
     963            {15, 0x00003ce5}, /* _IOSftWriteAt */
     964            {15, 0x0000403e}, /* _SftFileSize */
     965            {15, 0x000383c8}, /* _VMAllocMem */
     966            {15, 0x0001e146}, /* _VMGetOwner */
     967            {15, 0x0004466e}, /* g_tkExecPgm */
     968            {11, 0x0000d7a4}, /* f_FuStrLenZ */
     969            {11, 0x0000d75a}, /* f_FuStrLen */
     970            {11, 0x0000d898}, /* f_FuBuff */
     971            {15, 0x0001d4a8}, /* _VMObjHandleInfo */
     972            {15, 0x0003c177}, /* _ldrOpenPath */
     973            {15, 0x00038b10}, /* _LDRClearSem */
     974            {15, 0x0000a73c}, /* _KSEMRequestMutex */
     975            {10, 0x0001c9ec}, /* _LdrSem */
     976            {15, 0x00028e09}, /* _TKSuBuff */
     977            {15, 0x00028a3f}, /* _TKFuBuff */
     978            {15, 0x00028bc9}, /* _TKFuBufLen */
     979            {15, 0x00038b4c}, /* _ldrValidateMteHandle */
     980        }
     981    },
     982#endif
    259983    { /* 8259RS.SYM */
    260         8259, 'R', TYPE_SMP, 15,
     984        8259, KF_SMP, 15,
    261985        {
    262986            {14, 0x0000bdd0}, /* _ldrRead */
     
    2771001            {11, 0x00009f5c}, /* f_FuStrLen */
    2781002            {11, 0x0000a185}, /* f_FuBuff */
     1003            {14, 0x00025f07}, /* _VMObjHandleInfo */
     1004            {14, 0x00046842}, /* _ldrOpenPath */
     1005            {14, 0x0004306c}, /* _LDRClearSem */
     1006            {14, 0x0000d410}, /* _KSEMRequestMutex */
     1007            {9 , 0x0000d12c}, /* _LdrSem */
     1008            {14, 0x00033093}, /* _TKSuBuff */
     1009            {14, 0x00032c28}, /* _TKFuBuff */
     1010            {14, 0x00032df2}, /* _TKFuBufLen */
     1011            {14, 0x000430b8}, /* _ldrValidateMteHandle */
    2791012        }
    2801013    },
    2811014    { /* 8259RU.SYM */
    282         8259, 'R', TYPE_UNI, 14,
     1015        8259, KF_UNI, 14,
    2831016        {
    2841017            {13, 0x00009234}, /* _ldrRead */
     
    2961029            {13, 0x0001d2de}, /* _VMGetOwner */
    2971030            {13, 0x00042de2}, /* g_tkExecPgm */
    298             {9, 0x0000d7a4}, /* f_FuStrLenZ */
    299             {9, 0x0000d75a}, /* f_FuStrLen */
    300             {9, 0x0000d898}, /* f_FuBuff */
    301         }
    302     },
     1031            {9 , 0x0000d7a4}, /* f_FuStrLenZ */
     1032            {9 , 0x0000d75a}, /* f_FuStrLen */
     1033            {9 , 0x0000d898}, /* f_FuBuff */
     1034            {13, 0x0001c640}, /* _VMObjHandleInfo */
     1035            {13, 0x0003a87f}, /* _ldrOpenPath */
     1036            {13, 0x00037218}, /* _LDRClearSem */
     1037            {13, 0x0000a580}, /* _KSEMRequestMutex */
     1038            {8 , 0x0000c828}, /* _LdrSem */
     1039            {13, 0x00027fa1}, /* _TKSuBuff */
     1040            {13, 0x00027bd7}, /* _TKFuBuff */
     1041            {13, 0x00027d61}, /* _TKFuBufLen */
     1042            {13, 0x00037254}, /* _ldrValidateMteHandle */
     1043        }
     1044    },
     1045#ifdef ALLKERNELS
     1046    { /* 8260AS.SYM */
     1047        8260, KF_SMP | KF_ALLSTRICT, 17,
     1048        {
     1049            {16, 0x0000d38c}, /* _ldrRead */
     1050            {16, 0x000587b0}, /* _ldrOpen */
     1051            {16, 0x000592d0}, /* _ldrClose */
     1052            {16, 0x00059320}, /* _LDRQAppType */
     1053            {16, 0x00056a68}, /* _ldrEnum32bitRelRecs */
     1054            {16, 0x00006180}, /* _IOSftOpen */
     1055            {16, 0x0000670c}, /* _IOSftClose */
     1056            {16, 0x000067c4}, /* _IOSftTransPath */
     1057            {16, 0x00006450}, /* _IOSftReadAt */
     1058            {16, 0x0000661c}, /* _IOSftWriteAt */
     1059            {16, 0x000068fc}, /* _SftFileSize */
     1060            {16, 0x00053dc8}, /* _VMAllocMem */
     1061            {16, 0x0002f9d2}, /* _VMGetOwner */
     1062            {16, 0x00063cf8}, /* g_tkExecPgm */
     1063            {13, 0x0000a618}, /* f_FuStrLenZ */
     1064            {13, 0x0000a598}, /* f_FuStrLen */
     1065            {13, 0x0000a7e0}, /* f_FuBuff */
     1066            {16, 0x0002e1f7}, /* _VMObjHandleInfo */
     1067            {16, 0x00058a4a}, /* _ldrOpenPath */
     1068            {16, 0x00054a64}, /* _LDRClearSem */
     1069            {16, 0x0000f07c}, /* _KSEMRequestMutex */
     1070            {11, 0x0002c474}, /* _LdrSem */
     1071            {16, 0x0003e7cc}, /* _TKSuBuff */
     1072            {16, 0x0003e31b}, /* _TKFuBuff */
     1073            {16, 0x0003e527}, /* _TKFuBufLen */
     1074            {16, 0x00054afc}, /* _ldrValidateMteHandle */
     1075        }
     1076    },
     1077#endif
     1078#ifdef ALLKERNELS
     1079    { /* 8260AU.SYM */
     1080        8260, KF_UNI | KF_ALLSTRICT, 16,
     1081        {
     1082            {15, 0x0000a2a0}, /* _ldrRead */
     1083            {15, 0x0004a19c}, /* _ldrOpen */
     1084            {15, 0x0004ab34}, /* _ldrClose */
     1085            {15, 0x0004ab84}, /* _LDRQAppType */
     1086            {15, 0x000480c4}, /* _ldrEnum32bitRelRecs */
     1087            {15, 0x000044a0}, /* _IOSftOpen */
     1088            {15, 0x00004918}, /* _IOSftClose */
     1089            {15, 0x000049b0}, /* _IOSftTransPath */
     1090            {15, 0x00004764}, /* _IOSftReadAt */
     1091            {15, 0x0000476b}, /* _IOSftWriteAt */
     1092            {15, 0x00004ad8}, /* _SftFileSize */
     1093            {15, 0x00045a44}, /* _VMAllocMem */
     1094            {15, 0x0002376a}, /* _VMGetOwner */
     1095            {15, 0x00053b5c}, /* g_tkExecPgm */
     1096            {11, 0x0000e9d4}, /* f_FuStrLenZ */
     1097            {11, 0x0000e988}, /* f_FuStrLen */
     1098            {11, 0x0000eaec}, /* f_FuBuff */
     1099            {15, 0x000226b4}, /* _VMObjHandleInfo */
     1100            {15, 0x0004a427}, /* _ldrOpenPath */
     1101            {15, 0x000464f8}, /* _LDRClearSem */
     1102            {15, 0x0000bbcc}, /* _KSEMRequestMutex */
     1103            {10, 0x0002a1d8}, /* _LdrSem */
     1104            {15, 0x000316d8}, /* _TKSuBuff */
     1105            {15, 0x000312ca}, /* _TKFuBuff */
     1106            {15, 0x00031496}, /* _TKFuBufLen */
     1107            {15, 0x00046580}, /* _ldrValidateMteHandle */
     1108        }
     1109    },
     1110#endif
     1111#ifdef ALLKERNELS
     1112    { /* 8260HS.SYM */
     1113        8260, KF_SMP | KF_HALFSTRICT, 17,
     1114        {
     1115            {16, 0x0000befc}, /* _ldrRead */
     1116            {16, 0x00048c8c}, /* _ldrOpen */
     1117            {16, 0x00049688}, /* _ldrClose */
     1118            {16, 0x000496d8}, /* _LDRQAppType */
     1119            {16, 0x00047184}, /* _ldrEnum32bitRelRecs */
     1120            {16, 0x0000531c}, /* _IOSftOpen */
     1121            {16, 0x0000589a}, /* _IOSftClose */
     1122            {16, 0x00005951}, /* _IOSftTransPath */
     1123            {16, 0x000055e2}, /* _IOSftReadAt */
     1124            {16, 0x000057ab}, /* _IOSftWriteAt */
     1125            {16, 0x00005a7b}, /* _SftFileSize */
     1126            {16, 0x00044d74}, /* _VMAllocMem */
     1127            {16, 0x00028c56}, /* _VMGetOwner */
     1128            {16, 0x00052e52}, /* g_tkExecPgm */
     1129            {13, 0x00009f7c}, /* f_FuStrLenZ */
     1130            {13, 0x00009efc}, /* f_FuStrLen */
     1131            {13, 0x0000a125}, /* f_FuBuff */
     1132            {16, 0x000278af}, /* _VMObjHandleInfo */
     1133            {16, 0x00048f0e}, /* _ldrOpenPath */
     1134            {16, 0x00045738}, /* _LDRClearSem */
     1135            {16, 0x0000d66c}, /* _KSEMRequestMutex */
     1136            {11, 0x0001d6f0}, /* _LdrSem */
     1137            {16, 0x00034ad3}, /* _TKSuBuff */
     1138            {16, 0x00034668}, /* _TKFuBuff */
     1139            {16, 0x00034832}, /* _TKFuBufLen */
     1140            {16, 0x00045784}, /* _ldrValidateMteHandle */
     1141        }
     1142    },
     1143#endif
     1144#ifdef ALLKERNELS
     1145    { /* 8260HU.SYM */
     1146        8260, KF_UNI | KF_HALFSTRICT, 16,
     1147        {
     1148            {15, 0x000092d8}, /* _ldrRead */
     1149            {15, 0x0003bf10}, /* _ldrOpen */
     1150            {15, 0x0003c798}, /* _ldrClose */
     1151            {15, 0x0003c7e8}, /* _LDRQAppType */
     1152            {15, 0x0003a10c}, /* _ldrEnum32bitRelRecs */
     1153            {15, 0x00003a24}, /* _IOSftOpen */
     1154            {15, 0x00003e90}, /* _IOSftClose */
     1155            {15, 0x00003f25}, /* _IOSftTransPath */
     1156            {15, 0x00003cde}, /* _IOSftReadAt */
     1157            {15, 0x00003ce5}, /* _IOSftWriteAt */
     1158            {15, 0x0000403e}, /* _SftFileSize */
     1159            {15, 0x000383d8}, /* _VMAllocMem */
     1160            {15, 0x0001e156}, /* _VMGetOwner */
     1161            {15, 0x00044716}, /* g_tkExecPgm */
     1162            {11, 0x0000d7a4}, /* f_FuStrLenZ */
     1163            {11, 0x0000d75a}, /* f_FuStrLen */
     1164            {11, 0x0000d898}, /* f_FuBuff */
     1165            {15, 0x0001d4b8}, /* _VMObjHandleInfo */
     1166            {15, 0x0003c187}, /* _ldrOpenPath */
     1167            {15, 0x00038b20}, /* _LDRClearSem */
     1168            {15, 0x0000a74c}, /* _KSEMRequestMutex */
     1169            {10, 0x0001c9f4}, /* _LdrSem */
     1170            {15, 0x00028e15}, /* _TKSuBuff */
     1171            {15, 0x00028a4b}, /* _TKFuBuff */
     1172            {15, 0x00028bd5}, /* _TKFuBufLen */
     1173            {15, 0x00038b5c}, /* _ldrValidateMteHandle */
     1174        }
     1175    },
     1176#endif
    3031177    { /* 8260RS.SYM */
    304         8260, 'R', TYPE_SMP, 15,
     1178        8260, KF_SMP, 15,
    3051179        {
    3061180            {14, 0x0000bdec}, /* _ldrRead */
     
    3211195            {11, 0x00009efc}, /* f_FuStrLen */
    3221196            {11, 0x0000a125}, /* f_FuBuff */
     1197            {14, 0x00026093}, /* _VMObjHandleInfo */
     1198            {14, 0x00046ada}, /* _ldrOpenPath */
     1199            {14, 0x00043304}, /* _LDRClearSem */
     1200            {14, 0x0000d42c}, /* _KSEMRequestMutex */
     1201            {9 , 0x0000d158}, /* _LdrSem */
     1202            {14, 0x000332b7}, /* _TKSuBuff */
     1203            {14, 0x00032e4c}, /* _TKFuBuff */
     1204            {14, 0x00033016}, /* _TKFuBufLen */
     1205            {14, 0x00043350}, /* _ldrValidateMteHandle */
    3231206        }
    3241207    },
    3251208    { /* 8260RU.SYM */
    326         8260, 'R', TYPE_UNI, 14,
     1209        8260, KF_UNI, 14,
    3271210        {
    3281211            {13, 0x00009244}, /* _ldrRead */
     
    3401223            {13, 0x0001d2ee}, /* _VMGetOwner */
    3411224            {13, 0x00042e8a}, /* g_tkExecPgm */
    342             {9, 0x0000d7a4}, /* f_FuStrLenZ */
    343             {9, 0x0000d75a}, /* f_FuStrLen */
    344             {9, 0x0000d898}, /* f_FuBuff */
    345         }
    346     },
     1225            {9 , 0x0000d7a4}, /* f_FuStrLenZ */
     1226            {9 , 0x0000d75a}, /* f_FuStrLen */
     1227            {9 , 0x0000d898}, /* f_FuBuff */
     1228            {13, 0x0001c650}, /* _VMObjHandleInfo */
     1229            {13, 0x0003a88f}, /* _ldrOpenPath */
     1230            {13, 0x00037228}, /* _LDRClearSem */
     1231            {13, 0x0000a590}, /* _KSEMRequestMutex */
     1232            {8 , 0x0000c830}, /* _LdrSem */
     1233            {13, 0x00027fad}, /* _TKSuBuff */
     1234            {13, 0x00027be3}, /* _TKFuBuff */
     1235            {13, 0x00027d6d}, /* _TKFuBufLen */
     1236            {13, 0x00037264}, /* _ldrValidateMteHandle */
     1237        }
     1238    },
     1239#ifdef ALLKERNELS
     1240    { /* 8261AS.SYM */
     1241        8261, KF_SMP | KF_ALLSTRICT, 17,
     1242        {
     1243            {16, 0x0000d7d8}, /* _ldrRead */
     1244            {16, 0x0005c3d0}, /* _ldrOpen */
     1245            {16, 0x0005cf18}, /* _ldrClose */
     1246            {16, 0x0005cf68}, /* _LDRQAppType */
     1247            {16, 0x0005a674}, /* _ldrEnum32bitRelRecs */
     1248            {16, 0x00006320}, /* _IOSftOpen */
     1249            {16, 0x00006808}, /* _IOSftClose */
     1250            {16, 0x000068c0}, /* _IOSftTransPath */
     1251            {16, 0x0000661c}, /* _IOSftReadAt */
     1252            {16, 0x00006623}, /* _IOSftWriteAt */
     1253            {16, 0x000069f8}, /* _SftFileSize */
     1254            {16, 0x000579d4}, /* _VMAllocMem */
     1255            {16, 0x0002fef6}, /* _VMGetOwner */
     1256            {16, 0x00067a48}, /* g_tkExecPgm */
     1257            {13, 0x0000a824}, /* f_FuStrLenZ */
     1258            {13, 0x0000a7a4}, /* f_FuStrLen */
     1259            {13, 0x0000a9ec}, /* f_FuBuff */
     1260            {16, 0x0002e717}, /* _VMObjHandleInfo */
     1261            {16, 0x0005c68a}, /* _ldrOpenPath */
     1262            {16, 0x00058670}, /* _LDRClearSem */
     1263            {16, 0x0000f4fc}, /* _KSEMRequestMutex */
     1264            {11, 0x0002c800}, /* _LdrSem */
     1265            {16, 0x0003f29c}, /* _TKSuBuff */
     1266            {16, 0x0003eded}, /* _TKFuBuff */
     1267            {16, 0x0003eff9}, /* _TKFuBufLen */
     1268            {16, 0x00058708}, /* _ldrValidateMteHandle */
     1269        }
     1270    },
     1271#endif
     1272#ifdef ALLKERNELS
     1273    { /* 8261AU.SYM */
     1274        8261, KF_UNI | KF_ALLSTRICT, 16,
     1275        {
     1276            {15, 0x0000a328}, /* _ldrRead */
     1277            {15, 0x0004a48c}, /* _ldrOpen */
     1278            {15, 0x0004ae2c}, /* _ldrClose */
     1279            {15, 0x0004ae7c}, /* _LDRQAppType */
     1280            {15, 0x00048394}, /* _ldrEnum32bitRelRecs */
     1281            {15, 0x00004520}, /* _IOSftOpen */
     1282            {15, 0x00004998}, /* _IOSftClose */
     1283            {15, 0x00004a30}, /* _IOSftTransPath */
     1284            {15, 0x000047e4}, /* _IOSftReadAt */
     1285            {15, 0x000047eb}, /* _IOSftWriteAt */
     1286            {15, 0x00004b58}, /* _SftFileSize */
     1287            {15, 0x00045d10}, /* _VMAllocMem */
     1288            {15, 0x0002384a}, /* _VMGetOwner */
     1289            {15, 0x00053f24}, /* g_tkExecPgm */
     1290            {11, 0x0000ea04}, /* f_FuStrLenZ */
     1291            {11, 0x0000e9b8}, /* f_FuStrLen */
     1292            {11, 0x0000eb1c}, /* f_FuBuff */
     1293            {15, 0x00022794}, /* _VMObjHandleInfo */
     1294            {15, 0x0004a717}, /* _ldrOpenPath */
     1295            {15, 0x000467c4}, /* _LDRClearSem */
     1296            {15, 0x0000bc54}, /* _KSEMRequestMutex */
     1297            {10, 0x0002a394}, /* _LdrSem */
     1298            {15, 0x000317f0}, /* _TKSuBuff */
     1299            {15, 0x000313e0}, /* _TKFuBuff */
     1300            {15, 0x000315ac}, /* _TKFuBufLen */
     1301            {15, 0x0004684c}, /* _ldrValidateMteHandle */
     1302        }
     1303    },
     1304#endif
     1305#ifdef ALLKERNELS
     1306    { /* 8261HS.SYM */
     1307        8261, KF_SMP | KF_HALFSTRICT, 17,
     1308        {
     1309            {16, 0x0000c2ec}, /* _ldrRead */
     1310            {16, 0x0004c87c}, /* _ldrOpen */
     1311            {16, 0x0004d2a4}, /* _ldrClose */
     1312            {16, 0x0004d2f4}, /* _LDRQAppType */
     1313            {16, 0x0004ad6c}, /* _ldrEnum32bitRelRecs */
     1314            {16, 0x0000547c}, /* _IOSftOpen */
     1315            {16, 0x00005955}, /* _IOSftClose */
     1316            {16, 0x00005a0c}, /* _IOSftTransPath */
     1317            {16, 0x0000576c}, /* _IOSftReadAt */
     1318            {16, 0x00005773}, /* _IOSftWriteAt */
     1319            {16, 0x00005b36}, /* _SftFileSize */
     1320            {16, 0x0004895c}, /* _VMAllocMem */
     1321            {16, 0x000292bc}, /* _VMGetOwner */
     1322            {16, 0x00056d3a}, /* g_tkExecPgm */
     1323            {13, 0x0000a158}, /* f_FuStrLenZ */
     1324            {13, 0x0000a0d8}, /* f_FuStrLen */
     1325            {13, 0x0000a301}, /* f_FuBuff */
     1326            {16, 0x00027f13}, /* _VMObjHandleInfo */
     1327            {16, 0x0004cb22}, /* _ldrOpenPath */
     1328            {16, 0x00049320}, /* _LDRClearSem */
     1329            {16, 0x0000da8c}, /* _KSEMRequestMutex */
     1330            {11, 0x0001d780}, /* _LdrSem */
     1331            {16, 0x000356e7}, /* _TKSuBuff */
     1332            {16, 0x0003527a}, /* _TKFuBuff */
     1333            {16, 0x00035444}, /* _TKFuBufLen */
     1334            {16, 0x0004936c}, /* _ldrValidateMteHandle */
     1335        }
     1336    },
     1337#endif
     1338#ifdef ALLKERNELS
     1339    { /* 8261HU.SYM */
     1340        8261, KF_UNI | KF_HALFSTRICT, 16,
     1341        {
     1342            {15, 0x00009328}, /* _ldrRead */
     1343            {15, 0x0003c120}, /* _ldrOpen */
     1344            {15, 0x0003c9ac}, /* _ldrClose */
     1345            {15, 0x0003c9fc}, /* _LDRQAppType */
     1346            {15, 0x0003a308}, /* _ldrEnum32bitRelRecs */
     1347            {15, 0x00003a70}, /* _IOSftOpen */
     1348            {15, 0x00003edc}, /* _IOSftClose */
     1349            {15, 0x00003f71}, /* _IOSftTransPath */
     1350            {15, 0x00003d2a}, /* _IOSftReadAt */
     1351            {15, 0x00003d31}, /* _IOSftWriteAt */
     1352            {15, 0x0000408a}, /* _SftFileSize */
     1353            {15, 0x000385d4}, /* _VMAllocMem */
     1354            {15, 0x0001e156}, /* _VMGetOwner */
     1355            {15, 0x00044a9a}, /* g_tkExecPgm */
     1356            {11, 0x0000d7d0}, /* f_FuStrLenZ */
     1357            {11, 0x0000d786}, /* f_FuStrLen */
     1358            {11, 0x0000d8c4}, /* f_FuBuff */
     1359            {15, 0x0001d4bc}, /* _VMObjHandleInfo */
     1360            {15, 0x0003c397}, /* _ldrOpenPath */
     1361            {15, 0x00038d1c}, /* _LDRClearSem */
     1362            {15, 0x0000a79c}, /* _KSEMRequestMutex */
     1363            {10, 0x0001ca30}, /* _LdrSem */
     1364            {15, 0x00028e31}, /* _TKSuBuff */
     1365            {15, 0x00028a67}, /* _TKFuBuff */
     1366            {15, 0x00028bf1}, /* _TKFuBufLen */
     1367            {15, 0x00038d58}, /* _ldrValidateMteHandle */
     1368        }
     1369    },
     1370#endif
    3471371    { /* 8261RS.SYM */
    348         8261, 'R', TYPE_SMP, 15,
     1372        8261, KF_SMP, 15,
    3491373        {
    3501374            {14, 0x0000c1dc}, /* _ldrRead */
     
    3651389            {11, 0x0000a0d8}, /* f_FuStrLen */
    3661390            {11, 0x0000a301}, /* f_FuBuff */
     1391            {14, 0x000266f7}, /* _VMObjHandleInfo */
     1392            {14, 0x0004a712}, /* _ldrOpenPath */
     1393            {14, 0x00046f10}, /* _LDRClearSem */
     1394            {14, 0x0000d84c}, /* _KSEMRequestMutex */
     1395            {9 , 0x0000d1e8}, /* _LdrSem */
     1396            {14, 0x00033ecb}, /* _TKSuBuff */
     1397            {14, 0x00033a5e}, /* _TKFuBuff */
     1398            {14, 0x00033c28}, /* _TKFuBufLen */
     1399            {14, 0x00046f5c}, /* _ldrValidateMteHandle */
    3671400        }
    3681401    },
    3691402    { /* 8261RU.SYM */
    370         8261, 'R', TYPE_UNI, 14,
     1403        8261, KF_UNI, 14,
    3711404        {
    3721405            {13, 0x00009294}, /* _ldrRead */
     
    3841417            {13, 0x0001d2ee}, /* _VMGetOwner */
    3851418            {13, 0x0004315a}, /* g_tkExecPgm */
    386             {9, 0x0000d7d0}, /* f_FuStrLenZ */
    387             {9, 0x0000d786}, /* f_FuStrLen */
    388             {9, 0x0000d8c4}, /* f_FuBuff */
    389         }
    390     },
     1419            {9 , 0x0000d7d0}, /* f_FuStrLenZ */
     1420            {9 , 0x0000d786}, /* f_FuStrLen */
     1421            {9 , 0x0000d8c4}, /* f_FuBuff */
     1422            {13, 0x0001c654}, /* _VMObjHandleInfo */
     1423            {13, 0x0003aab3}, /* _ldrOpenPath */
     1424            {13, 0x00037438}, /* _LDRClearSem */
     1425            {13, 0x0000a5e0}, /* _KSEMRequestMutex */
     1426            {8 , 0x0000c86c}, /* _LdrSem */
     1427            {13, 0x00027fc9}, /* _TKSuBuff */
     1428            {13, 0x00027bff}, /* _TKFuBuff */
     1429            {13, 0x00027d89}, /* _TKFuBufLen */
     1430            {13, 0x00037474}, /* _ldrValidateMteHandle */
     1431        }
     1432    },
     1433#ifdef ALLKERNELS
     1434    { /* 8262AS.SYM */
     1435        8262, KF_SMP | KF_ALLSTRICT, 17,
     1436        {
     1437            {16, 0x0000d7d8}, /* _ldrRead */
     1438            {16, 0x0005c2d0}, /* _ldrOpen */
     1439            {16, 0x0005ce18}, /* _ldrClose */
     1440            {16, 0x0005ce68}, /* _LDRQAppType */
     1441            {16, 0x0005a574}, /* _ldrEnum32bitRelRecs */
     1442            {16, 0x00006320}, /* _IOSftOpen */
     1443            {16, 0x00006808}, /* _IOSftClose */
     1444            {16, 0x000068c0}, /* _IOSftTransPath */
     1445            {16, 0x0000661c}, /* _IOSftReadAt */
     1446            {16, 0x00006623}, /* _IOSftWriteAt */
     1447            {16, 0x000069f8}, /* _SftFileSize */
     1448            {16, 0x000578d4}, /* _VMAllocMem */
     1449            {16, 0x0002fdf6}, /* _VMGetOwner */
     1450            {16, 0x00067948}, /* g_tkExecPgm */
     1451            {13, 0x0000a824}, /* f_FuStrLenZ */
     1452            {13, 0x0000a7a4}, /* f_FuStrLen */
     1453            {13, 0x0000a9ec}, /* f_FuBuff */
     1454            {16, 0x0002e617}, /* _VMObjHandleInfo */
     1455            {16, 0x0005c58a}, /* _ldrOpenPath */
     1456            {16, 0x00058570}, /* _LDRClearSem */
     1457            {16, 0x0000f4fc}, /* _KSEMRequestMutex */
     1458            {11, 0x0002c800}, /* _LdrSem */
     1459            {16, 0x0003f19c}, /* _TKSuBuff */
     1460            {16, 0x0003eced}, /* _TKFuBuff */
     1461            {16, 0x0003eef9}, /* _TKFuBufLen */
     1462            {16, 0x00058608}, /* _ldrValidateMteHandle */
     1463        }
     1464    },
     1465#endif
     1466#ifdef ALLKERNELS
     1467    { /* 8262AU.SYM */
     1468        8262, KF_UNI | KF_ALLSTRICT, 16,
     1469        {
     1470            {15, 0x0000a328}, /* _ldrRead */
     1471            {15, 0x0004a3a8}, /* _ldrOpen */
     1472            {15, 0x0004ad48}, /* _ldrClose */
     1473            {15, 0x0004ad98}, /* _LDRQAppType */
     1474            {15, 0x000482b0}, /* _ldrEnum32bitRelRecs */
     1475            {15, 0x00004520}, /* _IOSftOpen */
     1476            {15, 0x00004998}, /* _IOSftClose */
     1477            {15, 0x00004a30}, /* _IOSftTransPath */
     1478            {15, 0x000047e4}, /* _IOSftReadAt */
     1479            {15, 0x000047eb}, /* _IOSftWriteAt */
     1480            {15, 0x00004b58}, /* _SftFileSize */
     1481            {15, 0x00045c2c}, /* _VMAllocMem */
     1482            {15, 0x00023766}, /* _VMGetOwner */
     1483            {15, 0x00053e40}, /* g_tkExecPgm */
     1484            {11, 0x0000ea08}, /* f_FuStrLenZ */
     1485            {11, 0x0000e9bc}, /* f_FuStrLen */
     1486            {11, 0x0000eb20}, /* f_FuBuff */
     1487            {15, 0x000226b0}, /* _VMObjHandleInfo */
     1488            {15, 0x0004a633}, /* _ldrOpenPath */
     1489            {15, 0x000466e0}, /* _LDRClearSem */
     1490            {15, 0x0000bc54}, /* _KSEMRequestMutex */
     1491            {10, 0x0002a394}, /* _LdrSem */
     1492            {15, 0x0003170c}, /* _TKSuBuff */
     1493            {15, 0x000312fc}, /* _TKFuBuff */
     1494            {15, 0x000314c8}, /* _TKFuBufLen */
     1495            {15, 0x00046768}, /* _ldrValidateMteHandle */
     1496        }
     1497    },
     1498#endif
     1499#ifdef ALLKERNELS
     1500    { /* 8262HS.SYM */
     1501        8262, KF_SMP | KF_HALFSTRICT, 17,
     1502        {
     1503            {16, 0x0000c2ec}, /* _ldrRead */
     1504            {16, 0x0004c77c}, /* _ldrOpen */
     1505            {16, 0x0004d1a4}, /* _ldrClose */
     1506            {16, 0x0004d1f4}, /* _LDRQAppType */
     1507            {16, 0x0004ac6c}, /* _ldrEnum32bitRelRecs */
     1508            {16, 0x0000547c}, /* _IOSftOpen */
     1509            {16, 0x00005955}, /* _IOSftClose */
     1510            {16, 0x00005a0c}, /* _IOSftTransPath */
     1511            {16, 0x0000576c}, /* _IOSftReadAt */
     1512            {16, 0x00005773}, /* _IOSftWriteAt */
     1513            {16, 0x00005b36}, /* _SftFileSize */
     1514            {16, 0x0004885c}, /* _VMAllocMem */
     1515            {16, 0x000291bc}, /* _VMGetOwner */
     1516            {16, 0x00056c3a}, /* g_tkExecPgm */
     1517            {13, 0x0000a15c}, /* f_FuStrLenZ */
     1518            {13, 0x0000a0dc}, /* f_FuStrLen */
     1519            {13, 0x0000a305}, /* f_FuBuff */
     1520            {16, 0x00027e13}, /* _VMObjHandleInfo */
     1521            {16, 0x0004ca22}, /* _ldrOpenPath */
     1522            {16, 0x00049220}, /* _LDRClearSem */
     1523            {16, 0x0000da8c}, /* _KSEMRequestMutex */
     1524            {11, 0x0001d780}, /* _LdrSem */
     1525            {16, 0x000355e7}, /* _TKSuBuff */
     1526            {16, 0x0003517a}, /* _TKFuBuff */
     1527            {16, 0x00035344}, /* _TKFuBufLen */
     1528            {16, 0x0004926c}, /* _ldrValidateMteHandle */
     1529        }
     1530    },
     1531#endif
     1532#ifdef ALLKERNELS
     1533    { /* 8262HU.SYM */
     1534        8262, KF_UNI | KF_HALFSTRICT, 16,
     1535        {
     1536            {15, 0x00009328}, /* _ldrRead */
     1537            {15, 0x0003c03c}, /* _ldrOpen */
     1538            {15, 0x0003c8c8}, /* _ldrClose */
     1539            {15, 0x0003c918}, /* _LDRQAppType */
     1540            {15, 0x0003a224}, /* _ldrEnum32bitRelRecs */
     1541            {15, 0x00003a70}, /* _IOSftOpen */
     1542            {15, 0x00003edc}, /* _IOSftClose */
     1543            {15, 0x00003f71}, /* _IOSftTransPath */
     1544            {15, 0x00003d2a}, /* _IOSftReadAt */
     1545            {15, 0x00003d31}, /* _IOSftWriteAt */
     1546            {15, 0x0000408a}, /* _SftFileSize */
     1547            {15, 0x000384f0}, /* _VMAllocMem */
     1548            {15, 0x0001e072}, /* _VMGetOwner */
     1549            {15, 0x000449b6}, /* g_tkExecPgm */
     1550            {11, 0x0000d7d4}, /* f_FuStrLenZ */
     1551            {11, 0x0000d78a}, /* f_FuStrLen */
     1552            {11, 0x0000d8c8}, /* f_FuBuff */
     1553            {15, 0x0001d3d8}, /* _VMObjHandleInfo */
     1554            {15, 0x0003c2b3}, /* _ldrOpenPath */
     1555            {15, 0x00038c38}, /* _LDRClearSem */
     1556            {15, 0x0000a79c}, /* _KSEMRequestMutex */
     1557            {10, 0x0001ca30}, /* _LdrSem */
     1558            {15, 0x00028d4d}, /* _TKSuBuff */
     1559            {15, 0x00028983}, /* _TKFuBuff */
     1560            {15, 0x00028b0d}, /* _TKFuBufLen */
     1561            {15, 0x00038c74}, /* _ldrValidateMteHandle */
     1562        }
     1563    },
     1564#endif
    3911565    { /* 8262RS.SYM */
    392         8262, 'R', TYPE_SMP, 15,
     1566        8262, KF_SMP, 15,
    3931567        {
    3941568            {14, 0x0000c1dc}, /* _ldrRead */
     
    4091583            {11, 0x0000a0dc}, /* f_FuStrLen */
    4101584            {11, 0x0000a305}, /* f_FuBuff */
     1585            {14, 0x000265f7}, /* _VMObjHandleInfo */
     1586            {14, 0x0004a612}, /* _ldrOpenPath */
     1587            {14, 0x00046e10}, /* _LDRClearSem */
     1588            {14, 0x0000d84c}, /* _KSEMRequestMutex */
     1589            {9 , 0x0000d1e8}, /* _LdrSem */
     1590            {14, 0x00033dcb}, /* _TKSuBuff */
     1591            {14, 0x0003395e}, /* _TKFuBuff */
     1592            {14, 0x00033b28}, /* _TKFuBufLen */
     1593            {14, 0x00046e5c}, /* _ldrValidateMteHandle */
    4111594        }
    4121595    },
    4131596    { /* 8262RU.SYM */
    414         8262, 'R', TYPE_UNI, 14,
     1597        8262, KF_UNI, 14,
    4151598        {
    4161599            {13, 0x00009294}, /* _ldrRead */
     
    4281611            {13, 0x0001d20a}, /* _VMGetOwner */
    4291612            {13, 0x00043076}, /* g_tkExecPgm */
    430             {9, 0x0000d7d4}, /* f_FuStrLenZ */
    431             {9, 0x0000d78a}, /* f_FuStrLen */
    432             {9, 0x0000d8c8}, /* f_FuBuff */
    433         }
    434     },
     1613            {9 , 0x0000d7d4}, /* f_FuStrLenZ */
     1614            {9 , 0x0000d78a}, /* f_FuStrLen */
     1615            {9 , 0x0000d8c8}, /* f_FuBuff */
     1616            {13, 0x0001c570}, /* _VMObjHandleInfo */
     1617            {13, 0x0003a9cf}, /* _ldrOpenPath */
     1618            {13, 0x00037354}, /* _LDRClearSem */
     1619            {13, 0x0000a5e0}, /* _KSEMRequestMutex */
     1620            {8 , 0x0000c86c}, /* _LdrSem */
     1621            {13, 0x00027ee5}, /* _TKSuBuff */
     1622            {13, 0x00027b1b}, /* _TKFuBuff */
     1623            {13, 0x00027ca5}, /* _TKFuBufLen */
     1624            {13, 0x00037390}, /* _ldrValidateMteHandle */
     1625        }
     1626    },
     1627#ifdef ALLKERNELS
     1628    { /* 8263AS.SYM */
     1629        8263, KF_SMP | KF_ALLSTRICT, 17,
     1630        {
     1631            {16, 0x0000d854}, /* _ldrRead */
     1632            {16, 0x0005c3ac}, /* _ldrOpen */
     1633            {16, 0x0005cef4}, /* _ldrClose */
     1634            {16, 0x0005cf44}, /* _LDRQAppType */
     1635            {16, 0x0005a644}, /* _ldrEnum32bitRelRecs */
     1636            {16, 0x0000632c}, /* _IOSftOpen */
     1637            {16, 0x00006814}, /* _IOSftClose */
     1638            {16, 0x000068cc}, /* _IOSftTransPath */
     1639            {16, 0x00006628}, /* _IOSftReadAt */
     1640            {16, 0x0000662f}, /* _IOSftWriteAt */
     1641            {16, 0x00006a04}, /* _SftFileSize */
     1642            {16, 0x000579a4}, /* _VMAllocMem */
     1643            {16, 0x0002fe72}, /* _VMGetOwner */
     1644            {16, 0x00067990}, /* g_tkExecPgm */
     1645            {13, 0x0000a838}, /* f_FuStrLenZ */
     1646            {13, 0x0000a7b8}, /* f_FuStrLen */
     1647            {13, 0x0000aa00}, /* f_FuBuff */
     1648            {16, 0x0002e693}, /* _VMObjHandleInfo */
     1649            {16, 0x0005c666}, /* _ldrOpenPath */
     1650            {16, 0x00058640}, /* _LDRClearSem */
     1651            {16, 0x0000f578}, /* _KSEMRequestMutex */
     1652            {11, 0x0002c84c}, /* _LdrSem */
     1653            {16, 0x0003f218}, /* _TKSuBuff */
     1654            {16, 0x0003ed69}, /* _TKFuBuff */
     1655            {16, 0x0003ef75}, /* _TKFuBufLen */
     1656            {16, 0x000586d8}, /* _ldrValidateMteHandle */
     1657        }
     1658    },
     1659#endif
     1660#ifdef ALLKERNELS
     1661    { /* 8263AU.SYM */
     1662        8263, KF_UNI | KF_ALLSTRICT, 16,
     1663        {
     1664            {15, 0x0000a3a4}, /* _ldrRead */
     1665            {15, 0x0004a5b0}, /* _ldrOpen */
     1666            {15, 0x0004af50}, /* _ldrClose */
     1667            {15, 0x0004afa0}, /* _LDRQAppType */
     1668            {15, 0x000484b4}, /* _ldrEnum32bitRelRecs */
     1669            {15, 0x0000452c}, /* _IOSftOpen */
     1670            {15, 0x000049a4}, /* _IOSftClose */
     1671            {15, 0x00004a3c}, /* _IOSftTransPath */
     1672            {15, 0x000047f0}, /* _IOSftReadAt */
     1673            {15, 0x000047f7}, /* _IOSftWriteAt */
     1674            {15, 0x00004b64}, /* _SftFileSize */
     1675            {15, 0x00045e30}, /* _VMAllocMem */
     1676            {15, 0x000237e2}, /* _VMGetOwner */
     1677            {15, 0x0005403c}, /* g_tkExecPgm */
     1678            {11, 0x0000ea08}, /* f_FuStrLenZ */
     1679            {11, 0x0000e9bc}, /* f_FuStrLen */
     1680            {11, 0x0000eb20}, /* f_FuBuff */
     1681            {15, 0x0002272c}, /* _VMObjHandleInfo */
     1682            {15, 0x0004a83b}, /* _ldrOpenPath */
     1683            {15, 0x000468e4}, /* _LDRClearSem */
     1684            {15, 0x0000bcd0}, /* _KSEMRequestMutex */
     1685            {10, 0x0002a3e8}, /* _LdrSem */
     1686            {15, 0x00031788}, /* _TKSuBuff */
     1687            {15, 0x00031378}, /* _TKFuBuff */
     1688            {15, 0x00031544}, /* _TKFuBufLen */
     1689            {15, 0x0004696c}, /* _ldrValidateMteHandle */
     1690        }
     1691    },
     1692#endif
     1693#ifdef ALLKERNELS
     1694    { /* 8263HS.SYM */
     1695        8263, KF_SMP | KF_HALFSTRICT, 17,
     1696        {
     1697            {16, 0x0000c360}, /* _ldrRead */
     1698            {16, 0x0004c870}, /* _ldrOpen */
     1699            {16, 0x0004d298}, /* _ldrClose */
     1700            {16, 0x0004d2e8}, /* _LDRQAppType */
     1701            {16, 0x0004ad54}, /* _ldrEnum32bitRelRecs */
     1702            {16, 0x00005484}, /* _IOSftOpen */
     1703            {16, 0x0000595d}, /* _IOSftClose */
     1704            {16, 0x00005a14}, /* _IOSftTransPath */
     1705            {16, 0x00005774}, /* _IOSftReadAt */
     1706            {16, 0x0000577b}, /* _IOSftWriteAt */
     1707            {16, 0x00005b3e}, /* _SftFileSize */
     1708            {16, 0x00048944}, /* _VMAllocMem */
     1709            {16, 0x00029230}, /* _VMGetOwner */
     1710            {16, 0x00056cde}, /* g_tkExecPgm */
     1711            {13, 0x0000a170}, /* f_FuStrLenZ */
     1712            {13, 0x0000a0f0}, /* f_FuStrLen */
     1713            {13, 0x0000a319}, /* f_FuBuff */
     1714            {16, 0x00027e87}, /* _VMObjHandleInfo */
     1715            {16, 0x0004cb16}, /* _ldrOpenPath */
     1716            {16, 0x00049308}, /* _LDRClearSem */
     1717            {16, 0x0000db00}, /* _KSEMRequestMutex */
     1718            {11, 0x0001d7c0}, /* _LdrSem */
     1719            {16, 0x0003565b}, /* _TKSuBuff */
     1720            {16, 0x000351ee}, /* _TKFuBuff */
     1721            {16, 0x000353b8}, /* _TKFuBufLen */
     1722            {16, 0x00049354}, /* _ldrValidateMteHandle */
     1723        }
     1724    },
     1725#endif
     1726#ifdef ALLKERNELS
     1727    { /* 8263HU.SYM */
     1728        8263, KF_UNI | KF_HALFSTRICT, 16,
     1729        {
     1730            {15, 0x0000939c}, /* _ldrRead */
     1731            {15, 0x0003c1c4}, /* _ldrOpen */
     1732            {15, 0x0003ca50}, /* _ldrClose */
     1733            {15, 0x0003caa0}, /* _LDRQAppType */
     1734            {15, 0x0003a3a4}, /* _ldrEnum32bitRelRecs */
     1735            {15, 0x00003a78}, /* _IOSftOpen */
     1736            {15, 0x00003ee4}, /* _IOSftClose */
     1737            {15, 0x00003f79}, /* _IOSftTransPath */
     1738            {15, 0x00003d32}, /* _IOSftReadAt */
     1739            {15, 0x00003d39}, /* _IOSftWriteAt */
     1740            {15, 0x00004092}, /* _SftFileSize */
     1741            {15, 0x00038670}, /* _VMAllocMem */
     1742            {15, 0x0001e0e6}, /* _VMGetOwner */
     1743            {15, 0x00044b5e}, /* g_tkExecPgm */
     1744            {11, 0x0000d7d4}, /* f_FuStrLenZ */
     1745            {11, 0x0000d78a}, /* f_FuStrLen */
     1746            {11, 0x0000d8c8}, /* f_FuBuff */
     1747            {15, 0x0001d44c}, /* _VMObjHandleInfo */
     1748            {15, 0x0003c43b}, /* _ldrOpenPath */
     1749            {15, 0x00038db8}, /* _LDRClearSem */
     1750            {15, 0x0000a810}, /* _KSEMRequestMutex */
     1751            {10, 0x0001ca70}, /* _LdrSem */
     1752            {15, 0x00028dc1}, /* _TKSuBuff */
     1753            {15, 0x000289f7}, /* _TKFuBuff */
     1754            {15, 0x00028b81}, /* _TKFuBufLen */
     1755            {15, 0x00038df4}, /* _ldrValidateMteHandle */
     1756        }
     1757    },
     1758#endif
    4351759    { /* 8263RS.SYM */
    436         8263, 'R', TYPE_SMP, 15,
     1760        8263, KF_SMP, 15,
    4371761        {
    4381762            {14, 0x0000c250}, /* _ldrRead */
     
    4531777            {11, 0x0000a0f0}, /* f_FuStrLen */
    4541778            {11, 0x0000a319}, /* f_FuBuff */
     1779            {14, 0x0002666b}, /* _VMObjHandleInfo */
     1780            {14, 0x0004a706}, /* _ldrOpenPath */
     1781            {14, 0x00046ef8}, /* _LDRClearSem */
     1782            {14, 0x0000d8c0}, /* _KSEMRequestMutex */
     1783            {9 , 0x0000d228}, /* _LdrSem */
     1784            {14, 0x00033e3f}, /* _TKSuBuff */
     1785            {14, 0x000339d2}, /* _TKFuBuff */
     1786            {14, 0x00033b9c}, /* _TKFuBufLen */
     1787            {14, 0x00046f44}, /* _ldrValidateMteHandle */
    4551788        }
    4561789    },
    4571790    { /* 8263RU.SYM */
    458         8263, 'R', TYPE_UNI, 14,
     1791        8263, KF_UNI, 14,
    4591792        {
    4601793            {13, 0x00009308}, /* _ldrRead */
     
    4721805            {13, 0x0001d27e}, /* _VMGetOwner */
    4731806            {13, 0x0004321e}, /* g_tkExecPgm */
    474             {9, 0x0000d7d4}, /* f_FuStrLenZ */
    475             {9, 0x0000d78a}, /* f_FuStrLen */
    476             {9, 0x0000d8c8}, /* f_FuBuff */
    477         }
    478     },
     1807            {9 , 0x0000d7d4}, /* f_FuStrLenZ */
     1808            {9 , 0x0000d78a}, /* f_FuStrLen */
     1809            {9 , 0x0000d8c8}, /* f_FuBuff */
     1810            {13, 0x0001c5e4}, /* _VMObjHandleInfo */
     1811            {13, 0x0003ab57}, /* _ldrOpenPath */
     1812            {13, 0x000374d4}, /* _LDRClearSem */
     1813            {13, 0x0000a654}, /* _KSEMRequestMutex */
     1814            {8 , 0x0000c8ac}, /* _LdrSem */
     1815            {13, 0x00027f59}, /* _TKSuBuff */
     1816            {13, 0x00027b8f}, /* _TKFuBuff */
     1817            {13, 0x00027d19}, /* _TKFuBufLen */
     1818            {13, 0x00037510}, /* _ldrValidateMteHandle */
     1819        }
     1820    },
     1821#ifdef ALLKERNELS
     1822    { /* 8264AS.SYM */
     1823        8264, KF_SMP | KF_ALLSTRICT, 17,
     1824        {
     1825            {16, 0x0000d854}, /* _ldrRead */
     1826            {16, 0x0005c344}, /* _ldrOpen */
     1827            {16, 0x0005ce84}, /* _ldrClose */
     1828            {16, 0x0005ced4}, /* _LDRQAppType */
     1829            {16, 0x0005a5f0}, /* _ldrEnum32bitRelRecs */
     1830            {16, 0x0000632c}, /* _IOSftOpen */
     1831            {16, 0x00006814}, /* _IOSftClose */
     1832            {16, 0x000068cc}, /* _IOSftTransPath */
     1833            {16, 0x00006628}, /* _IOSftReadAt */
     1834            {16, 0x0000662f}, /* _IOSftWriteAt */
     1835            {16, 0x00006a04}, /* _SftFileSize */
     1836            {16, 0x00057950}, /* _VMAllocMem */
     1837            {16, 0x0002feb6}, /* _VMGetOwner */
     1838            {16, 0x000678cc}, /* g_tkExecPgm */
     1839            {13, 0x0000a840}, /* f_FuStrLenZ */
     1840            {13, 0x0000a7c0}, /* f_FuStrLen */
     1841            {13, 0x0000aa08}, /* f_FuBuff */
     1842            {16, 0x0002e6d7}, /* _VMObjHandleInfo */
     1843            {16, 0x0005c5fe}, /* _ldrOpenPath */
     1844            {16, 0x000585ec}, /* _LDRClearSem */
     1845            {16, 0x0000f5cc}, /* _KSEMRequestMutex */
     1846            {11, 0x0002c858}, /* _LdrSem */
     1847            {16, 0x0003f274}, /* _TKSuBuff */
     1848            {16, 0x0003edc5}, /* _TKFuBuff */
     1849            {16, 0x0003efd1}, /* _TKFuBufLen */
     1850            {16, 0x00058684}, /* _ldrValidateMteHandle */
     1851        }
     1852    },
     1853#endif
     1854#ifdef ALLKERNELS
     1855    { /* 8264AU.SYM */
     1856        8264, KF_UNI | KF_ALLSTRICT, 16,
     1857        {
     1858            {15, 0x0000a3a8}, /* _ldrRead */
     1859            {15, 0x0004a5f0}, /* _ldrOpen */
     1860            {15, 0x0004af88}, /* _ldrClose */
     1861            {15, 0x0004afd8}, /* _LDRQAppType */
     1862            {15, 0x00048508}, /* _ldrEnum32bitRelRecs */
     1863            {15, 0x00004530}, /* _IOSftOpen */
     1864            {15, 0x000049a8}, /* _IOSftClose */
     1865            {15, 0x00004a40}, /* _IOSftTransPath */
     1866            {15, 0x000047f4}, /* _IOSftReadAt */
     1867            {15, 0x000047fb}, /* _IOSftWriteAt */
     1868            {15, 0x00004b68}, /* _SftFileSize */
     1869            {15, 0x00045e84}, /* _VMAllocMem */
     1870            {15, 0x000238ca}, /* _VMGetOwner */
     1871            {15, 0x000540d0}, /* g_tkExecPgm */
     1872            {11, 0x0000ea10}, /* f_FuStrLenZ */
     1873            {11, 0x0000e9c4}, /* f_FuStrLen */
     1874            {11, 0x0000eb28}, /* f_FuBuff */
     1875            {15, 0x00022814}, /* _VMObjHandleInfo */
     1876            {15, 0x0004a87b}, /* _ldrOpenPath */
     1877            {15, 0x00046938}, /* _LDRClearSem */
     1878            {15, 0x0000bcd4}, /* _KSEMRequestMutex */
     1879            {10, 0x0002a384}, /* _LdrSem */
     1880            {15, 0x00031888}, /* _TKSuBuff */
     1881            {15, 0x00031478}, /* _TKFuBuff */
     1882            {15, 0x00031644}, /* _TKFuBufLen */
     1883            {15, 0x000469c0}, /* _ldrValidateMteHandle */
     1884        }
     1885    },
     1886#endif
     1887#ifdef ALLKERNELS
     1888    { /* 8264HS.SYM */
     1889        8264, KF_SMP | KF_HALFSTRICT, 17,
     1890        {
     1891            {16, 0x0000c360}, /* _ldrRead */
     1892            {16, 0x0004c7b0}, /* _ldrOpen */
     1893            {16, 0x0004d1d0}, /* _ldrClose */
     1894            {16, 0x0004d220}, /* _LDRQAppType */
     1895            {16, 0x0004aca8}, /* _ldrEnum32bitRelRecs */
     1896            {16, 0x00005484}, /* _IOSftOpen */
     1897            {16, 0x0000595d}, /* _IOSftClose */
     1898            {16, 0x00005a14}, /* _IOSftTransPath */
     1899            {16, 0x00005774}, /* _IOSftReadAt */
     1900            {16, 0x0000577b}, /* _IOSftWriteAt */
     1901            {16, 0x00005b3e}, /* _SftFileSize */
     1902            {16, 0x00048898}, /* _VMAllocMem */
     1903            {16, 0x00029210}, /* _VMGetOwner */
     1904            {16, 0x00056be2}, /* g_tkExecPgm */
     1905            {13, 0x0000a178}, /* f_FuStrLenZ */
     1906            {13, 0x0000a0f8}, /* f_FuStrLen */
     1907            {13, 0x0000a321}, /* f_FuBuff */
     1908            {16, 0x00027e67}, /* _VMObjHandleInfo */
     1909            {16, 0x0004ca56}, /* _ldrOpenPath */
     1910            {16, 0x0004925c}, /* _LDRClearSem */
     1911            {16, 0x0000db54}, /* _KSEMRequestMutex */
     1912            {11, 0x0001d7c8}, /* _LdrSem */
     1913            {16, 0x00035653}, /* _TKSuBuff */
     1914            {16, 0x000351e6}, /* _TKFuBuff */
     1915            {16, 0x000353b0}, /* _TKFuBufLen */
     1916            {16, 0x000492a8}, /* _ldrValidateMteHandle */
     1917        }
     1918    },
     1919#endif
     1920#ifdef ALLKERNELS
     1921    { /* 8264HU.SYM */
     1922        8264, KF_UNI | KF_HALFSTRICT, 16,
     1923        {
     1924            {15, 0x000093a0}, /* _ldrRead */
     1925            {15, 0x0003c204}, /* _ldrOpen */
     1926            {15, 0x0003ca88}, /* _ldrClose */
     1927            {15, 0x0003cad8}, /* _LDRQAppType */
     1928            {15, 0x0003a3f8}, /* _ldrEnum32bitRelRecs */
     1929            {15, 0x00003a7c}, /* _IOSftOpen */
     1930            {15, 0x00003ee8}, /* _IOSftClose */
     1931            {15, 0x00003f7d}, /* _IOSftTransPath */
     1932            {15, 0x00003d36}, /* _IOSftReadAt */
     1933            {15, 0x00003d3d}, /* _IOSftWriteAt */
     1934            {15, 0x00004096}, /* _SftFileSize */
     1935            {15, 0x000386c4}, /* _VMAllocMem */
     1936            {15, 0x0001e20e}, /* _VMGetOwner */
     1937            {15, 0x00044c02}, /* g_tkExecPgm */
     1938            {11, 0x0000d7e0}, /* f_FuStrLenZ */
     1939            {11, 0x0000d796}, /* f_FuStrLen */
     1940            {11, 0x0000d8d4}, /* f_FuBuff */
     1941            {15, 0x0001d574}, /* _VMObjHandleInfo */
     1942            {15, 0x0003c47b}, /* _ldrOpenPath */
     1943            {15, 0x00038e0c}, /* _LDRClearSem */
     1944            {15, 0x0000a814}, /* _KSEMRequestMutex */
     1945            {10, 0x0001ca70}, /* _LdrSem */
     1946            {15, 0x00028f15}, /* _TKSuBuff */
     1947            {15, 0x00028b49}, /* _TKFuBuff */
     1948            {15, 0x00028cd3}, /* _TKFuBufLen */
     1949            {15, 0x00038e48}, /* _ldrValidateMteHandle */
     1950        }
     1951    },
     1952#endif
    4791953    { /* 8264RS.SYM */
    480         8264, 'R', TYPE_SMP, 15,
     1954        8264, KF_SMP, 15,
    4811955        {
    4821956            {14, 0x0000c250}, /* _ldrRead */
     
    4971971            {11, 0x0000a0f8}, /* f_FuStrLen */
    4981972            {11, 0x0000a321}, /* f_FuBuff */
     1973            {14, 0x0002664b}, /* _VMObjHandleInfo */
     1974            {14, 0x0004a7ca}, /* _ldrOpenPath */
     1975            {14, 0x00046fd0}, /* _LDRClearSem */
     1976            {14, 0x0000d914}, /* _KSEMRequestMutex */
     1977            {9 , 0x0000d238}, /* _LdrSem */
     1978            {14, 0x00033e37}, /* _TKSuBuff */
     1979            {14, 0x000339ca}, /* _TKFuBuff */
     1980            {14, 0x00033b94}, /* _TKFuBufLen */
     1981            {14, 0x0004701c}, /* _ldrValidateMteHandle */
    4991982        }
    5001983    },
    5011984    { /* 8264RU.SYM */
    502         8264, 'R', TYPE_UNI, 14,
     1985        8264, KF_UNI, 14,
    5031986        {
    5041987            {13, 0x0000930c}, /* _ldrRead */
     
    5161999            {13, 0x0001d3a6}, /* _VMGetOwner */
    5172000            {13, 0x00043432}, /* g_tkExecPgm */
    518             {9, 0x0000d7e0}, /* f_FuStrLenZ */
    519             {9, 0x0000d796}, /* f_FuStrLen */
    520             {9, 0x0000d8d4}, /* f_FuBuff */
    521         }
    522     },
     2001            {9 , 0x0000d7e0}, /* f_FuStrLenZ */
     2002            {9 , 0x0000d796}, /* f_FuStrLen */
     2003            {9 , 0x0000d8d4}, /* f_FuBuff */
     2004            {13, 0x0001c70c}, /* _VMObjHandleInfo */
     2005            {13, 0x0003ad0b}, /* _ldrOpenPath */
     2006            {13, 0x0003769c}, /* _LDRClearSem */
     2007            {13, 0x0000a658}, /* _KSEMRequestMutex */
     2008            {8 , 0x0000c8b4}, /* _LdrSem */
     2009            {13, 0x000280ad}, /* _TKSuBuff */
     2010            {13, 0x00027ce1}, /* _TKFuBuff */
     2011            {13, 0x00027e6b}, /* _TKFuBufLen */
     2012            {13, 0x000376d8}, /* _ldrValidateMteHandle */
     2013        }
     2014    },
     2015#ifdef ALLKERNELS
     2016    { /* 8265AS.SYM */
     2017        8265, KF_SMP | KF_ALLSTRICT, 17,
     2018        {
     2019            {16, 0x0000d854}, /* _ldrRead */
     2020            {16, 0x0005c394}, /* _ldrOpen */
     2021            {16, 0x0005ced4}, /* _ldrClose */
     2022            {16, 0x0005cf24}, /* _LDRQAppType */
     2023            {16, 0x0005a62c}, /* _ldrEnum32bitRelRecs */
     2024            {16, 0x0000632c}, /* _IOSftOpen */
     2025            {16, 0x00006814}, /* _IOSftClose */
     2026            {16, 0x000068cc}, /* _IOSftTransPath */
     2027            {16, 0x00006628}, /* _IOSftReadAt */
     2028            {16, 0x0000662f}, /* _IOSftWriteAt */
     2029            {16, 0x00006a04}, /* _SftFileSize */
     2030            {16, 0x0005798c}, /* _VMAllocMem */
     2031            {16, 0x0002fede}, /* _VMGetOwner */
     2032            {16, 0x0006791c}, /* g_tkExecPgm */
     2033            {13, 0x0000a840}, /* f_FuStrLenZ */
     2034            {13, 0x0000a7c0}, /* f_FuStrLen */
     2035            {13, 0x0000aa08}, /* f_FuBuff */
     2036            {16, 0x0002e6ff}, /* _VMObjHandleInfo */
     2037            {16, 0x0005c64e}, /* _ldrOpenPath */
     2038            {16, 0x00058628}, /* _LDRClearSem */
     2039            {16, 0x0000f5b8}, /* _KSEMRequestMutex */
     2040            {11, 0x0002c834}, /* _LdrSem */
     2041            {16, 0x0003f29c}, /* _TKSuBuff */
     2042            {16, 0x0003eded}, /* _TKFuBuff */
     2043            {16, 0x0003eff9}, /* _TKFuBufLen */
     2044            {16, 0x000586c0}, /* _ldrValidateMteHandle */
     2045        }
     2046    },
     2047#endif
     2048#ifdef ALLKERNELS
     2049    { /* 8265AU.SYM */
     2050        8265, KF_UNI | KF_ALLSTRICT, 16,
     2051        {
     2052            {15, 0x0000a3a8}, /* _ldrRead */
     2053            {15, 0x0004a658}, /* _ldrOpen */
     2054            {15, 0x0004aff0}, /* _ldrClose */
     2055            {15, 0x0004b040}, /* _LDRQAppType */
     2056            {15, 0x00048558}, /* _ldrEnum32bitRelRecs */
     2057            {15, 0x00004530}, /* _IOSftOpen */
     2058            {15, 0x000049a8}, /* _IOSftClose */
     2059            {15, 0x00004a40}, /* _IOSftTransPath */
     2060            {15, 0x000047f4}, /* _IOSftReadAt */
     2061            {15, 0x000047fb}, /* _IOSftWriteAt */
     2062            {15, 0x00004b68}, /* _SftFileSize */
     2063            {15, 0x00045ed4}, /* _VMAllocMem */
     2064            {15, 0x0002390e}, /* _VMGetOwner */
     2065            {15, 0x00054138}, /* g_tkExecPgm */
     2066            {11, 0x0000ea50}, /* f_FuStrLenZ */
     2067            {11, 0x0000ea04}, /* f_FuStrLen */
     2068            {11, 0x0000eb68}, /* f_FuBuff */
     2069            {15, 0x00022858}, /* _VMObjHandleInfo */
     2070            {15, 0x0004a8e3}, /* _ldrOpenPath */
     2071            {15, 0x00046988}, /* _LDRClearSem */
     2072            {15, 0x0000bccc}, /* _KSEMRequestMutex */
     2073            {10, 0x0002a360}, /* _LdrSem */
     2074            {15, 0x000318c8}, /* _TKSuBuff */
     2075            {15, 0x000314b8}, /* _TKFuBuff */
     2076            {15, 0x00031684}, /* _TKFuBufLen */
     2077            {15, 0x00046a10}, /* _ldrValidateMteHandle */
     2078        }
     2079    },
     2080#endif
     2081#ifdef ALLKERNELS
     2082    { /* 8265HS.SYM */
     2083        8265, KF_SMP | KF_HALFSTRICT, 17,
     2084        {
     2085            {16, 0x0000c360}, /* _ldrRead */
     2086            {16, 0x0004c86c}, /* _ldrOpen */
     2087            {16, 0x0004d28c}, /* _ldrClose */
     2088            {16, 0x0004d2dc}, /* _LDRQAppType */
     2089            {16, 0x0004ad50}, /* _ldrEnum32bitRelRecs */
     2090            {16, 0x00005484}, /* _IOSftOpen */
     2091            {16, 0x0000595d}, /* _IOSftClose */
     2092            {16, 0x00005a14}, /* _IOSftTransPath */
     2093            {16, 0x00005774}, /* _IOSftReadAt */
     2094            {16, 0x0000577b}, /* _IOSftWriteAt */
     2095            {16, 0x00005b3e}, /* _SftFileSize */
     2096            {16, 0x00048940}, /* _VMAllocMem */
     2097            {16, 0x000292a4}, /* _VMGetOwner */
     2098            {16, 0x00056c8e}, /* g_tkExecPgm */
     2099            {13, 0x0000a178}, /* f_FuStrLenZ */
     2100            {13, 0x0000a0f8}, /* f_FuStrLen */
     2101            {13, 0x0000a321}, /* f_FuBuff */
     2102            {16, 0x00027efb}, /* _VMObjHandleInfo */
     2103            {16, 0x0004cb12}, /* _ldrOpenPath */
     2104            {16, 0x00049304}, /* _LDRClearSem */
     2105            {16, 0x0000db44}, /* _KSEMRequestMutex */
     2106            {11, 0x0001d7c8}, /* _LdrSem */
     2107            {16, 0x000356e7}, /* _TKSuBuff */
     2108            {16, 0x0003527a}, /* _TKFuBuff */
     2109            {16, 0x00035444}, /* _TKFuBufLen */
     2110            {16, 0x00049350}, /* _ldrValidateMteHandle */
     2111        }
     2112    },
     2113#endif
     2114#ifdef ALLKERNELS
     2115    { /* 8265HU.SYM */
     2116        8265, KF_UNI | KF_HALFSTRICT, 16,
     2117        {
     2118            {15, 0x000093a0}, /* _ldrRead */
     2119            {15, 0x0003c12c}, /* _ldrOpen */
     2120            {15, 0x0003c9b0}, /* _ldrClose */
     2121            {15, 0x0003ca00}, /* _LDRQAppType */
     2122            {15, 0x0003a30c}, /* _ldrEnum32bitRelRecs */
     2123            {15, 0x00003a7c}, /* _IOSftOpen */
     2124            {15, 0x00003ee8}, /* _IOSftClose */
     2125            {15, 0x00003f7d}, /* _IOSftTransPath */
     2126            {15, 0x00003d36}, /* _IOSftReadAt */
     2127            {15, 0x00003d3d}, /* _IOSftWriteAt */
     2128            {15, 0x00004096}, /* _SftFileSize */
     2129            {15, 0x000385d8}, /* _VMAllocMem */
     2130            {15, 0x0001e116}, /* _VMGetOwner */
     2131            {15, 0x00044b2a}, /* g_tkExecPgm */
     2132            {11, 0x0000d830}, /* f_FuStrLenZ */
     2133            {11, 0x0000d7e6}, /* f_FuStrLen */
     2134            {11, 0x0000d924}, /* f_FuBuff */
     2135            {15, 0x0001d47c}, /* _VMObjHandleInfo */
     2136            {15, 0x0003c3a3}, /* _ldrOpenPath */
     2137            {15, 0x00038d20}, /* _LDRClearSem */
     2138            {15, 0x0000a808}, /* _KSEMRequestMutex */
     2139            {10, 0x0001ca70}, /* _LdrSem */
     2140            {15, 0x00028e1d}, /* _TKSuBuff */
     2141            {15, 0x00028a51}, /* _TKFuBuff */
     2142            {15, 0x00028bdb}, /* _TKFuBufLen */
     2143            {15, 0x00038d5c}, /* _ldrValidateMteHandle */
     2144        }
     2145    },
     2146#endif
    5232147    { /* 8265RS.SYM */
    524         8265, 'R', TYPE_SMP, 15,
     2148        8265, KF_SMP, 15,
    5252149        {
    5262150            {14, 0x0000c250}, /* _ldrRead */
     
    5412165            {11, 0x0000a0f8}, /* f_FuStrLen */
    5422166            {11, 0x0000a321}, /* f_FuBuff */
     2167            {14, 0x000266d3}, /* _VMObjHandleInfo */
     2168            {14, 0x0004a87a}, /* _ldrOpenPath */
     2169            {14, 0x0004706c}, /* _LDRClearSem */
     2170            {14, 0x0000d914}, /* _KSEMRequestMutex */
     2171            {9 , 0x0000d238}, /* _LdrSem */
     2172            {14, 0x00033ebf}, /* _TKSuBuff */
     2173            {14, 0x00033a52}, /* _TKFuBuff */
     2174            {14, 0x00033c1c}, /* _TKFuBufLen */
     2175            {14, 0x000470b8}, /* _ldrValidateMteHandle */
    5432176        }
    5442177    },
    5452178    { /* 8265RU.SYM */
    546         8265, 'R', TYPE_UNI, 14,
     2179        8265, KF_UNI, 14,
    5472180        {
    5482181            {13, 0x0000930c}, /* _ldrRead */
     
    5602193            {13, 0x0001d2a6}, /* _VMGetOwner */
    5612194            {13, 0x00043352}, /* g_tkExecPgm */
    562             {9, 0x0000d830}, /* f_FuStrLenZ */
    563             {9, 0x0000d7e6}, /* f_FuStrLen */
    564             {9, 0x0000d924}, /* f_FuBuff */
    565         }
    566     },
     2195            {9 , 0x0000d830}, /* f_FuStrLenZ */
     2196            {9 , 0x0000d7e6}, /* f_FuStrLen */
     2197            {9 , 0x0000d924}, /* f_FuBuff */
     2198            {13, 0x0001c60c}, /* _VMObjHandleInfo */
     2199            {13, 0x0003ac2b}, /* _ldrOpenPath */
     2200            {13, 0x000375a8}, /* _LDRClearSem */
     2201            {13, 0x0000a65c}, /* _KSEMRequestMutex */
     2202            {8 , 0x0000c8b4}, /* _LdrSem */
     2203            {13, 0x00027fad}, /* _TKSuBuff */
     2204            {13, 0x00027be1}, /* _TKFuBuff */
     2205            {13, 0x00027d6b}, /* _TKFuBufLen */
     2206            {13, 0x000375e4}, /* _ldrValidateMteHandle */
     2207        }
     2208    },
     2209#ifdef ALLKERNELS
     2210    { /* 9029AU.SYM */
     2211        9029, KF_UNI | KF_ALLSTRICT, 15,
     2212        {
     2213            {14, 0x0000a2d4}, /* _ldrRead */
     2214            {14, 0x000493ac}, /* _ldrOpen */
     2215            {14, 0x00049d44}, /* _ldrClose */
     2216            {14, 0x00049d94}, /* _LDRQAppType */
     2217            {14, 0x000473a4}, /* _ldrEnum32bitRelRecs */
     2218            {14, 0x00003e18}, /* _IOSftOpen */
     2219            {14, 0x000042cc}, /* _IOSftClose */
     2220            {14, 0x00004374}, /* _IOSftTransPath */
     2221            {14, 0x000040ec}, /* _IOSftReadAt */
     2222            {14, 0x000040f3}, /* _IOSftWriteAt */
     2223            {14, 0x0000449c}, /* _SftFileSize */
     2224            {14, 0x00044d2c}, /* _VMAllocMem */
     2225            {14, 0x00022b9a}, /* _VMGetOwner */
     2226            {14, 0x00052ae0}, /* g_tkExecPgm */
     2227            {11, 0x0000f864}, /* f_FuStrLenZ */
     2228            {11, 0x0000f818}, /* f_FuStrLen */
     2229            {11, 0x0000f97c}, /* f_FuBuff */
     2230            {14, 0x00021ae4}, /* _VMObjHandleInfo */
     2231            {14, 0x00049637}, /* _ldrOpenPath */
     2232            {14, 0x000457d8}, /* _LDRClearSem */
     2233            {14, 0x0000bc80}, /* _KSEMRequestMutex */
     2234            {10, 0x00015e48}, /* _LdrSem */
     2235            {14, 0x00030640}, /* _TKSuBuff */
     2236            {14, 0x00030232}, /* _TKFuBuff */
     2237            {14, 0x000303fe}, /* _TKFuBufLen */
     2238            {14, 0x00045860}, /* _ldrValidateMteHandle */
     2239        }
     2240    },
     2241#endif
     2242#ifdef ALLKERNELS
     2243    { /* 9029HU.SYM */
     2244        9029, KF_UNI | KF_HALFSTRICT, 15,
     2245        {
     2246            {14, 0x0000947c}, /* _ldrRead */
     2247            {14, 0x0003b03c}, /* _ldrOpen */
     2248            {14, 0x0003b8c4}, /* _ldrClose */
     2249            {14, 0x0003b914}, /* _LDRQAppType */
     2250            {14, 0x0003930c}, /* _ldrEnum32bitRelRecs */
     2251            {14, 0x0000355c}, /* _IOSftOpen */
     2252            {14, 0x00003a02}, /* _IOSftClose */
     2253            {14, 0x00003aa9}, /* _IOSftTransPath */
     2254            {14, 0x00003823}, /* _IOSftReadAt */
     2255            {14, 0x0000382a}, /* _IOSftWriteAt */
     2256            {14, 0x00003bc2}, /* _SftFileSize */
     2257            {14, 0x000375e0}, /* _VMAllocMem */
     2258            {14, 0x0001d618}, /* _VMGetOwner */
     2259            {14, 0x0004361a}, /* g_tkExecPgm */
     2260            {11, 0x0000e594}, /* f_FuStrLenZ */
     2261            {11, 0x0000e54a}, /* f_FuStrLen */
     2262            {11, 0x0000e688}, /* f_FuBuff */
     2263            {14, 0x0001c978}, /* _VMObjHandleInfo */
     2264            {14, 0x0003b2b3}, /* _ldrOpenPath */
     2265            {14, 0x00037d20}, /* _LDRClearSem */
     2266            {14, 0x0000a92c}, /* _KSEMRequestMutex */
     2267            {10, 0x0000a550}, /* _LdrSem */
     2268            {14, 0x00027f8d}, /* _TKSuBuff */
     2269            {14, 0x00027bc1}, /* _TKFuBuff */
     2270            {14, 0x00027d4b}, /* _TKFuBufLen */
     2271            {14, 0x00037d5c}, /* _ldrValidateMteHandle */
     2272        }
     2273    },
     2274#endif
    5672275    { /* 9029RU.SYM */
    568         9029, 'R', TYPE_UNI, 13,
     2276        9029, KF_UNI, 13,
    5692277        {
    5702278            {12, 0x00009404}, /* _ldrRead */
     
    5822290            {12, 0x0001c8f0}, /* _VMGetOwner */
    5832291            {12, 0x00041eb6}, /* g_tkExecPgm */
    584             {9, 0x0000e594}, /* f_FuStrLenZ */
    585             {9, 0x0000e54a}, /* f_FuStrLen */
    586             {9, 0x0000e688}, /* f_FuBuff */
    587         }
    588     },
     2292            {9 , 0x0000e594}, /* f_FuStrLenZ */
     2293            {9 , 0x0000e54a}, /* f_FuStrLen */
     2294            {9 , 0x0000e688}, /* f_FuBuff */
     2295            {12, 0x0001bc50}, /* _VMObjHandleInfo */
     2296            {12, 0x00039b77}, /* _ldrOpenPath */
     2297            {12, 0x000365e0}, /* _LDRClearSem */
     2298            {12, 0x0000a78c}, /* _KSEMRequestMutex */
     2299            {8 , 0x0000a398}, /* _LdrSem */
     2300            {12, 0x00027265}, /* _TKSuBuff */
     2301            {12, 0x00026e99}, /* _TKFuBuff */
     2302            {12, 0x00027023}, /* _TKFuBufLen */
     2303            {12, 0x0003661c}, /* _ldrValidateMteHandle */
     2304        }
     2305    },
     2306#ifdef ALLKERNELS
     2307    { /* 9030AU.SYM */
     2308        9030, KF_UNI | KF_ALLSTRICT, 16,
     2309        {
     2310            {15, 0x0000a7b4}, /* _ldrRead */
     2311            {15, 0x00049c60}, /* _ldrOpen */
     2312            {15, 0x0004a5f8}, /* _ldrClose */
     2313            {15, 0x0004a648}, /* _LDRQAppType */
     2314            {15, 0x00047b7c}, /* _ldrEnum32bitRelRecs */
     2315            {15, 0x00004318}, /* _IOSftOpen */
     2316            {15, 0x000047cc}, /* _IOSftClose */
     2317            {15, 0x00004874}, /* _IOSftTransPath */
     2318            {15, 0x000045ec}, /* _IOSftReadAt */
     2319            {15, 0x000045f3}, /* _IOSftWriteAt */
     2320            {15, 0x0000499c}, /* _SftFileSize */
     2321            {15, 0x00045510}, /* _VMAllocMem */
     2322            {15, 0x00023390}, /* _VMGetOwner */
     2323            {15, 0x00053590}, /* g_tkExecPgm */
     2324            {11, 0x0000ecfc}, /* f_FuStrLenZ */
     2325            {11, 0x0000ecb0}, /* f_FuStrLen */
     2326            {11, 0x0000ee14}, /* f_FuBuff */
     2327            {15, 0x000222d8}, /* _VMObjHandleInfo */
     2328            {15, 0x00049eeb}, /* _ldrOpenPath */
     2329            {15, 0x00045fc4}, /* _LDRClearSem */
     2330            {15, 0x0000c160}, /* _KSEMRequestMutex */
     2331            {10, 0x00016f2c}, /* _LdrSem */
     2332            {15, 0x00030e98}, /* _TKSuBuff */
     2333            {15, 0x00030a88}, /* _TKFuBuff */
     2334            {15, 0x00030c54}, /* _TKFuBufLen */
     2335            {15, 0x0004604c}, /* _ldrValidateMteHandle */
     2336        }
     2337    },
     2338#endif
     2339#ifdef ALLKERNELS
     2340    { /* 9030HU.SYM */
     2341        9030, KF_UNI | KF_HALFSTRICT, 16,
     2342        {
     2343            {15, 0x0000980c}, /* _ldrRead */
     2344            {15, 0x0003b8c4}, /* _ldrOpen */
     2345            {15, 0x0003c14c}, /* _ldrClose */
     2346            {15, 0x0003c19c}, /* _LDRQAppType */
     2347            {15, 0x00039acc}, /* _ldrEnum32bitRelRecs */
     2348            {15, 0x0000390c}, /* _IOSftOpen */
     2349            {15, 0x00003db2}, /* _IOSftClose */
     2350            {15, 0x00003e59}, /* _IOSftTransPath */
     2351            {15, 0x00003bd3}, /* _IOSftReadAt */
     2352            {15, 0x00003bda}, /* _IOSftWriteAt */
     2353            {15, 0x00003f72}, /* _SftFileSize */
     2354            {15, 0x00037d98}, /* _VMAllocMem */
     2355            {15, 0x0001dd38}, /* _VMGetOwner */
     2356            {15, 0x0004406e}, /* g_tkExecPgm */
     2357            {11, 0x0000db08}, /* f_FuStrLenZ */
     2358            {11, 0x0000dabe}, /* f_FuStrLen */
     2359            {11, 0x0000dbfc}, /* f_FuBuff */
     2360            {15, 0x0001d094}, /* _VMObjHandleInfo */
     2361            {15, 0x0003bb3b}, /* _ldrOpenPath */
     2362            {15, 0x000384e0}, /* _LDRClearSem */
     2363            {15, 0x0000acbc}, /* _KSEMRequestMutex */
     2364            {10, 0x0000a56c}, /* _LdrSem */
     2365            {15, 0x000286d9}, /* _TKSuBuff */
     2366            {15, 0x0002830f}, /* _TKFuBuff */
     2367            {15, 0x00028499}, /* _TKFuBufLen */
     2368            {15, 0x0003851c}, /* _ldrValidateMteHandle */
     2369        }
     2370    },
     2371#endif
    5892372    { /* 9030RU.SYM */
    590         9030, 'R', TYPE_UNI, 14,
     2373        9030, KF_UNI, 14,
    5912374        {
    5922375            {13, 0x00009784}, /* _ldrRead */
     
    6042387            {13, 0x0001d000}, /* _VMGetOwner */
    6052388            {13, 0x0004288a}, /* g_tkExecPgm */
    606             {9, 0x0000db08}, /* f_FuStrLenZ */
    607             {9, 0x0000dabe}, /* f_FuStrLen */
    608             {9, 0x0000dbfc}, /* f_FuBuff */
    609         }
    610     },
     2389            {9 , 0x0000db08}, /* f_FuStrLenZ */
     2390            {9 , 0x0000dabe}, /* f_FuStrLen */
     2391            {9 , 0x0000dbfc}, /* f_FuBuff */
     2392            {13, 0x0001c35c}, /* _VMObjHandleInfo */
     2393            {13, 0x0003a38b}, /* _ldrOpenPath */
     2394            {13, 0x00036d30}, /* _LDRClearSem */
     2395            {13, 0x0000ab0c}, /* _KSEMRequestMutex */
     2396            {8 , 0x0000a3b4}, /* _LdrSem */
     2397            {13, 0x000279a1}, /* _TKSuBuff */
     2398            {13, 0x000275d7}, /* _TKFuBuff */
     2399            {13, 0x00027761}, /* _TKFuBufLen */
     2400            {13, 0x00036d6c}, /* _ldrValidateMteHandle */
     2401        }
     2402    },
     2403#ifdef ALLKERNELS
     2404    { /* 9031AU.SYM */
     2405        9031, KF_UNI | KF_ALLSTRICT, 16,
     2406        {
     2407            {15, 0x0000a84c}, /* _ldrRead */
     2408            {15, 0x0004979c}, /* _ldrOpen */
     2409            {15, 0x0004a138}, /* _ldrClose */
     2410            {15, 0x0004a188}, /* _LDRQAppType */
     2411            {15, 0x000476c4}, /* _ldrEnum32bitRelRecs */
     2412            {15, 0x00004318}, /* _IOSftOpen */
     2413            {15, 0x000047cc}, /* _IOSftClose */
     2414            {15, 0x00004874}, /* _IOSftTransPath */
     2415            {15, 0x000045ec}, /* _IOSftReadAt */
     2416            {15, 0x000045f3}, /* _IOSftWriteAt */
     2417            {15, 0x0000499c}, /* _SftFileSize */
     2418            {15, 0x00045188}, /* _VMAllocMem */
     2419            {15, 0x000234b0}, /* _VMGetOwner */
     2420            {15, 0x000530e4}, /* g_tkExecPgm */
     2421            {11, 0x0000ecfc}, /* f_FuStrLenZ */
     2422            {11, 0x0000ecb0}, /* f_FuStrLen */
     2423            {11, 0x0000ee14}, /* f_FuBuff */
     2424            {15, 0x000223f0}, /* _VMObjHandleInfo */
     2425            {15, 0x00049a27}, /* _ldrOpenPath */
     2426            {15, 0x00045b94}, /* _LDRClearSem */
     2427            {15, 0x0000c1b4}, /* _KSEMRequestMutex */
     2428            {10, 0x00026f18}, /* _LdrSem */
     2429            {15, 0x00030b94}, /* _TKSuBuff */
     2430            {15, 0x00030784}, /* _TKFuBuff */
     2431            {15, 0x00030950}, /* _TKFuBufLen */
     2432            {15, 0x00045c1c}, /* _ldrValidateMteHandle */
     2433        }
     2434    },
     2435#endif
     2436#ifdef ALLKERNELS
     2437    { /* 9031HU.SYM */
     2438        9031, KF_UNI | KF_HALFSTRICT, 16,
     2439        {
     2440            {15, 0x0000989c}, /* _ldrRead */
     2441            {15, 0x0003b7b8}, /* _ldrOpen */
     2442            {15, 0x0003c03c}, /* _ldrClose */
     2443            {15, 0x0003c08c}, /* _LDRQAppType */
     2444            {15, 0x000399b4}, /* _ldrEnum32bitRelRecs */
     2445            {15, 0x0000390c}, /* _IOSftOpen */
     2446            {15, 0x00003db2}, /* _IOSftClose */
     2447            {15, 0x00003e59}, /* _IOSftTransPath */
     2448            {15, 0x00003bd3}, /* _IOSftReadAt */
     2449            {15, 0x00003bda}, /* _IOSftWriteAt */
     2450            {15, 0x00003f72}, /* _SftFileSize */
     2451            {15, 0x00037d00}, /* _VMAllocMem */
     2452            {15, 0x0001dd60}, /* _VMGetOwner */
     2453            {15, 0x00044036}, /* g_tkExecPgm */
     2454            {11, 0x0000db08}, /* f_FuStrLenZ */
     2455            {11, 0x0000dabe}, /* f_FuStrLen */
     2456            {11, 0x0000dbfc}, /* f_FuBuff */
     2457            {15, 0x0001d0bc}, /* _VMObjHandleInfo */
     2458            {15, 0x0003ba2f}, /* _ldrOpenPath */
     2459            {15, 0x00038448}, /* _LDRClearSem */
     2460            {15, 0x0000ad4c}, /* _KSEMRequestMutex */
     2461            {10, 0x0001a574}, /* _LdrSem */
     2462            {15, 0x00028705}, /* _TKSuBuff */
     2463            {15, 0x0002833b}, /* _TKFuBuff */
     2464            {15, 0x000284c5}, /* _TKFuBufLen */
     2465            {15, 0x00038484}, /* _ldrValidateMteHandle */
     2466        }
     2467    },
     2468#endif
    6112469    { /* 9031RU.SYM */
    612         9031, 'R', TYPE_UNI, 14,
     2470        9031, KF_UNI, 14,
    6132471        {
    6142472            {13, 0x00009814}, /* _ldrRead */
     
    6262484            {13, 0x0001d09c}, /* _VMGetOwner */
    6272485            {13, 0x0004288a}, /* g_tkExecPgm */
    628             {9, 0x0000db08}, /* f_FuStrLenZ */
    629             {9, 0x0000dabe}, /* f_FuStrLen */
    630             {9, 0x0000dbfc}, /* f_FuBuff */
    631         }
    632     },
     2486            {9 , 0x0000db08}, /* f_FuStrLenZ */
     2487            {9 , 0x0000dabe}, /* f_FuStrLen */
     2488            {9 , 0x0000dbfc}, /* f_FuBuff */
     2489            {13, 0x0001c3f8}, /* _VMObjHandleInfo */
     2490            {13, 0x0003a2a3}, /* _ldrOpenPath */
     2491            {13, 0x00036cbc}, /* _LDRClearSem */
     2492            {13, 0x0000ab9c}, /* _KSEMRequestMutex */
     2493            {8 , 0x0000a3bc}, /* _LdrSem */
     2494            {13, 0x00027a41}, /* _TKSuBuff */
     2495            {13, 0x00027677}, /* _TKFuBuff */
     2496            {13, 0x00027801}, /* _TKFuBufLen */
     2497            {13, 0x00036cf8}, /* _ldrValidateMteHandle */
     2498        }
     2499    },
     2500#ifdef ALLKERNELS
     2501    { /* 9032AU.SYM */
     2502        9032, KF_UNI | KF_ALLSTRICT, 16,
     2503        {
     2504            {15, 0x0000a84c}, /* _ldrRead */
     2505            {15, 0x000496c8}, /* _ldrOpen */
     2506            {15, 0x0004a060}, /* _ldrClose */
     2507            {15, 0x0004a0b0}, /* _LDRQAppType */
     2508            {15, 0x000475e4}, /* _ldrEnum32bitRelRecs */
     2509            {15, 0x00004318}, /* _IOSftOpen */
     2510            {15, 0x000047cc}, /* _IOSftClose */
     2511            {15, 0x00004874}, /* _IOSftTransPath */
     2512            {15, 0x000045ec}, /* _IOSftReadAt */
     2513            {15, 0x000045f3}, /* _IOSftWriteAt */
     2514            {15, 0x0000499c}, /* _SftFileSize */
     2515            {15, 0x000450a8}, /* _VMAllocMem */
     2516            {15, 0x000234a8}, /* _VMGetOwner */
     2517            {15, 0x000530d4}, /* g_tkExecPgm */
     2518            {11, 0x0000ecf8}, /* f_FuStrLenZ */
     2519            {11, 0x0000ecac}, /* f_FuStrLen */
     2520            {11, 0x0000ee10}, /* f_FuBuff */
     2521            {15, 0x000223e8}, /* _VMObjHandleInfo */
     2522            {15, 0x00049953}, /* _ldrOpenPath */
     2523            {15, 0x00045ab4}, /* _LDRClearSem */
     2524            {15, 0x0000c1b4}, /* _KSEMRequestMutex */
     2525            {10, 0x00026f00}, /* _LdrSem */
     2526            {15, 0x00030b60}, /* _TKSuBuff */
     2527            {15, 0x00030752}, /* _TKFuBuff */
     2528            {15, 0x0003091e}, /* _TKFuBufLen */
     2529            {15, 0x00045b3c}, /* _ldrValidateMteHandle */
     2530        }
     2531    },
     2532#endif
     2533#ifdef ALLKERNELS
     2534    { /* 9032HU.SYM */
     2535        9032, KF_UNI | KF_HALFSTRICT, 16,
     2536        {
     2537            {15, 0x0000989c}, /* _ldrRead */
     2538            {15, 0x0003b9cc}, /* _ldrOpen */
     2539            {15, 0x0003c250}, /* _ldrClose */
     2540            {15, 0x0003c2a0}, /* _LDRQAppType */
     2541            {15, 0x00039bc8}, /* _ldrEnum32bitRelRecs */
     2542            {15, 0x0000390c}, /* _IOSftOpen */
     2543            {15, 0x00003db2}, /* _IOSftClose */
     2544            {15, 0x00003e59}, /* _IOSftTransPath */
     2545            {15, 0x00003bd3}, /* _IOSftReadAt */
     2546            {15, 0x00003bda}, /* _IOSftWriteAt */
     2547            {15, 0x00003f72}, /* _SftFileSize */
     2548            {15, 0x00037f14}, /* _VMAllocMem */
     2549            {15, 0x0001dd5e}, /* _VMGetOwner */
     2550            {15, 0x0004421a}, /* g_tkExecPgm */
     2551            {11, 0x0000db00}, /* f_FuStrLenZ */
     2552            {11, 0x0000dab6}, /* f_FuStrLen */
     2553            {11, 0x0000dbf4}, /* f_FuBuff */
     2554            {15, 0x0001d0bc}, /* _VMObjHandleInfo */
     2555            {15, 0x0003bc43}, /* _ldrOpenPath */
     2556            {15, 0x0003865c}, /* _LDRClearSem */
     2557            {15, 0x0000ad4c}, /* _KSEMRequestMutex */
     2558            {10, 0x0001a574}, /* _LdrSem */
     2559            {15, 0x00028711}, /* _TKSuBuff */
     2560            {15, 0x00028347}, /* _TKFuBuff */
     2561            {15, 0x000284d1}, /* _TKFuBufLen */
     2562            {15, 0x00038698}, /* _ldrValidateMteHandle */
     2563        }
     2564    },
     2565#endif
    6332566    { /* 9032RU.SYM */
    634         9032, 'R', TYPE_UNI, 14,
     2567        9032, KF_UNI, 14,
    6352568        {
    6362569            {13, 0x00009814}, /* _ldrRead */
     
    6482581            {13, 0x0001d09a}, /* _VMGetOwner */
    6492582            {13, 0x00042b3a}, /* g_tkExecPgm */
    650             {9, 0x0000db00}, /* f_FuStrLenZ */
    651             {9, 0x0000dab6}, /* f_FuStrLen */
    652             {9, 0x0000dbf4}, /* f_FuBuff */
    653         }
    654     },
     2583            {9 , 0x0000db00}, /* f_FuStrLenZ */
     2584            {9 , 0x0000dab6}, /* f_FuStrLen */
     2585            {9 , 0x0000dbf4}, /* f_FuBuff */
     2586            {13, 0x0001c3f8}, /* _VMObjHandleInfo */
     2587            {13, 0x0003a4f3}, /* _ldrOpenPath */
     2588            {13, 0x00036f0c}, /* _LDRClearSem */
     2589            {13, 0x0000ab9c}, /* _KSEMRequestMutex */
     2590            {8 , 0x0000a3bc}, /* _LdrSem */
     2591            {13, 0x00027a4d}, /* _TKSuBuff */
     2592            {13, 0x00027683}, /* _TKFuBuff */
     2593            {13, 0x0002780d}, /* _TKFuBufLen */
     2594            {13, 0x00036f48}, /* _ldrValidateMteHandle */
     2595        }
     2596    },
     2597#ifdef ALLKERNELS
     2598    { /* 9033AU.SYM */
     2599        9033, KF_UNI | KF_ALLSTRICT, 16,
     2600        {
     2601            {15, 0x0000a850}, /* _ldrRead */
     2602            {15, 0x00049814}, /* _ldrOpen */
     2603            {15, 0x0004a1b4}, /* _ldrClose */
     2604            {15, 0x0004a204}, /* _LDRQAppType */
     2605            {15, 0x0004771c}, /* _ldrEnum32bitRelRecs */
     2606            {15, 0x00004318}, /* _IOSftOpen */
     2607            {15, 0x000047cc}, /* _IOSftClose */
     2608            {15, 0x00004874}, /* _IOSftTransPath */
     2609            {15, 0x000045ec}, /* _IOSftReadAt */
     2610            {15, 0x000045f3}, /* _IOSftWriteAt */
     2611            {15, 0x0000499c}, /* _SftFileSize */
     2612            {15, 0x000451e0}, /* _VMAllocMem */
     2613            {15, 0x0002358c}, /* _VMGetOwner */
     2614            {15, 0x00053228}, /* g_tkExecPgm */
     2615            {11, 0x0000ed2c}, /* f_FuStrLenZ */
     2616            {11, 0x0000ece0}, /* f_FuStrLen */
     2617            {11, 0x0000ee44}, /* f_FuBuff */
     2618            {15, 0x000224cc}, /* _VMObjHandleInfo */
     2619            {15, 0x00049a9f}, /* _ldrOpenPath */
     2620            {15, 0x00045bec}, /* _LDRClearSem */
     2621            {15, 0x0000c1c4}, /* _KSEMRequestMutex */
     2622            {10, 0x00026ecc}, /* _LdrSem */
     2623            {15, 0x00030c44}, /* _TKSuBuff */
     2624            {15, 0x00030836}, /* _TKFuBuff */
     2625            {15, 0x00030a02}, /* _TKFuBufLen */
     2626            {15, 0x00045c74}, /* _ldrValidateMteHandle */
     2627        }
     2628    },
     2629#endif
     2630#ifdef ALLKERNELS
     2631    { /* 9033HU.SYM */
     2632        9033, KF_UNI | KF_HALFSTRICT, 16,
     2633        {
     2634            {15, 0x000098ac}, /* _ldrRead */
     2635            {15, 0x0003bb24}, /* _ldrOpen */
     2636            {15, 0x0003c3b0}, /* _ldrClose */
     2637            {15, 0x0003c400}, /* _LDRQAppType */
     2638            {15, 0x00039d0c}, /* _ldrEnum32bitRelRecs */
     2639            {15, 0x0000390c}, /* _IOSftOpen */
     2640            {15, 0x00003db2}, /* _IOSftClose */
     2641            {15, 0x00003e59}, /* _IOSftTransPath */
     2642            {15, 0x00003bd3}, /* _IOSftReadAt */
     2643            {15, 0x00003bda}, /* _IOSftWriteAt */
     2644            {15, 0x00003f72}, /* _SftFileSize */
     2645            {15, 0x00038058}, /* _VMAllocMem */
     2646            {15, 0x0001de42}, /* _VMGetOwner */
     2647            {15, 0x0004437a}, /* g_tkExecPgm */
     2648            {11, 0x0000db30}, /* f_FuStrLenZ */
     2649            {11, 0x0000dae6}, /* f_FuStrLen */
     2650            {11, 0x0000dc24}, /* f_FuBuff */
     2651            {15, 0x0001d1a0}, /* _VMObjHandleInfo */
     2652            {15, 0x0003bd9b}, /* _ldrOpenPath */
     2653            {15, 0x000387a0}, /* _LDRClearSem */
     2654            {15, 0x0000ad68}, /* _KSEMRequestMutex */
     2655            {10, 0x0001a578}, /* _LdrSem */
     2656            {15, 0x000287f5}, /* _TKSuBuff */
     2657            {15, 0x0002842b}, /* _TKFuBuff */
     2658            {15, 0x000285b5}, /* _TKFuBufLen */
     2659            {15, 0x000387dc}, /* _ldrValidateMteHandle */
     2660        }
     2661    },
     2662#endif
    6552663    { /* 9033RU.SYM */
    656         9033, 'R', TYPE_UNI, 14,
     2664        9033, KF_UNI, 14,
    6572665        {
    6582666            {13, 0x00009824}, /* _ldrRead */
     
    6702678            {13, 0x0001d172}, /* _VMGetOwner */
    6712679            {13, 0x00042c8e}, /* g_tkExecPgm */
    672             {9, 0x0000db30}, /* f_FuStrLenZ */
    673             {9, 0x0000dae6}, /* f_FuStrLen */
    674             {9, 0x0000dc24}, /* f_FuBuff */
    675         }
    676     },
     2680            {9 , 0x0000db30}, /* f_FuStrLenZ */
     2681            {9 , 0x0000dae6}, /* f_FuStrLen */
     2682            {9 , 0x0000dc24}, /* f_FuBuff */
     2683            {13, 0x0001c4d0}, /* _VMObjHandleInfo */
     2684            {13, 0x0003a63f}, /* _ldrOpenPath */
     2685            {13, 0x00037044}, /* _LDRClearSem */
     2686            {13, 0x0000abb8}, /* _KSEMRequestMutex */
     2687            {8 , 0x0000a3c0}, /* _LdrSem */
     2688            {13, 0x00027b25}, /* _TKSuBuff */
     2689            {13, 0x0002775b}, /* _TKFuBuff */
     2690            {13, 0x000278e5}, /* _TKFuBufLen */
     2691            {13, 0x00037080}, /* _ldrValidateMteHandle */
     2692        }
     2693    },
     2694#ifdef ALLKERNELS
     2695    { /* 9034AU.SYM */
     2696        9034, KF_UNI | KF_ALLSTRICT, 16,
     2697        {
     2698            {15, 0x0000a3cc}, /* _ldrRead */
     2699            {15, 0x0004a144}, /* _ldrOpen */
     2700            {15, 0x0004aae8}, /* _ldrClose */
     2701            {15, 0x0004ab38}, /* _LDRQAppType */
     2702            {15, 0x00048048}, /* _ldrEnum32bitRelRecs */
     2703            {15, 0x000044b4}, /* _IOSftOpen */
     2704            {15, 0x00004968}, /* _IOSftClose */
     2705            {15, 0x00004a10}, /* _IOSftTransPath */
     2706            {15, 0x00004788}, /* _IOSftReadAt */
     2707            {15, 0x0000478f}, /* _IOSftWriteAt */
     2708            {15, 0x00004b38}, /* _SftFileSize */
     2709            {15, 0x00045b0c}, /* _VMAllocMem */
     2710            {15, 0x0002399c}, /* _VMGetOwner */
     2711            {15, 0x00053b44}, /* g_tkExecPgm */
     2712            {11, 0x0000ed44}, /* f_FuStrLenZ */
     2713            {11, 0x0000ecf8}, /* f_FuStrLen */
     2714            {11, 0x0000ee5c}, /* f_FuBuff */
     2715            {15, 0x000228dc}, /* _VMObjHandleInfo */
     2716            {15, 0x0004a3cf}, /* _ldrOpenPath */
     2717            {15, 0x00046518}, /* _LDRClearSem */
     2718            {15, 0x0000bcfc}, /* _KSEMRequestMutex */
     2719            {10, 0x00027160}, /* _LdrSem */
     2720            {15, 0x00031014}, /* _TKSuBuff */
     2721            {15, 0x00030c04}, /* _TKFuBuff */
     2722            {15, 0x00030dd0}, /* _TKFuBufLen */
     2723            {15, 0x000465a0}, /* _ldrValidateMteHandle */
     2724        }
     2725    },
     2726#endif
     2727#ifdef ALLKERNELS
     2728    { /* 9034HU.SYM */
     2729        9034, KF_UNI | KF_HALFSTRICT, 16,
     2730        {
     2731            {15, 0x000093fc}, /* _ldrRead */
     2732            {15, 0x0003be50}, /* _ldrOpen */
     2733            {15, 0x0003c6dc}, /* _ldrClose */
     2734            {15, 0x0003c72c}, /* _LDRQAppType */
     2735            {15, 0x0003a034}, /* _ldrEnum32bitRelRecs */
     2736            {15, 0x00003a30}, /* _IOSftOpen */
     2737            {15, 0x00003ed6}, /* _IOSftClose */
     2738            {15, 0x00003f7d}, /* _IOSftTransPath */
     2739            {15, 0x00003cf7}, /* _IOSftReadAt */
     2740            {15, 0x00003cfe}, /* _IOSftWriteAt */
     2741            {15, 0x00004096}, /* _SftFileSize */
     2742            {15, 0x00038380}, /* _VMAllocMem */
     2743            {15, 0x0001e136}, /* _VMGetOwner */
     2744            {15, 0x0004476a}, /* g_tkExecPgm */
     2745            {11, 0x0000db44}, /* f_FuStrLenZ */
     2746            {11, 0x0000dafa}, /* f_FuStrLen */
     2747            {11, 0x0000dc38}, /* f_FuBuff */
     2748            {15, 0x0001d494}, /* _VMObjHandleInfo */
     2749            {15, 0x0003c0c7}, /* _ldrOpenPath */
     2750            {15, 0x00038ac8}, /* _LDRClearSem */
     2751            {15, 0x0000a874}, /* _KSEMRequestMutex */
     2752            {10, 0x0001a5bc}, /* _LdrSem */
     2753            {15, 0x00028aa1}, /* _TKSuBuff */
     2754            {15, 0x000286d7}, /* _TKFuBuff */
     2755            {15, 0x00028861}, /* _TKFuBufLen */
     2756            {15, 0x00038b04}, /* _ldrValidateMteHandle */
     2757        }
     2758    },
     2759#endif
    6772760    { /* 9034RU.SYM */
    678         9034, 'R', TYPE_UNI, 14,
     2761        9034, KF_UNI, 14,
    6792762        {
    6802763            {13, 0x00009368}, /* _ldrRead */
     
    6922775            {13, 0x0001d2fa}, /* _VMGetOwner */
    6932776            {13, 0x00042fda}, /* g_tkExecPgm */
    694             {9, 0x0000db44}, /* f_FuStrLenZ */
    695             {9, 0x0000dafa}, /* f_FuStrLen */
    696             {9, 0x0000dc38}, /* f_FuBuff */
    697         }
    698     },
     2777            {9 , 0x0000db44}, /* f_FuStrLenZ */
     2778            {9 , 0x0000dafa}, /* f_FuStrLen */
     2779            {9 , 0x0000dc38}, /* f_FuBuff */
     2780            {13, 0x0001c658}, /* _VMObjHandleInfo */
     2781            {13, 0x0003a977}, /* _ldrOpenPath */
     2782            {13, 0x00037374}, /* _LDRClearSem */
     2783            {13, 0x0000a6b8}, /* _KSEMRequestMutex */
     2784            {8 , 0x0000a404}, /* _LdrSem */
     2785            {13, 0x00027c65}, /* _TKSuBuff */
     2786            {13, 0x0002789b}, /* _TKFuBuff */
     2787            {13, 0x00027a25}, /* _TKFuBufLen */
     2788            {13, 0x000373b0}, /* _ldrValidateMteHandle */
     2789        }
     2790    },
     2791#ifdef ALLKERNELS
     2792    { /* 9035AU.SYM */
     2793        9035, KF_UNI | KF_ALLSTRICT, 16,
     2794        {
     2795            {15, 0x0000a3cc}, /* _ldrRead */
     2796            {15, 0x00049cf0}, /* _ldrOpen */
     2797            {15, 0x0004a68c}, /* _ldrClose */
     2798            {15, 0x0004a6dc}, /* _LDRQAppType */
     2799            {15, 0x00047c08}, /* _ldrEnum32bitRelRecs */
     2800            {15, 0x000044b4}, /* _IOSftOpen */
     2801            {15, 0x00004968}, /* _IOSftClose */
     2802            {15, 0x00004a10}, /* _IOSftTransPath */
     2803            {15, 0x00004788}, /* _IOSftReadAt */
     2804            {15, 0x0000478f}, /* _IOSftWriteAt */
     2805            {15, 0x00004b38}, /* _SftFileSize */
     2806            {15, 0x000456cc}, /* _VMAllocMem */
     2807            {15, 0x000237ac}, /* _VMGetOwner */
     2808            {15, 0x00053758}, /* g_tkExecPgm */
     2809            {11, 0x0000ed44}, /* f_FuStrLenZ */
     2810            {11, 0x0000ecf8}, /* f_FuStrLen */
     2811            {11, 0x0000ee5c}, /* f_FuBuff */
     2812            {15, 0x000226ec}, /* _VMObjHandleInfo */
     2813            {15, 0x00049f7b}, /* _ldrOpenPath */
     2814            {15, 0x000460d8}, /* _LDRClearSem */
     2815            {15, 0x0000bcfc}, /* _KSEMRequestMutex */
     2816            {10, 0x00027164}, /* _LdrSem */
     2817            {15, 0x00030e3c}, /* _TKSuBuff */
     2818            {15, 0x00030a2c}, /* _TKFuBuff */
     2819            {15, 0x00030bf8}, /* _TKFuBufLen */
     2820            {15, 0x00046160}, /* _ldrValidateMteHandle */
     2821        }
     2822    },
     2823#endif
     2824#ifdef ALLKERNELS
     2825    { /* 9035HU.SYM */
     2826        9035, KF_UNI | KF_HALFSTRICT, 16,
     2827        {
     2828            {15, 0x000093fc}, /* _ldrRead */
     2829            {15, 0x0003c0b4}, /* _ldrOpen */
     2830            {15, 0x0003c938}, /* _ldrClose */
     2831            {15, 0x0003c988}, /* _LDRQAppType */
     2832            {15, 0x0003a2ac}, /* _ldrEnum32bitRelRecs */
     2833            {15, 0x00003a30}, /* _IOSftOpen */
     2834            {15, 0x00003ed6}, /* _IOSftClose */
     2835            {15, 0x00003f7d}, /* _IOSftTransPath */
     2836            {15, 0x00003cf7}, /* _IOSftReadAt */
     2837            {15, 0x00003cfe}, /* _IOSftWriteAt */
     2838            {15, 0x00004096}, /* _SftFileSize */
     2839            {15, 0x000385f8}, /* _VMAllocMem */
     2840            {15, 0x0001e272}, /* _VMGetOwner */
     2841            {15, 0x00044a1e}, /* g_tkExecPgm */
     2842            {11, 0x0000db44}, /* f_FuStrLenZ */
     2843            {11, 0x0000dafa}, /* f_FuStrLen */
     2844            {11, 0x0000dc38}, /* f_FuBuff */
     2845            {15, 0x0001d5d0}, /* _VMObjHandleInfo */
     2846            {15, 0x0003c32b}, /* _ldrOpenPath */
     2847            {15, 0x00038d40}, /* _LDRClearSem */
     2848            {15, 0x0000a874}, /* _KSEMRequestMutex */
     2849            {10, 0x0001a5bc}, /* _LdrSem */
     2850            {15, 0x00028be9}, /* _TKSuBuff */
     2851            {15, 0x0002881f}, /* _TKFuBuff */
     2852            {15, 0x000289a9}, /* _TKFuBufLen */
     2853            {15, 0x00038d7c}, /* _ldrValidateMteHandle */
     2854        }
     2855    },
     2856#endif
    6992857    { /* 9035RU.SYM */
    700         9035, 'R', TYPE_UNI, 14,
     2858        9035, KF_UNI, 14,
    7012859        {
    7022860            {13, 0x00009368}, /* _ldrRead */
     
    7142872            {13, 0x0001d436}, /* _VMGetOwner */
    7152873            {13, 0x0004324e}, /* g_tkExecPgm */
    716             {9, 0x0000db44}, /* f_FuStrLenZ */
    717             {9, 0x0000dafa}, /* f_FuStrLen */
    718             {9, 0x0000dc38}, /* f_FuBuff */
    719         }
    720     },
     2874            {9 , 0x0000db44}, /* f_FuStrLenZ */
     2875            {9 , 0x0000dafa}, /* f_FuStrLen */
     2876            {9 , 0x0000dc38}, /* f_FuBuff */
     2877            {13, 0x0001c794}, /* _VMObjHandleInfo */
     2878            {13, 0x0003abdb}, /* _ldrOpenPath */
     2879            {13, 0x000375ec}, /* _LDRClearSem */
     2880            {13, 0x0000a6b8}, /* _KSEMRequestMutex */
     2881            {8 , 0x0000a404}, /* _LdrSem */
     2882            {13, 0x00027dad}, /* _TKSuBuff */
     2883            {13, 0x000279e3}, /* _TKFuBuff */
     2884            {13, 0x00027b6d}, /* _TKFuBufLen */
     2885            {13, 0x00037628}, /* _ldrValidateMteHandle */
     2886        }
     2887    },
     2888#ifdef ALLKERNELS
     2889    { /* 9036AU.SYM */
     2890        9036, KF_UNI | KF_ALLSTRICT, 16,
     2891        {
     2892            {15, 0x0000a444}, /* _ldrRead */
     2893            {15, 0x00049f78}, /* _ldrOpen */
     2894            {15, 0x0004a914}, /* _ldrClose */
     2895            {15, 0x0004a964}, /* _LDRQAppType */
     2896            {15, 0x00047e84}, /* _ldrEnum32bitRelRecs */
     2897            {15, 0x0000452c}, /* _IOSftOpen */
     2898            {15, 0x000049e0}, /* _IOSftClose */
     2899            {15, 0x00004a88}, /* _IOSftTransPath */
     2900            {15, 0x00004800}, /* _IOSftReadAt */
     2901            {15, 0x00004807}, /* _IOSftWriteAt */
     2902            {15, 0x00004bb0}, /* _SftFileSize */
     2903            {15, 0x00045948}, /* _VMAllocMem */
     2904            {15, 0x00023814}, /* _VMGetOwner */
     2905            {15, 0x00053a98}, /* g_tkExecPgm */
     2906            {11, 0x0000ed84}, /* f_FuStrLenZ */
     2907            {11, 0x0000ed38}, /* f_FuStrLen */
     2908            {11, 0x0000ee9c}, /* f_FuBuff */
     2909            {15, 0x00022754}, /* _VMObjHandleInfo */
     2910            {15, 0x0004a203}, /* _ldrOpenPath */
     2911            {15, 0x00046354}, /* _LDRClearSem */
     2912            {15, 0x0000bd6c}, /* _KSEMRequestMutex */
     2913            {10, 0x000272f4}, /* _LdrSem */
     2914            {15, 0x00030eb8}, /* _TKSuBuff */
     2915            {15, 0x00030aa8}, /* _TKFuBuff */
     2916            {15, 0x00030c74}, /* _TKFuBufLen */
     2917            {15, 0x000463dc}, /* _ldrValidateMteHandle */
     2918        }
     2919    },
     2920#endif
     2921#ifdef ALLKERNELS
     2922    { /* 9036HU.SYM */
     2923        9036, KF_UNI | KF_HALFSTRICT, 16,
     2924        {
     2925            {15, 0x00009448}, /* _ldrRead */
     2926            {15, 0x0003c2d4}, /* _ldrOpen */
     2927            {15, 0x0003cb58}, /* _ldrClose */
     2928            {15, 0x0003cba8}, /* _LDRQAppType */
     2929            {15, 0x0003a4b8}, /* _ldrEnum32bitRelRecs */
     2930            {15, 0x00003a7c}, /* _IOSftOpen */
     2931            {15, 0x00003f22}, /* _IOSftClose */
     2932            {15, 0x00003fc9}, /* _IOSftTransPath */
     2933            {15, 0x00003d43}, /* _IOSftReadAt */
     2934            {15, 0x00003d4a}, /* _IOSftWriteAt */
     2935            {15, 0x000040e2}, /* _SftFileSize */
     2936            {15, 0x00038804}, /* _VMAllocMem */
     2937            {15, 0x0001e31a}, /* _VMGetOwner */
     2938            {15, 0x00044cea}, /* g_tkExecPgm */
     2939            {11, 0x0000db94}, /* f_FuStrLenZ */
     2940            {11, 0x0000db4a}, /* f_FuStrLen */
     2941            {11, 0x0000dc88}, /* f_FuBuff */
     2942            {15, 0x0001d678}, /* _VMObjHandleInfo */
     2943            {15, 0x0003c54b}, /* _ldrOpenPath */
     2944            {15, 0x00038f4c}, /* _LDRClearSem */
     2945            {15, 0x0000a8b4}, /* _KSEMRequestMutex */
     2946            {10, 0x0001a5f0}, /* _LdrSem */
     2947            {15, 0x00028c99}, /* _TKSuBuff */
     2948            {15, 0x000288cf}, /* _TKFuBuff */
     2949            {15, 0x00028a59}, /* _TKFuBufLen */
     2950            {15, 0x00038f88}, /* _ldrValidateMteHandle */
     2951        }
     2952    },
     2953#endif
    7212954    { /* 9036RU.SYM */
    722         9036, 'R', TYPE_UNI, 14,
     2955        9036, KF_UNI, 14,
    7232956        {
    7242957            {13, 0x000093b4}, /* _ldrRead */
     
    7362969            {13, 0x0001d4ee}, /* _VMGetOwner */
    7372970            {13, 0x0004359e}, /* g_tkExecPgm */
    738             {9, 0x0000db94}, /* f_FuStrLenZ */
    739             {9, 0x0000db4a}, /* f_FuStrLen */
    740             {9, 0x0000dc88}, /* f_FuBuff */
     2971            {9 , 0x0000db94}, /* f_FuStrLenZ */
     2972            {9 , 0x0000db4a}, /* f_FuStrLen */
     2973            {9 , 0x0000dc88}, /* f_FuBuff */
     2974            {13, 0x0001c84c}, /* _VMObjHandleInfo */
     2975            {13, 0x0003ae03}, /* _ldrOpenPath */
     2976            {13, 0x00037800}, /* _LDRClearSem */
     2977            {13, 0x0000a708}, /* _KSEMRequestMutex */
     2978            {8 , 0x0000a438}, /* _LdrSem */
     2979            {13, 0x00027e6d}, /* _TKSuBuff */
     2980            {13, 0x00027aa3}, /* _TKFuBuff */
     2981            {13, 0x00027c2d}, /* _TKFuBufLen */
     2982            {13, 0x0003783c}, /* _ldrValidateMteHandle */
    7412983        }
    7422984    },
    7432985    { /* Terminating entry */
    744         0,0,0,0,
     2986        0,0,0,
    7452987        {
    7462988            {0,0},
     
    7613003            {0,0},
    7623004            {0,0},
     3005            {0,0},
     3006            {0,0},
     3007            {0,0},
     3008            {0,0},
     3009            {0,0},
     3010            {0,0},
     3011            {0,0},
     3012            {0,0},
     3013            {0,0},
    7633014        }
    7643015    }
  • branches/GRACE/src/win32k/dev16/d16init.c

    r2898 r3834  
    1 /* $Id: d16init.c,v 1.6 2000-02-25 18:15:02 bird Exp $
     1/* $Id: d16init.c,v 1.6.4.1 2000-07-16 22:43:21 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
     
    3939#include "dev1632.h"
    4040#include "dev16.h"
     41#include "vprntf16.h"
     42#include "log.h"
     43#include "options.h"
    4144
    4245/**
     
    5154USHORT NEAR dev0Init(PRPINITIN pRpIn, PRPINITOUT pRpOut)
    5255{
     56    APIRET  rc;
    5357    Device_Help = pRpIn->DevHlpEP;
     58
     59    /*
     60     * Does this work at Ring-3 (inittime)?
     61     * If this work we could be saved from throuble!
     62     */
     63    rc = initGetDosTableData();
     64    if (rc != NO_ERROR)
     65        printf16("win32k - elf$: initGetDosTableData failed with rc=%d\n", rc);
    5466
    5567    pRpOut->BPBArray = NULL;
     
    8092    NPSZ            npszErrMsg = NULL;
    8193
     94    /*
     95     * Probe kernel data.
     96     */
    8297    rc = ProbeKernel(pRpIn);
    8398    if (rc == NO_ERROR)
    8499    {
     100        /*
     101         * Open and send a Ring-0 init packet to elf$.
     102         * If this succeeds win32k$ init succeeds.
     103         */
    85104        rc = DosOpen("\\dev\\elf$", &hDev0, &usAction, 0UL, FILE_NORMAL,
    86105                     OPEN_ACTION_FAIL_IF_NEW | OPEN_ACTION_OPEN_IF_EXISTS,
     
    93112            if (rc == NO_ERROR)
    94113            {
    95                 if (data.Status != STATUS_DONE)
    96                     npszErrMsg = "Ring-0 initiation failed\n\r";
     114                if ((rc = data.Status) == STATUS_DONE)
     115                {
     116                    if (!options.fQuiet)
     117                        printf16("Win32k.sys succesfully initiated!\n");
     118                    pRpOut->Status = pRpOut->rph.Status = data.Status;
     119                }
    97120                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                 }
     121                    npszErrMsg = "Ring-0 initiation failed. rc=%d\n";
    104122            }
    105123            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 
     124                npszErrMsg = "Ring-0 init: DosDevIOCtl failed. rc=%d\n";
    120125            DosClose(hDev0);
    121126        }
    122127        else
    123             npszErrMsg = "DosOpen failed.\n\r";
     128            npszErrMsg = "Ring-0 init: DosOpen failed. rc=%d\n";
    124129    }
    125130    else
    126         npszErrMsg = "ProbeKernel failed.\n\r";
    127     pRpOut->BPBArray = NULL;
     131        npszErrMsg = ""; /* ProbeKrnl do its own complaining, but we need something here to indicate failure. */
     132
     133    /*
     134     * Fill return data.
     135     */
    128136    pRpOut->CodeEnd = (USHORT)&CODE16END;
    129137    pRpOut->DataEnd = (USHORT)&DATA16END;
     138    pRpOut->BPBArray= NULL;
    130139    pRpOut->Unit    = 0;
    131140
     141    /*
     142     * Any errors?, if so complain!
     143     */
    132144    if (npszErrMsg)
    133145    {
    134         DosPutMessage(1, strlen(npszErrMsg) + 1, npszErrMsg);
    135         return pRpOut->rph.Status = STATUS_DONE | STERR | ERROR_I24_QUIET_INIT_FAIL;
    136     }
    137 
     146        printf16(npszErrMsg, rc);
     147        return pRpOut->Status = pRpOut->rph.Status = STATUS_DONE | STERR | ERROR_I24_QUIET_INIT_FAIL;
     148    }
     149
     150    /* successful return */
    138151    return pRpOut->rph.Status;
    139152}
     
    142155
    143156/**
    144  * R0 16-bit initiation function.
     157 * R0 16-bit initiation.
    145158 * This gets TKSSBase, thunks parameters and calls R0 32-bit initiation function.
    146159 * @returns   Status word.
     
    162175        ULONG ulLinData;
    163176
     177        /*
     178         * Thunk the request packet and lock userdata.
     179         */
    164180        if (!DevHelp_VirtToLin(SELECTOROF(pRp->ParmPacket), OFFSETOF(pRp->ParmPacket), &ulLinParm)
    165181            &&
     
    175191                                (LIN)~0UL, SSToDS_16(&hLockData[0]), &cPages)
    176192                )
    177             {   /* data and param is locked (do we need to lock the request packet too ?). */
    178                 /* create new 32-bit packet */
     193            {
     194                /*
     195                 * -data and param is locked (do we need to lock the request packet too ?).-
     196                 * Create new 32-bit init packet - Parameter pointer is thunked.
     197                 */
    179198                RP32INIT rp32init;
    180199
     
    191210                ((PD16R0INITDATA)pRp->DataPacket)->Status = usRc;
    192211
    193                 /* finished - unlock data and parm */
     212                /*
     213                 * finished - unlock data and parm
     214                 */
    194215                DevHelp_VMUnLock((LIN)SSToDS_16(&hLockParm[0]));
    195216                DevHelp_VMUnLock((LIN)SSToDS_16(&hLockData[0]));
     
    204225        usRc |= ERROR_I24_GEN_FAILURE;
    205226
    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 
    223227    return usRc;
    224228}
     
    235239 *            After R0Init16 is called TKSSBase16 _is_ set.
    236240 *            IMPORTANT! This function must _not_ be called after the initiation of the second device driver!!!
     241 *                       (Since this is init code not present after init...)
    237242 */
    238243USHORT NEAR initGetDosTableData(void)
  • branches/GRACE/src/win32k/dev16/probkrnl.c

    r3411 r3834  
    1 /* $Id: probkrnl.c,v 1.20 2000-04-17 01:56:48 bird Exp $
     1/* $Id: probkrnl.c,v 1.20.4.1 2000-07-16 22:43:22 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                                                               *
     
    6868#include "vprntf16.h"
    6969#include "log.h"
     70#include "options.h"
    7071
    7172
     
    8081/*
    8182 * 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!
     83 * IMPORTANT: aImportTab has two sibling arrays, one in d32init.c, aulProc, and
     84 *            the calltab.asm, which must match entry by entry.
     85 *            When adding/removing/shuffling items in aImportTab, aulProc and
     86 *            calltab.asm has to be updated immediately!
    8587 */
    8688IMPORTKRNLSYM aImportTab[NBR_OF_KRNLIMPORTS] =
     
    104106    {FALSE, -1, 10, "f_FuStrLen",           -1,  -1,  -1,  -1, EPT_PROCIMPORT16},  /* 15 */
    105107    {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, 16, "_VMObjHandleInfo",     -1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 17 */
     109    {FALSE, -1, 12, "_ldrOpenPath",         -1,  -1,  -1,  -1, EPT_PROC32},        /* 18 */
     110    {FALSE, -1, 12, "_LDRClearSem",         -1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 19 */
     111    {FALSE, -1, 17, "_KSEMRequestMutex",    -1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 20 */
     112    {FALSE, -1,  7, "_LdrSem",              -1,  -1,  -1,  -1, EPT_VARIMPORT32},   /* 21 */
     113    {FALSE, -1,  9, "_TKSuBuff",            -1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 22 */
     114    {FALSE, -1,  9, "_TKFuBuff",            -1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 23 */
     115    {FALSE, -1, 11, "_TKFuBufLen",          -1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 24 */
     116    {FALSE, -1, 21, "_ldrValidateMteHandle",-1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 25 */
     117    {FALSE, -1,  7, "_TCBCur",              -1,  -1,  -1,  -1, EPT_VARIMPORT16},   /* 26 */
     118    {FALSE, -1,  8, "_PTDACur",             -1,  -1,  -1,  -1, EPT_VARIMPORT16},   /* 27 */
     119    {FALSE, -1, 10, "ptda_start",           -1,  -1,  -1,  -1, EPT_VARIMPORT16},   /* 28 */
     120    {FALSE, -1, 12, "ptda_environ",         -1,  -1,  -1,  -1, EPT_VARIMPORT16},   /* 29 */
     121
    108122};
    109 
    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;
    115123
    116124
     
    118126 * privat data
    119127 */
    120 static int          fQuiet           = 0;
     128#if defined(DEBUGR3)
    121129static char         szUsrOS2Krnl[50] = {0};
    122130static char         szOS2Krnl[]      = {"c:\\os2krnl"};
    123 
     131#endif
    124132static char         szUsrSym[50]     = {0};
    125133static char *       apszSym[]        =
     
    148156
    149157
     158/*
     159 *
     160 */
     161static struct
     162{
     163    short       sErr;
     164    const char *pszMsg;
     165} aErrorMsgs[] =
     166{
     167    {ERROR_PROB_KRNL_OPEN_FAILED,       "Krnl: Failed to open kernel file."},
     168    {ERROR_PROB_KRNL_SEEK_SIZE,         "Krnl: Failed to seek to end to of file."},
     169    {ERROR_PROB_KRNL_SEEK_FIRST,        "Krnl: Failed to start of file."},
     170    {ERROR_PROB_KRNL_READ_FIRST,        "Krnl: Failed to read (first)."},
     171    {ERROR_PROB_KRNL_READ_NEXT,         "Krnl: Failed to read."},
     172    {ERROR_PROB_KRNL_TAG_NOT_FOUND,     "Krnl: Build level tag was not found."},
     173    {ERROR_PROB_KRNL_INV_SIGANTURE,     "Krnl: Invalid build level signature."},
     174    {ERROR_PROB_KRNL_INV_BUILD_NBR,     "Krnl: Invalid build level number."},
     175    {ERROR_PROB_KRNL_BUILD_VERSION,     "Krnl: Invalid build level version."},
     176    {ERROR_PROB_KRNL_MZ_SEEK,           "Krnl: Failed to seek to start of file. (MZ)"},
     177    {ERROR_PROB_KRNL_MZ_READ,           "Krnl: Failed to read MZ header."},
     178    {ERROR_PROB_KRNL_NEOFF_INVALID,     "Krnl: Invalid new-header offset in MZ header."},
     179    {ERROR_PROB_KRNL_NEOFF_SEEK,        "Krnl: Failed to seek to new-header offset."},
     180    {ERROR_PROB_KRNL_LX_READ,           "Krnl: Failed to read LX header."},
     181    {ERROR_PROB_KRNL_LX_SIGNATURE,      "Krnl: Invalid LX header signature."},
     182    {ERROR_PROB_KRNL_OBJECT_CNT,        "Krnl: Object count don't match the running kernel."},
     183    {ERROR_PROB_KRNL_OBJECT_CNR_10,     "Krnl: Less than 10 objects - not a valid kernel file!"},
     184    {ERROR_PROB_KRNL_OTE_SEEK,          "Krnl: Failed to seek to OTEs."},
     185    {ERROR_PROB_KRNL_OTE_READ,          "Krnl: Failed to read OTEs."},
     186    {ERROR_PROB_KRNL_OTE_SIZE_MIS,      "Krnl: Size of a OTE didn't match the running kernel."},
     187
     188    /*
     189     * ProbeSymFile error messages
     190     */
     191    {ERROR_PROB_SYM_FILE_NOT_FOUND,     "Sym: Symbol file was not found."},
     192    {ERROR_PROB_SYM_READERROR,          "Sym: Read failed."},
     193    {ERROR_PROB_SYM_INVALID_MOD_NAME,   "Sym: Invalid module name (not OS2KRNL)."},
     194    {ERROR_PROB_SYM_SEGS_NE_OBJS,       "Sym: Number of segments don't match the object count of the kernel."},
     195    {ERROR_PROB_SYM_SEG_DEF_SEEK,       "Sym: Failed to seek to a segment definition."},
     196    {ERROR_PROB_SYM_SEG_DEF_READ,       "Sym: Failed to read a segment definition."},
     197    {ERROR_PROB_SYM_IMPORTS_NOTFOUND,   "Sym: All the imports wasn't found."},
     198
     199    {ERROR_PROB_SYMDB_KRNL_NOT_FOUND,   "SymDB: Kernel was not found."}
     200};
     201
     202/*
     203 * Fake data for Ring-3 testing.
     204 */
     205#ifdef R3TST
     206USHORT      usFakeVerMajor = 20;
     207USHORT      usFakeVerMinor = 45;
     208#ifdef R3TST
     209static ach[11] =  {0}; /* works around compiler/linker bug */
     210#endif
     211#endif
     212
    150213
    151214/*******************************************************************************
     
    157220static int      fseek(HFILE hfile, signed long off, int iOrg);
    158221static unsigned long fsize(HFILE hFile);
    159 static void     puts(char *psz);
    160 
    161 /* C-library replacements. */
     222
     223/* C-library replacements and additions. */
    162224static void     kmemcpy(char *psz1, const char *psz2, int cch);
    163225static char *   kstrstr(const char *psz1, const char *psz2);
     
    169231static int      kargncpy(char *pszTarget, const char *pszArg, unsigned cchMaxlen);
    170232
     233static const char * GetErrorMsg(short sErr);
     234
    171235/* Workers */
    172 static int      LookupKrnlEntry(unsigned uBuild, unsigned char chType,
    173                                 unsigned char fchType, unsigned char cObjects);
     236static int      LookupKrnlEntry(unsigned short usBuild, unsigned short fKernel, unsigned char cObjects);
    174237static int      VerifyPrologs(void);
    175238static int      ProbeSymFile(const char *pszFilename);
     
    177240
    178241/* Ouput */
    179 static void     ShowDecNumber(unsigned long ul);
    180 static void     ShowHexNumber(unsigned long ul);
    181242static void     ShowResult(int rc, int iSym);
    182243
     
    277338
    278339/**
    279  * puts lookalike
    280  */
    281 static void puts(char * psz)
    282 {
    283     DosPutMessage(0, kstrlen(psz), psz);
    284 }
    285 
    286 
    287 /**
    288340 * kmemcpy - memory copy - slow!
    289341 * @param     psz1  target
     
    481533
    482534
     535/**
     536 * Get the message text for an error message.
     537 * @returns Pointer to error text. NULL if not found.
     538 * @param   sErr  Error code id.
     539 * @status  completely implemented.
     540 * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     541 */
     542static const char * GetErrorMsg(short sErr)
     543{
     544    int i;
     545    for (i = 0; i < sizeof(aErrorMsgs) / sizeof(aErrorMsgs[0]); i++)
     546    {
     547        if (aErrorMsgs[i].sErr == sErr)
     548            return aErrorMsgs[i].pszMsg;
     549    }
     550    return NULL;
     551}
     552
     553
    483554
    484555/*******************************************************************************
     
    493564 *            1 if not found.
    494565 *            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
     566 * @param     usBuild       Build level.
     567 * @param     fKernel       Kernel (type) flags. (KF_* from options.h)
    500568 * @param     cObjects      Count of object in the running kernel.
    501569 * @sketch    Loop thru the table.
     
    503571 * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
    504572 */
    505 static int LookupKrnlEntry(unsigned uBuild, unsigned char fchBldType, unsigned char fchType, unsigned char cObjects)
     573static int LookupKrnlEntry(unsigned short usBuild, unsigned short fKernel, unsigned char cObjects)
    506574{
    507575    int i;
     
    512580    for (i = 0; aKrnlSymDB[i].usBuild != 0; i++)
    513581    {
    514         if (aKrnlSymDB[i].usBuild       == uBuild
    515             && aKrnlSymDB[i].fchBldType == fchBldType
    516             && aKrnlSymDB[i].fchType    == fchType
    517             && aKrnlSymDB[i].cObjects   == cObjects)
     582        if (   aKrnlSymDB[i].usBuild  == usBuild
     583            && aKrnlSymDB[i].fKernel  == fKernel
     584            && aKrnlSymDB[i].cObjects == cObjects)
    518585        {   /* found matching entry! */
    519586            int j;
     
    550617
    551618    /* not found */
    552     return 1;
     619    return ERROR_PROB_SYMDB_KRNL_NOT_FOUND;
    553620}
    554621#endif /* !EXTRACT */
     622
    555623
    556624/**
     
    616684    {
    617685        dprintf(("Error opening file %s\n", pszFilename));
    618         return -50;
     686        return ERROR_PROB_SYM_FILE_NOT_FOUND;
    619687    }
    620688    dprintf(("\nSuccessfully opened symbolfile: %s\n", pszFilename));
     
    629697    {   /* oops! read failed, close file and fail. */
    630698        fclose(hSym);
    631         return -51;
     699        return ERROR_PROB_SYM_READERROR;
    632700    }
    633701    achBuffer[0] = MapDef.achModName[0];
     
    646714        dprintf(("Modulename verify failed\n"));
    647715        fclose(hSym);
    648         return -51;
     716        return ERROR_PROB_SYM_INVALID_MOD_NAME;
    649717    }
    650718
     
    658726        dprintf(("Segment No. verify failed\n"));
    659727        fclose(hSym);
    660         return -52;
     728        return ERROR_PROB_SYM_SEGS_NE_OBJS;
    661729    }
    662730    #endif /* !EXTRACT */
     
    701769        {   /* Failed to seek to the segment definition, fail! */
    702770            fclose(hSym);
    703             return -53;
     771            return ERROR_PROB_SYM_SEG_DEF_SEEK;
    704772        }
    705773        rc = fread(&SegDef, sizeof(SEGDEF), 1, hSym);
     
    707775        {   /* Failed to read the segment definition, fail! */
    708776            fclose(hSym);
    709             return -53;
     777            return ERROR_PROB_SYM_SEG_DEF_READ;
    710778        }
    711779
     
    786854            for (i = 0; i < NBR_OF_KRNLIMPORTS; i++)
    787855            {
    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 */
     856                if (!aImportTab[i].fFound                                       /* Not allready found */
     857                    && (aImportTab[i].fType & EPT_VARIMPORT ? !fCode : fCode)   /* Don't look for code in a data segment */
     858                    && aImportTab[i].cchName == cchName                         /* Equal name length */
     859                    && kstrncmp(aImportTab[i].achName, achBuffer, cchName) == 0 /* Equal name */
    793860                    )
    794861                {   /* Symbol was found */
     
    833900     */
    834901    if (cLeftToFind != 0)
    835         return -57;
     902        return ERROR_PROB_SYM_IMPORTS_NOTFOUND;
    836903
    837904    /*
     
    843910
    844911/**
    845  * Gets the os/2 kernel OTE's (object table entries).
    846  * @returns   0 on success. Not 0 on error.
     912 * Get kernelinformation (OTEs (object table entries), build, type, debug...)
     913 * @returns 0 on success.
     914 *              options.ulBuild, fchType, fDebug, cObjects and paKrnlOTEs is set on successful return.
     915 *          Not 0 on error.
    847916 */
    848917static int   GetKernelInfo(void)
    849918{
    850 #if !defined(DEBUGR3) && !defined(EXTRACT) /* IOCtl not available after inittime! */
     919#if !defined(DEBUGR3) && !defined(EXTRACT) /* This IOCtl is not available after inittime! */
    851920    static KRNLINFO KrnlInfo = {0};
    852921    APIRET          rc;
     
    854923    USHORT          usAction = 0;
    855924
     925    /*
     926     * Issue an IOCtl to elf$ to query kernel information.
     927     */
    856928    rc = DosOpen("\\dev\\elf$", &hDev0, &usAction, 0UL, FILE_NORMAL,
    857929                 OPEN_ACTION_FAIL_IF_NEW | OPEN_ACTION_OPEN_IF_EXISTS,
     
    863935        if (rc == NO_ERROR)
    864936        {
    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];
    873937            #ifdef DEBUG
    874             for (i = 0; i < NBR_OF_KRNLIMPORTS; i++)
     938            unsigned i;
     939            #endif
     940
     941            /*
     942             * Set the exported parameters
     943             */
     944            options.ulBuild = KrnlInfo.ulBuild;
     945            options.fKernel = KrnlInfo.fKernel;
     946            cObjects        = KrnlInfo.cObjects;
     947            paKrnlOTEs      = &KrnlInfo.aObjects[0];
     948
     949            /*
     950             * If debugging probkrnl dump kernel OTEs.
     951             */
     952            #ifdef DEBUG
     953            dprintf(("debug: kernel OTE:\n"));
     954            for (i = 0; i < cObjects; i++)
    875955                dprintf(("debug: no.%2d base=%lx size=%lx sel=%x\n",
    876956                         i,
     
    879959                         paKrnlOTEs[i].ote_sel));
    880960            #endif
    881 
    882961        }
    883962        DosClose(hDev0);
     
    885964
    886965    if (rc != NO_ERROR)
    887         printf16("Failed to get kernel OTEs\r\n");
     966        printf16("Failed to get kernel OTEs. rc=%d\n", rc);
    888967
    889968    return rc;
     
    899978        {
    900979            rc = ReadOS2Krnl(szUsrOS2Krnl);
    901             if (rc != 0)
     980            if (rc != NO_ERROR)
    902981            {
    903                 puts("Warning: Invalid kernel file specified. Tries defaults.\n\r");
     982                printf16("Warning: Invalid kernel file specified. Tries defaults.\n");
    904983                szUsrOS2Krnl[0] = '\0';
    905984                rc = ReadOS2Krnl(szOS2Krnl);
     
    918997/**
    919998 * 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.
     999 * @param   rc      Return code.
     1000 * @param   iSym    index of .sym-file into static struct.
    9221001 */
    9231002#ifndef EXTRACT
     
    9291008     * Complain even if quiet on error
    9301009     */
    931     if (!fQuiet || rc != 0)
     1010    if (!options.fQuiet || rc != NO_ERROR)
    9321011    {
    9331012        printf16("Win32k - Odin32 support driver.\n");
     
    9361015         * kernel stuff
    9371016         */
    938         if (rc <= -50 || rc == 0)
     1017        if (rc == NO_ERROR || rc > ERROR_PROB_KRNL_LAST)
    9391018        {
    9401019            #ifdef DEBUGR3
    9411020            printf16("    Found kernel:     %s\n", szOS2Krnl);
    9421021            #endif
    943             printf16("    Build:            %d - v%d.%d\n",
    944                      usBuild, usVerMajor, usVerMinor);
    945         }
     1022            printf16("    Build:            %ld - v%d.%d\n",
     1023                     options.ulBuild, options.usVerMajor, options.usVerMinor);
     1024        }
     1025        else if (rc >= ERROR_PROB_KRNL_FIRST)
     1026            printf16("    Kernel probing failed with rc=%d.\n", rc);
    9461027        else
    947             printf16("    Kernel probing failed with rc=%d.\n", rc);
     1028            printf16("    Failed before probing kernel.\n");
    9481029
    9491030        /*
    9501031         * symbol-file
    9511032         */
    952         if (rc == 0)
     1033        if (rc == NO_ERROR || rc > ERROR_PROB_SYM_LAST)
    9531034            printf16("    Found symbolfile: %s\n",
    9541035                     szUsrSym[0] == '\0' ? apszSym[iSym] : szUsrSym);
     1036        else if (rc >= ERROR_PROB_SYM_FIRST)
     1037            printf16("    Failed to find symbolfile!\n");
    9551038        else
    956             printf16("    Failed to find symbolfile! rc=%d\n", rc);
     1039            printf16("    Failed before searching for symbolfile.\n");
    9571040
    9581041        /*
     
    9611044        for (i = 0; i < NBR_OF_KRNLIMPORTS; i++)
    9621045        {
    963             printf16("  %-20s at ",aImportTab[i].achName);
     1046            printf16("  %-21s at ",aImportTab[i].achName);
    9641047            if (aImportTab[i].fFound)
    9651048                printf16("0x%08lx%s", aImportTab[i].ulAddress, (i % 2) == 0 ? "" : "\n");
     
    9681051        }
    9691052        if (i % 2) printf16("\n");
     1053
     1054        /*
     1055         * Display error code.
     1056         */
     1057        if (rc != NO_ERROR)
     1058        {
     1059            const char *psz = GetErrorMsg(rc);
     1060            printf16("ProbeKernel failed with rc=%d.\n", rc);
     1061            if (psz) printf16("%s\n", psz);
     1062        }
    9701063    }
    9711064}
     
    10031096                switch (pReqPack->InitArgs[i])
    10041097                {
     1098                    #if defined(DEBUGR3)
    10051099                    case 'k':
    10061100                    case 'K': /* Kernel file */
     
    10081102                        i += kargncpy(szUsrOS2Krnl, &pReqPack->InitArgs[i], sizeof(szUsrOS2Krnl));
    10091103                        break;
     1104                    #endif
    10101105
    10111106                    case 'n':
    10121107                    case 'N': /* NoLoader */
     1108                        options.fNoLoader = TRUE;
    10131109                        return 0;
    10141110
    10151111                    case 'q':
    10161112                    case 'Q': /* Quiet */
    1017                         fQuiet = 1;
     1113                        options.fQuiet = TRUE;
    10181114                        break;
    10191115
     
    10211117                    case 'S': /* Symbol file */
    10221118                        i++;
    1023                         if (pReqPack->InitArgs[i] == 'Y' || pReqPack->InitArgs[i] == 'y')
     1119                        if (   pReqPack->InitArgs[i] != 'c' && pReqPack->InitArgs[i] != 'C'
     1120                            && pReqPack->InitArgs[i] != 'm' && pReqPack->InitArgs[i] != 'M'
     1121                            ) /* -script and -smp is ignored */
    10241122                            i += kargncpy(szUsrSym, &pReqPack->InitArgs[i], sizeof(szUsrSym));
    10251123                        break;
     
    10271125                    case 'v':
    10281126                    case 'V': /* Verbose */
    1029                         fQuiet = 0;
     1127                        options.fQuiet = FALSE;
    10301128                        break;
    10311129                }
     
    10441142    pGIS = MAKEPGINFOSEG(selGIS);
    10451143    usBootDrive = pGIS->bootdrive;
    1046     usVerMajor  = pGIS->uchMajorVersion;
    1047     usVerMinor  = pGIS->uchMinorVersion;
     1144#ifndef R3TST
     1145    options.usVerMajor  = pGIS->uchMajorVersion;
     1146    options.usVerMinor  = pGIS->uchMinorVersion;
     1147#else
     1148    options.usVerMajor  = usFakeVerMajor;
     1149    options.usVerMinor  = usFakeVerMinor;
     1150#endif
    10481151    dprintf(("BootDrive: %d\n", usBootDrive));
    10491152
    10501153    /* set driveletter in constants strings */
    10511154    usBootDrive = (char)usBootDrive + (char)'a' - 1;
     1155    #if defined(DEBUGR3)
    10521156    szOS2Krnl[0] = (char)usBootDrive;
     1157    #endif
    10531158    for (i = 0; apszSym[i] != NULL; i++)
    10541159        apszSym[i][0] = (char)usBootDrive;
     
    10581163    /*-----------------*/
    10591164    rc = GetKernelInfo();
    1060     if (rc != NO_ERROR)
    1061         return rc;
    10621165
    10631166    /*--------------*/
     
    10721175            if (rc)
    10731176            {
    1074                 puts("Warning: Invalid symbol file specified. Tries defaults.\n\r");
     1177                printf16("Warning: Invalid symbol file specified. Tries defaults.\n");
    10751178                szUsrSym[0] = '\0';
    10761179            }
    10771180        }
    1078         if (rc != 0) /* if user sym failed or don't exists. */
     1181        if (rc != NO_ERROR) /* if user sym failed or don't exists. */
    10791182        {
    10801183            /*
    10811184             * Check database - only if not a debug kernel!
    10821185             * 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...)
     1186             * (This is because I am unable to distinguish between half and
     1187             *  all strict kernels...)
    10841188             */
    1085             if (fDebug ||
    1086                 (rc = LookupKrnlEntry((unsigned short)usBuild, 'R', fchType, cObjects)) != 0
     1189            if ((options.fKernel & KF_DEBUG) ||
     1190                (rc = LookupKrnlEntry((unsigned short)options.ulBuild,
     1191                                      (unsigned short)options.fKernel,
     1192                                      cObjects)
     1193                 ) != NO_ERROR
    10871194                )
    10881195            {
    10891196                /* search on disk */
    10901197                i = 0;
    1091                 while (apszSym[i] != NULL && (rc = ProbeSymFile(apszSym[i])) != 0)
     1198                while (apszSym[i] != NULL
     1199                       && (rc = ProbeSymFile(apszSym[i])) != NO_ERROR
     1200                       )
    10921201                    i++;
    10931202            }
     
    11131222    int VerMinor, VerMajor;
    11141223
    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;
     1224    VerMajor = options.ulBuild < 20000 ? 20 : 30/*?*/;
     1225    VerMinor = options.ulBuild <  6600 ? 10 :  options.ulBuild <  8000 ? 11 : options.ulBuild < 9000 ? 30 :
     1226               options.ulBuild < 10000 ? 40 :  options.ulBuild < 15000 ? 45 : 50;
     1227
     1228    return VerMajor - (int)options.usVerMajor | VerMinor - (int)options.usVerMinor;
    11201229}
    11211230
     
    11231232/**
    11241233 * 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.
     1234 * @returns   0 on success.
     1235 *            One of the ERROR_PROB_KRNL_* defines on error.
     1236 * @param     pszFilename   Filename of the OS/2 kernel.
     1237 * @result    options.ulBuild is set.
    11281238 * @remark    This step will be eliminated by searching thru the DOSGROUP datasegment
    11291239 *            in the kernel memory. This segment have a string "Internal revision 9.034[smp|uni]"
     
    11401250    if (hKrnl != 0)
    11411251    {
     1252        /*
     1253         * Get size of kernel file.
     1254         */
    11421255        cbKrnl = fsize(hKrnl);
    11431256        if (!fseek(hKrnl, 0, SEEK_SET))
     1257        {
     1258            /*
     1259             * Call worker with filehandle and size.
     1260             */
    11441261            rc = ReadOS2Krnl2(hKrnl, cbKrnl);
     1262        }
    11451263        else
    1146             rc = -2;
     1264            rc = ERROR_PROB_KRNL_SEEK_SIZE;
    11471265        fclose(hKrnl);
    11481266    }
     
    11501268    {
    11511269        dprintf(("Could not open file\n"));
    1152         rc = -1;
     1270        rc = ERROR_PROB_KRNL_OPEN_FAILED;
    11531271    }
    11541272    return rc;
     
    11591277 * Worker function for ReadOS2Krnl
    11601278 * @returns   0 on success.
    1161  *            errorcodes on failure. (-1 >= rc >= -14)
     1279 *            One of the ERROR_PROB_KRNL_* defines on error.
    11621280 * @param     hKrnl   Handle to the kernel file.
    11631281 * @param     cbKrnl  Size of the kernel file.
     
    11761294
    11771295
    1178     /* find bldlevel string - "@#IBM:14.020#@  IBM OS/2 Kernel - 14.020F" */
     1296    /*
     1297     * Find bldlevel string - for example: "@#IBM:14.020#@  IBM OS/2 Kernel - 14.020F"
     1298     * Searching the entire file lineary from the start.
     1299     */
    11791300    if (fseek(hKrnl, 0, SEEK_SET))
    1180         return -2;
     1301        return ERROR_PROB_KRNL_SEEK_FIRST;
    11811302
    11821303    if (!fread(&achBuffer[KERNEL_ID_STRING_LENGTH], 1, KERNEL_READ_SIZE, hKrnl))
    1183         return -3;
     1304        return ERROR_PROB_KRNL_READ_FIRST;
    11841305
    11851306    i = KERNEL_ID_STRING_LENGTH;
     
    11911312            kmemcpy(achBuffer, &achBuffer[KERNEL_READ_SIZE], KERNEL_ID_STRING_LENGTH);
    11921313            if (!fread(&achBuffer[KERNEL_ID_STRING_LENGTH], 1, cbKrnl > KERNEL_READ_SIZE ? KERNEL_READ_SIZE : (int)cbKrnl, hKrnl))
    1193                 return -3;
     1314                return ERROR_PROB_KRNL_READ_NEXT;
    11941315
    11951316            i = 0;
     
    12041325    }
    12051326
     1327    /* found it? */
    12061328    if (cbKrnl == 0)
    12071329    {
    12081330        fclose(hKrnl);
    1209         return -4;
    1210     }
     1331        return ERROR_PROB_KRNL_TAG_NOT_FOUND;
     1332    }
     1333
     1334
     1335    /*
     1336     * We've found the @#IBM: tag. So now we'll try read it.
     1337     */
    12111338
    12121339    /* displacement */
     
    12171344    /* verify signature */
    12181345    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;
     1346        return ERROR_PROB_KRNL_INV_SIGANTURE;
     1347
     1348    /*
     1349     * read options.ulBuild
     1350     */
     1351    options.ulBuild  = (char)(achBuffer[i+6] - '0') * 1000;
    12231352    if (achBuffer[i+7] != '.')
    12241353    {
    12251354        /* this code is for Warp5 */
    1226         usBuild *= 10;
    1227         usBuild += (char)(achBuffer[i+7] - '0') * 1000;
     1355        options.ulBuild *= 10;
     1356        options.ulBuild += (char)(achBuffer[i+7] - '0') * 1000;
    12281357        i++;
    12291358        j--;
    12301359        if (achBuffer[i+7] != '.')
    12311360        {
    1232             usBuild = usBuild * 10;
    1233             usBuild = usBuild + (unsigned short)(achBuffer[i+7] - '0') * 1000;
     1361            options.ulBuild *= 10;
     1362            options.ulBuild += (unsigned long)(achBuffer[i+7] - '0') * 1000;
    12341363            i++;
    12351364            j--;
     
    12391368    if (j == 0)
    12401369    {
    1241         usBuild += (achBuffer[i+ 8] - '0') * 10;
    1242         usBuild += (achBuffer[i+ 9] - '0') * 1;
     1370        options.ulBuild += (achBuffer[i+ 8] - '0') * 10;
     1371        options.ulBuild += (achBuffer[i+ 9] - '0') * 1;
    12431372    }
    12441373    else
    12451374    {
    12461375        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 
     1376            return ERROR_PROB_KRNL_INV_BUILD_NBR;
     1377        options.ulBuild += (achBuffer[i+ 8] - '0') * 100;
     1378        options.ulBuild += (achBuffer[i+ 9] - '0') * 10;
     1379        options.ulBuild += (achBuffer[i+10] - '0');
     1380    }
     1381
     1382    /*
     1383     * We've read the build number. Let's check that it matches the OS/2
     1384     * version reported by DosGetInfoSeg.
     1385     */
    12531386    if (VerifyKernelVer())
    1254         return -9;
    1255     dprintf(("usBuild: %d\n", usBuild));
     1387        return ERROR_PROB_KRNL_BUILD_VERSION;
     1388    dprintf(("options.ulBuild: %d\n", options.ulBuild));
    12561389
    12571390    /* get segment number */
    12581391    /* read-MZheader */
    12591392    if (fseek(hKrnl,0,SEEK_SET))
    1260         return -2;
     1393        return ERROR_PROB_KRNL_MZ_SEEK;
    12611394
    12621395    if (!fread(achBuffer, 1, 0x40, hKrnl))
    1263         return -3;
     1396        return ERROR_PROB_KRNL_MZ_READ;
    12641397
    12651398    offLXHdr = *(unsigned long int *)&achBuffer[0x3c];
    12661399
    12671400    if (offLXHdr > 0x2000 && offLXHdr < 0x80) /* just to detect garbage */
    1268         return -6;
     1401        return ERROR_PROB_KRNL_NEOFF_INVALID;
    12691402
    12701403    if (fseek(hKrnl, offLXHdr, SEEK_SET))
    1271         return -2;
     1404        return ERROR_PROB_KRNL_NEOFF_SEEK;
    12721405
    12731406    if (!fread(achBuffer, 1, sizeof(struct e32_exe), hKrnl))
    1274         return -3;
     1407        return ERROR_PROB_KRNL_LX_READ;
    12751408
    12761409    /* check LX-magic */
    12771410    if (achBuffer[0] != 'L' || achBuffer[1] != 'X')
    1278         return -7;
     1411        return ERROR_PROB_KRNL_LX_SIGNATURE;
    12791412
    12801413#if !defined(DEBUGR3) && !defined(EXTRACT)
     
    12821415    pLXHdr = (struct e32_exe *)achBuffer;
    12831416    if ((UCHAR)pLXHdr->e32_objcnt != cObjects)
    1284         return -8;
     1417        return ERROR_PROB_KRNL_OBJECT_CNT;
    12851418
    12861419    if (pLXHdr->e32_objcnt < 10)
    1287         return -9;
    1288 
    1289     /* check objects (sizes and flags(?)) */
     1420        return ERROR_PROB_KRNL_OBJECT_CNR_10;
     1421
     1422    /* check objects sizes. */
    12901423    if (!fseek(hKrnl, (LONG)offLXHdr + (LONG)pLXHdr->e32_objtab, SEEK_SET))
    12911424    {
     
    12941427        {
    12951428            if (!fread(achBuffer, 1, sizeof(OTE), hKrnl))
    1296                 return -11;
     1429                return ERROR_PROB_KRNL_OTE_READ;
    12971430            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
     1431                return ERROR_PROB_KRNL_OTE_SIZE_MIS;
    13041432        }
    13051433    }
    13061434    else
    1307         return -10;
     1435        return ERROR_PROB_KRNL_OTE_SEEK;
    13081436#else
    13091437    /* Since we can't get the OTEs from the kernel when debugging in RING-3,
     
    13221450        for (i = 0; i < (int)cObjects; i++)
    13231451            if (!fread(&paKrnlOTEs[i], 1, sizeof(struct o32_obj), hKrnl))
    1324                 return -11;
     1452                return ERROR_PROB_KRNL_OTE_READ;
    13251453    }
    13261454    else
    1327         return -10;
     1455        return ERROR_PROB_KRNL_OTE_SEEK;
    13281456#endif
    13291457
    1330     return 0;
     1458    return NO_ERROR;
    13311459}
    13321460
     
    13701498 * Where: n - are the build number 4 or 5 digits.
    13711499 *        t - kernel type. R = retail, H = half strict, A = all strict.
    1372  *        m - UNI or SMP.  U = UNI processor kernel. S = SMP processor kernel.
     1500 *        m - UNI or SMP.  U = UNI processor kernel. S = SMP processor kernel. 4 = Warp 4 FP13+
    13731501 * @returns   NO_ERROR on success. Untracable error code on error.
    13741502 * @param     pszFilename  Pointer to read only filename of the .sym-file.
     
    13971525    }
    13981526
    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 
    14081527    /*
    14091528     * Probe kernelfile
     
    14191538        int i;
    14201539
     1540        /** @remark
     1541         * Currently information for retail kernels are usable, but we'll
     1542         * generate it for the debug kernels too, but this information
     1543         * is enclaved within an "#ifdef ALLKERNELS ... #endif".
     1544         */
     1545        if (pszFilename[cch-6] != 'R')
     1546            printf16("#ifdef ALLKERNELS\n");
     1547
    14211548        printf16("    { /* %s */\n"
    1422                  "        %.*s, \'%c\', %s, %d,\n"
     1549                 "        %.*s, ",
     1550                 pszFilename,
     1551                 cch - 6, &pszFilename[0]              /* build number */
     1552                 );
     1553
     1554        switch (pszFilename[cch - 5])
     1555        {
     1556            case 'S':   printf16("KF_SMP"); break;
     1557            case '4':   printf16("KF_UNI | KF_W4"); break;
     1558            case 'U':   printf16("KF_UNI"); break;
     1559        }
     1560        switch (pszFilename[cch - 6])
     1561        {
     1562            case 'A':   printf16(" | KF_ALLSTRICT"); break;
     1563            case 'H':   printf16(" | KF_HALFSTRICT"); break;
     1564        }
     1565        printf16(", %d,\n"
    14231566                 "        {\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",
    14291567                 aImportTab[0].iObject + 1); /* ASSUMES that DOSCODE32 is the last object. */
    14301568
     
    14321570        {
    14331571            char *psz = aImportTab[i].achName;
    1434             printf16("            {%2d, 0x%08lx}, /* %s */\n",
     1572            printf16("            {%-2d, 0x%08lx}, /* %s */\n",
    14351573                     aImportTab[i].iObject,
    14361574                     aImportTab[i].offObject,
     
    14401578        printf16("        }\n"
    14411579                 "    },\n");
     1580
     1581        /** @remark
     1582         * Currently information for retail kernels are usable, but we'll
     1583         * generate it for the debug kernels too, but this information
     1584         * is enclaved within an "#ifdef ALLKERNELS ... #endif".
     1585         */
     1586        if (pszFilename[cch-6] != 'R')
     1587            printf16("#endif\n");
    14421588    }
    14431589    else
     
    14601606{
    14611607    APIRET  rc;
    1462 
     1608    const char *  psz;
    14631609
    14641610    /*
     
    14741620         */
    14751621        int i;
    1476         for (i = 0; i < argc; i++)
     1622        for (i = 1; i < argc; i++)
    14771623        {
    14781624            rc = processFile(argv[i]);
     
    14801626            {
    14811627                printf16("processFile failed with rc=%d for file %s\n",
    1482                           rc, argv[i]);
     1628                         rc, argv[i]);
     1629                if (psz = GetErrorMsg(rc))
     1630                    printf16("%s\n", psz);
    14831631                return rc;
    14841632            }
     
    14981646        int         i;
    14991647
    1500         printf16("/* $Id: probkrnl.c,v 1.20 2000-04-17 01:56:48 bird Exp $\n"
     1648        printf16("/* $Id: probkrnl.c,v 1.20.4.1 2000-07-16 22:43:22 bird Exp $\n"
    15011649                 "*\n"
    15021650                 "* Autogenerated kernel symbol database.\n"
     
    15131661                 "#include <os2.h>\n"
    15141662                 "#include \"probkrnl.h\"\n"
     1663                 "#include \"options.h\"\n"
    15151664                 "\n");
    15161665
     
    15281677                printf16("processFile failed with rc=%d for file %s\n",
    15291678                         rc, &ffb.achName[0]);
     1679                if (psz = GetErrorMsg(rc))
     1680                    printf16("%s\n", psz);
    15301681                return rc;
    15311682            }
     
    15371688
    15381689        printf16("    { /* Terminating entry */\n"
    1539                  "        0,0,0,0,\n"
     1690                 "        0,0,0,\n"
    15401691                 "        {\n");
    15411692        for (i = 0; i < NBR_OF_KRNLIMPORTS; i++)
  • branches/GRACE/src/win32k/dev16/vprntf16.c

    r2905 r3834  
    1 /* $Id: vprntf16.c,v 1.2 2000-02-26 17:49:28 bird Exp $
     1/* $Id: vprntf16.c,v 1.2.4.1 2000-07-16 22:43:24 bird Exp $
    22 *
    33 * vprintf and printf - 16-bit.
     
    4646*   Global Variables                                                           *
    4747*******************************************************************************/
     48static char chReturn  = '\r';
    4849static char chNewLine = '\n';
    49 static char chReturn  = '\r';
     50static char chReturnWithNewLine[2] = "\r\n";
    5051
    5152/*******************************************************************************
     
    413414static void choutconsole(int ch)
    414415{
    415     USHORT usWrote;
    416 
    417416    if (ch != '\r')
    418417    {
     418        USHORT  usWrote;                /* Bytes written (ignored). */
    419419        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);
     420            DosWrite(1, (PVOID)&chReturnWithNewLine, 2, &usWrote);
     421        else
     422            DosWrite(1, (PVOID)&ch, 1, &usWrote);
    426423    }
    427424}
     
    438435 *            At runtime the text is only sendt to com-port.
    439436 */
    440 static char *stroutconsole(char *psz, signed cchMax)
    441 {
     437static char *stroutconsole(register char *psz, signed cchMax)
     438{
     439    register CHAR   ch;
     440
    442441    while (cchMax > 0 && *psz != '\0')
    443442    {
    444         USHORT cch = 0;
    445         USHORT us;
    446 
    447         while (cchMax - cch > 0 && psz[cch] != '\0' && psz[cch] != '\r' && psz[cch] != '\n')
     443        register signed cch = 0;
     444        USHORT          us;             /* Bytes written (ignored). */
     445
     446        while (cchMax > cch && (ch = psz[cch]) != '\0' && ch != '\r' && ch != '\n')
    448447            cch++;
    449448
    450449        /* write string part */
    451         us = cch;
    452450        DosWrite(1, (PVOID)psz, cch, &us);
    453451
    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++;
     452        /* cr and lf: expand lf to cr+lf and ignore cr. */
     453        while (cchMax > cch)
     454        {
     455            if ((ch = psz[cch]) == '\n')
     456                DosWrite(1, (PVOID)&chReturnWithNewLine, 2, &us);
     457            else
     458                if (ch != '\r')
     459                    break;
     460            cch++;
    465461        }
    466462
     
    481477static void chout(int ch)
    482478{
    483     #ifdef RING0
     479    #if defined(RING0) && !defined(R3TST)
    484480        if (fInitTime)
    485481            choutconsole(ch);
     
    514510static char *strout(char *psz, signed cchMax)
    515511{
    516     #ifdef RING0
     512    #if defined(RING0) && !defined(R3TST)
    517513        int cchYield = 0;
    518514
     
    539535
    540536            /* cr and lf check + skip */
    541             if (psz[cch] == '\n' || psz[cch] == '\r')
     537            if (cch < cchMax && (psz[cch] == '\n' || psz[cch] == '\r'))
    542538            {
    543539                if (psz[cch] == '\n')
  • branches/GRACE/src/win32k/dev32/d32init.c

    r3485 r3834  
    1 /* $Id: d32init.c,v 1.19 2000-05-03 10:46:06 bird Exp $
     1/* $Id: d32init.c,v 1.19.4.1 2000-07-16 22:42:03 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/*******************************************************************************
     
    4545#include "macros.h"
    4646
     47#ifdef R3TST
     48    #include "test.h"
     49#endif
     50
    4751
    4852/*******************************************************************************
     
    5357static char * apszInfoLevel[] = {"INFOLEVEL_QUIET", "INFOLEVEL_ERROR", "INFOLEVEL_WARNING", "INFOLEVEL_INFO", "INFOLEVEL_INFOALL", "!invalid!"};
    5458#endif
    55 static PMTE    pKrnlMTE = NULL;
    56 static PSMTE   pKrnlSMTE = NULL;
    57 static POTE    pKrnlOTE = NULL;
     59PMTE    pKrnlMTE = NULL;
     60PSMTE   pKrnlSMTE = NULL;
     61POTE    pKrnlOTE = NULL;
    5862
    5963
     
    6165*   Internal Functions                                                         *
    6266*******************************************************************************/
    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);
     67 ULONG          readnum(const char *pszNum);
     68_Inline int     ModR_M_32bit(char bModRM);
     69_Inline int     ModR_M_16bit(char bModRM);
     70int             interpretFunctionProlog32(char *pach, BOOL fOverload);
     71int             interpretFunctionProlog16(char *pach, BOOL fOverload);
     72int             importTabInit(void);
     73#ifdef R3TST
     74PMTE            GetOS2KrnlMTETst(void);
     75void            R3TstFixImportTab(void);
     76#endif
     77
    6878
    6979
     
    118128        {
    119129            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                 }
     130            case 'C': /* -C[1|2] or -Com:[1|2]  -  com-port no, def:-C2 */
     131                pszTmp2 = strpbrk(pszTmp, ":=/- ");
     132                if (pszTmp2 != NULL && (*pszTmp2 == ':' || *pszTmp2 == '='))
     133                    pszTmp2++;
     134                else
     135                    pszTmp2 = pszTmp + 1;
     136                options.usCom = (USHORT)(*pszTmp2 == '1' ? OUTPUT_COM1 : OUTPUT_COM2);
    131137                break;
    132138
     
    134140            case 'E':/* ELF */
    135141                pszTmp2 = strpbrk(pszTmp, ":=/- ");
    136                 if (pszTmp2 != NULL && (int)(pszTmp2-pszTmp) < cch-1
     142                if (pszTmp2 != NULL
    137143                    && (pszTmp2[1] == 'N' ||pszTmp2[1] == 'n' || pszTmp2[1] == 'D' || pszTmp2[1] == 'd')
    138144                    )
     
    145151            case 'H': /* Heap options */
    146152                pszTmp2 = strpbrk(pszTmp, ":=/- ");
    147                 if (pszTmp2 != NULL && (int)(pszTmp2-pszTmp) < cch-1
    148                     && (*pszTmp2 == ':' || *pszTmp2 == '='))
     153                if (pszTmp2 != NULL && (*pszTmp2 == ':' || *pszTmp2 == '='))
    149154                {
    150155                    ul = readnum(pszTmp2 + 1);
     
    162167            case 'L': /* -L[..]<:|=| >[<Y..|E..| > | <N..|D..>] */
    163168                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')
     169                if (pszTmp2 != NULL
     170                    && (pszTmp2[1] == 'Y' ||pszTmp2[1] == 'y' || pszTmp2[1] == 'E' || pszTmp2[1] == 'e')
    166171                    )
     172                    options.fLogging = TRUE;
     173                else
    167174                    options.fLogging = FALSE;
    168                 else
    169                     options.fLogging = TRUE;
    170175                break;
    171176
     
    178183            case 'P': /* PE */
    179184                pszTmp2 = strpbrk(pszTmp, ":=/- ");
    180                 if (pszTmp2 != NULL && (int)(pszTmp2-pszTmp) < cch-1
    181                     && (*pszTmp2 == ':' || *pszTmp2 == '='))
     185                if (pszTmp2 != NULL && (*pszTmp2 == ':' || *pszTmp2 == '='))
    182186                {
    183                     pszTmp++;
    184                     if (strnicmp(pszTmp, "pe2lx", 5) == 0)
     187                    pszTmp2++;
     188                    if (strnicmp(pszTmp2, "pe2lx", 5) == 0)
    185189                        options.fPE = FLAGS_PE_PE2LX;
    186                     else if (strnicmp(pszTmp, "pe", 2) == 0)
     190                    else if (strnicmp(pszTmp2, "pe", 2) == 0)
    187191                        options.fPE = FLAGS_PE_PE;
    188                     else if (strnicmp(pszTmp, "mixed", 2) == 0)
     192                    else if (strnicmp(pszTmp2, "mixed", 2) == 0)
    189193                        options.fPE = FLAGS_PE_MIXED;
    190                     else if (strnicmp(pszTmp, "not", 2) == 0)
     194                    else if (strnicmp(pszTmp2, "not", 2) == 0)
    191195                        options.fPE = FLAGS_PE_NOT;
    192196                    else
     
    205209            case 'R': /* ResHeap options */
    206210                pszTmp2 = strpbrk(pszTmp, ":=/- ");
    207                 if (pszTmp2 != NULL && (int)(pszTmp2-pszTmp) < cch-1
    208                     && (*pszTmp2 == ':' || *pszTmp2 == '='))
     211                if (pszTmp2 != NULL && (*pszTmp2 == ':' || *pszTmp2 == '='))
    209212                {
    210213                    ul = readnum(pszTmp2 + 1);
     
    222225            case 'S': /* Sym:<filename> or Script:<Yes|No> or Smp */
    223226                /* SMP kernel */
    224                 if (pszTmp[1] == 'm' || pszTmp[1] == 'M')
    225                     options.fKernel = KF_SMP;
    226                 else
     227                pszTmp2 = strpbrk(pszTmp, ":=/- ");
     228                if (pszTmp[1] == 'c' || pszTmp[1] == 'C')
    227229                {
    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                     }
     230                    options.fUNIXScript =
     231                        pszTmp2 != NULL
     232                        && (int)(pszTmp2-pszTmp) < cch-1
     233                        && (*pszTmp2 == ':' || *pszTmp2 == '=')
     234                        && (pszTmp2[1] == 'Y' || pszTmp2[1] == 'y');
    235235                }
    236                 break;
    237 
    238             case 'u':
    239             case 'U': /* UNI kernel */
    240                 options.fKernel = KF_UNI;
    241236                break;
    242237
     
    247242
    248243            case 'w':
    249             case 'W':
     244            case 'W': /* ModuleBase info level; -W<n> or -Warning:<n> */
    250245                if (pszTmp[1] >= '0' && pszTmp[1] <= '4')
    251246                    options.ulInfoLevel = pszTmp[1] - '0';
     
    253248                {
    254249                    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';
     250                    if (pszTmp2 != NULL && (*pszTmp2 == ':' || *pszTmp2 == '='))
     251                        pszTmp2++;
     252                    else
     253                        pszTmp2 = pszTmp + 1;
     254
     255                    if (*pszTmp2 >= '0' && *pszTmp2 <= '4')
     256                        options.ulInfoLevel = *pszTmp2 - '0';
    260257                }
    261258                break;
     
    270267    if (options.cbResHeapInit > options.cbResHeapMax)
    271268        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;
    277269
    278270    /* Log option summary */
     
    288280    else
    289281        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",
     282    kprintf(("\tCom port no.%03xh\n", options.usCom));
     283
     284    kprintf(("\tKernel: v%d.%d  build %d  type ",
    293285                options.usVerMajor,
    294286                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)]));
     287                options.ulBuild));
     288    if (options.fKernel & KF_SMP)
     289        kprintf(("SMP "));
     290    else if (options.fKernel & KF_W4)
     291        kprintf(("W4 "));
     292    else
     293        kprintf(("UNI "));
     294    if (options.fKernel & KF_DEBUG)
     295        kprintf(("DEBUG\n"));
     296    else
     297        kprintf(("\n"));
     298
     299    kprintf(("\tfPE=%d (%s)\n",     options.fPE, apszPE[MIN(options.fPE, 5)]));
    299300    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));
     301    kprintf(("\tfElf=%d\n",         options.fElf));
     302    kprintf(("\tfUNIXScript=%d\n",  options.fUNIXScript));
     303    kprintf(("\tfREXXScript=%d\n",  options.fREXXScript));
     304    kprintf(("\tfJAVA=%d\n",        options.fJava));
     305    kprintf(("\tfNoLoader=%d\n",    options.fNoLoader));
    303306    kprintf(("\tcbSwpHeapInit=0x%08x  cbSwpHeapMax=0x%08x\n",
    304307             options.cbSwpHeapInit, options.cbSwpHeapMax));
    305308    kprintf(("\tcbResHeapInit=0x%08x  cbResHeapMax=0x%08x\n",
    306              options.cbSwpHeapInit, options.cbSwpHeapMax));
     309             options.cbResHeapInit, options.cbResHeapMax));
    307310    kprintf(("Options - Summary - End\n"));
    308311    #endif /* debug */
     
    325328    /* functionoverrides */
    326329    if (!options.fNoLoader)
    327         if (ImportTabInit() != NO_ERROR)
     330        if (importTabInit() != NO_ERROR)
    328331            return STATUS_DONE | STERR | ERROR_I24_QUIET_INIT_FAIL;
    329332
     
    369372 * @author    knut st. osmundsen
    370373 */
    371 static ULONG    readnum(const char *pszNum)
     374ULONG    readnum(const char *pszNum)
    372375{
    373376    ULONG ulRet = 0;
     
    428431
    429432    /* Find the kernel OTE table */
     433#ifndef R3TST
    430434    pKrnlMTE = GetOS2KrnlMTE();
     435#else
     436    pKrnlMTE = GetOS2KrnlMTETst();
     437#endif
    431438    if (pKrnlMTE != NULL)
    432439    {
     
    461468                     * Search for internal revision stuff in the two first objects.
    462469                     */
    463                     pKrnlInfo->usBuild = 0;
    464                     for (i = 0; i < 2 && pKrnlInfo->usBuild == 0; i++)
     470                    pKrnlInfo->ulBuild = 0;
     471                    for (i = 0; i < 2 && pKrnlInfo->ulBuild == 0; i++)
    465472                    {
     473                        #ifndef R3TST
    466474                        const char *psz = (const char*)pKrnlOTE[i].ote_base;
    467                         const char *pszEnd = psz + pKrnlOTE[i].ote_size;
    468 
    469                         while (psz + 100 < pszEnd)
     475                        const char *pszEnd = psz + pKrnlOTE[i].ote_size - 50; /* Last possible search position. */
     476                        #else
     477                        extern const char *pszInternalRevision; /* defined in win32ktst.c */
     478                        const char *psz =  pszInternalRevision;
     479                        const char *pszEnd = psz + 3;
     480                        #endif
     481
     482                        while (psz < pszEnd)
    470483                        {
    471484                            if (strncmp(psz, "Internal revision ", 18) == 0 && (psz[18] >= '0' && psz[18] <= '9'))
    472485                            {
    473486                                int j;
    474                                 kprintf2(("GetOTEs32: found internal revision: '%s'\n", psz));
     487                                kprintf2(("GetKernelInfo32: found internal revision: '%s'\n", psz));
    475488
    476489                                /* skip to end of "Internal revision " string. */
     
    481494                                {
    482495                                    if (*psz != '.')
    483                                         pKrnlInfo->usBuild = (unsigned short)(pKrnlInfo->usBuild * 10 + (*psz - '0'));
     496                                        pKrnlInfo->ulBuild = (unsigned short)(pKrnlInfo->ulBuild * 10 + (*psz - '0'));
    484497                                    psz++;
    485498                                }
    486499
    487500                                /* 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 */
     501                                if (   !(pKrnlInfo->ulBuild >=  8254 && pKrnlInfo->ulBuild <  8383) /* Warp 3 fp 32 -> fp 60 */
     502                                    && !(pKrnlInfo->ulBuild >=  9023 && pKrnlInfo->ulBuild <= 9036) /* Warp 4 GA -> fp 12 */
     503                                    && !(pKrnlInfo->ulBuild >= 14039 && pKrnlInfo->ulBuild < 14080) /* Warp 4.5 GA -> fp 40 */
    491504                                      )
    492505                                {
    493                                     kprintf(("GetOTEs32: info summary: Build %d is invalid - invalid fixpack?\n", pKrnlInfo->usBuild));
    494                                     usRc = 6;
     506                                    kprintf(("GetKernelInfo32: info summary: Build %d is invalid - invalid fixpack?\n", pKrnlInfo->ulBuild));
     507                                    usRc = ERROR_D32_INVALID_BUILD;
    495508                                    break;
    496509                                }
     
    500513                                    || (psz[0] == '_' && (psz[1] == 'S' || psz[1] == 's'))  /* _SMP  */
    501514                                    )
    502                                     pKrnlInfo->fchType = TYPE_SMP;
    503                                 else if (psz[0] == '_' && psz[1] == 'W' && psz[2] == '4')    /* _W4  */
    504                                     pKrnlInfo->fchType = TYPE_W4;
     515                                    pKrnlInfo->fKernel = KF_SMP;
    505516                                else
    506                                     pKrnlInfo->fchType = TYPE_UNI;
     517                                    if (*psz != ','
     518                                        && (psz[0] == '_' && (psz[1] == 'W' || psz[1] == 'w') && psz[2] == '4')  /* _W4 */
     519                                        )
     520                                    pKrnlInfo->fKernel = KF_W4 | KF_UNI;
     521                                else
     522                                    pKrnlInfo->fKernel = KF_UNI;
    507523
    508524
    509525                                /* Check if its a debug kernel (look for DEBUG at start of object 3-5) */
     526                            #ifndef R3TST
    510527                                j = 3;
    511                                 pKrnlInfo->fDebug = FALSE;
    512528                                while (j < 5)
    513529                                {
     
    520536                                        && strncmp((char*)pKrnlOTE[j].ote_base, "DEBUG", 5) == 0)
    521537                                    {
    522                                         pKrnlInfo->fDebug = TRUE;
     538                                        pKrnlInfo->fKernel |= KF_DEBUG;
    523539                                        break;
    524540                                    }
    525541                                    j++;
    526542                                }
     543                            #else
     544                                NOREF(j);
     545                            #endif
    527546
    528547                                /* Display info */
    529                                 kprintf(("GetOTEs32: info summary: Build %d, fchType=%d, fDebug=%d\n",
    530                                          pKrnlInfo->usBuild, pKrnlInfo->fchType, pKrnlInfo->fDebug));
     548                                kprintf(("GetKernelInfo32: info summary: Build %d, fKernel=%d\n",
     549                                         pKrnlInfo->ulBuild, pKrnlInfo->fKernel));
    531550
    532551                                /* Break out */
     
    540559
    541560                    /* Set error code if not found */
    542                     if (pKrnlInfo->usBuild == 0)
     561                    if (pKrnlInfo->ulBuild == 0)
    543562                    {
    544                         usRc = 5;
    545                         kprintf(("GetOTEs32: Internal revision was not found!\n"));
     563                        usRc = ERROR_D32_BUILD_INFO_NOT_FOUND;
     564                        kprintf(("GetKernelInfo32: Internal revision was not found!\n"));
    546565                    }
    547566                }
    548567                else
    549                     usRc = 4;
     568                    usRc = ERROR_D32_NO_OBJECT_TABLE;
    550569            }
    551570            else
    552                 usRc = 3;
     571                usRc = ERROR_D32_TOO_MANY_OBJECTS;
    553572        }
    554573        else
    555             usRc = 2;
     574            usRc = ERROR_D32_NO_SWAPMTE;
    556575    }
    557576    else
    558         usRc = 1;
    559 
    560 
    561     if (usRc != 0)
    562         kprintf(("GetOTEs32: failed. usRc = %d\n", usRc));
     577        usRc = ERROR_D32_GETOS2KRNL_FAILED;
     578
     579    if (usRc != NO_ERROR)
     580        kprintf(("GetKernelInfo32: failed. usRc = %d\n", usRc));
    563581
    564582    return (USHORT)(usRc | (usRc != NO_ERROR ? STATUS_DONE | STERR : STATUS_DONE));
     
    575593 * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
    576594 */
    577 _Inline int ModR_M_32bit(char bModRM)
     595int ModR_M_32bit(char bModRM)
    578596{
    579597    if ((bModRM & 0xc0) == 0x80  /* ex. mov ax,[ebp+11145543h] */
     
    591609
    592610
     611/**
     612 * Functions which cacluates the instructionsize given a ModR/M byte.
     613 * @returns   Number of bytes to add to cb and pach.
     614 * @param     bModRM  ModR/M byte.
     615 * @status    completely implemented.
     616 * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     617 */
     618int ModR_M_16bit(char bModRM)
     619{
     620    if ((bModRM & 0xc0) == 0x80  /* ex. mov ax,[ebp+11145543h] */
     621        || ((bModRM & 0xc0) == 0 && (bModRM & 0x07) == 5)) /* ex. mov ebp,[0ff231234h] */
     622    {   /* 16-bit displacement */
     623        return 4;
     624    }
     625    else if ((bModRM & 0xc0) == 0x40) /* ex. mov ecx,[esi]+4fh */
     626    {   /* 8-bit displacement */
     627        return 2;
     628    }
     629    /* no displacement (only /r byte) */
     630    return 1;
     631}
     632
     633
    593634
    594635
     
    603644 *                       FALSE: Function is to be imported.
    604645 */
    605 static int interpretFunctionProlog32(char *pach, BOOL fOverload)
     646int interpretFunctionProlog32(char *pach, BOOL fOverload)
    606647{
    607648    int cb = -3;
    608 
    609649    kprintf2(("interpretFunctionProlog32(0x%08x, %d):\n"
    610650              "\t%02x %02x %02x %02x - %02x %02x %02x %02x\n"
     
    787827 *                       FALSE: Function is to be imported.
    788828 */
    789 static int interpretFunctionProlog16(char *pach, BOOL fOverload)
     829int interpretFunctionProlog16(char *pach, BOOL fOverload)
    790830{
    791831    int cb = -7;
     
    809849        while (cb < 8 || fForce)        /* 8 is the size of a 66h prefixed far jump instruction. */
    810850        {
     851            int cb2;
    811852            fForce = FALSE;
    812853            switch (*pach)
    813854            {
     855                case 0x06:              /* push es */
     856                case 0x0e:              /* push cs */
     857                case 0x1e:              /* push ds */
     858                case 0x16:              /* push ss */
     859                    break;
     860
    814861                case 0x0f:              /* push gs and push fs */
    815862                    if (pach[1] != 0xA0 && pach[1] != 0xA8)
     
    888935                    break;
    889936
     937                /* complex sized instruction - "/5 ib" */
     938                case 0x80:              /* 5: sub r/m8, imm8  7: cmp r/m8, imm8 */
     939                case 0x83:              /* 5: sub r/m16, imm8 7: cmp r/m16, imm8 */
     940                    if ((pach[1] & 0x38) == (5<<3)
     941                        || (pach[1] & 0x38) == (7<<3)
     942                        )
     943                    {
     944                        cb += cb2 = 1 + ModR_M_16bit(pach[1]); /* 1 is the size of the imm8 */
     945                        pach += cb2;
     946                    }
     947                    else
     948                    {
     949                        kprintf(("interpretFunctionProlog32: unknown instruction (-3) 0x%x 0x%x 0x%x\n", pach[0], pach[1], pach[2]));
     950                        return -3;
     951                    }
     952                    break;
     953
     954
    890955                default:
    891956                    kprintf(("interpretFunctionProlog16: unknown instruction 0x%x 0x%x 0x%x\n", pach[0], pach[1], pach[2]));
     
    913978USHORT _loadds _Far32 _Pascal VerifyImportTab32(void)
    914979{
    915     int i;
    916     int cb;
    917     int cbmin;
     980    USHORT  usRc;
     981    int     i;
     982    int     cb;
     983    int     cbmin;
    918984
    919985    /* VerifyImporTab32 is called before the initroutine! */
    920986    pulTKSSBase32 = (PULONG)_TKSSBase16;
    921987
     988#ifdef R3TST
     989    R3TstFixImportTab();
     990#endif
     991
    922992    /* Check that pKrnlOTE is set */
    923     if (GetKernelInfo32(NULL) != NO_ERROR)
    924         return STATUS_DONE | STERR | 1;
     993    usRc = GetKernelInfo32(NULL);
     994    if (usRc != NO_ERROR)
     995        return (USHORT)(STATUS_DONE | STERR | (usRc & STECODE));
    925996
    926997    /*
     
    9401011        {
    9411012            kprintf(("VerifyImportTab32: procedure no.%d was not fFound!\n", i));
    942             return STATUS_DONE | STERR | 2;
     1013            return STATUS_DONE | STERR | ERROR_D32_PROC_NOT_FOUND;
    9431014        }
    9441015
     1016    #ifndef R3TST
    9451017        /* Verify read/writeable. */
    9461018        if (_aImportTab[i].iObject >= pKrnlSMTE->smte_objcnt                                /* object index valid? */
     
    9561028                     i, &_aImportTab[i].achName[0], _aImportTab[i].ulAddress,
    9571029                     _aImportTab[i].iObject, _aImportTab[i].offObject));
    958             return STATUS_DONE | STERR | 3;
     1030            return STATUS_DONE | STERR | ERROR_D32_INVALID_OBJ_OR_ADDR;
    9591031        }
    9601032
     
    9651037            kprintf(("VerifyImportTab32: procedure no.%d has an invalid address, %#08x!\n",
    9661038                     i, _aImportTab[i].ulAddress));
    967             return STATUS_DONE | STERR | 4;
     1039            return STATUS_DONE | STERR | ERROR_D32_INVALID_ADDRESS;
    9681040        }
     1041    #endif
    9691042
    9701043        switch (_aImportTab[i].fType & ~EPT_BIT_MASK)
     
    9911064                 * Check result of the function prolog interpretations.
    9921065                 */
    993                 if (cb <= 0 && cb + cbmin >= MAXSIZE_PROLOG)
     1066                if (cb <= 0 || cb + cbmin >= MAXSIZE_PROLOG)
    9941067                {   /* failed, too small or too large. */
    9951068                    kprintf(("VerifyImportTab32: verify failed for procedure no.%d (cd=%d)\n", i, cb));
    996                     return STATUS_DONE | STERR | 5;
     1069                    return STATUS_DONE | STERR | ERROR_D32_TOO_INVALID_PROLOG;
    9971070                }
    9981071                break;
     
    10031076
    10041077            default:
    1005                 kprintf(("VerifyImportTab32: only EPT_PROC is implemented\n",i));
     1078                kprintf(("VerifyImportTab32: invalid type/type not implemented\n",i));
    10061079                Int3(); /* temporary fix! */
    1007                 return STATUS_DONE | STERR | 6;
     1080                return STATUS_DONE | STERR | ERROR_D32_NOT_IMPLEMENTED;
    10081081        }
    10091082    }
     
    10171090 * @returns   NO_ERROR on success. !0 on error.
    10181091 */
    1019 static int importTabInit(void)
     1092int importTabInit(void)
    10201093{
    10211094    /* This table must be updated with the overloading functions. */
    10221095    static unsigned auFuncs[NBR_OF_KRNLIMPORTS] =
    10231096    {
    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
    1042     };
    1043 
     1097        (unsigned)myldrRead,            /* 0 */
     1098        (unsigned)myldrOpen,            /* 1 */
     1099        (unsigned)myldrClose,           /* 2 */
     1100        (unsigned)myLDRQAppType,        /* 3 */
     1101        (unsigned)myldrEnum32bitRelRecs,/* 4 */
     1102        0,                              /* 5 */
     1103        0,                              /* 6 */
     1104        0,                              /* 7 */
     1105        0,                              /* 8 */
     1106        0,                              /* 9 */
     1107        0,                              /* 10 */
     1108        0,                              /* 11 */
     1109        0,                              /* 12 */
     1110        (unsigned)&mytkExecPgm,         /* 13 */
     1111        0,                              /* 14 */
     1112        0,                              /* 15 */
     1113        0,                              /* 16 */
     1114        0,                              /* 17 */
     1115        (unsigned)myldrOpenPath,        /* 18 */
     1116        0,                              /* 19 */
     1117        0,                              /* 20 */
     1118        0,                              /* 21 */
     1119        0,                              /* 22 */
     1120        0,                              /* 23 */
     1121        0,                              /* 24 */
     1122        0,                              /* 25 */
     1123        0,                              /* 26 */
     1124        0,                              /* 27 */
     1125        0,                              /* 28 */
     1126        0                               /* 29 */
     1127    };
    10441128    int i;
    10451129    int cb;
    10461130    int cbmin;
     1131
     1132#ifdef R3TST
     1133    R3TstFixImportTab();
     1134#endif
    10471135
    10481136    /*
     
    10681156        {
    10691157            kprintf(("ImportTabInit: Verify failed for procedure no.%d, cb=%d\n", i, cb));
    1070             return 1;
     1158            return ERROR_D32_VERIFY_FAILED;
    10711159        }
    10721160    }
     
    11141202                    kprintf(("ImportTabInit: FATAL verify failed for procedure no.%d when rehooking it!\n",i));
    11151203                    Int3(); /* ipe - later! */
    1116                     return 1;
     1204                    return ERROR_D32_VERIFY_FAILED;
    11171205                }
    11181206                break;
     
    11591247                    kprintf(("ImportTabInit: FATAL verify failed for procedure no.%d when rehooking it!\n",i));
    11601248                    Int3(); /* ipe - later! */
    1161                     return 1;
     1249                    return ERROR_D32_VERIFY_FAILED;
    11621250                }
    11631251                break;
     
    11871275                    kprintf(("ImportTabInit: FATAL verify failed for procedure no.%d when importing it!\n",i));
    11881276                    Int3(); /* ipe - later! */
    1189                     return 1;
     1277                    return ERROR_D32_VERIFY_FAILED;
    11901278                }
    11911279                break;
     
    12151303                    kprintf(("ImportTabInit: FATAL verify failed for procedure no.%d when importing it!\n",i));
    12161304                    Int3(); /* ipe - later! */
    1217                     return 1;
     1305                    return ERROR_D32_VERIFY_FAILED;
    12181306                }
    12191307                break;
     
    12421330                kprintf(("ImportTabInit: unsupported type. (procedure no.%d, cb=%d)\n", i, cb));
    12431331                Int3(); /* ipe - later! */
    1244                 return 1;
     1332                return ERROR_D32_VERIFY_FAILED;
    12451333        } /* switch - type */
    12461334    }   /* for */
     
    12501338#endif /* !DEBUGR3 */
    12511339
     1340
     1341#ifdef R3TST
     1342/**
     1343 * Creates a fake kernel MTE, SMTE and OTE for use while testing in Ring3.
     1344 * @returns Pointer to the fake kernel MTE.
     1345 * @status  completely implemented.
     1346 * @author  knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     1347 */
     1348PMTE GetOS2KrnlMTETst(void)
     1349{
     1350    static MTE    KrnlMTE;
     1351    static SMTE   KrnlSMTE;
     1352    static OTE    aKrnlOTE[17];
     1353
     1354    extern int  cObjectsFake; /* defined in win32ktst.c */
     1355
     1356    KrnlMTE.mte_swapmte = &KrnlSMTE;
     1357    KrnlSMTE.smte_objtab = &aKrnlOTE[0];
     1358    KrnlSMTE.smte_objcnt = cObjectsFake;
     1359
     1360    aKrnlOTE[0].ote_size     = 0x00000FB4;
     1361    aKrnlOTE[0].ote_base     = 0xffe10000;
     1362    aKrnlOTE[0].ote_flags    = 0x80001063;
     1363    aKrnlOTE[0].ote_pagemap  = 1;
     1364    aKrnlOTE[0].ote_mapsize  = 1;
     1365    aKrnlOTE[0].ote_sel      = 0;
     1366    aKrnlOTE[0].ote_hob      = 0;
     1367
     1368    aKrnlOTE[1].ote_size     = 0x0000A7CD;
     1369    aKrnlOTE[1].ote_base     = 0xffe20000;
     1370    aKrnlOTE[1].ote_flags    = 0x80001063;
     1371    aKrnlOTE[1].ote_pagemap  = 0x00000002;
     1372    aKrnlOTE[1].ote_mapsize  = 0x0000000B;
     1373    aKrnlOTE[1].ote_sel      = 0x0;
     1374    aKrnlOTE[1].ote_hob      = 0x0;
     1375
     1376    aKrnlOTE[2].ote_size     = 0x000084C9;
     1377    aKrnlOTE[2].ote_base     = 0xffe30000;
     1378    aKrnlOTE[2].ote_flags    = 0x80001045;
     1379    aKrnlOTE[2].ote_pagemap  = 0x0000000D;
     1380    aKrnlOTE[2].ote_mapsize  = 0x00000009;
     1381    aKrnlOTE[2].ote_sel      = 0x0;
     1382    aKrnlOTE[2].ote_hob      = 0x0;
     1383
     1384    aKrnlOTE[3].ote_size     = 0x00010000;
     1385    aKrnlOTE[3].ote_base     = 0xffe40000;
     1386    aKrnlOTE[3].ote_flags    = 0x800090A3;
     1387    aKrnlOTE[3].ote_pagemap  = 0x00000016;
     1388    aKrnlOTE[3].ote_mapsize  = 0x00000010;
     1389    aKrnlOTE[3].ote_sel      = 0x0;
     1390    aKrnlOTE[3].ote_hob      = 0x0;
     1391
     1392    aKrnlOTE[4].ote_size     = 0x00002A80;
     1393    aKrnlOTE[4].ote_base     = 0xffe50000;
     1394    aKrnlOTE[4].ote_flags    = 0x80009023;
     1395    aKrnlOTE[4].ote_pagemap  = 0x00000026;
     1396    aKrnlOTE[4].ote_mapsize  = 0x00000003;
     1397    aKrnlOTE[4].ote_sel      = 0x0;
     1398    aKrnlOTE[4].ote_hob      = 0x0;
     1399
     1400    aKrnlOTE[5].ote_size     = 0x00005734;
     1401    aKrnlOTE[5].ote_base     = 0xffe60000;
     1402    aKrnlOTE[5].ote_flags    = 0x80001023;
     1403    aKrnlOTE[5].ote_pagemap  = 0x00000029;
     1404    aKrnlOTE[5].ote_mapsize  = 0x00000003;
     1405    aKrnlOTE[5].ote_sel      = 0x0;
     1406    aKrnlOTE[5].ote_hob      = 0x0;
     1407
     1408    aKrnlOTE[6].ote_size     = 0x00002833;
     1409    aKrnlOTE[6].ote_base     = 0xffe70000;
     1410    aKrnlOTE[6].ote_flags    = 0x80001015;
     1411    aKrnlOTE[6].ote_pagemap  = 0x0000002C;
     1412    aKrnlOTE[6].ote_mapsize  = 0x00000003;
     1413    aKrnlOTE[6].ote_sel      = 0x0;
     1414    aKrnlOTE[6].ote_hob      = 0x0;
     1415
     1416    aKrnlOTE[7].ote_size     = 0x000001B0;
     1417    aKrnlOTE[7].ote_base     = 0xffe80000;
     1418    aKrnlOTE[7].ote_flags    = 0x80002213;
     1419    aKrnlOTE[7].ote_pagemap  = 0x0000002F;
     1420    aKrnlOTE[7].ote_mapsize  = 0x00000001;
     1421    aKrnlOTE[7].ote_sel      = 0x0;
     1422    aKrnlOTE[7].ote_hob      = 0x0;
     1423
     1424    aKrnlOTE[8].ote_size     = 0x000027CC;
     1425    aKrnlOTE[8].ote_base     = 0xffe90000;
     1426    aKrnlOTE[8].ote_flags    = 0x80002013;
     1427    aKrnlOTE[8].ote_pagemap  = 0x00000030;
     1428    aKrnlOTE[8].ote_mapsize  = 0x00000003;
     1429    aKrnlOTE[8].ote_sel      = 0x0;
     1430    aKrnlOTE[8].ote_hob      = 0x0;
     1431
     1432    aKrnlOTE[9].ote_size     = 0x0000FDA8;
     1433    aKrnlOTE[9].ote_base     = 0xffeA0000;
     1434    aKrnlOTE[9].ote_flags    = 0x80002033;
     1435    aKrnlOTE[9].ote_pagemap  = 0x00000033;
     1436    aKrnlOTE[9].ote_mapsize  = 0x0000000D;
     1437    aKrnlOTE[9].ote_sel      = 0x0;
     1438    aKrnlOTE[9].ote_hob      = 0x0;
     1439
     1440    aKrnlOTE[10].ote_size     = 0x0000ECD6;
     1441    aKrnlOTE[10].ote_base     = 0xffeB0000;
     1442    aKrnlOTE[10].ote_flags    = 0x80001015;
     1443    aKrnlOTE[10].ote_pagemap  = 0x00000040;
     1444    aKrnlOTE[10].ote_mapsize  = 0x0000000F;
     1445    aKrnlOTE[10].ote_sel      = 0x0;
     1446    aKrnlOTE[10].ote_hob      = 0x0;
     1447
     1448    aKrnlOTE[11].ote_size     = 0x0000EAF4;
     1449    aKrnlOTE[11].ote_base     = 0xffeC0000;
     1450    aKrnlOTE[11].ote_flags    = 0x80001015;
     1451    aKrnlOTE[11].ote_pagemap  = 0x0000004F;
     1452    aKrnlOTE[11].ote_mapsize  = 0x0000000F;
     1453    aKrnlOTE[11].ote_sel      = 0x0;
     1454    aKrnlOTE[11].ote_hob      = 0x0;
     1455
     1456    aKrnlOTE[12].ote_size     = 0x0000D900;
     1457    aKrnlOTE[12].ote_base     = 0xffeD0000;
     1458    aKrnlOTE[12].ote_flags    = 0x80001015;
     1459    aKrnlOTE[12].ote_pagemap  = 0x0000005E;
     1460    aKrnlOTE[12].ote_mapsize  = 0x0000000E;
     1461    aKrnlOTE[12].ote_sel      = 0x0;
     1462    aKrnlOTE[12].ote_hob      = 0x0;
     1463
     1464    aKrnlOTE[13].ote_size     = 0x0000D6DC;
     1465    aKrnlOTE[13].ote_base     = 0xffeE0000;
     1466    aKrnlOTE[13].ote_flags    = 0x80001015;
     1467    aKrnlOTE[13].ote_pagemap  = 0x0000006C;
     1468    aKrnlOTE[13].ote_mapsize  = 0x0000000E;
     1469    aKrnlOTE[13].ote_sel      = 0x0;
     1470    aKrnlOTE[13].ote_hob      = 0x0;
     1471
     1472    aKrnlOTE[14].ote_size     = 0x000B684B;
     1473    aKrnlOTE[14].ote_base     = 0xffeF0000;
     1474    aKrnlOTE[14].ote_flags    = 0x80002015;
     1475    aKrnlOTE[14].ote_pagemap  = 0x0000007A;
     1476    aKrnlOTE[14].ote_mapsize  = 0x000000B7;
     1477    aKrnlOTE[14].ote_sel      = 0x0;
     1478    aKrnlOTE[14].ote_hob      = 0x0;
     1479
     1480    aKrnlOTE[15].ote_size     = 0x000B684B;
     1481    aKrnlOTE[15].ote_base     = 0xffeF0000;
     1482    aKrnlOTE[15].ote_flags    = 0x80002015;
     1483    aKrnlOTE[15].ote_pagemap  = 0x0000007A;
     1484    aKrnlOTE[15].ote_mapsize  = 0x000000B7;
     1485    aKrnlOTE[15].ote_sel      = 0x0;
     1486    aKrnlOTE[15].ote_hob      = 0x0;
     1487
     1488    aKrnlOTE[16].ote_size     = 0x000B684B;
     1489    aKrnlOTE[16].ote_base     = 0xffeF0000;
     1490    aKrnlOTE[16].ote_flags    = 0x80002015;
     1491    aKrnlOTE[16].ote_pagemap  = 0x0000007A;
     1492    aKrnlOTE[16].ote_mapsize  = 0x000000B7;
     1493    aKrnlOTE[16].ote_sel      = 0x0;
     1494    aKrnlOTE[16].ote_hob      = 0x0;
     1495
     1496    return &KrnlMTE;
     1497}
     1498
     1499/**
     1500 * -Ring-3 testing-
     1501 * Changes the entries in _aImportTab to point to their fake equivalents.
     1502 * @returns void
     1503 * @param   void
     1504 * @status  completely implemented.
     1505 * @author  knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     1506 * @remark  Called before the _aImportTab array is used/verified.
     1507 */
     1508VOID R3TstFixImportTab(VOID)
     1509{
     1510    struct _TstFaker
     1511    {
     1512        unsigned   uAddress;
     1513        int        fObj;                   /* 1 = CODE32, 2 = CODE16, 3 = DATA32, 4 = DATA16 */
     1514    }
     1515    aTstFakers[NBR_OF_KRNLIMPORTS] =
     1516    {
     1517        {(unsigned)fakeldrRead,             1},
     1518        {(unsigned)fakeldrOpen,             1},
     1519        {(unsigned)fakeldrClose,            1},
     1520        {(unsigned)fakeLDRQAppType,         1},
     1521        {(unsigned)fakeldrEnum32bitRelRecs, 1},
     1522        {(unsigned)fakeIOSftOpen,           1},
     1523        {(unsigned)fakeIOSftClose,          1},
     1524        {(unsigned)fakeIOSftTransPath,      1},
     1525        {(unsigned)fakeIOSftReadAt,         1},
     1526        {(unsigned)fakeIOSftWriteAt,        1},
     1527        {(unsigned)fakeSftFileSize,         1},
     1528        {(unsigned)fakeVMAllocMem,          1},
     1529        {(unsigned)fakeVMGetOwner,          1},
     1530        {(unsigned)fakeg_tkExecPgm,         1},
     1531        {(unsigned)fakef_FuStrLenZ,         2},
     1532        {(unsigned)fakef_FuStrLen,          2},
     1533        {(unsigned)fakef_FuBuff,            2},
     1534        {(unsigned)fakeVMObjHandleInfo,     1},
     1535        {(unsigned)fakeldrOpenPath,         1},
     1536        {(unsigned)fakeLDRClearSem,         1},
     1537        {(unsigned)fakeKSEMRequestMutex,    1},
     1538        {(unsigned)&fakeLDRSem,             3},
     1539        {(unsigned)fakeTKSuBuff,            1},
     1540        {(unsigned)fakeTKFuBuff,            1},
     1541        {(unsigned)fakeTKFuBufLen,          1},
     1542        {(unsigned)fakeldrValidateMteHandle,1},
     1543        {(unsigned)&fakepTCBCur,            4},
     1544        {(unsigned)&fakepPTDACur,           4},
     1545        {(unsigned)&fakeptda_start,         4},
     1546        {(unsigned)&fakeptda_environ,       4}
     1547    };
     1548    int i;
     1549
     1550    for (i = 0; i < NBR_OF_KRNLIMPORTS; i++)
     1551    {
     1552        switch (_aImportTab[i].fType)
     1553        {
     1554            case EPT_PROC32:
     1555                if (aTstFakers[i].fObj != 1)
     1556                    kprintf(("R3TstFixImportTab: invalid segment config for entry %i. (PROC32)\n", i));
     1557                break;
     1558            case EPT_PROCIMPORT32:
     1559                if (aTstFakers[i].fObj != 1)
     1560                    kprintf(("R3TstFixImportTab: invalid segment config for entry %i. (PROCIMPORT32)\n", i));
     1561                break;
     1562            case EPT_PROCIMPORT16:
     1563                if (aTstFakers[i].fObj != 2)
     1564                    kprintf(("R3TstFixImportTab: invalid segment config for entry %i. (PROCIMPORT16)\n", i));
     1565                break;
     1566            case EPT_VARIMPORT32:
     1567            case EPT_VARIMPORT16:
     1568                if (aTstFakers[i].fObj != 3 && aTstFakers[i].fObj != 4)
     1569                    kprintf(("R3TstFixImportTab: invalid segment config for entry %i. (VARIMPORT32/16)\n", i));
     1570                break;
     1571        } /* switch - type */
     1572
     1573        _aImportTab[i].ulAddress = aTstFakers[i].uAddress;
     1574        switch (aTstFakers[i].fObj)
     1575        {
     1576            case 1:
     1577                _aImportTab[i].usSel = GetSelectorCODE32();
     1578                _aImportTab[i].offObject = aTstFakers[i].uAddress - (unsigned)&CODE32START;
     1579                break;
     1580            case 2:
     1581                _aImportTab[i].usSel = GetSelectorCODE16();
     1582                _aImportTab[i].offObject = aTstFakers[i].uAddress - (unsigned)&CODE16START;
     1583                break;
     1584            case 3:
     1585                _aImportTab[i].usSel = GetSelectorDATA32();
     1586                _aImportTab[i].offObject = aTstFakers[i].uAddress - (unsigned)&DATA32START;
     1587                break;
     1588            case 4:
     1589                _aImportTab[i].usSel = GetSelectorDATA16();
     1590                _aImportTab[i].offObject = aTstFakers[i].uAddress - (unsigned)&DATA16START;
     1591                break;
     1592            default:
     1593                kprintf(("R3TstFixImportTab: invalid segment config for entry %i.\n", i));
     1594        }
     1595    } /* for */
     1596}
     1597#endif
    12521598
    12531599
     
    13671713        0xEC, 0x83, 0xEC, 0x0C, 0x53, 0x57, 0x8D, 0x55,
    13681714        0xF8
     1715    };
     1716    char achf_ldrOpenPath[] = {
     1717        0x55, 0xA1, 0xA4, 0x0A, 0x00, 0x00, 0x8B, 0xEC,
     1718        0x83, 0xEC, 0x28, 0x66, 0x8B, 0x80, 0xFE, 0x01,
     1719        0x00, 0x00, 0x53, 0x57, 0x66, 0x89, 0x45, 0xE2
    13691720    };
    13701721
     
    13901741        achf_FuBuff            ,
    13911742        achf_VMObjHandleInfo   ,
     1743        achf_ldrOpenPath       ,
    13921744        NULL
    13931745    };
  • branches/GRACE/src/win32k/include/LdrCalls.h

    r2501 r3834  
    1 /* $Id: LdrCalls.h,v 1.3 2000-01-22 18:21:00 bird Exp $
     1/* $Id: LdrCalls.h,v 1.3.4.1 2000-07-16 22:43:30 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/**
     169 * LDRClearSem - Clears the loader semaphore.
     170 * (It does some garbage collection on release.)
     171 * @returns   NO_ERROR on sucess.
     172 *            OS/2 error on failure. (ERROR_INTERRUPT?)
     173 */
     174extern ULONG LDRCALL LDRClearSem(void);
     175
     176
     177/**
     178 * LDRGetSem - Requests the loader semaphore..
     179 * @returns   NO_ERROR if succesfully.
     180 *            OS2 errorcode on failure. (ERROR_INTERRUPT?)
     181 */
     182#define LDRGetSem()   KSEMRequestMutex(*pLdrSem, (ULONG)-1)
     183
     184
     185/*
     186 * Pointer to the loader semaphore.
     187 */
     188#ifdef _OS2KSEM_h_
     189extern HKMTX *  pLdrSem;
     190#endif
     191
     192
     193/**
     194 * Validates an hMTE and gets the MTE pointer.
     195 * @returns   Pointer to MTE on success.
     196 *            NULL on error.
     197 * @param     hMTE  MTE handle.
     198 * @remark    If you wan't to this faster:
     199 *              Use the hMTE as a HOB and get the HOB address (by using VMGetHandleInfo).
     200 */
     201extern PMTE LDRCALL ldrValidateMteHandle(HMTE hMTE);
     202
     203
    169204
    170205#ifdef __cplusplus
  • branches/GRACE/src/win32k/include/OS2KVM.h

    r3411 r3834  
    1 /* $Id: OS2KVM.h,v 1.4 2000-04-17 01:56:49 bird Exp $
     1/* $Id: OS2KVM.h,v 1.4.4.1 2000-07-16 22:43:27 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                                                         *
  • branches/GRACE/src/win32k/include/env.h

    r3412 r3834  
    1 /* $Id: env.h,v 1.2 2000-04-17 02:26:04 bird Exp $
     1/* $Id: env.h,v 1.2.4.1 2000-07-16 22:43:29 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
  • branches/GRACE/src/win32k/include/ldr.h

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

    r2828 r3834  
    1 /* $Id: myExecPgm.h,v 1.1 2000-02-19 08:41:10 bird Exp $
     1/* $Id: myExecPgm.h,v 1.1.4.1 2000-07-16 22:43:31 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
  • branches/GRACE/src/win32k/include/options.h

    r2898 r3834  
    1 /* $Id: options.h,v 1.10 2000-02-25 18:15:06 bird Exp $
     1/* $Id: options.h,v 1.10.4.1 2000-07-16 22:43:32 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 */
     
    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. */
  • branches/GRACE/src/win32k/include/pe2lx.h

    r2925 r3834  
    1 /* $Id: pe2lx.h,v 1.9 2000-02-27 02:16:43 bird Exp $
     1/* $Id: pe2lx.h,v 1.9.4.1 2000-07-16 22:43:32 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 pachModname, USHORT cchModname, ldrlv_t *pLdrLv, PULONG pfl); /* (ldrOpenPath) */
    6869    #ifndef RING0
    6970    ULONG  testApplyFixups();
    7071    ULONG  writeFile(PCSZ pszLXFilename);
    7172    #endif
     73
     74    /** @cat public query methods */
     75    BOOL    isExe();
     76    BOOL    isDll();
    7277
    7378    /** @cat public Helper methods */
     
    120125    /** @cat static helpers */
    121126    static PCSZ queryOdin32ModuleName(PCSZ pszWin32ModuleName);
     127    static BOOL initOdin32Path();
    122128
    123129    /** @cat static dump methods */
     
    195201        ULONG flFlags;                      /* equivalent object flags */
    196202    } paSecChars2Flags[];
     203
     204    static const char *     pszOdin32Path;  /* Odin32 base path. */
    197205};
    198206
  • branches/GRACE/src/win32k/include/probkrnl.h

    r3411 r3834  
    1 /* $Id: probkrnl.h,v 1.13 2000-04-17 01:56:49 bird Exp $
     1/* $Id: probkrnl.h,v 1.13.4.1 2000-07-16 22:43:33 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      30      /* When this is changed make sure to   */
    1919                                        /* update the arrays in d32init.c and  */
    2020                                        /* probkrnl.c */
     
    2525#define EPT_PROCIMPORT          0x01    /* procedure 32bit - import only */
    2626#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 */
     27#define EPT_32BIT               0x00    /* 32 bit entry-point  */
     28#define EPT_16BIT               0x80    /* 16 bit entry-point */
    2929#define EPT_BIT_MASK            0x80    /* Mask bit entry-point */
    3030#define EPT16BitEntry(a)    (((a).fType & EPT_BIT_MASK) == EPT_16BIT)
     
    4141#define EPT_VARIMPORT16         (EPT_VARIMPORT | EPT_16BIT)
    4242
    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. */
     43
     44/* Kernel type: SMP/UNI/W4 (flags matches KF_* in options.h)  */
     45#if 0
     46#define TYPE_UNI                0x00     /* Any UNI processor kernel except Warp 4 fp13 and above. */
     47#define TYPE_SMP                0x01     /* SMP Warp3 Adv. or Warp 4.5 SMP */
     48#define TYPE_W4                 0x02     /* Warp4 fp13 and above. */
     49#endif
     50
     51/*
     52 * Probkrnl error codes. (They all begin with ERROR_PROB_.)
     53 *
     54 * NOTE! ERROR_PROB_KRNL_*  <  ERROR_PROB_SYM_*  <  ERROR_PROB_SYMDB_*
     55 */
     56#define ERROR_PROB_BASE                             10000
     57#define ERROR_PROB_KRNL_FIRST                       ERROR_PROB_KRNL_OPEN_FAILED
     58#define ERROR_PROB_KRNL_LAST                        ERROR_PROB_KRNL_OTE_READ
     59#define ERROR_PROB_KRNL_OPEN_FAILED                 (ERROR_PROB_BASE + 0)
     60#define ERROR_PROB_KRNL_SEEK_SIZE                   (ERROR_PROB_BASE + 2)
     61#define ERROR_PROB_KRNL_SEEK_FIRST                  (ERROR_PROB_BASE + 3)
     62#define ERROR_PROB_KRNL_READ_FIRST                  (ERROR_PROB_BASE + 4)
     63#define ERROR_PROB_KRNL_READ_NEXT                   (ERROR_PROB_BASE + 5)
     64#define ERROR_PROB_KRNL_TAG_NOT_FOUND               (ERROR_PROB_BASE + 6)
     65#define ERROR_PROB_KRNL_INV_SIGANTURE               (ERROR_PROB_BASE + 7)
     66#define ERROR_PROB_KRNL_INV_BUILD_NBR               (ERROR_PROB_BASE + 8)
     67#define ERROR_PROB_KRNL_BUILD_VERSION               (ERROR_PROB_BASE + 9)
     68#define ERROR_PROB_KRNL_MZ_SEEK                     (ERROR_PROB_BASE + 10)
     69#define ERROR_PROB_KRNL_MZ_READ                     (ERROR_PROB_BASE + 11)
     70#define ERROR_PROB_KRNL_NEOFF_INVALID               (ERROR_PROB_BASE + 12)
     71#define ERROR_PROB_KRNL_NEOFF_SEEK                  (ERROR_PROB_BASE + 13)
     72#define ERROR_PROB_KRNL_LX_READ                     (ERROR_PROB_BASE + 14)
     73#define ERROR_PROB_KRNL_LX_SIGNATURE                (ERROR_PROB_BASE + 15)
     74#define ERROR_PROB_KRNL_OBJECT_CNT                  (ERROR_PROB_BASE + 16)
     75#define ERROR_PROB_KRNL_OBJECT_CNR_10               (ERROR_PROB_BASE + 17)
     76#define ERROR_PROB_KRNL_OTE_SEEK                    (ERROR_PROB_BASE + 18)
     77#define ERROR_PROB_KRNL_OTE_READ                    (ERROR_PROB_BASE + 19)
     78#define ERROR_PROB_KRNL_OTE_SIZE_MIS                (ERROR_PROB_BASE + 20)
     79
     80#define ERROR_PROB_SYM_FIRST                        ERROR_PROB_SYM_FILE_NOT_FOUND
     81#define ERROR_PROB_SYM_LAST                         ERROR_PROB_SYM_IMPORTS_NOTFOUND
     82#define ERROR_PROB_SYM_FILE_NOT_FOUND               (ERROR_PROB_BASE + 30)
     83#define ERROR_PROB_SYM_READERROR                    (ERROR_PROB_BASE + 31)
     84#define ERROR_PROB_SYM_INVALID_MOD_NAME             (ERROR_PROB_BASE + 32)
     85#define ERROR_PROB_SYM_SEGS_NE_OBJS                 (ERROR_PROB_BASE + 33)
     86#define ERROR_PROB_SYM_SEG_DEF_SEEK                 (ERROR_PROB_BASE + 34)
     87#define ERROR_PROB_SYM_SEG_DEF_READ                 (ERROR_PROB_BASE + 35)
     88/* - reserved for future errors - *
     89#define ERROR_PROB_SYM_                             (ERROR_PROB_BASE + 36)
     90#define ERROR_PROB_SYM_                             (ERROR_PROB_BASE + 37)
     91#define ERROR_PROB_SYM_                             (ERROR_PROB_BASE + 38) */
     92#define ERROR_PROB_SYM_IMPORTS_NOTFOUND             (ERROR_PROB_BASE + 39)
     93
     94#define ERROR_PROB_SYMDB_KRNL_NOT_FOUND             (ERROR_PROB_BASE + 40)
     95
    4796
    4897
     
    73122{
    74123    unsigned short usBuild;             /* Build number */
    75     unsigned char  fchBldType;          /* R, H, A */
    76     unsigned char  fchType;             /* TYPE_SMP, TYPE_UNI, TYPE_W4 */
     124    unsigned short fKernel;             /* Kernel flag (KF_* defines in options.h). */
    77125    unsigned char  cObjects;            /* Count of objects */
    78126    struct
     
    92140*******************************************************************************/
    93141extern 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) */
    99 
     142extern KRNLDBENTRY   aKrnlSymDB[];      /* defined in symdb.c (for 16-bit usage) */
     143extern KRNLDBENTRY   _aKrnlSymDB[];     /* defined in symdb.c (for 32-bit usage) */
    100144
    101145#if defined(INCL_16) && defined(MAX_DISKDD_CMD) /* 16-bit only */
  • branches/GRACE/src/win32k/ldr/ModuleBase.cpp

    r2926 r3834  
    1 /* $Id: ModuleBase.cpp,v 1.3 2000-02-27 02:17:06 bird Exp $
     1/* $Id: ModuleBase.cpp,v 1.3.4.1 2000-07-16 22:43:33 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 "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 "ldrCalls.h"                   /* ldrOpenPath and ldrlv_t. */
     36#include "modulebase.h"                 /* ModuleBase class definitions, ++. */
    3637
    3738
     
    159160}
    160161
     162
     163/**
     164 * openPath - opens file eventually searching loader specific paths.
     165 *
     166 * This base implementation simply calls ldrOpenPath.
     167 * This method is only called for DLLs. DosLoadModule and Imports.
     168 *
     169 * @returns   OS2 return code.
     170 *            pLdrLv->lv_sfn  is set to filename handle.
     171 * @param     pachModname   Pointer to modulename. Not zero terminated!
     172 * @param     cchModname    Modulename length.
     173 * @param     pLdrLv        Loader local variables? (Struct from KERNEL.SDF)
     174 * @param     pfl           Pointer to flags which are passed on to ldrOpen.
     175 * @sketch
     176 * This is roughly what the original ldrOpenPath does:
     177 *      if !CLASS_GLOBAL or miniifs then
     178 *          ldrOpen(pachModName)
     179 *      else
     180 *          loop until no more libpath elements
     181 *              get next libpath element and add it to the modname.
     182 *              try open the modname
     183 *              if successfull then break the loop.
     184 *          endloop
     185 *      endif
     186 */
     187ULONG  ModuleBase::openPath(PCHAR pachModname, USHORT cchModname, ldrlv_t *pLdrLv, PULONG pfl) /* (ldrOpenPath) */
     188{
     189    #ifdef RING0
     190    printf("ModuleBase::openPath:\n");
     191    return ldrOpenPath(pachModname, cchModname, pLdrLv, pfl);
     192    #else
     193    NOREF(pachModname);
     194    NOREF(cchModname);
     195    NOREF(pLdrLv);
     196    NOREF(pfl);
     197    return ERROR_NOT_SUPPORTED;
     198    #endif
     199}
    161200
    162201
     
    273312        rc = DosRead(hFile, pvBuffer, cbToRead, &cbRead);
    274313    else
    275         printErr(("DosSetFilePtr(hfile, %#8x(%d),..) failed with rc = %d.",
     314        printErr(("DosSetFilePtr(hfile, %#8x(%d),..) failed with rc = %d.\n",
    276315                  ulOffset, ulOffset, rc));
    277316
  • branches/GRACE/src/win32k/ldr/ldr.cpp

    r2501 r3834  
    1 /* $Id: ldr.cpp,v 1.7 2000-01-22 18:21:01 bird Exp $
     1/* $Id: ldr.cpp,v 1.7.4.1 2000-07-16 22:43:34 bird Exp $
    22 *
    33 * ldr.cpp - Loader helpers.
     
    2828
    2929#include "log.h"
     30#include "avl.h"
    3031#include <peexe.h>
    3132#include <exe386.h>
    3233#include "OS2Krnl.h"
     34#include "ldr.h"
     35#include "ldrCalls.h"
    3336#include "ModuleBase.h"
    3437#include "pe2lx.h"
    35 #include "avl.h"
    36 #include "ldr.h"
    3738#include "options.h"
    3839
     
    4142*   Global Variables                                                           *
    4243*******************************************************************************/
    43 PAVLNODECORE    pSFNRoot = NULL;
    44 PAVLNODECORE    pMTERoot = NULL;
    45 
     44static PAVLNODECORE    pSFNRoot = NULL;
     45static PAVLNODECORE    pMTERoot = NULL;
     46
     47
     48/*
     49 * Loader State. (See ldr.h for more info.)
     50 */
     51ULONG          ulLdrState = LDRSTATE_UNKNOWN;
     52
     53
     54/*
     55 * Pointer to the executable module being loaded.
     56 * This pointer is set by ldrOpen and cleared by tkExecPgm.
     57 * It's hence only valid at tkExecPgm time. (isLdrStateExecPgm() == TRUE).
     58 */
     59PMODULE         pExeModule = NULL;
     60
     61
     62/*
     63 * Filehandle bitmap.
     64 */
    4665unsigned char   achHandleStates[MAX_FILE_HANDLES/8];
     66
     67
    4768
    4869
     
    6485 * Gets a module by the MTE.
    6586 * @returns   Pointer to module node. If not found NULL.
    66  * @param     pMTE  Pointer an Module Table Entry.
     87 * @param     pMTE  Pointer a Module Table Entry.
    6788 * @sketch    Try find it in the MTE tree.
    6889 *            IF not found THEN
     
    124145
    125146/**
     147 * Gets a module by the hMTE.
     148 * @returns   Pointer to module node. If not found NULL.
     149 * @param     hMTE  Handle to a Module Table Entry.
     150 * @sketch    Convert hMte to an pMTE (pointer to MTE).
     151 *            Call getModuleByMTE with MTE pointer.
     152 * @status    completely implemented.
     153 * @author    knut st. osmundsen
     154 */
     155PMODULE     getModuleByhMTE(HMTE hMTE)
     156{
     157    PMTE pMTE;
     158
     159    pMTE = ldrValidateMteHandle(hMTE);
     160    if (pMTE != NULL)
     161        return getModuleByMTE(pMTE);
     162
     163    return NULL;
     164}
     165
     166
     167/**
    126168 * Get a module by filename.
    127169 * @returns   Pointer to module node. If not found NULL.
  • branches/GRACE/src/win32k/ldr/myldrEnum32bitRelRecs.cpp

    r2537 r3834  
    1 /* $Id: myldrEnum32bitRelRecs.cpp,v 1.2 2000-01-27 23:43:07 bird Exp $
     1/* $Id: myldrEnum32bitRelRecs.cpp,v 1.2.4.1 2000-07-16 22:43:36 bird Exp $
    22 *
    33 * myldrEnum32bitRelRecs - ldrEnum32bitRelRecs
     
    2424#include <stdlib.h>
    2525
     26#include "avl.h"
    2627#include "log.h"
    2728#include <peexe.h>
    2829#include <exe386.h>
    2930#include "OS2Krnl.h"
    30 #include "avl.h"
    31 #include "ModuleBase.h"
    3231#include "ldr.h"
    3332#include "ldrCalls.h"
     33#include "ModuleBase.h"
    3434
    3535
     
    6363        APIRET rc;
    6464        #if 1
    65         kprintf(("ldrEnum32BitRelRecs: pMTE=0x%08x iObject=0x%02x iPageTable=0x%03x pvPage=0x%08x\n"
     65        kprintf(("myldrEnum32BitRelRecs: pMTE=0x%08x iObject=0x%02x iPageTable=0x%03x pvPage=0x%08x\n"
    6666                 "                     ulPageAddress=0x%08x pvPTDA=0x%08x\n",
    6767                 pMTE, iObject, iPageTable, pvPage, ulPageAddress, pvPTDA
  • branches/GRACE/src/win32k/ldr/myldrOpen.cpp

    r2838 r3834  
    1 /* $Id: myldrOpen.cpp,v 1.10 2000-02-21 09:24:01 bird Exp $
     1/* $Id: myldrOpen.cpp,v 1.10.4.1 2000-07-16 22:43:36 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
    1920
    2021/*******************************************************************************
     
    3031
    3132#include "log.h"
     33#include "avl.h"
     34#include "options.h"
    3235#include <peexe.h>
    3336#include <exe386.h>
     37#include "elf.h"
    3438#include "OS2Krnl.h"
    3539#include "dev32.h"
     40#include "ldr.h"
     41#include "ldrCalls.h"
    3642#include "ModuleBase.h"
    3743#include "pe2lx.h"
    38 #include "elf.h"
    39 #include "avl.h"
    40 #include "ldr.h"
    41 #include "ldrCalls.h"
    42 #include "options.h"
    4344#include "myExecPgm.h"
    44 
    45 /*******************************************************************************
    46 *   Global Variables                                                           *
    47 *******************************************************************************/
    48 extern BOOL fQAppType;                  /* From LDRQAppType */
     45#include "env.h"
     46#include "vprintf.h"                    /* Make 100% sure we have va_start.  */
     47
     48
    4949
    5050/*******************************************************************************
    5151*   Internal Functions                                                         *
    5252*******************************************************************************/
    53 static unsigned getArgsLength(const char *pachArgs);
     53/* static */ APIRET     AddArgsToFront(int cArgs,  ...);
     54/* static */ APIRET     SetExecName(const char *pszExeName);
     55/* static */ APIRET     OpenPATH(PSFN phFile, char *pszFilename, PULONG pfl);
    5456
    5557
     
    5961 * @param     phFile       Pointer to file handler. Holds filehandle on output.
    6062 * @param     pszFilename  Pointer to filename.
    61  * @parma     param3       Probably some flags.
     63 * @parma     pfl          Pointer to some flags.
    6264 */
    63 ULONG LDRCALL myldrOpen(PSFN phFile, char *pszFilename, ULONG param3)
     65ULONG LDRCALL myldrOpen(PSFN phFile, PSZ pszFilename, PULONG pfl)
    6466{
    65     ULONG rc;
    66 
    67     /*
     67    static  int cNesting = 0;           /* This is an variable which hold the nesting */
     68                                        /* level of this function. This is useful     */
     69                                        /* when we call it recurcively.               */
     70                                        /* The maximum nesting level is currently 3.  */
     71                                        /* When the maximum depth has been reached    */
     72                                        /* we'll not intercept loading any longer!    */
     73    ULONG rc;                           /* Return value. */
     74
     75    /** @sketch
    6876     * Try open the file (thats why this function is called anyway)
    6977     */
    70     rc = ldrOpen(phFile, pszFilename, param3);
    71 
    72     /* log sucesses */
     78    rc = ldrOpen(phFile, pszFilename, pfl);
    7379    if (rc == NO_ERROR)
    74         kprintf(("ldrOpen:  phFile=%#.4x, flags=%#.8x, pszFn=%s\n", *phFile, param3, pszFilename));
    75 
    76     /*
     80        kprintf(("myldrOpen-%d:  phFile=%#.4x, flags=%#.8x, pszFn=%s\n", cNesting, *phFile, pfl, pszFilename));
     81
     82
     83    /** @sketch
    7784     * Are we to intercept the loading?
    78      * - Only if open were succesful and one of the loaders are enabled.
     85     * - If open were successful.
     86     * - And Not too deep nesting.
     87     * - And that this isn't an unsupported load.
     88     * - And one of the loaders are enabled.
    7989     */
    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)
     90    if (rc == NO_ERROR
     91        && cNesting < 3
     92        && !isLdrStateLoadingUnsupported()
     93        && isAnyLoaderEnabled()
     94        )
     95    {
     96        union _u_ReadBufferPointers         /* Read buffer pointer(s). */
    9697        {
    97             kprintf(("ldrOpen: rmalloc(1024) failed\n"));
     98            char               *pach;       /* Pointer to the buffer as char. */
     99            PIMAGE_DOS_HEADER   pMzHdr;     /* Use the buffer as a dosheader. */
     100            PIMAGE_NT_HEADERS   pNtHdrs;    /* Use the buffer as a NT header. */
     101        } u1;
     102        unsigned            cbFile;         /* Filesize (0xffffffff if call to SftFileSize failed - should _never_ happen though) */
     103        unsigned            cbRead;         /* Amount of the buffer which contains valid data. */
     104        char *              psz;            /* Multipurpose string pointer no.1. */
     105        char *              psz2;           /* Multipurpose string pointer no.2. */
     106        char *              psz3;           /* Multipurpose string pointer no.3. */
     107
     108        /** @sketch
     109         * Allocate read buffer from resident heap.
     110         * IF this fails THEN we'll simply return NO_ERROR.
     111         */
     112        u1.pach = (char*)rmalloc(640);
     113        if (u1.pach == NULL)
     114        {
     115            kprintf(("myldrOpen-%d: rmalloc(640) failed\n", cNesting));
    98116            return NO_ERROR;
    99117        }
    100118
    101         /*
    102          * Try get the filesize
     119
     120        /** @sketch
     121         * Increment nesting level.
     122         */
     123        cNesting++;
     124
     125
     126        /** @sketch
     127         * Get the filesize. On failure filesize is set to ~0.
    103128         */
    104129        rc = SftFileSize(*phFile, (PULONG)SSToDS(&cbFile));
    105130        if (rc != NO_ERROR)
    106131        {
    107             kprintf(("ldrOpen: SftFileSize failed with rc=%d\n", rc));
     132            kprintf(("myldrOpen-%d: SftFileSize failed with rc=%d\n", cNesting, rc));
    108133            cbFile = (unsigned)~0;
    109134        }
    110135
    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)
     136
     137        /** @sketch
     138         *  Read the size of a DOS (ie. MZ) header.
     139         *  IF successful and more stuff in file THEN
     140         *      See if this is an recognizable module binary format:
     141         */
     142        cbRead = min(sizeof(IMAGE_DOS_HEADER), cbFile);
     143        rc = ldrRead(*phFile, 0UL, u1.pMzHdr, 0UL, cbRead, NULL);
     144        if (rc == NO_ERROR && cbRead < cbFile)
    117145        {
    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.
     146            /** @sketch
     147             * If LX header just give up at once.
    122148             */
    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
     149            if (u1.pMzHdr->e_magic == E32MAGIC)
     150                goto cleanup;
     151
     152            /** @sketch
     153             * IF PE or MZ header THEN
     154             */
     155            if (u1.pMzHdr->e_magic == IMAGE_DOS_SIGNATURE
     156                || u1.pNtHdrs->Signature == IMAGE_NT_SIGNATURE)
     157            {
     158                ULONG   offPe;          /* Offset to PE header. */
     159
     160                /** @sketch
     161                 * ---
     162                 * We now known that this is file has a MZ or a PE header. If it's
     163                 * a MZ header, we might end up with no "New" header or the "New"
     164                 * header might turn out to be a NE, LE, or LX header. I any of
     165                 * these non PE headers occur OS/2 will take care of it, we'll do nothing.
     166                 * ---
     167                 * IF PE loading is disable or MZ header and e_lfanew is invalid THEN
     168                 *     return (successfully) to the caller.
     169                 * ENDIF
     170                 * (Find the offset of the PE header while testing (offPe).)
    128171                 */
    129 
    130                 /* if PE loading is diable return to the caller */
    131                 if (options.fPE == FLAGS_PE_NOT)
     172                if (isPELoaderDisabled())
     173                    goto cleanup;
     174                if (u1.pMzHdr->e_magic == IMAGE_DOS_SIGNATURE)
    132175                {
    133                     rfree(pszBuffer);
    134                     return NO_ERROR;
     176                    offPe = u1.pMzHdr->e_lfanew;
     177                    if (offPe < sizeof(IMAGE_DOS_HEADER) || offPe > 0x04000000UL)
     178                        goto cleanup;
    135179                }
    136 
    137                 /*
    138                  * Read the PE header if it isn't what we allready have!
     180                else
     181                    offPe = 0;
     182
     183
     184                /** @sketch
     185                 * Read the PE header.
     186                 * If the read failes or not PE signature, there isn't anything for us to do.
    139187                 */
    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)
     188                rc = ldrRead(*phFile, offPe, u1.pach, 0UL, sizeof(IMAGE_NT_HEADERS), NULL);
     189                if (rc != NO_ERROR || u1.pNtHdrs->Signature != IMAGE_NT_SIGNATURE)
     190                    goto cleanup_noerror;
     191
     192
     193                /** @sketch
     194                 * PE signature found!
    149195                 */
    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                                  )
     196                kprintf(("myldrOpen-%d: PE executable...\n", cNesting));
     197
     198
     199                /** @sketch
     200                 * Use Pe2Lx?
     201                 *  - When Pe2Lx flag is set
     202                 *  - When the MIXED flag is set and the image isn't an executable
     203                 *    above the first 64MB private limit without relocations
     204                 */
     205                if (isPe2LxLoaderEnabled()
     206                    || (isMixedPeLoaderEnabled()
     207                        && ((u1.pNtHdrs->FileHeader.Characteristics & IMAGE_FILE_DLL)
     208                            || !(u1.pNtHdrs->FileHeader.Characteristics & IMAGE_FILE_RELOCS_STRIPPED)
     209                            || u1.pNtHdrs->OptionalHeader.ImageBase < 0x04000000UL /* 64MB */
    166210                            )
    167211                        )
    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)
     212                    )
     213                {   /** @sketch
     214                     *  Pe2Lx (Ring0 of course)
     215                     *      - Create a Pe2Lx class,
     216                     *      - initiate it
     217                     *      - Add the module to the module tree so we may find it later...
     218                     *      - Set the (file)handle state to 'our'.
     219                     *      - Set pExeModule to module pointer and loaderstate to our exe.
     220                     */
     221                    Pe2Lx * pPe2Lx = new Pe2Lx(*phFile);
     222                    if (pPe2Lx != NULL)
     223                    {
     224                        rc = pPe2Lx->init(pszFilename);
     225                        if (rc == NO_ERROR)
    177226                        {
    178                             rc = pPe2Lx->init(pszFilename);
     227                            kprintf(("myldrOpen-%d: Successfully init of Pe2Lx object.\n", cNesting));
     228                            rc = addModule(*phFile, NULL, MOD_TYPE_PE2LX, pPe2Lx);
    179229                            if (rc == NO_ERROR)
    180230                            {
    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"));
     231                                #pragma info(notrd)
     232                                SetState(*phFile, HSTATE_OUR);
     233                                #pragma info(restore)
     234                                if (pPe2Lx->isExe())
     235                                {
     236                                    setLdrStateLoadingOurEXE();
     237                                    pExeModule = getModuleBySFN(*phFile);
     238                                    #ifdef DEBUG
     239                                    if (pExeModule == NULL)
     240                                        kprintf(("myldrOpen-%d: getModuleBySFN failed when setting pExeModule! FATAL!\n", cNesting));
     241                                    #endif
     242                                }
    189243                            }
    190244                            else
    191                                 kprintf(("ldrOpen: Failed to init Pe2Lx object. rc=%d\n"));
    192                             if (rc != NO_ERROR)
    193                                 delete pPe2Lx;
     245                                kprintf(("myldrOpen-%d: Failed to add the module. rc=%d\n", cNesting));
    194246                        }
    195247                        else
    196                             kprintf(("ldrOpen: Failed to allocate Pe2Lx object.\n"));
     248                            kprintf(("myldrOpen-%d: Failed to init Pe2Lx object. rc=%d\n", cNesting));
     249                        if (rc != NO_ERROR)
     250                            delete pPe2Lx;
    197251                    }
    198252                    else
     253                        kprintf(("myldrOpen-%d: Failed to allocate Pe2Lx object.\n", cNesting));
     254
     255                     goto cleanup;
     256                }
     257
     258
     259                /** @sketch
     260                 *  Using PE.EXE to start EXE?
     261                 *      - When the file is an EXE file and PE.EXE is enabled.
     262                 */
     263                if ((u1.pNtHdrs->FileHeader.Characteristics & IMAGE_FILE_DLL == 0UL)
     264                    && (options.fPE == FLAGS_PE_PE || options.fPE == FLAGS_PE_MIXED)
     265                    && (isLdrStateExecPgm() || isLdrStateQAppType())
     266                    )
     267                {
     268                    /** @sketch
     269                     * PE.EXE:
     270                     * Find pe.exe - look in current directory and thru the PATH.
     271                     * Note! We use the read buffer (u1.p*) as a storage for the
     272                     * pe.exe filename and path.
     273                     */
     274                    kprintf(("myldrOpen-%d: pe.exe - opening\n", cNesting));
     275                    ldrClose(*phFile);
     276                    strcpy(u1.pach, "PE.EXE");
     277                    rc = ldrOpen(phFile, u1.pach, pfl); /* This isn't recusive! */
     278                    if (rc != NO_ERROR)
     279                        rc = OpenPATH(phFile, u1.pach, pfl);
     280                    if (rc == NO_ERROR)
    199281                    {
    200                         /*
    201                          * Starting of PE.EXE enable?
     282                        /** @sketch
     283                         * If we're in tkExecPgm state we'll have to shuffle the parameters
     284                         * and executable filename tkExecPgm were called with.
     285                         * If not tkExecPgm we can't do anything about parameters (and there is
     286                         * probably nothing to do either).
    202287                         */
    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;
     288                        kprintf(("myldrOpen-%d: pe.exe - %s\n", cNesting, u1.pach));
     289                        if (isLdrStateExecPgm() && fTkExecPgm)
     290                        {
     291                            rc = AddArgsToFront(1, achTkExecPgmFilename);
     292                            if (rc == NO_ERROR)
     293                            {
     294                                rc = SetExecName(u1.pach);
     295                                if (rc != NO_ERROR)
     296                                    kprintf(("myldrOpen-%d: pe.exe - failed to set pe.exe as execname. rc=%d\n", cNesting));
     297                            }
     298                            else
     299                                kprintf(("myldrOpen-%d: pe.exe - failed to add programname as argument. rc=%d\n", cNesting, rc));
     300                            goto cleanup_noerror;
    213301                        }
    214302                    }
     303                    else
     304                        kprintf(("myldrOpen-%d: pe.exe - couldn't find/open pe.exe\n", cNesting));
    215305                }
    216                 rfree(pszBuffer);
    217                 return NO_ERROR;
     306                goto cleanup;
     307            }
     308            /** @sketch End of PE Loading. */
     309
     310
     311            /** @sketch
     312             * ELF image?
     313             */
     314            if (u1.pach[0] == ELFMAG0 && u1.pach[1] == ELFMAG1 && u1.pach[2] == ELFMAG2 && u1.pach[3] == ELFMAG3)
     315            {
     316                if (isELFDisabled())
     317                    goto cleanup_noerror;
     318
     319                /*
     320                 * ELF signature found.
     321                 */
     322                kprintf(("myldrOpen-%d: ELF image! - not implemented yet!\n", cNesting));
     323
     324                /*
     325                 * Do nothing more yet. NEED AN ELF LOADER!!!
     326                 */
     327                goto cleanup;
     328            }
     329
     330
     331            /** @sketch
     332             * Java image?
     333             */
     334            if (u1.pach[0] == 0xCA && u1.pach[1] == 0xFE && u1.pach[2] == 0xBA && u1.pach[3] == 0xBE)
     335            {
     336                if (isJAVADisabled())
     337                    goto cleanup_noerror;
     338
     339                /** @sketch
     340                 * Java signature found.
     341                 * Try find the java executor in current dir or PATH: java.exe
     342                 */
     343                kprintf(("myldrOpen-%d: Jave image!\n", cNesting));
     344                #if 1
     345                ldrClose(*phFile);
     346                strcpy(u1.pach, "JAVA.EXE");
     347                rc = ldrOpen(phFile, u1.pach, pfl);
     348                if (rc != NO_ERROR)
     349                    rc = OpenPATH(phFile, u1.pach, pfl);
     350                if (rc == NO_ERROR)
     351                {
     352                    kprintf(("myldrOpen-%d: java - %s\n", cNesting, u1.pach));
     353                    /** @sketch
     354                     * If we're in tkExecPgm state we'll have to create an extra agrument, the
     355                     * class name without a .class extention. We'll do this after the filename
     356                     * in the u1 buffer. This argument is of course added to the front.
     357                     * Then the Executable name is to be updated.
     358                     */
     359                    if (isLdrStateExecPgm() && fTkExecPgm)
     360                    {
     361                        psz = u1.pach + 1 + CCHMAXPATH; /* ASSUMES that buffer is at least CCHMAXPATH*2 + 1 */
     362                        strcpy(psz, pszFilename);
     363                        psz2 = psz + strlen(psz);
     364                        while (psz2 > psz && *psz2 != '\\' && *psz2 != '/')
     365                        {
     366                            if (*psz2 == '.')
     367                            {
     368                                *psz2 = '\0';
     369                                break;
     370                            }
     371                            psz2--;
     372                        }
     373
     374                        rc = AddArgsToFront(1, psz);
     375                        if (rc == NO_ERROR)
     376                        {
     377                            rc = SetExecName(u1.pach);
     378                            if (rc != NO_ERROR)
     379                                kprintf(("myldrOpen-%d: java - failed to set java.exe as execname. rc=%d\n", cNesting, rc));
     380                        }
     381                        else
     382                            kprintf(("myldrOpen-%d: java - failed to add programname as argument. rc=%d\n", cNesting, rc));
     383                        goto cleanup_noerror;
     384                    }
     385                }
     386                else
     387                    kprintf(("myldrOpen-%d: java - couldn't find/open java.exe\n", cNesting));
     388
     389                #endif
     390                /** @sketch
     391                 *  End of Java loading. (return)
     392                 */
     393                goto cleanup;
     394            }
     395        }
     396        else
     397        {
     398            /** @sketch
     399             *  ELSE - the reading size of a DOS header failed or file is smaller than the dos header.
     400             *      IF read failed or filesize is less than 4 bytes THEN
     401             *          return no_error to the caller.
     402             *      ENDIF
     403             */
     404            #ifdef DEBUG
     405            if (rc != NO_ERROR)
     406            {
     407                kprintf(("myldrOpen-%d: ldrRead failed cbRead=%d, cbFile=%d,  rc=%d\n", cNesting, cbRead, cbFile, rc));
     408                goto cleanup_noerror;
     409            }
     410            if (cbRead < 4)
     411            {
     412                kprintf(("myldrOpen-%d: File too small! cbFile=%d\n", cNesting, cbFile));
     413                goto cleanup_noerror;
     414            }
     415            #else
     416            if (rc != NO_ERROR || cbRead < 4) //just forget files less than 4 bytes!
     417                goto cleanup_noerror;
     418            #endif
     419        }
     420        /** @sketch ENDIF (dos header read) */
     421
     422
     423
     424        /*
     425         * Only unreconized files passes this point!
     426         *
     427         * * Fileformats with lower priority should reside here. *
     428         *
     429         */
     430
     431        /** @sketch
     432         *  UNIX styled script?
     433         *      - Starts with a hash (#)
     434         *      - And we're loading an EXE
     435         *      - And we're either in QAppType or ExecPgm state.
     436         *      - And that a bang (!) is the first char after the hash (ignoring blanks).
     437         */
     438        if (*u1.pach == '#'
     439            && isLdrStateLoadingEXE()
     440            && (isLdrStateQAppType() || isLdrStateExecPgm())
     441            )
     442        {
     443            if (isUNIXScriptDisabled())
     444                goto cleanup_noerror;
     445            /*
     446             * Look for a bang (!). Tabs and spaces are skipped, anything else result in error.
     447             */
     448            psz = u1.pach + 1;
     449            while ((*psz == ' ' || *psz == '\t') && psz - u1.pach < cbRead)
     450                psz++;
     451            if (*psz == '!')
     452            {
     453                /** @sketch Found UNIX styled script! */
     454
     455                /** @sketch
     456                 * Read more of the script if necessary. (max is 256 chars (- Linux max is 127))
     457                 * Terminate the string read from the file to make sure with stop somewhere!
     458                 */
     459                if (cbRead < cbFile /*&& cbRead != 256*/)
     460                {
     461                    cbRead = min(256, cbFile);
     462                    rc = ldrRead(*phFile, 0UL, u1.pach, 0UL, cbRead, NULL);
     463                }
     464                u1.pach[cbRead] = '\0';
     465
     466                if (rc == NO_ERROR)
     467                {
     468                    /** @sketch
     469                     * Parse out filename and optional arguments (if any).
     470                     * The result of the parsing is that:
     471                     *      psz will point at the executable name.
     472                     *      psz2 will point at the arguments.
     473                     *  Both strings are trimmed.
     474                     */
     475                    psz++;                                                  /* psz points to the bang, skip it. */
     476                    while (*psz == ' ' || *psz == '\t')                     /* skip blanks after bang */
     477                        psz++;
     478                    if (*psz == '\r' || *psz == '\n' || *psz == '\0')       /* End-of-line? */
     479                    {
     480                        kprintf(("myldrOpen-%d: script no executable name.\n", cNesting));
     481                        goto cleanup_noerror; /* other error code? */
     482                    }
     483                    psz2 = psz + 1;                                         /* Not end-of-line, so add 1 before searching for args. */
     484                    while (*psz2 != '\0' && *psz2 != '\n' && *psz2 != '\r'  /* skip executable name. */
     485                           && *psz2 != ' ' && *psz2 != '\t')
     486                        psz2++;
     487                    while (*psz2 == ' ' || *psz2 == '\t')                    /* skip blanks after executable - pad them with '\0'! */
     488                        *psz2++ = '\0';
     489
     490                    psz3 = psz2;
     491                    while (*psz3 != '\n' && *psz3 != '\r' && *psz3 != '\0') /* find end of parameters and terminate the string. */
     492                        psz3++;
     493                    *psz3 = '\0';
     494                    while (psz3 >= psz2 && (*psz3 == '\0' || *psz3 == ' ' || *psz3 == '\t')) /* trim args */
     495                        *psz3-- = '\0';
     496
     497
     498                    /** @sketch
     499                     *  IF tkExecPgm THEN
     500                     *      Correct parameters - ie. add exec name (as argv[0]),
     501                     *        arguments (psz2) as argv[1+], old exec name, and finally
     502                     *        the existing parameters (current argv[1+]).
     503                     *      Set the executable name.
     504                     *  ENDIF
     505                     *  Open the new executable file recursively. (psz)
     506                     */
     507                     if (isLdrStateExecPgm())
     508                     {
     509                         if (*psz2)
     510                            rc = AddArgsToFront(3, psz, psz2, achTkExecPgmFilename);
     511                         else
     512                            rc = AddArgsToFront(2, psz, achTkExecPgmFilename);
     513                         if (rc != NO_ERROR)
     514                         {
     515                             kprintf(("myldrOpen-%d: AddArgsToFront failed with rc=%d\n", cNesting));
     516                             goto cleanup_noerror;
     517                         }
     518                         rc = SetExecName(psz);
     519                         if (rc != NO_ERROR)
     520                             kprintf(("myldrOpen-%d: SetExecName failed with rc=%d\n", cNesting));
     521                     }
     522                     rc = myldrOpen(phFile, psz, pfl);
     523                }
     524                else
     525                {
     526                    kprintf(("myldrOpen-%d: script - failed to read more of the script!, rc=%d cbRead=%d cbFile=%d.\n",
     527                             cNesting, rc, cbRead, cbFile));
     528                }
     529
     530                goto cleanup;
    218531            }
    219532            else
    220533            {
    221                 /*
    222                  * ELF image?
    223                  */
    224                 if (pach[0] == ELFMAG0 && pach[1] == ELFMAG1 && pach[2] == ELFMAG2 && pach[3] == ELFMAG3)
    225                 {
    226                     /*
    227                      * ELF signature found.
    228                      */
    229                     kprintf(("ldrOpen: ELF executable! - not implemented yet!\n"));
    230 
    231                     /*
    232                      * Do nothing more yet. NEED AN ELF LOADER!!!
    233                      */
    234                     rfree(pszBuffer);
    235                     return NO_ERROR;
    236                 }
     534                kprintf(("myldrOpen-%d: script - hash found but no bang (!).\n", cNesting));
     535            }
     536        } /**@sketch ENDIF - UNIX styled script. */
     537
     538
     539
     540        /** @sketch
     541         *  REXX script?
     542         *      - Starts with a REXX start comment ('/','*')
     543         *      - And we're loading an EXE
     544         *      - And we're either in QAppType or ExecPgm state.
     545         *      - Extention is currently ignored....
     546         *          .RX and .REX are known to be pure REXX scripts.
     547         *          While .CMD has to invoked used the commandline OS2_SHELL or COMSPEC variable.
     548         */
     549        if (*u1.pach == '/' && u1.pach[1] == '*'
     550            && isLdrStateLoadingEXE()
     551            && (isLdrStateQAppType() || isLdrStateExecPgm())
     552            )
     553        {
     554            if (isREXXScriptDisabled())
     555                goto cleanup_noerror;
     556
     557            /** @sketch
     558             * Found REXX styled script!
     559             * Find the REXX interpreter. We'll use kRx.exe to execute the REXX scripts.
     560             * (This interpreter could be embedded as a child of ModuleBase as it turned out
     561             * to be quite small about 700 bytes.)
     562             */
     563            kprintf(("myldrOpen-%d: Found REXX script\n", cNesting));
     564            ldrClose(*phFile);
     565            strcpy(u1.pach, "KRX.EXE");
     566            rc = ldrOpen(phFile, u1.pach, pfl);
     567            if (rc != NO_ERROR)
     568                rc = OpenPATH(phFile, u1.pach, pfl);
     569
     570            /** @sketch
     571             *  IF tkExecPgm THEN
     572             *      Correct parameters - ie. add exec name (as argv[0]), old exec name,
     573             *        and finally the existing parameters (current argv[1+]).
     574             *      Set the executable name.
     575             *  ENDIF
     576             */
     577             if (rc == NO_ERROR && isLdrStateExecPgm())
     578             {
     579                 rc = AddArgsToFront(2, u1.pach, achTkExecPgmFilename);
     580                 if (rc != NO_ERROR)
     581                 {
     582                     kprintf(("myldrOpen-%d: AddArgsToFront failed with rc=%d\n", cNesting));
     583                     goto cleanup_noerror;
     584                 }
     585                 rc = SetExecName(u1.pach);
     586                 if (rc != NO_ERROR)
     587                     kprintf(("myldrOpen-%d: SetExecName failed with rc=%d\n", cNesting));
     588
     589                 goto cleanup_noerror;
     590             }
     591             goto cleanup;
     592        } /**@sketch ENDIF - REXX styled script. */
     593
     594
     595        /*
     596         * Cleanup with rc set to NO_ERROR.
     597         */
     598    cleanup_noerror:
     599        rc = NO_ERROR;
     600
     601        /*
     602         * Cleanup without having rc set to NO_ERROR.
     603         * Decrement the nesting count.
     604         */
     605    cleanup:
     606        rfree(u1.pach);
     607        cNesting--;
     608    }
     609    #ifdef DEBUG
     610    else if (cNesting >= 3)
     611        kprintf(("myldrOpen-%d: cNesting = %d, which is too deep!\n", cNesting, cNesting));
     612    #endif
     613
     614    /** @sketch
     615     *  Return rc.
     616     */
     617    return rc;
     618}
     619
     620
     621/**
     622 * Adds new arguments to the front of the startup arguments for the program about to be
     623 * executed.
     624 *
     625 * @returns   OS/2 return code.
     626 * @param     cArgs     Count of arguments to add. At least 1!!!
     627 * @param     ...       Pointers to the arguments to add.
     628 *                      The first argument have to be the executable name. This have to the
     629 *                        the only argument in the first string.
     630 *                      The other arguements are space separated, so you could add a bunch
     631 *                        of arguments in a single string!
     632 *                      The last argument should be the old first parameter if this is to be
     633 *                        preserved. The old first parameter is overwritten since it's
     634 *                        normally the executable name.
     635 *
     636 * @status    completly implemented.
     637 * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     638 * @remark    Implementation note:
     639 *  The arguments convention is as follows:
     640 *      First argument, which should be the executable name, is terminated with a '\0'.
     641 *        It starts at offset 0 into the argument buffer, of course.
     642 *      All other arguemnts are separated by a space and follows the immediately after the
     643 *        first argument.
     644 *      The arguments are terminated by a double nulltermination: '\0\0'.
     645 */
     646APIRET AddArgsToFront(int cArgs,  ...)
     647{
     648    va_list     vaarg;                  /* Variable length argument list. */
     649    int         cchOldArgs;             /* Length of the old arguments (including the first argument). */
     650                                        /* cchOldArgs = 1 means no arguments. It don't include the very last '\0' */
     651                                        /* (remember argumets are terminated with two '\0's). */
     652    int         iSecondArg;             /* Index of the second argument. (Used to skip the first argument.) */
     653                                        /* Used first on the original arguments and them when adding the first */
     654                                        /* new argument. */
     655    int         cchNewArgs;             /* Length of the new arguments to be inserted. */
     656    int         i;                      /* Loop variable. Current function argument. */
     657    char *      psz;                    /* General string pointer. */
     658
     659
     660    /** @sketch
     661     *  Assert that we're in the right state.
     662     *  Calc the length of the existing parameters.
     663     *  Calc the length of the new arguments to determin.
     664     *  Assert that the new arguments have length > 0.
     665     */
     666    #ifdef DEBUG
     667    if (!isLdrStateExecPgm())
     668    {
     669        kprintf(("AddArgsToFront: not in tkExecPgm state.\n"));
     670        return ERROR_INVALID_PARAMETER;
     671    }
     672    #endif
     673    if (!fTkExecPgm)
     674    {
     675        kprintf(("AddArgsToFront: called when not in tkExecPgm data is invalid!\n"));
     676        return ERROR_INVALID_PARAMETER;
     677    }
     678
     679    cchOldArgs = iSecondArg = strlen(&achTkExecPgmArguments[0]) + 1;
     680    psz = &achTkExecPgmArguments[cchOldArgs];
     681    while (*psz != '\0')
     682        psz = &achTkExecPgmArguments[(cchOldArgs += strlen(psz) + 1)];
     683
     684    va_start(vaarg, cArgs);
     685    for (cchNewArgs = i = 0; i < cArgs; i++)
     686        cchNewArgs += strlen(va_arg(vaarg, char *)) + 1; /* 1 is for space or '\0'. */
     687    va_end(vaarg);
     688    #ifdef DEBUG
     689    if (cchNewArgs == 0)
     690    {
     691        kprintf(("AddArgsToFront: the size of the arguments to add is zero!\n"));
     692        return ERROR_INVALID_PARAMETER;
     693    }
     694    #endif
     695
     696
     697    /** @sketch
     698     *  Check if we have enough room for the new arguments. Fail if not enough.
     699     *  Move the existing arguments to make room for the new ones.
     700     *    !IMPORTANT! The first existing arguments (executable name) is skipped !IMPORTANT!
     701     *    !IMPORTANT! in this move as this have to be re-added in this call!    !IMPORTANT!
     702     */
     703    if (cchOldArgs + 1 + cchNewArgs > CCHARGUMENTS)
     704    {
     705        kprintf(("AddArgsToFront: argument buffer is too small to hold the arguments to add, cchOldArgs=%d, cchNewArgs=%d\n",
     706                 cchOldArgs, cchNewArgs));
     707        return ERROR_BAD_ARGUMENTS;
     708    }
     709
     710    if (cchOldArgs > 1)
     711    {
     712        memmove(&achTkExecPgmArguments[cchNewArgs], &achTkExecPgmArguments[iSecondArg],
     713                cchOldArgs - iSecondArg + 1);
     714    }
     715    else
     716        achTkExecPgmArguments[cchNewArgs + 1] = '\0';
     717
     718
     719    /** @sketch
     720     *  Copy new arguments.
     721     *  Since the first argument is special case we'll do it separately. (Uses '\0' as separator.)
     722     *    We assume that the entire first argument passed into this function should be the first argument!
     723     *    (This don't have to be true for the other arguments since these are space separated. You could
     724     *     pass in more than argument in a single string.)
     725     *  Loop thru the rest of the new arguments and add them with space as separator.
     726     */
     727    va_start(vaarg, cArgs);
     728    psz = va_arg(vaarg, char *);
     729    iSecondArg = strlen(psz) + 1;
     730    memcpy(&achTkExecPgmArguments[0], psz, iSecondArg);
     731
     732    psz = &achTkExecPgmArguments[iSecondArg];
     733    i = 2;                              /* one in advance to avoid a +1. */
     734    while (1)
     735    {
     736        strcpy(psz, va_arg(vaarg, char *));
     737        psz += strlen(psz);
     738        /* IF more arguments following (new or old) THEN add a space separator ELSE break loop */
     739        if (cchOldArgs > 1 || i < cArgs)
     740            *psz++ = ' ';
     741        else
     742            break;
     743        i++;
     744    }
     745    va_end(vaarg);
     746
     747    #ifdef DEBUG /* assertion */
     748    if (psz != &achTkExecPgmArguments[cchNewArgs])
     749    {
     750        kprintf(("AddArgsToFront: !Assertion failed! psz didn't end up where it should! (psz -> %d should be %d)\n",
     751                 psz - &achTkExecPgmArguments[0], cchNewArgs));
     752        if (cchOldArgs <= 1)
     753            psz[0] = psz[1] = '\0';
     754    }
     755    #endif
     756
     757    return NO_ERROR;
     758}
     759
     760
     761/**
     762 * Sets the executable name of the module.
     763 * This function is normally invoked after a different executable than the one requested was
     764 * opened. It does _NOT_ set the new executable name as the first argument, since it is more
     765 * convenient to this while calling AddArgsToFront to add other arguments.
     766 *
     767 * @returns   OS/2 return code.
     768 * @param     pszExecName   Pointer to new executable name.
     769 * @status    completly implemented.
     770 * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     771 * @remark    .
     772 */
     773APIRET SetExecName(const char *pszExecName)
     774{
     775    #ifdef DEBUG
     776    int cch;
     777    cch = strlen(pszExecName);
     778    if (cch > CCHMAXPATH)
     779    {
     780        kprintf(("ChangeExecName: filename is too long! cch=%d. name=%s\n", cch, pszExecName));
     781        return ERROR_FILENAME_EXCED_RANGE;
     782    }
     783    if (!isLdrStateExecPgm())
     784    {
     785        kprintf(("ChangeExecName: called when not in tkExecPgm state!!! FATAL ERROR!\n"));
     786        return ERROR_INVALID_PARAMETER;
     787    }
     788    #endif
     789    if (!fTkExecPgm)
     790    {
     791        kprintf(("ChangeExecName: called when not in tkExecPgm data is invalid!!! FATAL ERROR!\n"));
     792        return ERROR_INVALID_PARAMETER;
     793    }
     794
     795    strcpy(achTkExecPgmFilename, pszExecName);
     796
     797    return 0;
     798}
     799
     800
     801/**
     802 * Opens a file using the PATH environment variable of the current process.
     803 * @returns   OS2 return code.
     804 * @param     phFile        Pointer to filehandle. The filehandle is set to the SFN for the opened
     805 *                          file on successful return.
     806 *                          The filehandle is 0 on failure.
     807 * @param     pszFilename   Pointer to filename buffer. This will hold the filename on input.
     808 *                          On successful return it holds the filepath found.
     809 *                          On failiure it's undefined.
     810 * @param     pfl           Some flags set by ldrOpen.
     811 * @sketch    stub
     812 * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     813 * @remark
     814 */
     815APIRET OpenPATH(PSFN phFile, char *pszFilename, PULONG pfl)
     816{
     817    APIRET      rc;
     818    USHORT      TCBFailErr_save;
     819    int         cchFilename;            /* Filename length + 1. */
     820    const char *pszPath = ScanEnv(GetEnv(FALSE), "PATH"); /* Current Process environment? */
     821
     822    /**@sketch
     823     *  No PATH environment.
     824     */
     825    if (pszPath == NULL)
     826        return ERROR_FILE_NOT_FOUND;
     827
     828    cchFilename = strlen(pszFilename) + 1;
     829
     830    /**@sketch
     831     * We'll have to save the TCBFailErr since we don't want to cause
     832     * Hard Errors while searching invalid paths, etc. (ldrOpenPath does this!)
     833     */
     834    TCBFailErr_save = tcbGetTCBFailErr(tcbGetCur());
     835
     836    /**@ sketch
     837     *  Loop thru the PATH trying to open the specified file in each
     838     *  directory.
     839     */
     840    while (*pszPath != '\0')
     841    {
     842        const char *  pszNext = pszPath;
     843        int           cchPath;
     844        char          chEnd, ch;
     845
     846        /*
     847         * Find end of this path.
     848         */
     849        while (*pszPath == ' ') pszPath++; //skip leading spaces.
     850        chEnd = *pszPath == '"' ? '"' : ';';
     851        while ((ch = *pszNext) != chEnd && ch != '\0')
     852            pszNext++;
     853
     854        if (chEnd == '"')
     855        {
     856            cchPath = pszNext - (++pszPath); //pszPath points at '"' before incrementing it.
     857            if (ch != '\0')
     858                pszNext++;
     859        }
     860        else
     861        {
     862            /* Trim the string. */
     863            cchPath = pszNext - pszPath;
     864            while (cchPath > 0 && pszPath[cchPath-1] == ' ') //??
     865                cchPath--;
     866        }
     867
     868        /*
     869         *  No length? No Path! Or path'\'filename too long? => Next
     870         */
     871        if (cchPath > 0 && cchPath + cchFilename + 1 < CCHMAXPATH)
     872        {
     873            static char     achFilename[CCHMAXPATH];
     874            /*
     875             * Build filename
     876             */
     877            memcpy(achFilename, pszPath, cchPath);
     878            if ((ch = achFilename[cchPath - 1]) == '\\' || ch == '/')
     879                cchPath--;
     880            else
     881                achFilename[cchPath] = '\\';
     882            memcpy(&achFilename[cchPath + 1], pszFilename, cchFilename); /* cchFilename = length + 1; hence we copy the terminator too. */
     883
     884            /*
     885             * Try open the file.
     886             */
     887            rc = myldrOpen(phFile, achFilename, pfl);
     888            switch (rc)
     889            {
     890                case ERROR_FILE_NOT_FOUND:          case ERROR_PATH_NOT_FOUND:          case ERROR_ACCESS_DENIED:           case ERROR_INVALID_ACCESS:
     891                case ERROR_INVALID_DRIVE:           case ERROR_NOT_DOS_DISK:            case ERROR_REM_NOT_LIST:            case ERROR_BAD_NETPATH:
     892                case ERROR_NETWORK_BUSY:            case ERROR_DEV_NOT_EXIST:           case ERROR_TOO_MANY_CMDS:           case ERROR_ADAP_HDW_ERR:
     893                case ERROR_UNEXP_NET_ERR:           case ERROR_BAD_REM_ADAP:            case ERROR_NETNAME_DELETED:         case ERROR_BAD_DEV_TYPE:
     894                case ERROR_NETWORK_ACCESS_DENIED:   case ERROR_BAD_NET_NAME:            case ERROR_TOO_MANY_SESS:           case ERROR_REQ_NOT_ACCEP:
     895                case ERROR_INVALID_PASSWORD:        case ERROR_OPEN_FAILED:             case ERROR_INVALID_NAME:            case ERROR_FILENAME_EXCED_RANGE:
     896                case ERROR_VC_DISCONNECTED:
     897                    break;
     898
     899                case NO_ERROR:
     900                default:
     901                    tcbSetTCBFailErr(tcbGetCur(), TCBFailErr_save);
     902                    return rc;
    237903            }
    238904        }
     905        #ifdef DEBUG
     906        else if (cchPath > 0)   kprintf(("OpenPATH: Path component is too long\n"));
     907        #endif
    239908
    240909        /*
    241          * Only unreconized files and readerror passes this point!
    242          *
    243          * * Fileformats with lower priority should reside here. *
    244          *
    245          */
    246 
    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)
    252         {
    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         {
    264             /*
    265              * UNIX styled script?
    266              * FIXME! Must be more than 64 bytes long?
    267              *        No options!
    268              *        Firstline < 64 bytes!
    269              */
    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)
    274             {
    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
    283                  */
    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')
    291                 {
    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
    299                      */
    300                     pszEnd = pszStart;
    301                     kprintf(("ldrOpen: script debug 3\n"));
    302                     while (*pszEnd != '\0' && *pszEnd != '\r' && *pszEnd != '\n')
    303                     {
    304                         if (fFirst && (*pszEnd == ' ' || *pszEnd == '\t'))
    305                         {
    306                             *pszEnd = '\0';
    307                             fFirst = FALSE;
    308                             if (pszEnd[1] == '\0' || pszEnd[1] == '\r' || pszEnd[1] == '\n')
    309                                 fFirst = TRUE;
    310                         }
    311 
    312                         /* next */
    313                         pszEnd++;
    314                         cchToAdd++;
    315                     }
    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)
    324                     {
    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)
    336                         {
    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                             }
    397                         }
    398                         else
    399                         {
    400                             kprintf(("ldrOpen: QueryBufferPointerFromFilename failed.\n"));
    401                             rc = ERROR_BAD_EXE_FORMAT; /*?*/
    402                         }
    403                     }
    404                 }
    405                 else
    406                 {
    407                     kprintf(("ldrOpen: no interpereter on the first line.\n"));
    408                     rc = ERROR_BAD_EXE_FORMAT; /*?*/
    409                 }
    410             }
    411             else
    412             {
    413                 kprintf(("ldrOpen: read of min(cbFile, 256) = %d failed, rc = %d\n", cchRead, rc));
    414             }
    415         } /* else inn other formats here. */
    416         rfree(pszBuffer);
    417     }
    418     return rc;
     910         * Next
     911         */
     912        if (*pszNext == '\0')
     913            break;
     914        pszPath = pszNext + 1;
     915    }
     916
     917
     918    /*
     919     * File is not found.
     920     */
     921    *phFile = 0;
     922    tcbSetTCBFailErr(tcbGetCur(), TCBFailErr_save);
     923    return ERROR_FILE_NOT_FOUND;
    419924}
    420 
    421 
    422 /**
    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.
    427  * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
    428  */
    429 static unsigned getArgsLength(const char *pachArgs)
    430 {
    431     unsigned    cch = 1;
    432     const char *psz = pachArgs;
    433 
    434     while (*psz != '\0')
    435     {
    436         register unsigned cch2 = strlen(psz);
    437         cch += cch2;
    438         psz += cch2 + 1;
    439     }
    440 
    441     return cch;
    442 }
  • branches/GRACE/src/win32k/ldr/myldrRead.cpp

    r2501 r3834  
    1 /* $Id: myldrRead.cpp,v 1.6 2000-01-22 18:21:02 bird Exp $
     1/* $Id: myldrRead.cpp,v 1.6.4.1 2000-07-16 22:43:38 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
     
    2424
    2525#include "log.h"
     26#include "avl.h"
    2627#include "dev32.h"
    2728#include <peexe.h>
    2829#include <exe386.h>
    2930#include "OS2Krnl.h"
     31#include "ldrCalls.h"
     32#include "ldr.h"
    3033#include "ModuleBase.h"
    3134#include "pe2lx.h"
    32 #include "avl.h"
    33 #include "ldrCalls.h"
    34 #include "ldr.h"
    3535
    3636
     37/**
     38 * Overloads ldrRead.
     39 * @returns   OS/2 return code.
     40 * @param     hFile     Filehandle to read from.
     41 * @param     pvBuffer  Buffer to read into.
     42 * @param     fpBuffer  This is not flags as I first though, but probably a far 16-bit pointer
     43 *                      to the buffer.
     44 * @param     cbToRead  Count of bytes to read.
     45 * @param     pMTE
     46 * @sketch    IF it's our module THEN
     47 *                Get module pointer. (complain if this failes and backout to ldrRead.)
     48 *                Currently - verify that it's a Pe2Lx module. (complain and fail if not.)
     49 *                Invoke the read method of the module do the requested read operation.
     50 *                Save pMTE if present and not save allready.
     51 *            ENDIF
     52 *            - backout or not our module -
     53 *            forward request to the original ldrRead.
     54 * @status    Completely implemented.
     55 * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     56 */
    3757ULONG LDRCALL myldrRead(
    38                        SFN hFile,
    39                        ULONG ulOffset,
    40                        PVOID pBuffer,
    41                        ULONG ulFlags ,
    42                        ULONG ulBytesToRead,
    43                        PMTE pMTE
    44                        )
     58    SFN    hFile,
     59    ULONG  ulOffset,
     60    PVOID   pvBuffer,
     61    ULONG   fpBuffer,
     62    ULONG   cbToRead,
     63    PMTE    pMTE
     64    )
    4565{
    4666    ULONG   rc;
     
    5070    {
    5171        PMODULE pMod;
    52         kprintf(("ldrRead+: hF=%+04x off=%+08x pB=%+08x fl=%+08x cb=%+04x pMTE=%+08x\n",hFile,ulOffset,pBuffer,ulFlags,ulBytesToRead,pMTE));
     72        kprintf(("myldrRead: hF=%+04x off=%+08x pB=%+08x fp=%+08x cb=%+04x pMTE=%+08x\n",
     73                 hFile, ulOffset, pvBuffer, fpBuffer, cbToRead, pMTE));
    5374
    5475        pMod = getModuleBySFN(hFile);
     
    5980                pMod->pMTE = pMTE;
    6081
    61             /* debug */
    62             if (ulFlags != 0)
    63                 kprintf(("ldrRead: Warning ulFlags = 0x%x (!= 0)\n", ulFlags));
    64 
    6582            if ((pMod->fFlags & MOD_TYPE_MASK) == MOD_TYPE_PE2LX)
    66                 rc = pMod->Data.pModule->read(ulOffset, pBuffer, ulBytesToRead, ulFlags, pMTE);
     83                rc = pMod->Data.pModule->read(ulOffset, pvBuffer, fpBuffer, cbToRead, pMTE);
    6784            else
    6885            {
    69                 kprintf(("ldrRead: Invalid module type, %#x\n", pMod->fFlags & MOD_TYPE_MASK));
     86                kprintf(("myldrRead: Invalid module type, %#x\n", pMod->fFlags & MOD_TYPE_MASK));
    7087                rc = ERROR_READ_FAULT;
    7188            }
    72             return rc;
    7389        }
    7490        else
    75             kprintf(("ldrRead:  DON'T PANIC! - but I can't get Node ptr! - This is really an IPE!\n"));
     91        {
     92            kprintf(("myldrRead:  DON'T PANIC! - but I can't get Node ptr! - This is really an IPE!\n"));
     93            rc = ERROR_READ_FAULT;
     94        }
    7695    }
    77 
    78     rc = ldrRead(hFile, ulOffset, pBuffer, ulFlags, ulBytesToRead, pMTE);
    79 
     96    else
     97    {
     98        rc = ldrRead(hFile, ulOffset, pvBuffer, fpBuffer, cbToRead, pMTE);
     99    }
    80100    #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));
     101    kprintf(("myldrRead:  hF=%+04x off=%+08x pB=%+08x fp=%+08x cb=%+04x pMTE=%+08x rc=%d\n",
     102             hFile, ulOffset, pvBuffer, fpBuffer, cbToRead, pMTE, rc));
    83103    #endif
    84104
  • branches/GRACE/src/win32k/misc/env.c

    r3412 r3834  
    1 /* $Id: env.c,v 1.2 2000-04-17 02:26:04 bird Exp $
     1/* $Id: env.c,v 1.2.4.1 2000-07-16 22:43:39 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/*******************************************************************************
     
    2424#include "dev32hlp.h"
    2525#include "log.h"
    26 #include "ptda.h"
    2726#include "OS2Krnl.h"
    2827#include <string.h>
    29 
     28#include "macros.h"
    3029#include "env.h"
    3130
     
    3938 * @param     paszEnv   Pointer to the environment data to search.
    4039 *                      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.
     40 *                      by an empty string. The strings consists of two parts which
     41 *                      are separated by a euqal char ('='). The first part is the
     42 *                      variable name. The second part is the value of the variable.
     43 *
     44 *                      IF this is NULL we'll simply return NULL.
     45 * @param     pszVar    Name of the environment variable to find. (NULL not allowed.)
    4646 */
    4747const char *ScanEnv(const char *paszEnv, const char *pszVar)
    4848{
     49    int     cchVar;
     50    /*
     51     * Return if environment not found.
     52     */
     53    #ifdef DEBUG
     54    if (pszVar < (const char *)0x10000 || *pszVar == '\0')
     55        kprintf(("ScanEnv: Invalid parameter pszVar (%p)\n", pszVar));
     56    #endif
     57    if (paszEnv == NULL)
     58        return NULL;
     59    #ifdef DEBUG
     60    if (paszEnv < (const char *)0x10000)
     61        kprintf(("ScanEnv: Invalid parameter paszEnv (%p)\n", paszEnv));
     62    #endif
     63
    4964    /*
    5065     * Loop thru the environment data until an empty string is reached.
    5166     */
     67    cchVar = strlen(pszVar);
    5268    while (*paszEnv != '\0')
    5369    {
    54         register int i;                 /* Variable use to store the compare result. */
    55 
    5670        /*
    57          * Variable name.
    58          * Check if it's matching the name we're searching for and skip the variable name.
     71         * Check if the variable name is it's matching the one we're searching for.
    5972         */
    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;
     73        const char *pszEqual = strchr(paszEnv, '=');
     74        if (pszEqual != NULL && (pszEqual - paszEnv) == cchVar
     75            && memcmp(paszEnv, pszVar, cchVar) == 0
     76            )
     77        {
     78            /*
     79             * Variable was found. Return pointer to the value.
     80             */
     81            return pszEqual + 1;
    6582        }
    6683
    6784        /*
    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.
     85         * Skip this variable. (Don't use pszEqual since it might be NULL)
    7186         */
    72         if (*paszEnv == '\0')
    73             break;
    74 
    75         /* Skip value */
    7687        paszEnv += strlen(paszEnv) + 1;
    7788    }
     
    8293
    8394/**
    84  * Get the linear pointer to the environment data.
     95 * Get the linear pointer to the environment data for the current
     96 * process or the process being started (EXECed).
    8597 *
    86  * @returns   Pointer to environment data.
    87  *            NULL on failure.
     98 * @param       fExecChild      TRUE:  Get exec child environment.
     99 *                                     (Not supported by method 2)
     100 *                              FALSE: Get current process environment.
     101 * @returns     Pointer to environment data.
     102 *              NULL on failure.
    88103 */
    89 const char *GetEnv(void)
     104const char *GetEnv(BOOL fExecChild)
    90105{
    91     /*  There is probably two ways of getting the environment data for a the
     106    /*  There are probably two ways of getting the environment data for the
    92107     *  current process: 1) get it from the PTDA->ptda_environ
    93108     *                   2) Local infosegment (LIS from GetDosVar devhlp)
    94      *  I am not sure which one of these works best. What I know is that
     109     *  I am not sure which one of these which works best. What I know is that
    95110     *  method 1) is used by the w_GetEnv API worker. This API is called at
    96111     *  Ring-0 from some delete file operation. (Which uses it to get the
     
    98113     *  I don't want to thunk around using that. There for I'll implement
    99114     *  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.
     115     *  2), testing will show which one of them are the better.
    101116     */
    102117
     
    116131     */
    117132    pPTDACur = ptdaGetCur();
    118     if (pPTDA != NULL)
     133    if (pPTDACur != NULL)
    119134    {
    120         pPTDA = ptdaGet_pPTDAExecChild(pPTDA);
    121         if (pPTDA != NULL)
     135        pPTDA = ptdaGet_pPTDAExecChild(pPTDACur);
     136        if (pPTDA != NULL && fExecChild)
    122137        {
    123138            hobEnviron = ptdaGet_ptda_environ(pPTDA);
     
    127142                if (rc == NO_ERROR)
    128143                    return (const char *)ulAddr;
    129                 kprintf(("GetEnv: VMObjHandleInfo failed with rc=%d for hob=0x%04x\n", rc, hobEnviron));
     144                kprintf(("GetEnv: (1) VMObjHandleInfo failed with rc=%d for hob=0x%04x \n", rc, hobEnviron));
    130145            }
    131146        }
     
    135150        {
    136151            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             }
     152            if (rc == NO_ERROR)
     153                return (const char *)ulAddr;
     154            kprintf(("GetEnv: (2) VMObjHandleInfo failed with rc=%d for hob=0x%04x\n", rc, hobEnviron));
    141155        }
    142156    }
    143157    else
    144     {
     158    {   /* Not called at task time? No current task! */
    145159        kprintf(("GetEnv: Failed to get current PTDA.\n"));
    146160    }
    147161
    148     return (const char *)ulAddr;
     162    return NULL;
     163
    149164
    150165    #else
     166
    151167
    152168    struct InfoSegLDT * pLIS;           /* Pointer to local infosegment. */
     
    162178    {
    163179        kprintf(("GetEnv: Failed to get local info segment\n"));
     180        NOREF(fExecChild);
    164181        return NULL;
    165182    }
  • branches/GRACE/src/win32k/misc/vprintf.c

    r2501 r3834  
    1 /* $Id: vprintf.c,v 1.7 2000-01-22 18:21:03 bird Exp $
     1/* $Id: vprintf.c,v 1.7.4.1 2000-07-16 22:43:41 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
     
    4149#include "dev32.h"
    4250#include "vprintf.h"
     51#ifdef COMOUTPUT
     52    #include <builtin.h>
     53#endif
    4354#ifdef RING0
    44     #include <builtin.h>
    4555    #include "options.h"
    4656#endif
     
    222232int vprintf(const char *pszFormat, va_list args)
    223233{
    224     #ifdef RING0
     234    #if defined(RING0) && !defined(R3TST)
    225235    if (!options.fLogging)
    226236        return 0;
     
    239249int vprintf2(const char *pszFormat, va_list args)
    240250{
    241     #ifndef RING0
    242         int cch = 0;
    243     #endif
     251    int cch = 0;
    244252
    245253    while (*pszFormat != '\0')
     
    247255        if (*pszFormat == '%')
    248256        {
    249             #ifndef RING0
    250                 if (cch > 0)
    251                 {
    252                     strout((char*)(pszFormat - cch), cch);
    253                     cch = 0;
    254                 }
    255             #endif
     257            if (cch > 0)
     258            {
     259                strout((char*)(pszFormat - cch), cch);
     260                cch = 0;
     261            }
    256262
    257263            pszFormat++;  /* skip '%' */
     
    396402        else
    397403        {
    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
     404            cch++;
     405            pszFormat++;
     406        }
     407    }
     408
     409    if (cch > 0)
     410    {
     411        strout((char*)(pszFormat - cch), cch);
     412        cch = 0;
     413    }
    414414
    415415    return 0UL;
     
    479479static void chout(int ch)
    480480{
    481     #ifndef RING0
    482         ULONG ulWrote;
    483     #endif
     481#ifdef DOSWRITEOUTPUT
     482    ULONG ulWrote;
     483#endif
    484484
    485485    if (ch != '\r')
     
    487487        if (ch == '\n')
    488488        {
    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
     489        #ifdef COMOUTPUT
    499490            #pragma info(noeff)
    500491            while (!(_inp(options.usCom + 5) & 0x20));  /* Waits for the port to be ready. */
    501             _outp(options.usCom, ch);                   /* Put the char. */
     492            _outp(options.usCom, chReturn);             /* Put the char. */
    502493            #pragma info(restore)
    503             Yield();
    504         #else
    505             DosWrite(1, (void*)&ch, 1, &ulWrote);
    506494        #endif
     495        #ifdef DOSWRITEOUTPUT
     496            DosWrite(1, (void*)&chReturn, 1, SSToDS(&ulWrote));
     497        #endif
     498        }
     499    #ifdef COMOUTPUT
     500        #pragma info(noeff)
     501        while (!(_inp(options.usCom + 5) & 0x20));  /* Waits for the port to be ready. */
     502        _outp(options.usCom, ch);                   /* Put the char. */
     503        #pragma info(restore)
     504        Yield();
     505    #endif
     506    #ifdef DOSWRITEOUTPUT
     507        DosWrite(1, SSToDS(&ch), 1, SSToDS(&ulWrote));
     508    #endif
    507509    }
    508510}
     
    529531
    530532        /* 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
     533    #ifdef COMOUTPUT
     534        for (ul = 0; ul < cch; ul++)
     535        {
     536            #pragma info(noeff)
     537            while (!(_inp(options.usCom + 5) & 0x20));  /* Waits for the port to be ready. */
     538            _outp(options.usCom, psz[ul]);              /* Put the char. */
     539            #pragma info(restore)
     540        }
     541    #endif
     542    #ifdef DOSWRITEOUTPUT
     543        DosWrite(1, psz, cch, SSToDS(&ul));
     544    #endif
    542545
    543546        /* cr and lf check + skip */
    544         if (psz[cch] == '\n' || psz[cch] == '\r')
     547        if (cch < cchMax && (psz[cch] == '\n' || psz[cch] == '\r'))
    545548        {
    546549            if (psz[cch] == '\n')
    547550            {
    548             #ifdef RING0
     551            #ifdef COMOUTPUT
    549552                #pragma info(noeff)
    550553                while (!(_inp(options.usCom + 5) & 0x20));  /* Waits for the port to be ready. */
     
    552555                while (!(_inp(options.usCom + 5) & 0x20));  /* Waits for the port to be ready. */
    553556                _outp(options.usCom, chNewLine);            /* Put the char. */
    554                 cchYield ++;
     557                cchYield++;
    555558                #pragma info(restore)
    556             #else
    557                 DosWrite(1, (void*)&chReturn, 1, &ul);
    558                 DosWrite(1, (void*)&chNewLine, 1, &ul);
     559            #endif
     560            #ifdef DOSWRITEOUTPUT
     561                DosWrite(1, (void*)&chReturn, 1, SSToDS(&ul));
     562                DosWrite(1, (void*)&chNewLine, 1, SSToDS(&ul));
    559563            #endif
    560564
  • branches/GRACE/src/win32k/pe2lx/pe2lx.cpp

    r2927 r3834  
    1 /* $Id: pe2lx.cpp,v 1.18 2000-02-27 02:18:10 bird Exp $
     1/* $Id: pe2lx.cpp,v 1.18.4.1 2000-07-16 22:43:41 bird Exp $
    22 *
    33 * Pe2Lx class implementation. Ring 0 and Ring 3
     
    670670 * @param     pvBuffer   Pointer to buffer where data is to be put.
    671671 * @param     cbToRead   Bytes to be read.
    672  * @param     flFlag     Flags which was spesified to the ldrRead call.
     672 * @param     fpBuffer   Flags which was spesified to the ldrRead call.
    673673 * @parma     pMTE       Pointer to MTE which was specified to the ldrRead call.
    674674 * @return    NO_ERROR if successful something else if not.
     
    676676 * @author    knut st. osmundsen
    677677 */
    678 ULONG Pe2Lx::read(ULONG offLXFile, PVOID pvBuffer, ULONG cbToRead, ULONG flFlags, PMTE pMTE)
     678ULONG Pe2Lx::read(ULONG offLXFile, PVOID pvBuffer, ULONG fpBuffer, ULONG cbToRead, PMTE pMTE)
    679679{
    680680    APIRET rc = NO_ERROR;   /* Return code. */
     
    696696    #endif
    697697
    698     printInf(("read(%d, 0x%08x, %d, 0x%08x)\n", offLXFile, pvBuffer, cbToRead, flFlags));
     698    printInf(("Pe2Lx::read(%d, 0x%08x, 0x%08x, %d)\n", offLXFile, pvBuffer, fpBuffer, cbToRead));
    699699
    700700    /* Could we skip right to the datapages? */
     
    931931            /* calc PE offset and size of read. */
    932932            cbReadVar = min(paObjects[iObj].cbPhysical - offObject, cbToRead);
    933             rc = ReadAtF(hFile, offPEFile, pvBuffer, cbReadVar, flFlags, pMTE);
     933            rc = ReadAtF(hFile, offPEFile, pvBuffer, fpBuffer, cbReadVar, pMTE);
    934934        }
    935935        else
     
    938938            {   /* before TIBFix code. */
    939939                cbReadVar = min(paObjects[iObj].Misc.offTIBFix - offObject, cbToRead);
    940                 rc = ReadAtF(hFile, offPEFile, pvBuffer, cbReadVar, flFlags, pMTE);
     940                rc = ReadAtF(hFile, offPEFile, pvBuffer, fpBuffer, cbReadVar, pMTE);
    941941            }
    942942            else
     
    959959    }
    960960
    961     NOREF(flFlags);
     961    NOREF(fpBuffer);
    962962    NOREF(pMTE);
    963963    return rc;
     
    12811281
    12821282
     1283/**
     1284 * openPath - opens file eventually searching loader specific paths.
     1285 * This method is only called for DLLs. DosLoadModule and Imports.
     1286 *
     1287 * This base implementation simply calls ldrOpenPath.
     1288 *
     1289 * @returns   OS2 return code.
     1290 *            pLdrLv->lv_sfn  is set to filename handle.
     1291 * @param     pachModname   Pointer to modulename. Not zero terminated!
     1292 * @param     cchModname    Modulename length.
     1293 * @param     pLdrLv        Loader local variables? (Struct from KERNEL.SDF)
     1294 * @param     pfl           Pointer to flags which are passed on to ldrOpen.
     1295 * @sketch
     1296 * This is roughly what the original ldrOpenPath does:
     1297 *      if !CLASS_GLOBAL or miniifs then
     1298 *          ldrOpen(pachModName)
     1299 *      else
     1300 *          loop until no more libpath elements
     1301 *              get next libpath element and add it to the modname.
     1302 *              try open the modname
     1303 *              if successfull then break the loop.
     1304 *          endloop
     1305 *      endif
     1306 */
     1307ULONG  Pe2Lx::openPath(PCHAR pachModname, USHORT cchModname, ldrlv_t *pLdrLv, PULONG pfl) /* (ldrOpenPath) */
     1308{
     1309    #ifdef RING0
     1310
     1311    /* These defines sets the order the paths and pathlists are examined. */
     1312    #define FINDDLL_EXECUTABLEDIR   1
     1313    #define FINDDLL_CURRENTDIR      2
     1314    #define FINDDLL_SYSTEM32DIR     3
     1315    #define FINDDLL_SYSTEM16DIR     4
     1316    #define FINDDLL_WINDIR          5
     1317    #define FINDDLL_PATH            6
     1318    #define FINDDLL_BEGINLIBPATH    7
     1319    #define FINDDLL_LIBPATH         8
     1320    #define FINDDLL_ENDLIBPATH      9
     1321    #define FINDDLL_FIRST           FINDDLL_EXECUTABLEDIR
     1322    #define FINDDLL_LAST            FINDDLL_ENDLIBPATH
     1323
     1324    struct
     1325    {
     1326        char    sz[CCHMAXPATH];
     1327    } *pVars;
     1328
     1329
     1330    /*
     1331     * Mark the SFN invalid in the case of error.
     1332     * Initiate the Odin32 Path static variable.
     1333     * Allocate memory for local variables.
     1334     */
     1335    pLdrLv->lv_sfn = 0xffff;
     1336    initOdin32Path();
     1337    pVar = rmalloc(sizeof(*pVars));
     1338    if (pVar == NULL)
     1339        return ERROR_NOT_ENOUGH_MEMORY;
     1340
     1341    /* init stuff */
     1342
     1343
     1344
     1345
     1346    /** @sketch
     1347     * Loop thru the paths and pathlists searching them for the filename.
     1348     */
     1349    for (iPath = FINDDLL_FIRST; iPath <= FINDDLL_LAST; iPath++)
     1350    {
     1351        APIRET          rc;             /* Returncode from OS/2 APIs. */
     1352        const char  *   pszPath;        /* Pointer to the path being examined. */
     1353
     1354        /** @sketch
     1355         * Get the path/dir to examin. (This is determined by the value if iPath.)
     1356         */
     1357        switch (iPath)
     1358        {
     1359            case FINDDLL_EXECUTABLEDIR:
     1360                if (pszAltPath)
     1361                    pszPath = strcpy(plv->szPath, pszAltPath);
     1362                else
     1363                {
     1364                    /* ASSUMES: getFullPath allways returns a fully qualified
     1365                     *      path, ie. with at least one backslash. and that all
     1366                     *      slashes are backslashes!
     1367                     */
     1368                    if (!WinExe) continue;
     1369                    pszPath = strcpy(plv->szPath, WinExe->getFullPath());
     1370                }
     1371                psz = strrchr(plv->szPath, '\\');
     1372                dassert(psz, ("KERNEL32:Win32ImageBase::findDll(%s, 0x%08x, %d): "
     1373                        "WinExe->getFullPath returned a path not fully qualified: %s",
     1374                        pszFileName, pszFullName, cchFullName, pszPath));
     1375                if (psz)
     1376                    *psz = '\0';
     1377                else
     1378                    continue;
     1379                break;
     1380
     1381            case FINDDLL_CURRENTDIR:
     1382                pszPath = ".";
     1383                break;
     1384
     1385            case FINDDLL_SYSTEM32DIR:
     1386                pszPath = InternalGetSystemDirectoryA();
     1387                break;
     1388
     1389            case FINDDLL_SYSTEM16DIR:
     1390                #if 1
     1391                continue;               /* Skip this index */
     1392                #else
     1393                pszPath = InternalGetWindowsDirectoryA();
     1394                strcpy(plv->sz2, InternalGetWindowsDirectoryA());
     1395                strcat(plv->sz2, "\SYSTEM");
     1396                break;
     1397                #endif
     1398
     1399            case FINDDLL_WINDIR:
     1400                pszPath = InternalGetWindowsDirectoryA();
     1401                break;
     1402
     1403            case FINDDLL_PATH:
     1404                pszPath = getenv("PATH");
     1405                break;
     1406
     1407            case FINDDLL_BEGINLIBPATH:
     1408                rc = DosQueryExtLIBPATH(plv->szPath, BEGIN_LIBPATH);
     1409                if (rc != NO_ERROR)
     1410                {
     1411                    dassert(rc == NO_ERROR, ("KERNEL32:Win32ImageBase::findDll(%s, 0x%08x, %d): "
     1412                             "DosQueryExtLIBPATH failed with rc=%d, iPath=%d",
     1413                             pszFileName, pszFullName, cchFullName, rc, iPath));
     1414                    continue;
     1415                }
     1416                pszPath = plv->szPath;
     1417                break;
     1418
     1419            case FINDDLL_LIBPATH:
     1420                rc = DosQueryHeaderInfo(NULLHANDLE, 0, plv->szPath, sizeof(plv->szPath), QHINF_LIBPATH);
     1421                if (rc != NO_ERROR)
     1422                {
     1423                    dassert(rc == NO_ERROR, ("KERNEL32:Win32ImageBase::findDll(%s, 0x%08x, %d): "
     1424                             "DosQueryHeaderInfo failed with rc=%d, iPath=%d",
     1425                             pszFileName, pszFullName, cchFullName, rc, iPath));
     1426                    continue;
     1427                }
     1428                pszPath = plv->szPath;
     1429                break;
     1430
     1431            case FINDDLL_ENDLIBPATH:
     1432                rc = DosQueryExtLIBPATH(plv->szPath, END_LIBPATH);
     1433                if (rc != NO_ERROR)
     1434                {
     1435                    dassert(rc == NO_ERROR, ("KERNEL32:Win32ImageBase::findDll(%s, 0x%08x, %d): "
     1436                             "DosQueryExtLIBPATH failed with rc=%d, iPath=%d",
     1437                             pszFileName, pszFullName, cchFullName, rc, iPath));
     1438                    continue;
     1439                }
     1440                pszPath = plv->szPath;
     1441                break;
     1442
     1443            default: /* !internalerror! */
     1444                goto end;
     1445        }
     1446
     1447
     1448        /** @sketch
     1449         * pszPath is now set to the pathlist to be searched.
     1450         * So we'll loop thru all the paths in the list.
     1451         */
     1452        while (pszPath != NULL && *pszPath != '\0')
     1453        {
     1454            HDIR    hDir;               /* Find handle used when calling FindFirst. */
     1455            ULONG   culFiles;           /* Number of files to find / found. */
     1456            char *  pszNext;            /* Pointer to the next pathlist path */
     1457            int     cch;                /* Length of path (including the slash after the slash is added). */
     1458
     1459            /** @sketch
     1460             * Find the end of the path.
     1461             * Copy the path into the plv->sz buffer.
     1462             * Set pszNext.
     1463             */
     1464            pszNext = strchr(pszPath, ';');
     1465            if (pszNext != NULL)
     1466            {
     1467                cch = pszNext - pszPath;
     1468                pszNext++;
     1469            }
     1470            else
     1471                cch = strlen(pszPath);
     1472
     1473            if (cch + cchFileName + 1 >= sizeof(plv->sz)) /* assertion */
     1474            {
     1475                dassert(cch + cchFileName + 1 < sizeof(plv->sz), ("KERNEL32:Win32ImageBase::findDll(%s, 0x%08x, %d): "
     1476                        "cch (%d) + cchFileName (%d) + 1 < sizeof(plv->sz) (%d) - paths too long!, iPath=%d",
     1477                        pszFileName, pszFullName, cchFullName, cch, cchFileName, sizeof(plv->sz), iPath));
     1478                pszPath = pszNext;
     1479                continue;
     1480            }
     1481            memcpy(plv->sz, pszPath, cch); //arg! Someone made strncpy not work as supposed!
     1482
     1483
     1484            /** @sketch
     1485             * Add a '\\' and the filename (pszFullname) to the path;
     1486             * then we'll have a fullpath.
     1487             */
     1488            plv->sz[cch++] = '\\';
     1489            strcpy(&plv->sz[cch], pszFullName);
     1490
     1491
     1492            /** @sketch
     1493             *  Use DosFindFirst to check if the file exists.
     1494             *  IF the file exists THEN
     1495             *      Query Fullpath using OS/2 API.
     1496             *      IF unsuccessful THEN return relative name.
     1497             *          Check that the fullname buffer is large enough.
     1498             *          Copy the filename found to the fullname buffer.
     1499             *      ENDIF
     1500             *      IF successful THEN uppercase the fullname buffer.
     1501             *      goto end
     1502             *  ENDIF
     1503             */
     1504            hDir = HDIR_CREATE;
     1505            culFiles = 1;
     1506            rc = DosFindFirst(plv->sz, &hDir, FILE_NORMAL,
     1507                              &plv->findbuf3, sizeof(plv->findbuf3),
     1508                              &culFiles, FIL_STANDARD);
     1509            DosFindClose(hDir);
     1510            if (culFiles >= 1 && rc == NO_ERROR)
     1511            {
     1512                /* Return full path - we'll currently return a relative path. */
     1513                rc = DosQueryPathInfo(plv->sz, FIL_QUERYFULLNAME, pszFullName, cchFullName);
     1514                fRet = rc == NO_ERROR;
     1515                if (!fRet)
     1516                {
     1517                    /* Return a relative path - probably better that failing... */
     1518                    dassert(rc == NO_ERROR, ("KERNEL32:Win32ImageBase::findDll(%s, 0x%08x, %d): "
     1519                            "rc = %d",
     1520                            pszFileName, pszFullName, cchFullName, rc));
     1521
     1522                    if (cch + cchFileName + 1 <= cchFullName)
     1523                    {
     1524                        strcpy(pszFullName, plv->sz);
     1525                        strcpy(pszFullName + cch, plv->findbuf3.achName);
     1526                        fRet = TRUE;
     1527                    }
     1528                    else
     1529                    {
     1530                        dassert(cch + cchFileName + 1 > cchFullName, ("KERNEL32:Win32ImageBase::findDll(%s, 0x%08x, %d): "
     1531                                "cch (%d) + cchFileName (%d) + 1 < cchFullName (%d); %s",
     1532                                pszFileName, pszFullName, cchFullName, cch, cchFileName, cchFullName, plv->sz));
     1533                    }
     1534                }
     1535                if (fRet) strupr(pszFullName);
     1536                goto end;
     1537            }
     1538
     1539            pszPath = pszNext;
     1540        }
     1541    } /* for iPath */
     1542
     1543
     1544end:
     1545    /*
     1546     * Cleanup: free local variables.
     1547     */
     1548    free(plv);
     1549    return fRet;
     1550
     1551
     1552
     1553
     1554
     1555    return ldrOpenPath(pachModname, cchModname, pLdrLv, pfl);
     1556    #else
     1557    NOREF(pachModname);
     1558    NOREF(cchModname);
     1559    NOREF(pLdrLv);
     1560    NOREF(pfl);
     1561    return ERROR_NOT_SUPPORTED;
     1562    #endif
     1563}
     1564
     1565
     1566
     1567
    12831568#ifndef RING0
    12841569/**
     
    14111696}
    14121697#endif
     1698
     1699
     1700/**
     1701 * Is this module an executable?
     1702 * @returns   TRUE if executable.
     1703 *            FALSE if not an executable.
     1704 * @sketch
     1705 * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     1706 */
     1707BOOL    Pe2Lx::isExe()
     1708{
     1709    return ((this->LXHdr.e32_mflags & E32MODMASK) == E32MODEXE);
     1710}
     1711
     1712
     1713/**
     1714 * Is this module an dynamic link library.
     1715 * @returns   TRUE if dynamic link library.
     1716 *            FALSE if not a dynamic link library.
     1717 * @sketch
     1718 * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     1719 */
     1720BOOL    Pe2Lx::isDll()
     1721{
     1722    return ((this->LXHdr.e32_mflags & E32MODMASK) == E32MODDLL);
     1723}
    14131724
    14141725
  • branches/GRACE/src/win32k/win32k.def

    r2838 r3834  
    1515    DATA16_CONST    class 'FAR_DATA'
    1616    CODE16          class 'CODE'
     17    _IOSEG          class 'IOSEG_CODE'
    1718    CODE32          class 'CODE'
    1819    DATA32          class 'DATA'
Note: See TracChangeset for help on using the changeset viewer.