Index: trunk/src/win32k/Makefile
===================================================================
--- trunk/src/win32k/Makefile	(revision 2895)
+++ trunk/src/win32k/Makefile	(revision 2898)
@@ -1,4 +1,4 @@
 ################################################################################
-# $Id: Makefile,v 1.27 2000-02-23 09:02:19 bird Exp $
+# $Id: Makefile,v 1.28 2000-02-25 18:15:01 bird Exp $
 #
 # Copyright 1998-1999 knut st. osmundsen
@@ -34,5 +34,5 @@
 LFLAGS      = /nologo /MAP /NOI /NOE /NOD /A:16 /MAP /O:$@
 CDEFINES    = -DWIN32K -DRING0 -D__WIN32OS2__ -D__WINE__
-CDEFINES16  =
+CDEFINES16  = -DRING0
 ADEFINES    = -D:WIN32K
 
@@ -56,5 +56,5 @@
 CFLAGS16    = $(CFLAGS16)   -Zi -Od
 CPPFLAGS    = $(CPPFLAGS)   -O- -Ti+
-LFLAGS      = $(LFLAGS)     /NOEXEPACK /DEBUG /NODEBUG
+LFLAGS      = $(LFLAGS)     /NOEXEPACK /DEBUG  /NODEB
 ASFLAGS     = $(ASFLAGS)    -Od+
 CDEFINES    = $(CDEFINES)   -DDEBUG
@@ -64,5 +64,8 @@
 
 !ifdef NODEBUGINFO
-LFLAGS      = $(LFLAGS)     /NODEB
+LFLAGS      = $(LFLAGS)     /NODEB /EXEPACK:2 /PACKD /PACKC
+CFLAGS16    = $(CFLAGS16)   -Owis
+CFLAGS      = $(CFLAGS)     -O+ -Oi-
+CPPFLAGS    = $(CPPFLAGS)   -O+ -Oi-
 !endif
 
@@ -95,52 +98,52 @@
 .SUFFIXES: .obj .cpp .c .asm
 
-{dev16}.c{object}.obj:
+{dev16}.c{$(WIN32KOBJ)}.obj:
     @$(ECHO) compiling 16bit: $<
     @$(CC16) $(CFLAGS16) $(CDEFINES16) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES16) $<
 
-{dev32}.asm{object}.obj:
+{dev32}.asm{$(WIN32KOBJ)}.obj:
     @$(ECHO) assembling:      $<
     @$(AS) $(ASFLAGS) $(ADEFINES) $(AINCLUDES) $< -Fo:$@ -Fl:$(WIN32KLIST)\$(*B).lst
-{dev32}.c{object}.obj:
-    @$(ECHO) compiling 32bit: $<
-    @$(CC) -c $(CFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $<
-{dev32}.cpp{object}.obj:
-    @$(ECHO) compiling 32bit: $<
-    @$(CC) -c $(CPPFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $<
-
-{k32}.asm{object}.obj:
+{dev32}.c{$(WIN32KOBJ)}.obj:
+    @$(ECHO) compiling 32bit: $<
+    @$(CC) -c $(CFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $<
+{dev32}.cpp{$(WIN32KOBJ)}.obj:
+    @$(ECHO) compiling 32bit: $<
+    @$(CC) -c $(CPPFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $<
+
+{k32}.asm{$(WIN32KOBJ)}.obj:
     @$(ECHO) assembling:      $<
     @$(AS) $(ASFLAGS) $(ADEFINES) $(AINCLUDES) $< -Fo:$@ -Fl:$(WIN32KLIST)\$(*B).lst
-{k32}.c{object}.obj:
-    @$(ECHO) compiling 32bit: $<
-    @$(CC) -c $(CFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $<
-{k32}.cpp{object}.obj:
-    @$(ECHO) compiling 32bit: $<
-    @$(CC) -c $(CPPFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $<
-
-{ldr}.asm{object}.obj:
+{k32}.c{$(WIN32KOBJ)}.obj:
+    @$(ECHO) compiling 32bit: $<
+    @$(CC) -c $(CFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $<
+{k32}.cpp{$(WIN32KOBJ)}.obj:
+    @$(ECHO) compiling 32bit: $<
+    @$(CC) -c $(CPPFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $<
+
+{ldr}.asm{$(WIN32KOBJ)}.obj:
     @$(ECHO) assembling:      $<
     @$(AS) $(ASFLAGS) $(ADEFINES) $(AINCLUDES) $< -Fo:$@ -Fl:$(WIN32KLIST)\$(*B).lst
-{ldr}.c{object}.obj:
-    @$(ECHO) compiling 32bit: $<
-    @$(CC) -c $(CFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $<
-{ldr}.cpp{object}.obj:
-    @$(ECHO) compiling 32bit: $<
-    @$(CC) -c $(CPPFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $<
-
-{misc}.asm{object}.obj:
+{ldr}.c{$(WIN32KOBJ)}.obj:
+    @$(ECHO) compiling 32bit: $<
+    @$(CC) -c $(CFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $<
+{ldr}.cpp{$(WIN32KOBJ)}.obj:
+    @$(ECHO) compiling 32bit: $<
+    @$(CC) -c $(CPPFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $<
+
+{misc}.asm{$(WIN32KOBJ)}.obj:
     @$(ECHO) assembling:      $<
     $(AS) $(ASFLAGS) $(ADEFINES) $(AINCLUDES) $< -Fo:$@ -Fl:$(WIN32KLIST)\$(*B).lst
-{misc}.c{object}.obj:
-    @$(ECHO) compiling 32bit: $<
-    @$(CC) -c $(CFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $<
-{misc}.cpp{object}.obj:
-    @$(ECHO) compiling 32bit: $<
-    @$(CC) -c $(CPPFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $<
-
-{pe2lx}.c{object}.obj 32bit:
+{misc}.c{$(WIN32KOBJ)}.obj:
+    @$(ECHO) compiling 32bit: $<
+    @$(CC) -c $(CFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $<
+{misc}.cpp{$(WIN32KOBJ)}.obj:
+    @$(ECHO) compiling 32bit: $<
+    @$(CC) -c $(CPPFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $<
+
+{pe2lx}.c{$(WIN32KOBJ)}.obj 32bit:
     @$(ECHO) compiling: $<
     @$(CC) -c $(CFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $<
-{pe2lx}.cpp{object}.obj:
+{pe2lx}.cpp{$(WIN32KOBJ)}.obj:
     @$(ECHO) compiling 32bit: $<
     @$(CC) -c $(CPPFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $<
@@ -159,38 +162,41 @@
 # OBJECTS and LIBRARIES - Don't mess with the order or objects and libraries!
 ################################################################################
-OBJS  = object\devfirst.obj \
-        object\d16strat.obj \
-        object\d32hlp.obj \
-        object\d32globals.obj \
-        object\asmutils.obj \
-        object\calltab.obj \
-        object\malloc.obj \
-        object\smalloc_avl.obj \
-        object\avl.obj \
-        object\rmalloc_avl.obj \
-        object\new.obj \
-        object\stricmp.obj \
-        object\yield.obj \
-        object\vsprintf.obj \
-        object\vprintf.obj \
-        object\ldr.obj \
-        object\myldrClose.obj \
-        object\myldrOpen.obj \
-        object\myldrRead.obj \
-        object\myLDRQAppType.obj \
-        object\myldrEnum32bitRelRecs.obj \
-        object\pe2lx.obj \
-        object\ModuleBase.obj \
-        object\d32ElfIOCtl.obj \
-        object\d32Win32kIOCtl.obj \
-        object\k32AllocMemEx.obj \
-        object\buffer.obj \
-        object\mytkExecPgm.obj
+OBJS  = $(WIN32KOBJ)\devfirst.obj \
+        $(WIN32KOBJ)\d16strat.obj \
+        $(WIN32KOBJ)\d32hlp.obj \
+        $(WIN32KOBJ)\d32globals.obj \
+        $(WIN32KOBJ)\d16globl.obj \
+        $(WIN32KOBJ)\asmutils.obj \
+        $(WIN32KOBJ)\calltab.obj \
+        $(WIN32KOBJ)\malloc.obj \
+        $(WIN32KOBJ)\smalloc_avl.obj \
+        $(WIN32KOBJ)\avl.obj \
+        $(WIN32KOBJ)\rmalloc_avl.obj \
+        $(WIN32KOBJ)\new.obj \
+        $(WIN32KOBJ)\stricmp.obj \
+        $(WIN32KOBJ)\yield.obj \
+        $(WIN32KOBJ)\vsprintf.obj \
+        $(WIN32KOBJ)\vprintf.obj \
+        $(WIN32KOBJ)\ldr.obj \
+        $(WIN32KOBJ)\myldrClose.obj \
+        $(WIN32KOBJ)\myldrOpen.obj \
+        $(WIN32KOBJ)\myldrRead.obj \
+        $(WIN32KOBJ)\myLDRQAppType.obj \
+        $(WIN32KOBJ)\myldrEnum32bitRelRecs.obj \
+        $(WIN32KOBJ)\pe2lx.obj \
+        $(WIN32KOBJ)\ModuleBase.obj \
+        $(WIN32KOBJ)\d32ElfIOCtl.obj \
+        $(WIN32KOBJ)\d32Win32kIOCtl.obj \
+        $(WIN32KOBJ)\k32AllocMemEx.obj \
+        $(WIN32KOBJ)\buffer.obj \
+        $(WIN32KOBJ)\mytkExecPgm.obj
 
 
 OBJSINIT = \
-        object\d16init.obj \
-        object\d32init.obj \
-        object\probkrnl.obj
+        $(WIN32KOBJ)\d16init.obj \
+        $(WIN32KOBJ)\d32init.obj \
+        $(WIN32KOBJ)\ProbKrnl.obj \
+        $(WIN32KOBJ)\SymDB.obj \
+        $(WIN32KOBJ)\vprntf16.obj
 
 LIBS = \
@@ -210,10 +216,36 @@
 # SPECIAL RULES - Testing
 ################################################################################
-ProbKrnl.exe: dev16\ProbKrnl.c $(WIN32KBASE)\include\sym.h \
+ProbKrnl.exe: dev16\ProbKrnl.c dev16\symdb.c dev16\vprntf16.c \
+              $(WIN32KBASE)\include\sym.h \
               $(WIN32KBASE)\include\probKrnl.h
+    $(CC16) -c -W4 -Asfw -G2s -Zp -Zl -nologo -Fa -Zi -Od -Lp \
+        -DDEBUG -DDEBUGR3 -Fa$(WIN32KLIST)\$(*B).s     \
+        -Fo$(WIN32KOBJ)\probkrnl_p.obj $(CINCLUDES16) dev16\probkrnl.c
+    $(CC16) -c -W4 -Asfw -G2s -Zp -Zl -nologo -Fa -Zi -Od -Lp \
+        -DDEBUG -DDEBUGR3 -Fa$(WIN32KLIST)\$(*B).s     \
+        -Fo$(WIN32KOBJ)\symdb_p.obj $(CINCLUDES16) dev16\symdb.c
+    $(CC16) -c -W4 -Asfw -G2s -Zp -Zl -nologo -Fa -Zi -Od -Lp \
+        -DDEBUG -DDEBUGR3 -Fa$(WIN32KLIST)\$(*B).s     \
+        -Fo$(WIN32KOBJ)\vprntf16_p.obj $(CINCLUDES16) dev16\vprntf16.c
+    link /NOD /MAP:FULL /CO /pmtype:vio \
+        $(WIN32KOBJ)\probkrnl_p.obj + $(WIN32KOBJ)\symdb_p.obj + $(WIN32KOBJ)\vprntf16_p.obj, \
+        probkrnl.exe, probkrnl.map, $(TOOLKIT)\lib\os2286.lib + $(MSCPATH)\lib\clibcep.lib;
+
+extract.exe: dev16\ProbKrnl.c dev16\vprntf16.c \
+             $(WIN32KBASE)\include\sym.h \
+             $(WIN32KBASE)\include\probKrnl.h
     $(CC16) -c -W4 -Asfw -G2s -Zp -Zl -nologo -Fo$@ -Fa -Zi -Od -Lp \
-        $(CDEFINES16) -DDEBUGR3 -Fa$(WIN32KLIST)\$(*B).s     \
-        -Foprobkrnl.obj $(CINCLUDES16) dev16\probkrnl.c
-    link /NOD /MAP:FULL /CO /pmtype:vio probkrnl.obj, probkrnl.exe, probkrnl.map, $(TOOLKIT)\lib\os2286.lib + $(MSCPATH)\lib\clibcep.lib;
+        -DDEBUG -DEXTRACT -Fa$(WIN32KLIST)\$(*B).s     \
+        -Fo$(WIN32KOBJ)\probkrnl_e.obj $(CINCLUDES16) dev16\probkrnl.c
+    $(CC16) -c -W4 -Asfw -G2s -Zp -Zl -nologo -Fo$@ -Fa -Zi -Od -Lp \
+        -DDEBUG -DEXTRACT -Fa$(WIN32KLIST)\$(*B).s     \
+        -Fo$(WIN32KOBJ)\vprntf16_e.obj $(CINCLUDES16) dev16\vprntf16.c
+    link /NOD /MAP:FULL /CO /pmtype:vio \
+        $(WIN32KOBJ)\probkrnl_e.obj + $(WIN32KOBJ)\vprntf16_e.obj, \
+        $@, $(*B).map, $(TOOLKIT)\lib\os2286.lib + $(MSCPATH)\lib\clibcep.lib;
+
+d32init.exe: dev32\d32init.c
+    icc -Ss /Gr+ $(CINCLUDES) -DRING3 -DDEBUGR3 -DDEBUG \
+        -Fo$(WIN32KOBJ)\$(*B).r3obj -Fe$@ dev32\$(*B).c
 
 
@@ -222,8 +254,8 @@
 # Win32k.sys rule. Don't mess with the order or objects and libraries!
 ################################################################################
-$(NAME).sys: $(OBJS) $(LIBS) last.lib $(OBJSINIT) $(LIBSINIT) $(NAME).def
+$(NAME).sys: $(OBJS) $(LIBS) last.lib init.lib $(LIBSINIT) $(NAME).def
     -@$(ECHO) linking: $@
     $(LD) $(LFLAGS) @<<
-$(OBJS) $(LIBS) last.lib $(OBJSINIT) /IG $(LIBSINIT) $(NAME).def
+$(OBJS) $(LIBS) last.lib init.lib /IG $(LIBSINIT) $(NAME).def
 <<
     @mapsym $*.map > nul
@@ -247,10 +279,14 @@
     $(ILIB) /nologo /nobackup /convformat $@;
 
-last.lib: object\devlast.obj
-    -@del $@ > nul 2> nul
+last.lib: $(WIN32KOBJ)\devlast.obj
+    -@$(RM) $@ > nul 2> nul
     $(ILIB) /nologo /nobackup $@ $**;
 
+init.lib: $(OBJSINIT)
+    -@$(RM) $@ > nul 2> nul
+    $(ILIB) /nologo /nobackup $@ $**;
+
 libconv.exe: libconv.c
-    icc -Q+ libconv.c
+    icc -Q+ -Fe$@ -Fo$(WIN32KOBJ)\$(*B).obj libconv.c
 
 
@@ -291,16 +327,16 @@
 ################################################################################
 dep:
-    $(PDWIN32_TOOLS)\fastdep -oObject $(CINCLUDES) misc\*.c* ldr\*.c* dev32\*.c* \
+    $(PDWIN32_TOOLS)\fastdep -o$(WIN32KOBJ) $(CINCLUDES) misc\*.c* ldr\*.c* dev32\*.c* \
         dev16\*.c* pe2lx\*.c* k32\*.c* lib\*.c include\*.h
-    $(PDWIN32_TOOLS)\fastdep -a+ -oObject $(CINCLUDES16) dev16\*.c*
-
-
-object\asmutils.obj:            misc\asmutils.asm     include\devsegdf.inc
-object\buffer.obj:              misc\buffer.asm       include\devsegdf.inc
-object\calltab.obj:             ldr\calltab.asm       include\devsegdf.inc
-object\mytkExecPgm.obj:         ldr\mytkExecPgm.asm   include\devsegdf.inc
-object\d32hlp.obj:              dev32\d32hlp.asm      include\devsegdf.inc
-object\devfirst.obj:            dev32\devfirst.asm    include\devsegdf.inc
-object\devlast.obj:             dev32\devlast.asm     include\devsegdf.inc
+    $(PDWIN32_TOOLS)\fastdep -a+ -o$(WIN32KOBJ) $(CINCLUDES16) dev16\*.c*
+
+
+$(WIN32KOBJ)\asmutils.obj:      misc\asmutils.asm     include\devsegdf.inc
+$(WIN32KOBJ)\buffer.obj:        misc\buffer.asm       include\devsegdf.inc
+$(WIN32KOBJ)\calltab.obj:       ldr\calltab.asm       include\devsegdf.inc
+$(WIN32KOBJ)\mytkExecPgm.obj:   ldr\mytkExecPgm.asm   include\devsegdf.inc
+$(WIN32KOBJ)\d32hlp.obj:        dev32\d32hlp.asm      include\devsegdf.inc
+$(WIN32KOBJ)\devfirst.obj:      dev32\devfirst.asm    include\devsegdf.inc
+$(WIN32KOBJ)\devlast.obj:       dev32\devlast.asm     include\devsegdf.inc
 
 !ifndef NODEP
Index: trunk/src/win32k/dev16/SymDB.c
===================================================================
--- trunk/src/win32k/dev16/SymDB.c	(revision 2898)
+++ trunk/src/win32k/dev16/SymDB.c	(revision 2898)
@@ -0,0 +1,742 @@
+/* $Id: SymDB.c,v 1.1 2000-02-25 18:15:01 bird Exp $
+*
+* Autogenerated kernel symbol database.
+*
+* Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
+*
+* Project Odin Software License can be found in LICENSE.TXT
+*
+*/
+
+#include <os2.h>
+#include "probkrnl.h"
+
+KRNLDBENTRY aKrnlSymDB[] =
+{
+    { /* 14039RS.SYM */
+        14039, 'R', TRUE, 15,
+        {
+            {14, 0x00008390}, /* _ldrRead */
+            {14, 0x00061530}, /* _ldrOpen */
+            {14, 0x000628d0}, /* _ldrClose */
+            {14, 0x000629b5}, /* _LDRQAppType */
+            {14, 0x0005eae0}, /* _ldrEnum32bitRelRecs */
+            {14, 0x00005268}, /* _IOSftOpen */
+            {14, 0x00005b61}, /* _IOSftClose */
+            {14, 0x00005c5c}, /* _IOSftTransPath */
+            {14, 0x00005740}, /* _IOSftReadAt */
+            {14, 0x00005747}, /* _IOSftWriteAt */
+            {14, 0x00005d86}, /* _SftFileSize */
+            {14, 0x0005cec0}, /* _VMAllocMem */
+            {14, 0x0004ce4b}, /* _VMGetOwner */
+            {14, 0x0006ca7e}, /* g_tkExecPgm */
+            {11, 0x00009e10}, /* f_FuStrLenZ */
+            {11, 0x00009d90}, /* f_FuStrLen */
+            {11, 0x00009fb9}, /* f_FuBuff */
+        }
+    },
+    { /* 14039RU.SYM */
+        14039, 'R', FALSE, 14,
+        {
+            {13, 0x000070e4}, /* _ldrRead */
+            {13, 0x000577d0}, /* _ldrOpen */
+            {13, 0x00058aa0}, /* _ldrClose */
+            {13, 0x00058b85}, /* _LDRQAppType */
+            {13, 0x00055060}, /* _ldrEnum32bitRelRecs */
+            {13, 0x00004598}, /* _IOSftOpen */
+            {13, 0x00004df4}, /* _IOSftClose */
+            {13, 0x00004ecd}, /* _IOSftTransPath */
+            {13, 0x00004a2c}, /* _IOSftReadAt */
+            {13, 0x00004a33}, /* _IOSftWriteAt */
+            {13, 0x00004fe6}, /* _SftFileSize */
+            {13, 0x00053620}, /* _VMAllocMem */
+            {13, 0x00042dcb}, /* _VMGetOwner */
+            {13, 0x00061dde}, /* g_tkExecPgm */
+            { 9, 0x0000e640}, /* f_FuStrLenZ */
+            { 9, 0x0000e5f6}, /* f_FuStrLen */
+            { 9, 0x0000e738}, /* f_FuBuff */
+        }
+    },
+    { /* 8255RS.SYM */
+        8255, 'R', TRUE, 15,
+        {
+            {14, 0x0000b434}, /* _ldrRead */
+            {14, 0x00045838}, /* _ldrOpen */
+            {14, 0x00046234}, /* _ldrClose */
+            {14, 0x00046284}, /* _LDRQAppType */
+            {14, 0x00043d70}, /* _ldrEnum32bitRelRecs */
+            {14, 0x000049d4}, /* _IOSftOpen */
+            {14, 0x00004f52}, /* _IOSftClose */
+            {14, 0x00005009}, /* _IOSftTransPath */
+            {14, 0x00004c9a}, /* _IOSftReadAt */
+            {14, 0x00004e63}, /* _IOSftWriteAt */
+            {14, 0x00005133}, /* _SftFileSize */
+            {14, 0x00041964}, /* _VMAllocMem */
+            {14, 0x00026624}, /* _VMGetOwner */
+            {14, 0x0004f84e}, /* g_tkExecPgm */
+            {11, 0x0000a168}, /* f_FuStrLenZ */
+            {11, 0x0000a0e8}, /* f_FuStrLen */
+            {11, 0x0000a311}, /* f_FuBuff */
+        }
+    },
+    { /* 8255RU.SYM */
+        8255, 'R', FALSE, 13,
+        {
+            {12, 0x0000932c}, /* _ldrRead */
+            {12, 0x0003a00c}, /* _ldrOpen */
+            {12, 0x0003a890}, /* _ldrClose */
+            {12, 0x0003a8e0}, /* _LDRQAppType */
+            {12, 0x0003822c}, /* _ldrEnum32bitRelRecs */
+            {12, 0x000034a0}, /* _IOSftOpen */
+            {12, 0x0000390c}, /* _IOSftClose */
+            {12, 0x000039a1}, /* _IOSftTransPath */
+            {12, 0x0000375a}, /* _IOSftReadAt */
+            {12, 0x00003761}, /* _IOSftWriteAt */
+            {12, 0x00003aba}, /* _SftFileSize */
+            {12, 0x00036588}, /* _VMAllocMem */
+            {12, 0x0001ccde}, /* _VMGetOwner */
+            {12, 0x0004265e}, /* g_tkExecPgm */
+            { 9, 0x0000e124}, /* f_FuStrLenZ */
+            { 9, 0x0000e0da}, /* f_FuStrLen */
+            { 9, 0x0000e218}, /* f_FuBuff */
+        }
+    },
+    { /* 8256RS.SYM */
+        8256, 'R', TRUE, 15,
+        {
+            {14, 0x0000b434}, /* _ldrRead */
+            {14, 0x00045a50}, /* _ldrOpen */
+            {14, 0x0004644c}, /* _ldrClose */
+            {14, 0x0004649c}, /* _LDRQAppType */
+            {14, 0x00043f84}, /* _ldrEnum32bitRelRecs */
+            {14, 0x000049d4}, /* _IOSftOpen */
+            {14, 0x00004f52}, /* _IOSftClose */
+            {14, 0x00005009}, /* _IOSftTransPath */
+            {14, 0x00004c9a}, /* _IOSftReadAt */
+            {14, 0x00004e63}, /* _IOSftWriteAt */
+            {14, 0x00005133}, /* _SftFileSize */
+            {14, 0x00041b78}, /* _VMAllocMem */
+            {14, 0x00026800}, /* _VMGetOwner */
+            {14, 0x0004fb4a}, /* g_tkExecPgm */
+            {11, 0x0000a168}, /* f_FuStrLenZ */
+            {11, 0x0000a0e8}, /* f_FuStrLen */
+            {11, 0x0000a311}, /* f_FuBuff */
+        }
+    },
+    { /* 8256RU.SYM */
+        8256, 'R', FALSE, 13,
+        {
+            {12, 0x0000932c}, /* _ldrRead */
+            {12, 0x00039ff8}, /* _ldrOpen */
+            {12, 0x0003a87c}, /* _ldrClose */
+            {12, 0x0003a8cc}, /* _LDRQAppType */
+            {12, 0x00038218}, /* _ldrEnum32bitRelRecs */
+            {12, 0x000034a0}, /* _IOSftOpen */
+            {12, 0x0000390c}, /* _IOSftClose */
+            {12, 0x000039a1}, /* _IOSftTransPath */
+            {12, 0x0000375a}, /* _IOSftReadAt */
+            {12, 0x00003761}, /* _IOSftWriteAt */
+            {12, 0x00003aba}, /* _SftFileSize */
+            {12, 0x00036574}, /* _VMAllocMem */
+            {12, 0x0001ccde}, /* _VMGetOwner */
+            {12, 0x00042632}, /* g_tkExecPgm */
+            { 9, 0x0000e124}, /* f_FuStrLenZ */
+            { 9, 0x0000e0da}, /* f_FuStrLen */
+            { 9, 0x0000e218}, /* f_FuBuff */
+        }
+    },
+    { /* 8257RS.SYM */
+        8257, 'R', TRUE, 15,
+        {
+            {14, 0x0000b434}, /* _ldrRead */
+            {14, 0x000459a0}, /* _ldrOpen */
+            {14, 0x00046398}, /* _ldrClose */
+            {14, 0x000463e8}, /* _LDRQAppType */
+            {14, 0x00043ed4}, /* _ldrEnum32bitRelRecs */
+            {14, 0x000049d4}, /* _IOSftOpen */
+            {14, 0x00004f52}, /* _IOSftClose */
+            {14, 0x00005009}, /* _IOSftTransPath */
+            {14, 0x00004c9a}, /* _IOSftReadAt */
+            {14, 0x00004e63}, /* _IOSftWriteAt */
+            {14, 0x00005133}, /* _SftFileSize */
+            {14, 0x00041ac4}, /* _VMAllocMem */
+            {14, 0x000266f8}, /* _VMGetOwner */
+            {14, 0x0004fa96}, /* g_tkExecPgm */
+            {11, 0x0000a168}, /* f_FuStrLenZ */
+            {11, 0x0000a0e8}, /* f_FuStrLen */
+            {11, 0x0000a311}, /* f_FuBuff */
+        }
+    },
+    { /* 8257RU.SYM */
+        8257, 'R', FALSE, 13,
+        {
+            {12, 0x0000932c}, /* _ldrRead */
+            {12, 0x00039ff0}, /* _ldrOpen */
+            {12, 0x0003a874}, /* _ldrClose */
+            {12, 0x0003a8c4}, /* _LDRQAppType */
+            {12, 0x00038210}, /* _ldrEnum32bitRelRecs */
+            {12, 0x000034a0}, /* _IOSftOpen */
+            {12, 0x0000390c}, /* _IOSftClose */
+            {12, 0x000039a1}, /* _IOSftTransPath */
+            {12, 0x0000375a}, /* _IOSftReadAt */
+            {12, 0x00003761}, /* _IOSftWriteAt */
+            {12, 0x00003aba}, /* _SftFileSize */
+            {12, 0x00036564}, /* _VMAllocMem */
+            {12, 0x0001ccd6}, /* _VMGetOwner */
+            {12, 0x0004263e}, /* g_tkExecPgm */
+            { 9, 0x0000e124}, /* f_FuStrLenZ */
+            { 9, 0x0000e0da}, /* f_FuStrLen */
+            { 9, 0x0000e218}, /* f_FuBuff */
+        }
+    },
+    { /* 8258RS.SYM */
+        8258, 'R', TRUE, 15,
+        {
+            {14, 0x0000bdd0}, /* _ldrRead */
+            {14, 0x000464bc}, /* _ldrOpen */
+            {14, 0x00046eb8}, /* _ldrClose */
+            {14, 0x00046f08}, /* _LDRQAppType */
+            {14, 0x000449b4}, /* _ldrEnum32bitRelRecs */
+            {14, 0x0000526c}, /* _IOSftOpen */
+            {14, 0x000057ea}, /* _IOSftClose */
+            {14, 0x000058a1}, /* _IOSftTransPath */
+            {14, 0x00005532}, /* _IOSftReadAt */
+            {14, 0x000056fb}, /* _IOSftWriteAt */
+            {14, 0x000059cb}, /* _SftFileSize */
+            {14, 0x000425a4}, /* _VMAllocMem */
+            {14, 0x000271aa}, /* _VMGetOwner */
+            {14, 0x0005065e}, /* g_tkExecPgm */
+            {11, 0x00009fdc}, /* f_FuStrLenZ */
+            {11, 0x00009f5c}, /* f_FuStrLen */
+            {11, 0x0000a185}, /* f_FuBuff */
+        }
+    },
+    { /* 8258RU.SYM */
+        8258, 'R', FALSE, 14,
+        {
+            {13, 0x000091a4}, /* _ldrRead */
+            {13, 0x0003a580}, /* _ldrOpen */
+            {13, 0x0003ae08}, /* _ldrClose */
+            {13, 0x0003ae58}, /* _LDRQAppType */
+            {13, 0x0003877c}, /* _ldrEnum32bitRelRecs */
+            {13, 0x000039a4}, /* _IOSftOpen */
+            {13, 0x00003e10}, /* _IOSftClose */
+            {13, 0x00003ea5}, /* _IOSftTransPath */
+            {13, 0x00003c5e}, /* _IOSftReadAt */
+            {13, 0x00003c65}, /* _IOSftWriteAt */
+            {13, 0x00003fbe}, /* _SftFileSize */
+            {13, 0x00036a48}, /* _VMAllocMem */
+            {13, 0x0001d16a}, /* _VMGetOwner */
+            {13, 0x00042d56}, /* g_tkExecPgm */
+            { 9, 0x0000d794}, /* f_FuStrLenZ */
+            { 9, 0x0000d74a}, /* f_FuStrLen */
+            { 9, 0x0000d888}, /* f_FuBuff */
+        }
+    },
+    { /* 8259RS.SYM */
+        8259, 'R', TRUE, 15,
+        {
+            {14, 0x0000bdd0}, /* _ldrRead */
+            {14, 0x000465c0}, /* _ldrOpen */
+            {14, 0x00046fbc}, /* _ldrClose */
+            {14, 0x0004700c}, /* _LDRQAppType */
+            {14, 0x00044ab8}, /* _ldrEnum32bitRelRecs */
+            {14, 0x0000526c}, /* _IOSftOpen */
+            {14, 0x000057ea}, /* _IOSftClose */
+            {14, 0x000058a1}, /* _IOSftTransPath */
+            {14, 0x00005532}, /* _IOSftReadAt */
+            {14, 0x000056fb}, /* _IOSftWriteAt */
+            {14, 0x000059cb}, /* _SftFileSize */
+            {14, 0x000426a8}, /* _VMAllocMem */
+            {14, 0x000272ae}, /* _VMGetOwner */
+            {14, 0x00050812}, /* g_tkExecPgm */
+            {11, 0x00009fdc}, /* f_FuStrLenZ */
+            {11, 0x00009f5c}, /* f_FuStrLen */
+            {11, 0x0000a185}, /* f_FuBuff */
+        }
+    },
+    { /* 8259RU.SYM */
+        8259, 'R', FALSE, 14,
+        {
+            {13, 0x00009234}, /* _ldrRead */
+            {13, 0x0003a608}, /* _ldrOpen */
+            {13, 0x0003ae90}, /* _ldrClose */
+            {13, 0x0003aee0}, /* _LDRQAppType */
+            {13, 0x00038804}, /* _ldrEnum32bitRelRecs */
+            {13, 0x000039a4}, /* _IOSftOpen */
+            {13, 0x00003e10}, /* _IOSftClose */
+            {13, 0x00003ea5}, /* _IOSftTransPath */
+            {13, 0x00003c5e}, /* _IOSftReadAt */
+            {13, 0x00003c65}, /* _IOSftWriteAt */
+            {13, 0x00003fbe}, /* _SftFileSize */
+            {13, 0x00036ad0}, /* _VMAllocMem */
+            {13, 0x0001d2de}, /* _VMGetOwner */
+            {13, 0x00042de2}, /* g_tkExecPgm */
+            { 9, 0x0000d7a4}, /* f_FuStrLenZ */
+            { 9, 0x0000d75a}, /* f_FuStrLen */
+            { 9, 0x0000d898}, /* f_FuBuff */
+        }
+    },
+    { /* 8260RS.SYM */
+        8260, 'R', TRUE, 15,
+        {
+            {14, 0x0000bdec}, /* _ldrRead */
+            {14, 0x00046858}, /* _ldrOpen */
+            {14, 0x00047254}, /* _ldrClose */
+            {14, 0x000472a4}, /* _LDRQAppType */
+            {14, 0x00044d50}, /* _ldrEnum32bitRelRecs */
+            {14, 0x00005278}, /* _IOSftOpen */
+            {14, 0x000057f6}, /* _IOSftClose */
+            {14, 0x000058ad}, /* _IOSftTransPath */
+            {14, 0x0000553e}, /* _IOSftReadAt */
+            {14, 0x00005707}, /* _IOSftWriteAt */
+            {14, 0x000059d7}, /* _SftFileSize */
+            {14, 0x00042940}, /* _VMAllocMem */
+            {14, 0x0002743a}, /* _VMGetOwner */
+            {14, 0x00050b4a}, /* g_tkExecPgm */
+            {11, 0x00009f7c}, /* f_FuStrLenZ */
+            {11, 0x00009efc}, /* f_FuStrLen */
+            {11, 0x0000a125}, /* f_FuBuff */
+        }
+    },
+    { /* 8260RU.SYM */
+        8260, 'R', FALSE, 14,
+        {
+            {13, 0x00009244}, /* _ldrRead */
+            {13, 0x0003a618}, /* _ldrOpen */
+            {13, 0x0003aea0}, /* _ldrClose */
+            {13, 0x0003aef0}, /* _LDRQAppType */
+            {13, 0x00038814}, /* _ldrEnum32bitRelRecs */
+            {13, 0x000039a4}, /* _IOSftOpen */
+            {13, 0x00003e10}, /* _IOSftClose */
+            {13, 0x00003ea5}, /* _IOSftTransPath */
+            {13, 0x00003c5e}, /* _IOSftReadAt */
+            {13, 0x00003c65}, /* _IOSftWriteAt */
+            {13, 0x00003fbe}, /* _SftFileSize */
+            {13, 0x00036ae0}, /* _VMAllocMem */
+            {13, 0x0001d2ee}, /* _VMGetOwner */
+            {13, 0x00042e8a}, /* g_tkExecPgm */
+            { 9, 0x0000d7a4}, /* f_FuStrLenZ */
+            { 9, 0x0000d75a}, /* f_FuStrLen */
+            { 9, 0x0000d898}, /* f_FuBuff */
+        }
+    },
+    { /* 8261RS.SYM */
+        8261, 'R', TRUE, 15,
+        {
+            {14, 0x0000c1dc}, /* _ldrRead */
+            {14, 0x0004a46c}, /* _ldrOpen */
+            {14, 0x0004ae94}, /* _ldrClose */
+            {14, 0x0004aee4}, /* _LDRQAppType */
+            {14, 0x0004895c}, /* _ldrEnum32bitRelRecs */
+            {14, 0x000053d8}, /* _IOSftOpen */
+            {14, 0x000058b1}, /* _IOSftClose */
+            {14, 0x00005968}, /* _IOSftTransPath */
+            {14, 0x000056c8}, /* _IOSftReadAt */
+            {14, 0x000056cf}, /* _IOSftWriteAt */
+            {14, 0x00005a92}, /* _SftFileSize */
+            {14, 0x0004654c}, /* _VMAllocMem */
+            {14, 0x00027aa0}, /* _VMGetOwner */
+            {14, 0x000547fe}, /* g_tkExecPgm */
+            {11, 0x0000a158}, /* f_FuStrLenZ */
+            {11, 0x0000a0d8}, /* f_FuStrLen */
+            {11, 0x0000a301}, /* f_FuBuff */
+        }
+    },
+    { /* 8261RU.SYM */
+        8261, 'R', FALSE, 14,
+        {
+            {13, 0x00009294}, /* _ldrRead */
+            {13, 0x0003a83c}, /* _ldrOpen */
+            {13, 0x0003b0c8}, /* _ldrClose */
+            {13, 0x0003b118}, /* _LDRQAppType */
+            {13, 0x00038a24}, /* _ldrEnum32bitRelRecs */
+            {13, 0x000039f0}, /* _IOSftOpen */
+            {13, 0x00003e5c}, /* _IOSftClose */
+            {13, 0x00003ef1}, /* _IOSftTransPath */
+            {13, 0x00003caa}, /* _IOSftReadAt */
+            {13, 0x00003cb1}, /* _IOSftWriteAt */
+            {13, 0x0000400a}, /* _SftFileSize */
+            {13, 0x00036cf0}, /* _VMAllocMem */
+            {13, 0x0001d2ee}, /* _VMGetOwner */
+            {13, 0x0004315a}, /* g_tkExecPgm */
+            { 9, 0x0000d7d0}, /* f_FuStrLenZ */
+            { 9, 0x0000d786}, /* f_FuStrLen */
+            { 9, 0x0000d8c4}, /* f_FuBuff */
+        }
+    },
+    { /* 8262RS.SYM */
+        8262, 'R', TRUE, 15,
+        {
+            {14, 0x0000c1dc}, /* _ldrRead */
+            {14, 0x0004a36c}, /* _ldrOpen */
+            {14, 0x0004ad94}, /* _ldrClose */
+            {14, 0x0004ade4}, /* _LDRQAppType */
+            {14, 0x0004885c}, /* _ldrEnum32bitRelRecs */
+            {14, 0x000053d8}, /* _IOSftOpen */
+            {14, 0x000058b1}, /* _IOSftClose */
+            {14, 0x00005968}, /* _IOSftTransPath */
+            {14, 0x000056c8}, /* _IOSftReadAt */
+            {14, 0x000056cf}, /* _IOSftWriteAt */
+            {14, 0x00005a92}, /* _SftFileSize */
+            {14, 0x0004644c}, /* _VMAllocMem */
+            {14, 0x000279a0}, /* _VMGetOwner */
+            {14, 0x000546fe}, /* g_tkExecPgm */
+            {11, 0x0000a15c}, /* f_FuStrLenZ */
+            {11, 0x0000a0dc}, /* f_FuStrLen */
+            {11, 0x0000a305}, /* f_FuBuff */
+        }
+    },
+    { /* 8262RU.SYM */
+        8262, 'R', FALSE, 14,
+        {
+            {13, 0x00009294}, /* _ldrRead */
+            {13, 0x0003a758}, /* _ldrOpen */
+            {13, 0x0003afe4}, /* _ldrClose */
+            {13, 0x0003b034}, /* _LDRQAppType */
+            {13, 0x00038940}, /* _ldrEnum32bitRelRecs */
+            {13, 0x000039f0}, /* _IOSftOpen */
+            {13, 0x00003e5c}, /* _IOSftClose */
+            {13, 0x00003ef1}, /* _IOSftTransPath */
+            {13, 0x00003caa}, /* _IOSftReadAt */
+            {13, 0x00003cb1}, /* _IOSftWriteAt */
+            {13, 0x0000400a}, /* _SftFileSize */
+            {13, 0x00036c0c}, /* _VMAllocMem */
+            {13, 0x0001d20a}, /* _VMGetOwner */
+            {13, 0x00043076}, /* g_tkExecPgm */
+            { 9, 0x0000d7d4}, /* f_FuStrLenZ */
+            { 9, 0x0000d78a}, /* f_FuStrLen */
+            { 9, 0x0000d8c8}, /* f_FuBuff */
+        }
+    },
+    { /* 8263RS.SYM */
+        8263, 'R', TRUE, 15,
+        {
+            {14, 0x0000c250}, /* _ldrRead */
+            {14, 0x0004a460}, /* _ldrOpen */
+            {14, 0x0004ae88}, /* _ldrClose */
+            {14, 0x0004aed8}, /* _LDRQAppType */
+            {14, 0x00048944}, /* _ldrEnum32bitRelRecs */
+            {14, 0x000053e0}, /* _IOSftOpen */
+            {14, 0x000058b9}, /* _IOSftClose */
+            {14, 0x00005970}, /* _IOSftTransPath */
+            {14, 0x000056d0}, /* _IOSftReadAt */
+            {14, 0x000056d7}, /* _IOSftWriteAt */
+            {14, 0x00005a9a}, /* _SftFileSize */
+            {14, 0x00046534}, /* _VMAllocMem */
+            {14, 0x00027a14}, /* _VMGetOwner */
+            {14, 0x000547a2}, /* g_tkExecPgm */
+            {11, 0x0000a170}, /* f_FuStrLenZ */
+            {11, 0x0000a0f0}, /* f_FuStrLen */
+            {11, 0x0000a319}, /* f_FuBuff */
+        }
+    },
+    { /* 8263RU.SYM */
+        8263, 'R', FALSE, 14,
+        {
+            {13, 0x00009308}, /* _ldrRead */
+            {13, 0x0003a8e0}, /* _ldrOpen */
+            {13, 0x0003b16c}, /* _ldrClose */
+            {13, 0x0003b1bc}, /* _LDRQAppType */
+            {13, 0x00038ac0}, /* _ldrEnum32bitRelRecs */
+            {13, 0x000039f8}, /* _IOSftOpen */
+            {13, 0x00003e64}, /* _IOSftClose */
+            {13, 0x00003ef9}, /* _IOSftTransPath */
+            {13, 0x00003cb2}, /* _IOSftReadAt */
+            {13, 0x00003cb9}, /* _IOSftWriteAt */
+            {13, 0x00004012}, /* _SftFileSize */
+            {13, 0x00036d8c}, /* _VMAllocMem */
+            {13, 0x0001d27e}, /* _VMGetOwner */
+            {13, 0x0004321e}, /* g_tkExecPgm */
+            { 9, 0x0000d7d4}, /* f_FuStrLenZ */
+            { 9, 0x0000d78a}, /* f_FuStrLen */
+            { 9, 0x0000d8c8}, /* f_FuBuff */
+        }
+    },
+    { /* 8264RS.SYM */
+        8264, 'R', TRUE, 15,
+        {
+            {14, 0x0000c250}, /* _ldrRead */
+            {14, 0x0004a524}, /* _ldrOpen */
+            {14, 0x0004af44}, /* _ldrClose */
+            {14, 0x0004af94}, /* _LDRQAppType */
+            {14, 0x00048a1c}, /* _ldrEnum32bitRelRecs */
+            {14, 0x000053e0}, /* _IOSftOpen */
+            {14, 0x000058b9}, /* _IOSftClose */
+            {14, 0x00005970}, /* _IOSftTransPath */
+            {14, 0x000056d0}, /* _IOSftReadAt */
+            {14, 0x000056d7}, /* _IOSftWriteAt */
+            {14, 0x00005a9a}, /* _SftFileSize */
+            {14, 0x0004660c}, /* _VMAllocMem */
+            {14, 0x000279f4}, /* _VMGetOwner */
+            {14, 0x00054942}, /* g_tkExecPgm */
+            {11, 0x0000a178}, /* f_FuStrLenZ */
+            {11, 0x0000a0f8}, /* f_FuStrLen */
+            {11, 0x0000a321}, /* f_FuBuff */
+        }
+    },
+    { /* 8264RU.SYM */
+        8264, 'R', FALSE, 14,
+        {
+            {13, 0x0000930c}, /* _ldrRead */
+            {13, 0x0003aa94}, /* _ldrOpen */
+            {13, 0x0003b318}, /* _ldrClose */
+            {13, 0x0003b368}, /* _LDRQAppType */
+            {13, 0x00038c88}, /* _ldrEnum32bitRelRecs */
+            {13, 0x000039fc}, /* _IOSftOpen */
+            {13, 0x00003e68}, /* _IOSftClose */
+            {13, 0x00003efd}, /* _IOSftTransPath */
+            {13, 0x00003cb6}, /* _IOSftReadAt */
+            {13, 0x00003cbd}, /* _IOSftWriteAt */
+            {13, 0x00004016}, /* _SftFileSize */
+            {13, 0x00036f54}, /* _VMAllocMem */
+            {13, 0x0001d3a6}, /* _VMGetOwner */
+            {13, 0x00043432}, /* g_tkExecPgm */
+            { 9, 0x0000d7e0}, /* f_FuStrLenZ */
+            { 9, 0x0000d796}, /* f_FuStrLen */
+            { 9, 0x0000d8d4}, /* f_FuBuff */
+        }
+    },
+    { /* 8265RS.SYM */
+        8265, 'R', TRUE, 15,
+        {
+            {14, 0x0000c250}, /* _ldrRead */
+            {14, 0x0004a5d4}, /* _ldrOpen */
+            {14, 0x0004aff4}, /* _ldrClose */
+            {14, 0x0004b044}, /* _LDRQAppType */
+            {14, 0x00048ab8}, /* _ldrEnum32bitRelRecs */
+            {14, 0x000053e0}, /* _IOSftOpen */
+            {14, 0x000058b9}, /* _IOSftClose */
+            {14, 0x00005970}, /* _IOSftTransPath */
+            {14, 0x000056d0}, /* _IOSftReadAt */
+            {14, 0x000056d7}, /* _IOSftWriteAt */
+            {14, 0x00005a9a}, /* _SftFileSize */
+            {14, 0x000466a8}, /* _VMAllocMem */
+            {14, 0x00027a7c}, /* _VMGetOwner */
+            {14, 0x000549e2}, /* g_tkExecPgm */
+            {11, 0x0000a178}, /* f_FuStrLenZ */
+            {11, 0x0000a0f8}, /* f_FuStrLen */
+            {11, 0x0000a321}, /* f_FuBuff */
+        }
+    },
+    { /* 8265RU.SYM */
+        8265, 'R', FALSE, 14,
+        {
+            {13, 0x0000930c}, /* _ldrRead */
+            {13, 0x0003a9b4}, /* _ldrOpen */
+            {13, 0x0003b238}, /* _ldrClose */
+            {13, 0x0003b288}, /* _LDRQAppType */
+            {13, 0x00038b94}, /* _ldrEnum32bitRelRecs */
+            {13, 0x000039fc}, /* _IOSftOpen */
+            {13, 0x00003e68}, /* _IOSftClose */
+            {13, 0x00003efd}, /* _IOSftTransPath */
+            {13, 0x00003cb6}, /* _IOSftReadAt */
+            {13, 0x00003cbd}, /* _IOSftWriteAt */
+            {13, 0x00004016}, /* _SftFileSize */
+            {13, 0x00036e60}, /* _VMAllocMem */
+            {13, 0x0001d2a6}, /* _VMGetOwner */
+            {13, 0x00043352}, /* g_tkExecPgm */
+            { 9, 0x0000d830}, /* f_FuStrLenZ */
+            { 9, 0x0000d7e6}, /* f_FuStrLen */
+            { 9, 0x0000d924}, /* f_FuBuff */
+        }
+    },
+    { /* 9029RU.SYM */
+        9029, 'R', FALSE, 13,
+        {
+            {12, 0x00009404}, /* _ldrRead */
+            {12, 0x00039900}, /* _ldrOpen */
+            {12, 0x0003a188}, /* _ldrClose */
+            {12, 0x0003a1d8}, /* _LDRQAppType */
+            {12, 0x00037bcc}, /* _ldrEnum32bitRelRecs */
+            {12, 0x000034ec}, /* _IOSftOpen */
+            {12, 0x00003992}, /* _IOSftClose */
+            {12, 0x00003a39}, /* _IOSftTransPath */
+            {12, 0x000037b3}, /* _IOSftReadAt */
+            {12, 0x000037ba}, /* _IOSftWriteAt */
+            {12, 0x00003b52}, /* _SftFileSize */
+            {12, 0x00035ea0}, /* _VMAllocMem */
+            {12, 0x0001c8f0}, /* _VMGetOwner */
+            {12, 0x00041eb6}, /* g_tkExecPgm */
+            { 9, 0x0000e594}, /* f_FuStrLenZ */
+            { 9, 0x0000e54a}, /* f_FuStrLen */
+            { 9, 0x0000e688}, /* f_FuBuff */
+        }
+    },
+    { /* 9030RU.SYM */
+        9030, 'R', FALSE, 14,
+        {
+            {13, 0x00009784}, /* _ldrRead */
+            {13, 0x0003a114}, /* _ldrOpen */
+            {13, 0x0003a99c}, /* _ldrClose */
+            {13, 0x0003a9ec}, /* _LDRQAppType */
+            {13, 0x0003831c}, /* _ldrEnum32bitRelRecs */
+            {13, 0x0000388c}, /* _IOSftOpen */
+            {13, 0x00003d32}, /* _IOSftClose */
+            {13, 0x00003dd9}, /* _IOSftTransPath */
+            {13, 0x00003b53}, /* _IOSftReadAt */
+            {13, 0x00003b5a}, /* _IOSftWriteAt */
+            {13, 0x00003ef2}, /* _SftFileSize */
+            {13, 0x000365e8}, /* _VMAllocMem */
+            {13, 0x0001d000}, /* _VMGetOwner */
+            {13, 0x0004288a}, /* g_tkExecPgm */
+            { 9, 0x0000db08}, /* f_FuStrLenZ */
+            { 9, 0x0000dabe}, /* f_FuStrLen */
+            { 9, 0x0000dbfc}, /* f_FuBuff */
+        }
+    },
+    { /* 9031RU.SYM */
+        9031, 'R', FALSE, 14,
+        {
+            {13, 0x00009814}, /* _ldrRead */
+            {13, 0x0003a02c}, /* _ldrOpen */
+            {13, 0x0003a8b0}, /* _ldrClose */
+            {13, 0x0003a900}, /* _LDRQAppType */
+            {13, 0x00038228}, /* _ldrEnum32bitRelRecs */
+            {13, 0x0000388c}, /* _IOSftOpen */
+            {13, 0x00003d32}, /* _IOSftClose */
+            {13, 0x00003dd9}, /* _IOSftTransPath */
+            {13, 0x00003b53}, /* _IOSftReadAt */
+            {13, 0x00003b5a}, /* _IOSftWriteAt */
+            {13, 0x00003ef2}, /* _SftFileSize */
+            {13, 0x00036574}, /* _VMAllocMem */
+            {13, 0x0001d09c}, /* _VMGetOwner */
+            {13, 0x0004288a}, /* g_tkExecPgm */
+            { 9, 0x0000db08}, /* f_FuStrLenZ */
+            { 9, 0x0000dabe}, /* f_FuStrLen */
+            { 9, 0x0000dbfc}, /* f_FuBuff */
+        }
+    },
+    { /* 9032RU.SYM */
+        9032, 'R', FALSE, 14,
+        {
+            {13, 0x00009814}, /* _ldrRead */
+            {13, 0x0003a27c}, /* _ldrOpen */
+            {13, 0x0003ab00}, /* _ldrClose */
+            {13, 0x0003ab50}, /* _LDRQAppType */
+            {13, 0x00038478}, /* _ldrEnum32bitRelRecs */
+            {13, 0x0000388c}, /* _IOSftOpen */
+            {13, 0x00003d32}, /* _IOSftClose */
+            {13, 0x00003dd9}, /* _IOSftTransPath */
+            {13, 0x00003b53}, /* _IOSftReadAt */
+            {13, 0x00003b5a}, /* _IOSftWriteAt */
+            {13, 0x00003ef2}, /* _SftFileSize */
+            {13, 0x000367c4}, /* _VMAllocMem */
+            {13, 0x0001d09a}, /* _VMGetOwner */
+            {13, 0x00042b3a}, /* g_tkExecPgm */
+            { 9, 0x0000db00}, /* f_FuStrLenZ */
+            { 9, 0x0000dab6}, /* f_FuStrLen */
+            { 9, 0x0000dbf4}, /* f_FuBuff */
+        }
+    },
+    { /* 9033RU.SYM */
+        9033, 'R', FALSE, 14,
+        {
+            {13, 0x00009824}, /* _ldrRead */
+            {13, 0x0003a3c8}, /* _ldrOpen */
+            {13, 0x0003ac54}, /* _ldrClose */
+            {13, 0x0003aca4}, /* _LDRQAppType */
+            {13, 0x000385b0}, /* _ldrEnum32bitRelRecs */
+            {13, 0x0000388c}, /* _IOSftOpen */
+            {13, 0x00003d32}, /* _IOSftClose */
+            {13, 0x00003dd9}, /* _IOSftTransPath */
+            {13, 0x00003b53}, /* _IOSftReadAt */
+            {13, 0x00003b5a}, /* _IOSftWriteAt */
+            {13, 0x00003ef2}, /* _SftFileSize */
+            {13, 0x000368fc}, /* _VMAllocMem */
+            {13, 0x0001d172}, /* _VMGetOwner */
+            {13, 0x00042c8e}, /* g_tkExecPgm */
+            { 9, 0x0000db30}, /* f_FuStrLenZ */
+            { 9, 0x0000dae6}, /* f_FuStrLen */
+            { 9, 0x0000dc24}, /* f_FuBuff */
+        }
+    },
+    { /* 9034RU.SYM */
+        9034, 'R', FALSE, 14,
+        {
+            {13, 0x00009368}, /* _ldrRead */
+            {13, 0x0003a700}, /* _ldrOpen */
+            {13, 0x0003af8c}, /* _ldrClose */
+            {13, 0x0003afdc}, /* _LDRQAppType */
+            {13, 0x000388e0}, /* _ldrEnum32bitRelRecs */
+            {13, 0x000039b0}, /* _IOSftOpen */
+            {13, 0x00003e56}, /* _IOSftClose */
+            {13, 0x00003efd}, /* _IOSftTransPath */
+            {13, 0x00003c77}, /* _IOSftReadAt */
+            {13, 0x00003c7e}, /* _IOSftWriteAt */
+            {13, 0x00004016}, /* _SftFileSize */
+            {13, 0x00036c2c}, /* _VMAllocMem */
+            {13, 0x0001d2fa}, /* _VMGetOwner */
+            {13, 0x00042fda}, /* g_tkExecPgm */
+            { 9, 0x0000db44}, /* f_FuStrLenZ */
+            { 9, 0x0000dafa}, /* f_FuStrLen */
+            { 9, 0x0000dc38}, /* f_FuBuff */
+        }
+    },
+    { /* 9035RU.SYM */
+        9035, 'R', FALSE, 14,
+        {
+            {13, 0x00009368}, /* _ldrRead */
+            {13, 0x0003a964}, /* _ldrOpen */
+            {13, 0x0003b1e8}, /* _ldrClose */
+            {13, 0x0003b238}, /* _LDRQAppType */
+            {13, 0x00038b58}, /* _ldrEnum32bitRelRecs */
+            {13, 0x000039b0}, /* _IOSftOpen */
+            {13, 0x00003e56}, /* _IOSftClose */
+            {13, 0x00003efd}, /* _IOSftTransPath */
+            {13, 0x00003c77}, /* _IOSftReadAt */
+            {13, 0x00003c7e}, /* _IOSftWriteAt */
+            {13, 0x00004016}, /* _SftFileSize */
+            {13, 0x00036ea4}, /* _VMAllocMem */
+            {13, 0x0001d436}, /* _VMGetOwner */
+            {13, 0x0004324e}, /* g_tkExecPgm */
+            { 9, 0x0000db44}, /* f_FuStrLenZ */
+            { 9, 0x0000dafa}, /* f_FuStrLen */
+            { 9, 0x0000dc38}, /* f_FuBuff */
+        }
+    },
+    { /* 9036RU.SYM */
+        9036, 'R', FALSE, 14,
+        {
+            {13, 0x000093b4}, /* _ldrRead */
+            {13, 0x0003ab8c}, /* _ldrOpen */
+            {13, 0x0003b410}, /* _ldrClose */
+            {13, 0x0003b460}, /* _LDRQAppType */
+            {13, 0x00038d6c}, /* _ldrEnum32bitRelRecs */
+            {13, 0x000039fc}, /* _IOSftOpen */
+            {13, 0x00003ea2}, /* _IOSftClose */
+            {13, 0x00003f49}, /* _IOSftTransPath */
+            {13, 0x00003cc3}, /* _IOSftReadAt */
+            {13, 0x00003cca}, /* _IOSftWriteAt */
+            {13, 0x00004062}, /* _SftFileSize */
+            {13, 0x000370b8}, /* _VMAllocMem */
+            {13, 0x0001d4ee}, /* _VMGetOwner */
+            {13, 0x0004359e}, /* g_tkExecPgm */
+            { 9, 0x0000db94}, /* f_FuStrLenZ */
+            { 9, 0x0000db4a}, /* f_FuStrLen */
+            { 9, 0x0000dc88}, /* f_FuBuff */
+        }
+    },
+    { /* Terminating entry */
+        0,0,0,0,
+        {
+            {0,0},
+            {0,0},
+            {0,0},
+            {0,0},
+            {0,0},
+            {0,0},
+            {0,0},
+            {0,0},
+            {0,0},
+            {0,0},
+            {0,0},
+            {0,0},
+            {0,0},
+            {0,0},
+            {0,0},
+            {0,0},
+            {0,0},
+        }
+    }
+}; /* end of aKrnlSymDB[] */
Index: trunk/src/win32k/dev16/d16globl.c
===================================================================
--- trunk/src/win32k/dev16/d16globl.c	(revision 2898)
+++ trunk/src/win32k/dev16/d16globl.c	(revision 2898)
@@ -0,0 +1,37 @@
+/* $Id: d16globl.c,v 1.1 2000-02-25 18:19:24 bird Exp $
+ *
+ * d16globals - global data (16-bit)
+ *
+ * Copyright (c) 1999 knut st. osmundsen
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ */
+
+/*******************************************************************************
+*   Defined Constants                                                          *
+*******************************************************************************/
+#define INCL_NOPMAPI
+
+/*******************************************************************************
+*   Header Files                                                               *
+*******************************************************************************/
+#include <os2.h>
+#include "options.h"
+#include "log.h"
+
+/*******************************************************************************
+*   Global Variables                                                           *
+*******************************************************************************/
+
+/* Note: All global variables must be initialized!  *
+ *       Uninitialized variables ends up in DATA32. */
+
+PFN     Device_Help = NULL;
+ULONG   TKSSBase16  = 0;
+USHORT  R0FlatCS16  = 0;
+USHORT  R0FlatDS16  = 0;
+BOOL    fInitTime   = TRUE;
+
+struct options  options = DEFAULT_OPTION_ASSIGMENTS;
+
Index: trunk/src/win32k/dev16/d16init.c
===================================================================
--- trunk/src/win32k/dev16/d16init.c	(revision 2895)
+++ trunk/src/win32k/dev16/d16init.c	(revision 2898)
@@ -1,3 +1,3 @@
-/* $Id: d16init.c,v 1.5 2000-02-21 04:45:45 bird Exp $
+/* $Id: d16init.c,v 1.6 2000-02-25 18:15:02 bird Exp $
  *
  * d16init - init routines for both drivers.
@@ -21,4 +21,5 @@
 #define INCL_DOSERRORS
 #define INCL_NOPMAPI
+
 
 /*******************************************************************************
Index: trunk/src/win32k/dev16/d16strat.c
===================================================================
--- trunk/src/win32k/dev16/d16strat.c	(revision 2895)
+++ trunk/src/win32k/dev16/d16strat.c	(revision 2898)
@@ -1,3 +1,3 @@
-/* $Id: d16strat.c,v 1.7 2000-02-23 20:10:19 bird Exp $
+/* $Id: d16strat.c,v 1.8 2000-02-25 18:15:02 bird Exp $
  *
  * d16strat.c - 16-bit strategy routine, device headers, device_helper (ptr)
@@ -64,11 +64,4 @@
 };
 
-/* Note: All global variables must be initialized!  *
- *       Uninitialized variables ends up in DATA32. */
-PFN     Device_Help = NULL;
-ULONG   TKSSBase16  = 0;
-USHORT  R0FlatCS16  = 0;
-USHORT  R0FlatDS16  = 0;
-BOOL    fInitTime   = TRUE;
 
 
@@ -129,8 +122,13 @@
 {
     USHORT rc;
+
     if (pRp->Category == D16_IOCTL_CAT)
     {
         switch (pRp->Function)
         {
+            /*
+             * This is the IOCtl which does the R0-initiation of the device driver.
+             * Only available at init time...
+             */
             case D16_IOCTL_RING0INIT:
                 if (fInitTime)
@@ -142,5 +140,12 @@
                 break;
 
-            case D16_IOCTL_GETKRNLOTES:
+            /*
+             * This is the IOCtl collects info of the running kernel.
+             * Only available at init time.
+             *
+             * Since this IOCtl is issued before R0-Init is done, we'll have to
+             * init TKSSBase for both 16-bit and 32-bit code and be a bit carefull.
+             */
+            case D16_IOCTL_GETKRNLINFO:
                 if (fInitTime)
                 {
@@ -151,9 +156,16 @@
                                           &ulLin) != NO_ERROR)
                         return STATUS_DONE | STERR | ERROR_I24_INVALID_PARAMETER;
-                    return CallGetOTEs32(ulLin);
+                    return CallGetKernelInfo32(ulLin);
                 }
                 break;
 
-            case D16_IOCTL_VERIFYPROCTAB:
+            /*
+             * This is the IOCtl verifies the data in the ImportTab.
+             * Only available at init time.
+             *
+             * Since this IOCtl is issued before R0-Init is done, we'll have to
+             * init TKSSBase for both 16-bit and 32-bit code and be a bit carefull.
+             */
+            case D16_IOCTL_VERIFYIMPORTTAB:
                 if (fInitTime)
                 {
Index: trunk/src/win32k/dev16/probkrnl.c
===================================================================
--- trunk/src/win32k/dev16/probkrnl.c	(revision 2895)
+++ trunk/src/win32k/dev16/probkrnl.c	(revision 2898)
@@ -1,3 +1,3 @@
-/* $Id: probkrnl.c,v 1.15 2000-02-21 14:53:38 bird Exp $
+/* $Id: probkrnl.c,v 1.16 2000-02-25 18:15:02 bird Exp $
  *
  * Description:   Autoprobes the os2krnl file and os2krnl[*].sym files.
@@ -30,14 +30,7 @@
 *   Defined Constants And Macros                                               *
 *******************************************************************************/
-#ifdef DEBUGR3
-    #if 1
-        int printf(const char *, ...);
-        #define dprintf(a) printf a
-    #else
-        #define dprintf(a)
-    #endif
-#else
-    #define dprintf(a)
-    #define static
+/* Disable logging when doing extracts */
+#if defined(EXTRACT) || defined(RING0)
+    #define NOLOGGING 1
 #endif
 
@@ -72,4 +65,6 @@
 #include "dev16.h"
 #include "dev1632.h"
+#include "vprntf16.h"
+#include "log.h"
 
 
@@ -111,7 +106,9 @@
 };
 
-unsigned long int   ulBuild          = 0;
+unsigned short int  usBuild          = 0;
 unsigned short      usVerMajor       = 0;
 unsigned short      usVerMinor       = 0;
+unsigned char       fSMP             = FALSE;
+unsigned char       fDebug           = FALSE;
 
 
@@ -144,13 +141,8 @@
 };
 
-static KRNLOBJTABLE KrnlOTEs = {0};
-
-/* messages */
-static char szBanner[]   = "Win32k - Odin32 support driver.";
-static char szMsg1[]     = "\n\r    Found kernel:     ";
-static char szMsg1a[]    = "\n\r    Build:            ";
-static char szMsg2[]     = "\n\r    Found symbolfile: ";
-static char szMsg4[]     = "\n\r    Failed to find symbolfile!\n\r";
-static char szMsgfailed[]= "failed!   ";
+/* Result from GetKernelInfo/ReadOS2Krnl. */
+static unsigned char  cObjects = 0;
+static POTE           paKrnlOTEs = NULL;
+
 
 
@@ -172,13 +164,13 @@
 static int      kstrnicmp(const char *psz1, const char *psz2, int cch);
 static int      kstrlen(const char *psz);
+static char *   kstrcpy(char * pszTarget, const char * pszSource);
 static int      kargncpy(char *pszTarget, const char *pszArg, unsigned cchMaxlen);
 
 /* Workers */
+static int      LookupKrnlEntry(unsigned uBuild, unsigned char chType,
+                                unsigned char fSMP, unsigned char cObjects);
 static int      VerifyPrologs(void);
-static int      ProbeSymFile(char *pszFilename);
-static int      VerifyKernelVer(void);
-static int      ReadOS2Krnl(char *pszFilename);
-static int      ReadOS2Krnl2(HFILE hKrnl, unsigned long  cbKrnl);
-static int      GetKernelOTEs(void);
+static int      ProbeSymFile(const char *pszFilename);
+static int      GetKernelInfo(void);
 
 /* Ouput */
@@ -186,4 +178,10 @@
 static void     ShowHexNumber(unsigned long ul);
 static void     ShowResult(int rc, int iSym);
+
+/* Others used while debugging in R3. */
+static int      VerifyKernelVer(void);
+static int      ReadOS2Krnl(char *pszFilename);
+static int      ReadOS2Krnl2(HFILE hKrnl, unsigned long  cbKrnl);
+static int      processFile(const char *pszFilename);
 
 
@@ -409,4 +407,24 @@
 
 /**
+ * String copy (strcpy).
+ * @returns   Pointer to target string.
+ * @param     pszTarget  Target string.
+ * @param     pszSource  Source string.
+ * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
+ */
+static char * kstrcpy(char * pszTarget, register const char * pszSource)
+{
+    register char *psz = pszTarget;
+
+    while (*pszSource != '\0')
+        *psz++ = *pszSource++;
+
+    return pszTarget;
+}
+
+
+
+
+/**
  * Copy an argument to a buffer. Ie. "-K[=|:]c:\os2krnl ....". Supports quotes
  * @returns   Number of chars of pszArg that has been processed.
@@ -465,4 +483,73 @@
 *   Implementation Of The Important Functions                                  *
 *******************************************************************************/
+#ifndef EXTRACT
+/**
+ * Checks if this kernel is within the kernel symbol database.
+ * If an entry for the kernel is found, the data is copied from the
+ * database entry to aImportTab.
+ * @returns   NO_ERROR on succes (0)
+ *            1 if not found.
+ *            Error code on error.
+ * @param     uBuild    Build level.
+ * @param     chType    'A' all strict
+ *                      'H' half strict
+ *                      'R' retail
+ * @param     fSMP      TRUE: SMP
+ *                      FALSE: UNI
+ * @param     cObjects  Count of object in the running kernel.
+ * @sketch    Loop thru the table.
+ * @status    completely implemented.
+ * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
+ */
+static int LookupKrnlEntry(unsigned uBuild, unsigned char chType, unsigned char fSMP, unsigned char cObjects)
+{
+    int i;
+
+    /*
+     * Loop tru the DB entries until a NULL pointer is found.
+     */
+    for (i = 0; aKrnlSymDB[i].usBuild != 0; i++)
+    {
+        if (aKrnlSymDB[i].usBuild      == uBuild
+            && aKrnlSymDB[i].chType    == chType
+            && aKrnlSymDB[i].fSMP      == fSMP
+            && aKrnlSymDB[i].cObjects  == cObjects)
+        {   /* found matching entry! */
+            int j;
+            int rc;
+            register PKRNLDBENTRY pEntry = &aKrnlSymDB[i];
+
+            dprintf(("LookUpKrnlEntry - found entry for this kernel!\n"));
+
+            /*
+             * Copy symbol data from the DB to aImportTab.
+             */
+            for (j = 0; j < NBR_OF_KRNLIMPORTS; j++)
+            {
+                aImportTab[j].offObject  = pEntry->aSyms[j].offObject;
+                aImportTab[j].iObject    = pEntry->aSyms[j].iObject;
+                aImportTab[j].ulAddress  = paKrnlOTEs[pEntry->aSyms[j].iObject].ote_base
+                                           + pEntry->aSyms[j].offObject;
+                aImportTab[j].usSel      = paKrnlOTEs[pEntry->aSyms[j].iObject].ote_sel;
+                aImportTab[j].fFound     = TRUE;
+                dprintf(("  %-3d addr=0x%08lx off=0x%08lx  %s\n",
+                         j, aImportTab[j].ulAddress, aImportTab[j].offObject,
+                         aImportTab[j].achName));
+            }
+
+            /* Verify prologs*/
+            rc = VerifyPrologs();
+
+            /* set sym name */
+            if (rc == 0)
+                kstrcpy(szUsrSym, "Win32k Symbol Database");
+            return rc;
+        }
+    }
+
+    /* not found */
+    return 1;
+}
+#endif /* !EXTRACT */
 
 /**
@@ -473,5 +560,5 @@
 static int VerifyPrologs(void)
 {
-#ifndef DEBUGR3
+#if !defined(DEBUGR3) && !defined(EXTRACT)
     APIRET          rc;
     HFILE           hDev0 = 0;
@@ -484,5 +571,5 @@
     if (rc == NO_ERROR)
     {
-        rc = DosDevIOCtl("", "", D16_IOCTL_VERIFYPROCTAB, D16_IOCTL_CAT, hDev0);
+        rc = DosDevIOCtl("", "", D16_IOCTL_VERIFYIMPORTTAB, D16_IOCTL_CAT, hDev0);
         DosClose(hDev0);
     }
@@ -502,5 +589,5 @@
  * @remark    Error codes starts at -50.
  */
-static int ProbeSymFile(char * pszFilename)
+static int ProbeSymFile(const char * pszFilename)
 {
     HFILE          hSym;                /* Filehandle */
@@ -565,5 +652,6 @@
      * Verify that the number of segments is equal to the number objects in OS2KRNL.
      */
-    if (MapDef.cSegs != KrnlOTEs.cObjects)
+    #ifndef EXTRACT
+    if (MapDef.cSegs != cObjects)
     {   /* incorrect count of segments. */
         dprintf(("Segment No. verify failed\n"));
@@ -571,4 +659,5 @@
         return -52;
     }
+    #endif /* !EXTRACT */
 
 
@@ -577,5 +666,12 @@
      */
     for (i = 0; i < NBR_OF_KRNLIMPORTS; i++)
+    {
         aImportTab[i].fFound = 0;
+        #ifdef DEBUG
+        aImportTab[i].offObject = 0;
+        aImportTab[i].ulAddress = 0;
+        aImportTab[i].usSel = 0;
+        #endif
+    }
 
 
@@ -697,10 +793,12 @@
                 {   /* Symbol was found */
                     aImportTab[i].offObject = (SegDef.bFlags & 0x01 ? SymDef32.wSymVal : SymDef16.wSymVal);
-                    aImportTab[i].ulAddress = aImportTab[i].offObject + KrnlOTEs.aObjects[iSeg].ote_base;
+                    aImportTab[i].ulAddress = aImportTab[i].offObject + paKrnlOTEs[iSeg].ote_base;
                     aImportTab[i].iObject   = (unsigned char)iSeg;
-                    aImportTab[i].usSel     = KrnlOTEs.aObjects[iSeg].ote_sel;
+                    aImportTab[i].usSel     = paKrnlOTEs[iSeg].ote_sel;
+                    dprintf(("debug: base=%lx, size=%lx iSeg=%d\n", paKrnlOTEs[iSeg].ote_base, paKrnlOTEs[iSeg].ote_size, iSeg));
 
                     /* Paranoia test! */
-                    if (aImportTab[i].offObject < KrnlOTEs.aObjects[iSeg].ote_size)
+                    #ifndef EXTRACT
+                    if (aImportTab[i].offObject < paKrnlOTEs[iSeg].ote_size)
                     {
                         aImportTab[i].fFound = TRUE;
@@ -712,4 +810,8 @@
                     else/* test failed, continue on next symbol*/
                         dprintf(("Error: Paranoia test failed for %s\n", aImportTab[i].achName));;
+                    #else
+                    aImportTab[i].fFound = TRUE;
+                    cLeftToFind--;
+                    #endif /* !EXTRACT */
                     break;
                 }
@@ -740,231 +842,11 @@
 
 /**
- * Verifies that build no, matches kernel number.
- * @returns   0 on equal, !0 on error.
- */
-static int VerifyKernelVer(void)
-{
-    int VerMinor, VerMajor;
-
-    VerMajor = ulBuild < 20000 ? 20 : 30/*?*/;
-    VerMinor = ulBuild < 6600 ? 10 :  ulBuild < 8000 ? 11 : ulBuild < 9000 ? 30 :
-               ulBuild < 10000 ? 40 :  ulBuild < 15000 ? 45 : 50;
-
-    return VerMajor - (int)usVerMajor | VerMinor - (int)usVerMinor;
-}
-
-
-/**
- * Reads and verifies OS/2 kernel.
- * @returns   0 on success, not 0 on failure.
- * @param     filename   Filename of the OS/2 kernel.
- * @result    ulBuild is set.
- * @remark    This step will be eliminated by searching thru the DOSGROUP datasegment
- *            in the kernel memory. This segment have a string "Internal revision 9.034[smp|uni]"
- *            This would be much faster than reading the kernel file. It will also give us a more precise
- *            answer to the question! This is currently a TODO issue. !FIXME!
- */
-static int ReadOS2Krnl(char * pszFilename)
-{
-    HFILE          hKrnl;
-    unsigned long  cbKrnl;
-    int            rc;
-
-    hKrnl = fopen(pszFilename, "rb");
-    if (hKrnl != 0)
-    {
-        cbKrnl = fsize(hKrnl);
-        if (!fseek(hKrnl, 0, SEEK_SET))
-            rc = ReadOS2Krnl2(hKrnl, cbKrnl);
-        else
-            rc = -2;
-        fclose(hKrnl);
-    }
-    else
-    {
-        dprintf(("Could not open file\n"));
-        rc = -1;
-    }
-    return rc;
-}
-
-/**
- * Worker function for ReadOS2Krnl
- * @returns   0 on success.
- *            errorcodes on failure. (-1 >= rc >= -14)
- * @param     hKrnl   Handle to the kernel file.
- * @param     cbKrnl  Size of the kernel file.
- * @author    knut st. osmundsen
- */
-static int ReadOS2Krnl2(HFILE hKrnl, unsigned long  cbKrnl)
-{
-    int            i, j;
-    int            rc = 0;
-    char           achBuffer[KERNEL_ID_STRING_LENGTH + KERNEL_READ_SIZE];
-    unsigned long  offLXHdr;
-    struct e32_exe *pLXHdr;
-
-
-    /* find bldlevel string - "@#IBM:14.020#@  IBM OS/2 Kernel - 14.020F" */
-    if (fseek(hKrnl, 0, SEEK_SET))
-        return -2;
-
-    if (!fread(&achBuffer[KERNEL_ID_STRING_LENGTH], 1, KERNEL_READ_SIZE, hKrnl))
-        return -3;
-
-    i = KERNEL_ID_STRING_LENGTH;
-    while (cbKrnl > 0)
-    {
-        if (i == KERNEL_READ_SIZE)
-        {
-
-            kmemcpy(achBuffer, &achBuffer[KERNEL_READ_SIZE], KERNEL_ID_STRING_LENGTH);
-            if (!fread(&achBuffer[KERNEL_ID_STRING_LENGTH], 1, cbKrnl > KERNEL_READ_SIZE ? KERNEL_READ_SIZE : (int)cbKrnl, hKrnl))
-                return -3;
-
-            i = 0;
-        }
-
-        if (kstrncmp("@#IBM:", &achBuffer[i], 6) == 0)
-            break;
-
-        /* next */
-        i++;
-        cbKrnl--;
-    }
-
-    if (cbKrnl == 0)
-    {
-        fclose(hKrnl);
-        return -4;
-    }
-
-    /* displacement */
-    j = 0;
-    while (j < 6 && achBuffer[i+10+j] != '#')
-        j++;
-
-    /* verify signature */
-    if (kstrncmp(&achBuffer[i+10+j], "#@  IBM OS/2 Kernel", 19) != 0)
-        return -5;
-
-    /* read ulBuild */
-    ulBuild  = (char)(achBuffer[i+6] - '0') * 1000;
-    if (achBuffer[i+7] != '.')
-    {
-        /* this code is for Warp5 */
-        ulBuild *= 10;
-        ulBuild += (char)(achBuffer[i+7] - '0') * 1000;
-        i++;
-        j--;
-        if (achBuffer[i+7] != '.')
-        {
-            ulBuild = ulBuild * 10;
-            ulBuild = ulBuild + (unsigned long)(achBuffer[i+7] - '0') * 1000;
-            i++;
-            j--;
-        }
-    }
-
-    if (j == 0)
-    {
-        ulBuild += (achBuffer[i+ 8] - '0') * 10;
-        ulBuild += (achBuffer[i+ 9] - '0') * 1;
-    } else
-    {
-        if (j == 3)
-            return -9;
-        ulBuild += (achBuffer[i+ 8] - '0') * 100;
-        ulBuild += (achBuffer[i+ 9] - '0') * 10;
-        ulBuild += (achBuffer[i+10] - '0');
-    }
-
-    if (VerifyKernelVer())
-        return -9;
-    dprintf(("ulBuild: %d\n",ulBuild));
-
-    /* get segment number */
-    /* read-MZheader */
-    if (fseek(hKrnl,0,SEEK_SET))
-        return -2;
-
-    if (!fread(achBuffer, 1, 0x40, hKrnl))
-        return -3;
-
-    offLXHdr = *(unsigned long int *)&achBuffer[0x3c];
-
-    if (offLXHdr > 0x2000 && offLXHdr < 0x80) /* just to detect garbage */
-        return -6;
-
-    if (fseek(hKrnl, offLXHdr, SEEK_SET))
-        return -2;
-
-    if (!fread(achBuffer, 1, sizeof(struct e32_exe), hKrnl))
-        return -3;
-
-    /* check LX-magic */
-    if (achBuffer[0] != 'L' || achBuffer[1] != 'X')
-        return -7;
-
-#ifndef DEBUGR3
-    /* check object count - match it with what we got from the kernel. */
-    pLXHdr = (struct e32_exe *)achBuffer;
-    if ((UCHAR)pLXHdr->e32_objcnt != KrnlOTEs.cObjects)
-        return -8;
-
-    if (pLXHdr->e32_objcnt < 10)
-        return -9;
-
-    /* check objects (sizes and flags(?)) */
-    if (!fseek(hKrnl, (LONG)offLXHdr + (LONG)pLXHdr->e32_objtab, SEEK_SET))
-    {
-        struct o32_obj *pObj = (struct o32_obj *)achBuffer;
-        for (i = 0; i < (int)KrnlOTEs.cObjects; i++)
-        {
-            if (!fread(achBuffer, 1, sizeof(OTE), hKrnl))
-                return -11;
-            if (pObj->o32_size < KrnlOTEs.aObjects[i].ote_size)
-                return -12;
-
-            #if 0 /* don't work! */
-            if ((pObj->o32_flags & 0xffffUL) != (KrnlOTEs.aObjects[i].ote_flags & 0xffffUL))
-                return -14;
-            #endif
-        }
-    }
-    else
-        return -10;
-#else
-    /* Since we can't get the OTEs from the kernel when debugging in RING-3,
-     * we'll use what we find in the kernel.
-     */
-
-    /*  object count */
-    pLXHdr = (struct e32_exe *)achBuffer;
-    KrnlOTEs.cObjects = (UCHAR)pLXHdr->e32_objcnt;
-
-    /* get OTEs */
-    if (!fseek(hKrnl, (LONG)offLXHdr + (LONG)pLXHdr->e32_objtab, SEEK_SET))
-    {
-        struct o32_obj *pObj = (struct o32_obj *)achBuffer;
-        for (i = 0; i < (int)KrnlOTEs.cObjects; i++)
-            if (!fread(&KrnlOTEs.aObjects[i], 1, sizeof(struct o32_obj), hKrnl))
-                return -11;
-    }
-    else
-        return -10;
-#endif
-
-    return 0;
-}
-
-
-/**
  * Gets the os/2 kernel OTE's (object table entries).
  * @returns   0 on success. Not 0 on error.
  */
-static int   GetKernelOTEs(void)
-{
-#ifndef DEBUGR3
+static int   GetKernelInfo(void)
+{
+#if !defined(DEBUGR3) && !defined(EXTRACT) /* IOCtl not available after inittime! */
+    static KRNLINFO KrnlInfo = {0};
     APIRET          rc;
     HFILE           hDev0 = 0;
@@ -977,60 +859,58 @@
     if (rc == NO_ERROR)
     {
-        rc = DosDevIOCtl(&KrnlOTEs, "", D16_IOCTL_GETKRNLOTES, D16_IOCTL_CAT, hDev0);
+        rc = DosDevIOCtl(&KrnlInfo, "", D16_IOCTL_GETKRNLINFO, D16_IOCTL_CAT, hDev0);
+        if (rc == NO_ERROR)
+        {
+            int i;
+
+            /* Set the exported parameters */
+            usBuild  = KrnlInfo.usBuild;
+            fSMP     = KrnlInfo.fSMP;
+            fDebug   = KrnlInfo.fDebug;
+            cObjects = KrnlInfo.cObjects;
+            paKrnlOTEs = &KrnlInfo.aObjects[0];
+            #ifdef DEBUG
+            for (i = 0; i < NBR_OF_KRNLIMPORTS; i++)
+                dprintf(("debug: no.%2d base=%lx size=%lx sel=%x\n",
+                         i,
+                         paKrnlOTEs[i].ote_base,
+                         paKrnlOTEs[i].ote_size,
+                         paKrnlOTEs[i].ote_sel));
+            #endif
+
+        }
         DosClose(hDev0);
     }
 
     if (rc != NO_ERROR)
-        puts("Failed to get kernel OTEs\r\n");
+        printf16("Failed to get kernel OTEs\r\n");
 
     return rc;
+
 #else
-    KrnlOTEs.cObjects = 23;
-    return 0;
+    #ifndef EXTRACT
+        APIRET          rc;
+
+        /*--------------*/
+        /* read kernel  */
+        /*--------------*/
+        if (szUsrOS2Krnl[0] != '\0')
+        {
+            rc = ReadOS2Krnl(szUsrOS2Krnl);
+            if (rc != 0)
+            {
+                puts("Warning: Invalid kernel file specified. Tries defaults.\n\r");
+                szUsrOS2Krnl[0] = '\0';
+                rc = ReadOS2Krnl(szOS2Krnl);
+            }
+        }
+        else
+            rc = ReadOS2Krnl(szOS2Krnl);
+        return rc;
+    #else
+        return 0;
+    #endif
 #endif
 }
-
-
-/**
- * Displays an ULONG in decimal notation using DosPutMessage
- * @param     n   ULONG to show.
- */
-static void ShowDecNumber(unsigned long n)
-{
-    int f = 0;
-    unsigned long div;
-    char sif;
-
-    for (div = 1000000; div > 0; div /= 10)
-    {
-        sif = (char)(n/div);
-        n %= div;
-        if (sif != 0 || f)
-        {
-            f = 1;
-            sif += '0';
-            DosPutMessage(0, 1, &sif);
-        }
-    }
-}
-
-
-/**
- * Displays an ULONG in hexadecimal notation using DosPutMessage
- * @param     n   ULONG to show.
- */
-static void ShowHexNumber(unsigned long int n)
-{
-    signed int div;
-    char sif;
-    DosPutMessage(0, 2, "0x");
-    for (div = 28; div >= 0; div -= 4)
-    {
-        sif = (char)(n >> div) & (char)0xF;
-        sif += (sif < 10  ? '0' : 'a' - 10);
-        DosPutMessage(0, 1, &sif);
-    }
-}
-
 
 
@@ -1040,68 +920,53 @@
  * @param     iSym        index of .sym-file into static struct.
  */
+#ifndef EXTRACT
 static void ShowResult(int rc, int iSym)
 {
-    int i, j;
-
-    /* complain even if quiet on error */
+    int i;
+
+    /*
+     * Complain even if quiet on error
+     */
     if (!fQuiet || rc != 0)
     {
-        puts(szBanner);
-
-        /* kernel stuff */
-        puts(szMsg1);
+        printf16("Win32k - Odin32 support driver.\n");
+
+        /*
+         * kernel stuff
+         */
         if (rc <= -50 || rc == 0)
         {
-            puts(szOS2Krnl);
-            puts(szMsg1a);
-            ShowDecNumber(ulBuild);
-            puts(" - v");
-            ShowDecNumber(usVerMajor);
-            puts(".");
-            ShowDecNumber(usVerMinor);
+            #ifdef DEBUGR3
+            printf16("    Found kernel:     %s\n", szOS2Krnl);
+            #endif
+            printf16("    Build:            %d - v%d.%d\n",
+                     usBuild, usVerMajor, usVerMinor);
         }
         else
-            puts(szMsgfailed);
-
-        /* functions */
+            printf16("    Kernel probing failed with rc=%d.\n", rc);
+
+        /*
+         * symbol-file
+         */
         if (rc == 0)
+            printf16("    Found symbolfile: %s\n",
+                     szUsrSym[0] == '\0' ? apszSym[iSym] : szUsrSym);
+        else
+            printf16("    Failed to find symbolfile! rc=%d\n", rc);
+
+        /*
+         * function listing
+         */
+        for (i = 0; i < NBR_OF_KRNLIMPORTS; i++)
         {
-            puts(szMsg2);
-            if (szUsrSym[0] == '\0')
-                puts(apszSym[iSym]);
+            printf16("  %-20s at ",aImportTab[i].achName);
+            if (aImportTab[i].fFound)
+                printf16("0x%08lx%s", aImportTab[i].ulAddress, (i % 2) == 0 ? "" : "\n");
             else
-                puts(szUsrSym);
-
-            for (i = 0; i < NBR_OF_KRNLIMPORTS; i++)
-            {
-                if ((i % 2) == 0)
-                    puts("\n\r    ");
-                else
-                    puts("    ");
-                puts(aImportTab[i].achName);
-                for (j = aImportTab[i].cchName; j < 20; j++)
-                    puts(" ");
-
-                puts(" at ");
-                if (aImportTab[i].fFound)
-                    ShowHexNumber(aImportTab[i].ulAddress);
-                else
-                    puts(szMsgfailed);
-            }
+                printf16("failed!%s", (i % 2) == 0 ? "" : "\n");
         }
-        else
-            puts(szMsg4);
-        puts("\n\r");
-    }
-
-    /* if error: write rc */
-    if (rc != 0)
-    {
-        puts("rc = ");
-        ShowHexNumber((unsigned long)rc);
-        puts("\n\r");
-    }
-}
-
+        if (i % 2) printf16("\n");
+    }
+}
 
 
@@ -1187,25 +1052,9 @@
 
     /*-----------------*/
-    /* get kernel OTEs */
+    /* get kernel info */
     /*-----------------*/
-    rc = GetKernelOTEs();
+    rc = GetKernelInfo();
     if (rc != NO_ERROR)
         return rc;
-
-    /*--------------*/
-    /* read kernel  */
-    /*--------------*/
-    if (szUsrOS2Krnl[0] != '\0')
-    {
-        rc = ReadOS2Krnl(szUsrOS2Krnl);
-        if (rc != 0)
-        {
-            puts("Warning: Invalid kernel file specified. Tries defaults.\n\r");
-            szUsrOS2Krnl[0] = '\0';
-            rc = ReadOS2Krnl(szOS2Krnl);
-        }
-    }
-    else
-        rc = ReadOS2Krnl(szOS2Krnl);
 
     /*--------------*/
@@ -1224,9 +1073,20 @@
             }
         }
-        if (rc != 0) /* if user sym failed or don't exists */
+        if (rc != 0) /* if user sym failed or don't exists. */
         {
-            i = 0;
-            while (apszSym[i] != NULL && (rc = ProbeSymFile(apszSym[i])) != 0)
-                i++;
+            /*
+             * Check database - only if not a debug kernel!
+             * You usually have a .sym-file when using a debug kernel.
+             * (Currently I am not able to distinguish between half and all strict kernels...)
+             */
+            if (fDebug ||
+                (rc = LookupKrnlEntry((unsigned short)usBuild, 'R', fSMP, cObjects)) != 0
+                )
+            {
+                /* search on disk */
+                i = 0;
+                while (apszSym[i] != NULL && (rc = ProbeSymFile(apszSym[i])) != 0)
+                    i++;
+            }
         }
     }
@@ -1238,8 +1098,236 @@
     return rc;
 }
-
+#endif
 
 
 #ifdef DEBUGR3
+/**
+ * Verifies that build no, matches kernel number.
+ * @returns   0 on equal, !0 on error.
+ */
+static int VerifyKernelVer(void)
+{
+    int VerMinor, VerMajor;
+
+    VerMajor = usBuild < 20000 ? 20 : 30/*?*/;
+    VerMinor = usBuild <  6600 ? 10 :  usBuild <  8000 ? 11 : usBuild < 9000 ? 30 :
+               usBuild < 10000 ? 40 :  usBuild < 15000 ? 45 : 50;
+
+    return VerMajor - (int)usVerMajor | VerMinor - (int)usVerMinor;
+}
+
+
+/**
+ * Reads and verifies OS/2 kernel.
+ * @returns   0 on success, not 0 on failure.
+ * @param     filename   Filename of the OS/2 kernel.
+ * @result    usBuild is set.
+ * @remark    This step will be eliminated by searching thru the DOSGROUP datasegment
+ *            in the kernel memory. This segment have a string "Internal revision 9.034[smp|uni]"
+ *            This would be much faster than reading the kernel file. It will also give us a more precise
+ *            answer to the question! This is currently a TODO issue. !FIXME!
+ */
+static int ReadOS2Krnl(char * pszFilename)
+{
+    HFILE          hKrnl;
+    unsigned long  cbKrnl;
+    int            rc;
+
+    hKrnl = fopen(pszFilename, "rb");
+    if (hKrnl != 0)
+    {
+        cbKrnl = fsize(hKrnl);
+        if (!fseek(hKrnl, 0, SEEK_SET))
+            rc = ReadOS2Krnl2(hKrnl, cbKrnl);
+        else
+            rc = -2;
+        fclose(hKrnl);
+    }
+    else
+    {
+        dprintf(("Could not open file\n"));
+        rc = -1;
+    }
+    return rc;
+}
+
+
+/**
+ * Worker function for ReadOS2Krnl
+ * @returns   0 on success.
+ *            errorcodes on failure. (-1 >= rc >= -14)
+ * @param     hKrnl   Handle to the kernel file.
+ * @param     cbKrnl  Size of the kernel file.
+ * @author    knut st. osmundsen
+ */
+static int ReadOS2Krnl2(HFILE hKrnl, unsigned long  cbKrnl)
+{
+    #if defined(DEBUGR3) || !defined(EXTRACT)
+    static KRNLINFO KrnlInfo = {0};
+    #endif
+    int            i, j;
+    int            rc = 0;
+    char           achBuffer[KERNEL_ID_STRING_LENGTH + KERNEL_READ_SIZE];
+    unsigned long  offLXHdr;
+    struct e32_exe *pLXHdr;
+
+
+    /* find bldlevel string - "@#IBM:14.020#@  IBM OS/2 Kernel - 14.020F" */
+    if (fseek(hKrnl, 0, SEEK_SET))
+        return -2;
+
+    if (!fread(&achBuffer[KERNEL_ID_STRING_LENGTH], 1, KERNEL_READ_SIZE, hKrnl))
+        return -3;
+
+    i = KERNEL_ID_STRING_LENGTH;
+    while (cbKrnl > 0)
+    {
+        if (i == KERNEL_READ_SIZE)
+        {
+
+            kmemcpy(achBuffer, &achBuffer[KERNEL_READ_SIZE], KERNEL_ID_STRING_LENGTH);
+            if (!fread(&achBuffer[KERNEL_ID_STRING_LENGTH], 1, cbKrnl > KERNEL_READ_SIZE ? KERNEL_READ_SIZE : (int)cbKrnl, hKrnl))
+                return -3;
+
+            i = 0;
+        }
+
+        if (kstrncmp("@#IBM:", &achBuffer[i], 6) == 0)
+            break;
+
+        /* next */
+        i++;
+        cbKrnl--;
+    }
+
+    if (cbKrnl == 0)
+    {
+        fclose(hKrnl);
+        return -4;
+    }
+
+    /* displacement */
+    j = 0;
+    while (j < 6 && achBuffer[i+10+j] != '#')
+        j++;
+
+    /* verify signature */
+    if (kstrncmp(&achBuffer[i+10+j], "#@  IBM OS/2 Kernel", 19) != 0)
+        return -5;
+
+    /* read usBuild */
+    usBuild  = (char)(achBuffer[i+6] - '0') * 1000;
+    if (achBuffer[i+7] != '.')
+    {
+        /* this code is for Warp5 */
+        usBuild *= 10;
+        usBuild += (char)(achBuffer[i+7] - '0') * 1000;
+        i++;
+        j--;
+        if (achBuffer[i+7] != '.')
+        {
+            usBuild = usBuild * 10;
+            usBuild = usBuild + (unsigned short)(achBuffer[i+7] - '0') * 1000;
+            i++;
+            j--;
+        }
+    }
+
+    if (j == 0)
+    {
+        usBuild += (achBuffer[i+ 8] - '0') * 10;
+        usBuild += (achBuffer[i+ 9] - '0') * 1;
+    }
+    else
+    {
+        if (j == 3)
+            return -9;
+        usBuild += (achBuffer[i+ 8] - '0') * 100;
+        usBuild += (achBuffer[i+ 9] - '0') * 10;
+        usBuild += (achBuffer[i+10] - '0');
+    }
+
+    if (VerifyKernelVer())
+        return -9;
+    dprintf(("usBuild: %d\n", usBuild));
+
+    /* get segment number */
+    /* read-MZheader */
+    if (fseek(hKrnl,0,SEEK_SET))
+        return -2;
+
+    if (!fread(achBuffer, 1, 0x40, hKrnl))
+        return -3;
+
+    offLXHdr = *(unsigned long int *)&achBuffer[0x3c];
+
+    if (offLXHdr > 0x2000 && offLXHdr < 0x80) /* just to detect garbage */
+        return -6;
+
+    if (fseek(hKrnl, offLXHdr, SEEK_SET))
+        return -2;
+
+    if (!fread(achBuffer, 1, sizeof(struct e32_exe), hKrnl))
+        return -3;
+
+    /* check LX-magic */
+    if (achBuffer[0] != 'L' || achBuffer[1] != 'X')
+        return -7;
+
+#if !defined(DEBUGR3) && !defined(EXTRACT)
+    /* check object count - match it with what we got from the kernel. */
+    pLXHdr = (struct e32_exe *)achBuffer;
+    if ((UCHAR)pLXHdr->e32_objcnt != cObjects)
+        return -8;
+
+    if (pLXHdr->e32_objcnt < 10)
+        return -9;
+
+    /* check objects (sizes and flags(?)) */
+    if (!fseek(hKrnl, (LONG)offLXHdr + (LONG)pLXHdr->e32_objtab, SEEK_SET))
+    {
+        struct o32_obj *pObj = (struct o32_obj *)achBuffer;
+        for (i = 0; i < (int)cObjects; i++)
+        {
+            if (!fread(achBuffer, 1, sizeof(OTE), hKrnl))
+                return -11;
+            if (pObj->o32_size < paKrnlOTEs[i].ote_size)
+                return -12;
+
+            #if 0 /* don't work! */
+            if ((pObj->o32_flags & 0xffffUL) != (paKrnlOTEs[i].ote_flags & 0xffffUL))
+                return -14;
+            #endif
+        }
+    }
+    else
+        return -10;
+#else
+    /* Since we can't get the OTEs from the kernel when debugging in RING-3,
+     * we'll use what we find in the kernel.
+     */
+
+    /*  object count */
+    pLXHdr = (struct e32_exe *)achBuffer;
+    cObjects = (UCHAR)pLXHdr->e32_objcnt;
+    paKrnlOTEs = &KrnlInfo.aObjects[0];
+
+    /* get OTEs */
+    if (!fseek(hKrnl, (LONG)offLXHdr + (LONG)pLXHdr->e32_objtab, SEEK_SET))
+    {
+        struct o32_obj *pObj = (struct o32_obj *)achBuffer;
+        for (i = 0; i < (int)cObjects; i++)
+            if (!fread(&paKrnlOTEs[i], 1, sizeof(struct o32_obj), hKrnl))
+                return -11;
+    }
+    else
+        return -10;
+#endif
+
+    return 0;
+}
+
+
+
 /**
  * Debug - Main procedure for standalone testing.
@@ -1269,5 +1357,184 @@
     ProbeKernel(&ReqPack);
 }
-
 #endif
 
+
+#ifdef EXTRACT
+/**
+ * Dumps writes a KRNLDBENTRY struct to stderr for the given .sym-file.
+ * The filesnames are on this format:
+ *    nnnn[n]tm.SYM
+ * Where: n - are the build number 4 or 5 digits.
+ *        t - kernel type. R = retail, H = half strict, A = all strict.
+ *        m - UNI or SMP.  U = UNI processor kernel. S = SMP processor kernel.
+ * @returns   NO_ERROR on success. Untracable error code on error.
+ * @param     pszFilename  Pointer to read only filename of the .sym-file.
+ * @status    completely implemented.
+ * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
+ * @remark    Currently only retail kernels are processed. See note below.
+ */
+static int processFile(const char *pszFilename)
+{
+    APIRET   rc;
+    int      cch = kstrlen(pszFilename);
+
+    /* Filename check */
+    if (cch < 10 || cch > 11
+        || !(pszFilename[0] >= '0' && pszFilename[0] <= '9')
+        || !(pszFilename[1] >= '0' && pszFilename[1] <= '9')
+        || !(pszFilename[2] >= '0' && pszFilename[2] <= '9')
+        || !(pszFilename[3] >= '0' && pszFilename[3] <= '9')
+        || !(pszFilename[cch-7] >= '0' && pszFilename[cch-7] <= '9')
+        || !(pszFilename[cch-6] == 'A' || pszFilename[cch-6] == 'H' || pszFilename[cch-6] == 'R')
+        || !(pszFilename[cch-5] == 'S' || pszFilename[cch-5] == 'U')
+        )
+    {
+        printf16("invalid filename: %s\n", pszFilename);
+        return 2;
+    }
+
+    /** @remark
+     * All a/h-strict files are currently ignored.
+     * When a debug kernel is used we'll have to use the
+     * .sym-file for it. This is so because I can't distinguish
+     * between a all-strick and a half-strick kernel (yet).
+     */
+    if (pszFilename[cch-6] != 'R')
+        return 0;
+
+    /*
+     * Probe kernelfile
+     */
+    rc = ProbeSymFile(pszFilename);
+
+
+    /*
+     * on success dump a struct for this kernel
+     */
+    if (rc == 0)
+    {
+        int i;
+
+        printf16("    { /* %s */\n"
+                 "        %.*s, \'%c\', %s, %d,\n"
+                 "        {\n",
+                 pszFilename,
+                 cch - 6, &pszFilename[0],                       /* build number */
+                 pszFilename[cch - 6],                           /* Type, A=astrict, H=halfstrict, R=Retail */
+                 pszFilename[cch - 5] == 'S' ? "TRUE" : "FALSE", /* UNI: TRUE  SMP: FALSE */
+                 aImportTab[0].iObject + 1); /* ASSUMES that DOSCODE32 is the last object. */
+
+        for (i = 0; i < NBR_OF_KRNLIMPORTS; i++)
+        {
+            char *psz = aImportTab[i].achName;
+            printf16("            {%2d, 0x%08lx}, /* %s */\n",
+                     aImportTab[i].iObject,
+                     aImportTab[i].offObject,
+                     (char *)&aImportTab[i].achName[0]
+                     );
+        }
+        printf16("        }\n"
+                 "    },\n");
+    }
+    else
+        printf16("ProbeSymFile failed with rc=%d\n", rc);
+
+    return rc;
+}
+
+
+/**
+ * Extract program.
+ *
+ * This is some initial trial-and-error for creating an "database" of
+ * kernel entrypoints.
+ *
+ * Output to stderr the structs generated for the passed in *.sym file.
+ *
+ */
+int main(int argc, char **argv)
+{
+    APIRET  rc;
+
+    if (argc > 1)
+    {
+        /*
+         * Arguments: extract.exe <symfiles...>
+         */
+        int i;
+        for (i = 0; i < argc; i++)
+        {
+            rc = processFile(argv[i]);
+            if (rc != NO_ERROR)
+            {
+                printf16("processFile failed with rc=%d for file %s\n",
+                          rc, argv[i]);
+                return rc;
+            }
+        }
+    }
+    else
+    {
+        /*
+         * Arguments: extract.exe
+         *
+         * Action:    Scan current directory for *.sym files.
+         *
+         */
+        USHORT      usSearch = 1;
+        HDIR        hDir = HDIR_CREATE;
+        FILEFINDBUF ffb;
+        int         i;
+
+        printf16("/* $Id: probkrnl.c,v 1.16 2000-02-25 18:15:02 bird Exp $\n"
+                 "*\n"
+                 "* Autogenerated kernel symbol database.\n"
+                 "*\n"
+                 "* Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@pmsc.no)\n"
+                 "*\n"
+                 "* Project Odin Software License can be found in LICENSE.TXT\n"
+                 "*\n"
+                 "*/\n");
+
+        printf16("\n"
+                 "#include <os2.h>\n"
+                 "#include \"probkrnl.h\"\n"
+                 "\n");
+
+        printf16("KRNLDBENTRY aKrnlSymDB[] = \n"
+                 "{\n");
+
+        rc = DosFindFirst("*.sym", &hDir, FILE_NORMAL,
+                          &ffb, sizeof(ffb),
+                          &usSearch, 0UL);
+        while (rc == NO_ERROR & usSearch > 0)
+        {
+            rc = processFile(&ffb.achName[0]);
+            if (rc != NO_ERROR)
+            {
+                printf16("processFile failed with rc=%d for file %s\n",
+                         rc, &ffb.achName[0]);
+                return rc;
+            }
+
+            /* next file */
+            rc = DosFindNext(hDir, &ffb, sizeof(ffb), &usSearch);
+        }
+        DosFindClose(hDir);
+
+        printf16("    { /* Terminating entry */\n"
+                 "        0,0,0,0,\n"
+                 "        {\n");
+        for (i = 0; i < NBR_OF_KRNLIMPORTS; i++)
+            printf16("            {0,0},\n");
+        printf16("        }\n"
+                 "    }\n"
+                 "}; /* end of aKrnlSymDB[] */\n"
+                 );
+    }
+
+
+    return rc;
+}
+#endif /* EXTRACT */
+
Index: trunk/src/win32k/dev16/vprntf16.c
===================================================================
--- trunk/src/win32k/dev16/vprntf16.c	(revision 2898)
+++ trunk/src/win32k/dev16/vprntf16.c	(revision 2898)
@@ -0,0 +1,570 @@
+/* $Id: vprntf16.c,v 1.1 2000-02-25 18:15:02 bird Exp $
+ *
+ * vprintf and printf - 16-bit.
+ *
+ * WARNING: Do not include stdarg.h! AND it's only for use during init!!!
+ *
+ * Copyright (c) 1999 knut st. osmundsen
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ */
+
+/*******************************************************************************
+*   Defined Constants                                                          *
+*******************************************************************************/
+#define ISDIGIT(c) ((c) >= '0' && (c) <= '9')
+#define MAX(a, b)  ((a) >= (b) ? (a) : (b))
+#define MIN(a, b)  ((a) < (b) ? (a) : (b))
+
+#define NTSF_CAPITAL    0x0001
+#define NTSF_LEFT       0x0002
+#define NTSF_ZEROPAD    0x0004
+#define NTSF_SPECIAL    0x0008
+#define NTSF_VALSIGNED  0x0010
+#define NTSF_PLUS       0x0020
+#define NTSF_BLANK      0x0040
+
+
+#define INCL_DOSPROCESS
+#define INCL_DOSERRORS
+
+/*******************************************************************************
+*   Header Files                                                               *
+*******************************************************************************/
+#include <os2.h>
+
+#include "vprntf16.h"
+#ifdef RING0
+#include "options.h"
+#include "conio.h"
+#endif
+#include "dev16.h"
+
+/*******************************************************************************
+*   Global Variables                                                           *
+*******************************************************************************/
+static char chNewLine = '\n';
+static char chReturn  = '\r';
+
+/*******************************************************************************
+*   Internal Functions                                                         *
+*******************************************************************************/
+static int       _atoi_skip(const char _far **ppsz);
+static unsigned  _strnlen(const char *psz, unsigned cchMax);
+static void      choutconsole(int ch);
+static char *    stroutconsole(char *psz, signed cchMax);
+static void      chout(int ch);
+static char *    strout(char *psz, signed cchMax);
+
+
+/**
+ * Read an integer (decimal) and update the string pointer while reading.
+ * Do not support sign values.
+ * @returns   Integer value.
+ * @param     ppsz  Pointer to pointer to string. The string to be converted.
+ */
+static int _atoi_skip(const char _far **ppsz)
+{
+    int iValue = 0;
+
+    while (ISDIGIT(**ppsz))
+    {
+        iValue *= 10;
+        iValue += **ppsz - '0';
+        (*ppsz)++;
+    }
+
+    return iValue;
+}
+
+
+/**
+ * Finds the length of a string up to cchMax.
+ * @returns   Length.
+ * @param     psz     Pointer to string.
+ * @param     cchMax  Max length.
+ */
+static unsigned _strnlen(const char *psz, unsigned cchMax)
+{
+    const char *pszC = psz;
+
+    while (*psz != '\0' && cchMax-- > 0)
+        psz++;
+
+    return psz - pszC;
+}
+
+
+/**
+ * Formats a number according to the parameters.
+ * @returns   Pointer to next char. (after number)
+ * @param     psz            Pointer to output string.
+ * @param     lValue         Value
+ * @param     uiBase         Number representation base.
+ * @param     cchWidth       Width
+ * @param     cchPrecision   Precision.
+ * @param     fFlags         Flags (NTFS_*).
+ */
+static char * numtostr(long lValue, unsigned int uiBase,
+                       signed int cchWidth, signed int cchPrecision,
+                       unsigned int fFlags
+                       )
+{
+    char *          achDigits = "0123456789abcdef";
+    int             cchValue;
+    unsigned long   ul;
+    int             i;
+    int             j;
+
+#ifdef DEBUG
+    if (uiBase < 2 || uiBase > 16)
+        return NULL;
+#endif
+    if (fFlags & NTSF_CAPITAL)
+        achDigits = "0123456789ABCDEF";
+    if (fFlags & NTSF_LEFT)
+        fFlags &= ~NTSF_ZEROPAD;
+
+    /* determin value length */
+    cchValue = 0;
+    ul = (unsigned long)((fFlags & NTSF_VALSIGNED) && lValue < 0L ? -lValue : lValue);
+    do
+    {
+        cchValue++;
+        ul /= uiBase;
+    } while (ul > 0);
+
+    i = 0;
+    if (fFlags & NTSF_VALSIGNED)
+    {
+        if (lValue < 0)
+        {
+            lValue = -lValue;
+            chout('-');
+            i++;
+        }
+        else if (fFlags & (NTSF_PLUS | NTSF_BLANK))
+        {
+            chout(fFlags & NTSF_PLUS ? '+' : ' ');
+            i++;
+        }
+    }
+
+    if (fFlags & NTSF_SPECIAL && (uiBase % 8) == 0)
+    {
+        chout('0');
+        i++;
+        if (uiBase == 16)
+        {
+            chout(fFlags & NTSF_CAPITAL ? 'X' : 'x');
+            i++;
+        }
+    }
+
+
+    /* width - only if ZEROPAD */
+    cchWidth -= i + cchValue;
+    if (fFlags & NTSF_ZEROPAD)
+        while (--cchWidth >= 0)
+        {
+            chout('0');
+            cchPrecision--;
+        }
+    #if 0
+    else if (!(fFlags & NTSF_LEFT) && cchWidth > 0)
+    {   /* not yet supported! */
+        /*
+        for (j = i-1; j >= 0; j--)
+            psz[cchWidth + j] = psz[j];
+        for (j = 0; j < cchWidth; j++)
+            psz[j] = ' ';
+        i += cchWidth;
+        */
+    }
+    #endif
+
+    /* percision */
+    while (--cchPrecision >= cchValue)
+        chout('0');
+
+    ul = 1;
+    for (i = 1; i < cchValue; i++)
+        ul *= uiBase;
+    for (i = 0; i < cchValue; i++)
+    {
+        chout(achDigits[lValue / ul]);
+        lValue %= ul;
+        ul /= uiBase;
+    }
+
+    /* width if NTSF_LEFT */
+    if (fFlags & NTSF_LEFT)
+        while (--cchWidth >= 0)
+            chout(' ');
+
+
+    return NULL;
+}
+
+
+/**
+ * Partial vprintf implementation.
+ * This function don't check the fLogging flag, and will therefore allways write.
+ * @returns   number of
+ * @param     pszFormat   Format string.
+ * @param     args        Argument list.
+ */
+int vprintf16(const char *pszFormat, va_list args)
+{
+    int cch = 0;
+
+    while (*pszFormat != '\0')
+    {
+        if (*pszFormat == '%')
+        {
+            if (cch > 0)
+            {
+                strout((char*)(pszFormat - cch), cch);
+                cch = 0;
+            }
+
+            pszFormat++;  /* skip '%' */
+            if (*pszFormat == '%')    /* '%%'-> '%' */
+                chout(*pszFormat++);
+            else
+            {
+                long         lValue;
+                unsigned int fFlags = 0;
+                int          cchWidth = -1;
+                int          cchPrecision = -1;
+                unsigned int uiBase = 10;
+                char         chArgSize;
+
+                /* flags */
+                while (1)
+                {
+                    switch (*pszFormat++)
+                    {
+                        case '#':   fFlags |= NTSF_SPECIAL; continue;
+                        case '-':   fFlags |= NTSF_LEFT; continue;
+                        case '+':   fFlags |= NTSF_PLUS; continue;
+                        case ' ':   fFlags |= NTSF_BLANK; continue;
+                        case '0':   fFlags |= NTSF_ZEROPAD; continue;
+                    }
+                    pszFormat--;
+                    break;
+                }
+                /* width */
+                if (ISDIGIT(*pszFormat))
+                    cchWidth = _atoi_skip(&pszFormat);
+                else if (*pszFormat == '*')
+                {
+                    pszFormat++;
+                    cchWidth = va_arg(args, int);
+                    if (cchWidth < 0)
+                    {
+                        cchWidth = -cchWidth;
+                        fFlags |= NTSF_LEFT;
+                    }
+                }
+
+                /* precision */
+                if (*pszFormat == '.')
+                {
+                    pszFormat++;
+                    if (ISDIGIT(*pszFormat))
+                        cchPrecision = _atoi_skip(&pszFormat);
+                    else if (*pszFormat == '*')
+                    {
+                        pszFormat++;
+                        cchPrecision = va_arg(args, int);
+                    }
+                    if (cchPrecision < 0)
+                        cchPrecision = 0;
+                }
+
+                /* argsize */
+                chArgSize = *pszFormat;
+                if (chArgSize != 'l' && chArgSize != 'L' && chArgSize != 'H')
+                    chArgSize = 0;
+                else
+                    pszFormat++;
+
+                /* type */
+                switch (*pszFormat++)
+                {
+                    /* char */
+                    case 'c':
+                        if (!(fFlags & NTSF_LEFT))
+                            while (--cchWidth > 0)
+                                chout(' ');
+
+                        chout(va_arg(args, int));
+
+                        while (--cchWidth > 0)
+                            chout(' ');
+                        continue;
+
+                    case 'd': /* signed decimal integer */
+                    case 'i':
+                        fFlags |= NTSF_VALSIGNED;
+                        break;
+
+                    case 'o':
+                        uiBase = 8;
+                        break;
+
+                    case 'p':
+                        fFlags |= NTSF_SPECIAL; /* Note not standard behaviour (but I like it this way!) */
+                        uiBase = 16;
+                        break;
+
+                    case 's':   /* string */
+                    {
+                        int   cchStr;
+                        char *pszStr = va_arg(args, char*);
+
+                        if (pszStr < (char*)0x10000)
+                            pszStr = "<NULL>";
+                        cchStr = _strnlen(pszStr, (unsigned)cchPrecision);
+                        if (!(fFlags & NTSF_LEFT))
+                            while (--cchWidth >= cchStr)
+                                 chout(' ');
+
+                        pszStr = strout(pszStr, cchStr);
+
+                        while (--cchWidth >= cchStr)
+                            chout(' ');
+                        continue;
+                    }
+
+                    case 'u':
+                        uiBase = 10;
+                        break;
+
+                    case 'x':
+                    case 'X':
+                        uiBase = 16;
+                        break;
+
+                    default:
+                        continue;
+                }
+                /*-----------------*/
+                /* integer/pointer */
+                /*-----------------*/
+                /* get value */
+                if (pszFormat[-1] == 'p')
+                    lValue = (signed long)va_arg(args, char *);
+                else if (chArgSize == 'l')
+                    lValue = va_arg(args, signed long);
+                else if (chArgSize == 'h')
+                    lValue = va_arg(args, signed short);
+                else
+                    lValue = va_arg(args, signed int);
+                numtostr(lValue, uiBase, cchWidth, cchPrecision, fFlags);
+            }
+        }
+        else
+        {
+            cch++;
+            pszFormat++;
+        }
+    }
+
+    if (cch > 0)
+    {
+        strout((char*)(pszFormat - cch), cch);
+        cch = 0;
+    }
+
+    return 0UL;
+}
+
+
+/**
+ * printf - wraps arguments into a vprintf16 call.
+ * @returns   number of bytes written.
+ * @param     pszFormat  Pointer to format string.
+ * @param     ...        Optional parameters.
+ */
+int printf16(const char *pszFormat, ...)
+{
+    int     cch;
+    va_list arguments;
+
+    va_start(arguments, pszFormat);
+    cch = vprintf16(pszFormat, arguments);
+    va_end(arguments);
+
+    return cch;
+}
+
+
+
+/**
+ * Writes a char to output device.
+ * @param     ch  Char to write.
+ * @status    completely
+ * @author    knut st. osmundsen
+ */
+static void choutconsole(int ch)
+{
+    USHORT usWrote;
+
+    if (ch != '\r')
+    {
+        if (ch == '\n')
+        {
+            usWrote = 1;
+            DosWrite(1, (PVOID)&chReturn, 1, &usWrote);
+        }
+        usWrote = 1;
+        DosWrite(1, (PVOID)&ch, 1, &usWrote);
+    }
+}
+
+
+/**
+ * Write a string to the output device.
+ * @returns   pointer end of string.
+ * @param     psz     Pointer to the string to write.
+ * @param     cchMax  Max count of chars to write. (or until '\0')
+ * @status    completely implemented.
+ * @author    knut st. osmundsen
+ * @remark    At inittime the text is outputed to both screen and com-port.
+ *            At runtime the text is only sendt to com-port.
+ */
+static char *stroutconsole(char *psz, signed cchMax)
+{
+    while (cchMax > 0 && *psz != '\0')
+    {
+        USHORT cch = 0;
+        USHORT us;
+
+        while (cchMax - cch > 0 && psz[cch] != '\0' && psz[cch] != '\r' && psz[cch] != '\n')
+            cch++;
+
+        /* write string part */
+        us = cch;
+        DosWrite(1, (PVOID)psz, cch, &us);
+
+        /* cr and lf check + skip */
+        if (psz[cch] == '\n' || psz[cch] == '\r')
+        {
+            if (psz[cch] == '\n')
+            {
+                DosWrite(1, (PVOID)&chReturn, 1, &us);
+                DosWrite(1, (PVOID)&chNewLine, 1, &us);
+            }
+
+            while (cchMax - cch > 0 && (psz[cch] == '\r' || psz[cch] == '\n'))
+                cch++;
+        }
+
+        /* next */
+        psz += cch;
+        cchMax -= cch;
+    }
+    return psz;
+}
+
+
+/**
+ * Writes a char to output device.
+ * @param     ch  Char to write.
+ * @status    completely
+ * @author    knut st. osmundsen
+ */
+static void chout(int ch)
+{
+    #ifdef RING0
+        if (fInitTime)
+            choutconsole(ch);
+        if (!options.fLogging)
+            return;
+        if (ch != '\r')
+        {
+            if (ch == '\n')
+            {
+                while (!(inp(options.usCom + 5) & 0x20));  /* Waits for the port to be ready. */
+                outp(options.usCom, chReturn);             /* Put the char. */
+            }
+            while (!(inp(options.usCom + 5) & 0x20));  /* Waits for the port to be ready. */
+            outp(options.usCom, ch);                   /* Put the char. */
+            /* Yield(); - no 16-bit yield */
+        }
+    #else
+        return choutconsole(ch);
+    #endif
+
+}
+
+
+/**
+ * Write a string to the output device.
+ * @returns   pointer end of string.
+ * @param     psz     Pointer to the string to write.
+ * @param     cchMax  Max count of chars to write. (or until '\0')
+ * @status    completely implemented.
+ * @author    knut st. osmundsen
+ */
+static char *strout(char *psz, signed cchMax)
+{
+    #ifdef RING0
+        int cchYield = 0;
+
+        if (fInitTime)
+            stroutconsole(psz, cchMax);
+
+        if (!options.fLogging)
+            return psz;
+
+        while (cchMax > 0 && *psz != '\0')
+        {
+            ULONG cch = 0;
+            ULONG ul;
+
+            while (cchMax - cch > 0 && psz[cch] != '\0' && psz[cch] != '\r' && psz[cch] != '\n')
+                cch++;
+
+            /* write string part */
+            for (ul = 0; ul < cch; ul++)
+            {
+                while (!(inp(options.usCom + 5) & 0x20));  /* Waits for the port to be ready. */
+                outp(options.usCom, psz[ul]);              /* Put the char. */
+            }
+
+            /* cr and lf check + skip */
+            if (psz[cch] == '\n' || psz[cch] == '\r')
+            {
+                if (psz[cch] == '\n')
+                {
+                    while (!(inp(options.usCom + 5) & 0x20));  /* Waits for the port to be ready. */
+                    outp(options.usCom, chReturn);             /* Put the char. */
+                    while (!(inp(options.usCom + 5) & 0x20));  /* Waits for the port to be ready. */
+                    outp(options.usCom, chNewLine);            /* Put the char. */
+                    cchYield ++;
+                }
+
+                while (cchMax - cch > 0 && (psz[cch] == '\r' || psz[cch] == '\n'))
+                    cch++;
+            }
+
+            /* next */
+            psz += cch;
+            cchMax -= cch;
+            cchYield += cch;
+            if (cchYield > 3)
+                /* if (Yield())  no 16-bit yield. */
+                    cchYield = 0;
+        }
+
+        return psz;
+    #else
+        return stroutconsole(psz, cchMax);
+    #endif
+}
+
+
Index: trunk/src/win32k/dev32/d32globals.c
===================================================================
--- trunk/src/win32k/dev32/d32globals.c	(revision 2895)
+++ trunk/src/win32k/dev32/d32globals.c	(revision 2898)
@@ -1,3 +1,3 @@
-/* $Id: d32globals.c,v 1.4 2000-02-21 15:59:20 bird Exp $
+/* $Id: d32globals.c,v 1.5 2000-02-25 18:15:03 bird Exp $
  *
  * d32globals - global data (32-bit)
@@ -18,5 +18,4 @@
 *******************************************************************************/
 #include <os2.h>
-#include "options.h"
 
 /*******************************************************************************
@@ -24,10 +23,3 @@
 *******************************************************************************/
 PULONG          pulTKSSBase32;
-#ifdef DEBUG
-char szStartOfOptions[] = "START-OF-OPTIONS";
-#endif
-struct options  options = {0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0};
-#ifdef DEBUG
-char szEndOfOptions[] = "END-OF-OPTIONS";
-#endif
 
Index: trunk/src/win32k/dev32/d32init.c
===================================================================
--- trunk/src/win32k/dev32/d32init.c	(revision 2895)
+++ trunk/src/win32k/dev32/d32init.c	(revision 2898)
@@ -1,3 +1,3 @@
-/* $Id: d32init.c,v 1.15 2000-02-23 23:01:00 bird Exp $
+/* $Id: d32init.c,v 1.16 2000-02-25 18:15:03 bird Exp $
  *
  * d32init.c - 32-bits init routines.
@@ -15,4 +15,9 @@
                                         /* the one used in calltab.asm.       */
 #define static                          /* just to make all symbols visible in the kernel debugger.  */
+#if  0                                  /* Enable this to have extra debug logging. */
+    #define kprintf2(a) kprintf
+#else
+    #define kprintf2(a) (void)0
+#endif
 
 
@@ -49,4 +54,8 @@
 static char * apszInfoLevel[] = {"INFOLEVEL_QUIET", "INFOLEVEL_ERROR", "INFOLEVEL_WARNING", "INFOLEVEL_INFO", "INFOLEVEL_INFOALL", "!invalid!"};
 #endif
+static PMTE    pKrnlMTE = NULL;
+static PSMTE   pKrnlSMTE = NULL;
+static POTE    pKrnlOTE = NULL;
+
 
 /*******************************************************************************
@@ -70,9 +79,4 @@
 /* extern(s) located in mytkExecPgm.asm  */
 extern char     mytkExecPgm;
-extern char     CODE32START;
-extern char     CODE32END;
-extern char     CONST32_ROEND;
-extern char     DATA16START;
-extern char     DATA16_CONSTEND;
 
 
@@ -94,15 +98,11 @@
 USHORT _loadds _Far32 _Pascal R0Init32(RP32INIT *pRpInit)
 {
-    char   *pszTmp2;
-    char   *pszTmp;
-    ULONG   ul;
-    APIRET  rc;
-    LOCKHANDLE lhData16={0,0,0,0, 0,0,0,0, 0,0,0,0};
-    LOCKHANDLE lhData = {0,0,0,0, 0,0,0,0, 0,0,0,0};
-    LOCKHANDLE lhCode = {0,0,0,0, 0,0,0,0, 0,0,0,0};
+    char *      pszTmp2;
+    char *      pszTmp;
+    ULONG       ul;
+    APIRET      rc;
+    LOCKHANDLE  lockhandle;
 
     pulTKSSBase32 = (PULONG)_TKSSBase16;
-
-    SET_OPTIONS_TO_DEFAULT(options);
 
     /*---------------------*/
@@ -273,9 +273,10 @@
 
     /* Transfer version and build number from 16-bit probkrnl.c */
-    options.ulBuild    = _ulBuild;
+    options.ulBuild    = _usBuild;
     options.usVerMajor = _usVerMajor;
     options.usVerMinor = _usVerMinor;
 
-    /* log option summary - FIXME */
+    /* Log option summary */
+    #ifdef DEBUG
     kprintf(("Options - Summary - Start\n"));
     if (options.fQuiet)
@@ -306,4 +307,5 @@
              options.cbSwpHeapInit, options.cbSwpHeapMax));
     kprintf(("Options - Summary - End\n"));
+    #endif /* debug */
     /* end option summary */
 
@@ -331,26 +333,29 @@
      */
     /* 32-bit code segment */
+    memset(SSToDS(&lockhandle), 0, sizeof(lockhandle));
     rc = D32Hlp_VMLock2(&CODE32START,
                         ((unsigned)&CODE32END & ~0xFFF) - (unsigned)&CODE32START, /* Round down so we don't overlap with the next request. */
                         VMDHL_LONG,
-                        SSToDS(&lhCode));
+                        SSToDS(&lockhandle));
     if (rc != NO_ERROR)
         kprintf(("code segment lock failed with with rc=%d\n", rc));
 
     /* 32-bit data segment */
+    memset(SSToDS(&lockhandle), 0, sizeof(lockhandle));
     rc = D32Hlp_VMLock2(callTab,
                         &CONST32_ROEND - (char*)callTab,
                         VMDHL_LONG | VMDHL_WRITE,
-                        SSToDS(&lhData));
+                        SSToDS(&lockhandle));
     if (rc != NO_ERROR)
         kprintf(("data segment lock failed with with rc=%d\n", rc));
 
-    /* 16-bit data segment */
+    /* 16-bit data segment - is this necessary? */
+    memset(SSToDS(&lockhandle), 0, sizeof(lockhandle));
     rc = D32Hlp_VMLock2(&DATA16START,
-                        &DATA16_CONSTEND - &DATA16START,
+                        &DATA16END - &DATA16START,
                         VMDHL_LONG | VMDHL_WRITE,
-                        SSToDS(&lhData16));
+                        SSToDS(&lockhandle));
     if (rc != NO_ERROR)
-        kprintf(("data segment lock failed with with rc=%d\n", rc));
+        kprintf(("16-bit data segment lock failed with with rc=%d\n", rc));
 
     return STATUS_DONE;
@@ -371,4 +376,5 @@
     int   i = 0;
 
+    /* determin ulBase */
     if (*pszNum == '0')
         if (pszNum[1] == 'x' || pszNum[1] == 'X')
@@ -403,35 +409,52 @@
 /**
  * Get kernel OTEs
+ * This function set pKrnlMTE, pKrnlSMTE and pKrnlOTE.
  * @returns   Strategy return code:
  *            STATUS_DONE on success.
  *            STATUS_DONE | STERR | errorcode on failure.
- * @param     pOTEBuf  Pointer to output buffer.
+ * @param     pKrnlInfo  Pointer to output buffer.
+ *                       If NULL only the three global variables are set.
  * @status    completely implemented and tested.
  * @author    knut st. osmundsen
  * @remark    Called from IOCtl.
+ *            WARNING! This function is called before the initroutine (R0INIT)!
  */
-USHORT _loadds _Far32 _Pascal GetOTEs32(PKRNLOBJTABLE pOTEBuf)
+USHORT _loadds _Far32 _Pascal GetKernelInfo32(PKRNLINFO pKrnlInfo)
 {
-    PMTE    pMTE;
-    PSMTE   pSMTE;
-    POTE    pOTE;
     int     i;
     USHORT  usRc;
 
-    pMTE = GetOS2KrnlMTE();
-    if (pMTE != NULL)
+    /* VerifyImporTab32 is called before the initroutine! */
+    pulTKSSBase32 = (PULONG)_TKSSBase16;
+
+    /* Find the kernel OTE table */
+    pKrnlMTE = GetOS2KrnlMTE();
+    if (pKrnlMTE != NULL)
     {
-        pSMTE = pMTE->mte_swapmte;
-        if (pSMTE != NULL)
+        pKrnlSMTE = pKrnlMTE->mte_swapmte;
+        if (pKrnlSMTE != NULL)
         {
-            pOTEBuf->cObjects = (unsigned char)pSMTE->smte_objcnt;
-            if (pSMTE->smte_objcnt <= MAXKRNLOBJECTS)
+            if (pKrnlSMTE->smte_objcnt <= MAXKRNLOBJECTS)
             {
-                pOTE = pSMTE->smte_objtab;
-                if (pOTE != NULL)
+                pKrnlOTE = pKrnlSMTE->smte_objtab;
+                if (pKrnlOTE != NULL)
                 {
-                    /* Copy OTEs */
-                    for (i = 0; i < pOTEBuf->cObjects; i++)
-                        memcpy((void*)&pOTEBuf->aObjects[i], &pOTE[i], sizeof(OTE));
+                    /*
+                     * Thats all?
+                     */
+                    if (pKrnlInfo == NULL)
+                        return NO_ERROR;
+
+                    pKrnlInfo->cObjects = (unsigned char)pKrnlSMTE->smte_objcnt;
+
+                    /*
+                     * Copy OTEs
+                     */
+                    for (i = 0; i < pKrnlInfo->cObjects; i++)
+                    {
+                        memcpy((void*)&pKrnlInfo->aObjects[i], &pKrnlOTE[i], sizeof(OTE));
+                        kprintf2(("GetKernelInfo32: %d base=0x%08x size=0x%08x flags=0x%08x\n",
+                                  i, pKrnlOTE[i].ote_base, pKrnlOTE[i].ote_size, pKrnlOTE[i].ote_flags));
+                    }
                     usRc = 0;
 
@@ -439,19 +462,83 @@
                      * Search for internal revision stuff in the two first objects.
                      */
-                    #if 0
-                    for (i = 0; i < 2; i++)
+                    pKrnlInfo->usBuild = 0;
+                    for (i = 0; i < 2 && pKrnlInfo->usBuild == 0; i++)
                     {
-                        const char *psz = (const char*)pOTE[i].ote_base;
-                        const char *pszEnd = psz + pOTE[i].ote_size;
+                        const char *psz = (const char*)pKrnlOTE[i].ote_base;
+                        const char *pszEnd = psz + pKrnlOTE[i].ote_size;
 
                         while (psz + 100 < pszEnd)
                         {
-                            strncmp(psz, "Internal revision");
+                            if (strncmp(psz, "Internal revision ", 18) == 0 && (psz[18] >= '0' && psz[18] <= '9'))
+                            {
+                                int j;
+                                kprintf2(("GetOTEs32: found internal revision: '%s'\n", psz));
+
+                                /* skip to end of "Internal revision " string. */
+                                psz += 18;
+
+                                /* Read number*/
+                                while ((*psz >= '0' && *psz <= '9') || *psz == '.')
+                                {
+                                    if (*psz != '.')
+                                        pKrnlInfo->usBuild = (unsigned short)(pKrnlInfo->usBuild * 10 + (*psz - '0'));
+                                    psz++;
+                                }
+
+                                /* Check if build number seems valid. */
+                                if (   !(pKrnlInfo->usBuild >=  8254 && pKrnlInfo->usBuild <  8383) /* Warp 3 fp 32 -> fp 60 */
+                                    && !(pKrnlInfo->usBuild >=  9023 && pKrnlInfo->usBuild <  9063) /* Warp 4 GA -> fp 40 */
+                                    && !(pKrnlInfo->usBuild >= 14039 && pKrnlInfo->usBuild < 14080) /* Warp 4.5 GA -> fp 40 */
+                                      )
+                                {
+                                    kprintf(("GetOTEs32: info summary: Build %d is invalid - invalid fixpack?\n", pKrnlInfo->usBuild));
+                                    usRc = 6;
+                                    break;
+                                }
+
+                                /* If this is an Aurora or Warp 3 kernel there is more info! */
+                                pKrnlInfo->fSMP = (char)(*psz != ','
+                                    && (   (psz[1] == '_' && (psz[2] == 'S' || psz[2] == 's'))  /* F_SMP */
+                                        || (psz[2] == '_' && (psz[1] == 'S' || psz[1] == 's'))));/* _SMP  */
+
+                                /* Check if its a debug kernel (look for DEBUG at start of object 3-5) */
+                                j = 3;
+                                pKrnlInfo->fDebug = FALSE;
+                                while (j < 5)
+                                {
+
+                                    /* There should be no iopl object preceding the debugger data object. */
+                                    if ((pKrnlOTE[j].ote_flags & OBJIOPL) != 0)
+                                        break;
+                                    /* Is this is? */
+                                    if ((pKrnlOTE[j].ote_flags & OBJINVALID) == 0
+                                        && (pKrnlOTE[j].ote_flags & (OBJREAD | OBJWRITE)) == (OBJREAD | OBJWRITE)
+                                        && strncmp((char*)pKrnlOTE[j].ote_base, "DEBUG", 5) == 0)
+                                    {
+                                        pKrnlInfo->fDebug = TRUE;
+                                        break;
+                                    }
+                                    j++;
+                                }
+
+                                /* Display info */
+                                kprintf(("GetOTEs32: info summary: Build %d, fSMP=%d, fDebug=%d\n",
+                                         pKrnlInfo->usBuild, pKrnlInfo->fSMP, pKrnlInfo->fDebug));
+
+                                /* Break out */
+                                break;
+                            }
 
                             /* next */
                             psz++;
-                        }
+                        } /* while loop searching for "Internal revision " */
+                    } /* for loop on objects 0-1. */
+
+                    /* Set error code if not found */
+                    if (pKrnlInfo->usBuild == 0)
+                    {
+                        usRc = 5;
+                        kprintf(("GetOTEs32: Internal revision was not found!\n"));
                     }
-                    #endif
                 }
                 else
@@ -466,4 +553,5 @@
     else
         usRc = 1;
+
 
     if (usRc != 0)
@@ -515,10 +603,10 @@
     int cb = -3;
 
-    kprintf(("interpretFunctionProlog32(0x%08x, %d):\n"
-             "\t%02x %02x %02x %02x - %02x %02x %02x %02x\n"
-             "\t%02x %02x %02x %02x - %02x %02x %02x %02x\n",
-             pach, fOverload,
-             pach[0], pach[1], pach[2], pach[3], pach[4], pach[5], pach[6], pach[7],
-             pach[8], pach[9], pach[10],pach[11],pach[12],pach[13],pach[14],pach[15]));
+    kprintf2(("interpretFunctionProlog32(0x%08x, %d):\n"
+              "\t%02x %02x %02x %02x - %02x %02x %02x %02x\n"
+              "\t%02x %02x %02x %02x - %02x %02x %02x %02x\n",
+              pach, fOverload,
+              pach[0], pach[1], pach[2], pach[3], pach[4], pach[5], pach[6], pach[7],
+              pach[8], pach[9], pach[10],pach[11],pach[12],pach[13],pach[14],pach[15]));
 
     /*
@@ -699,10 +787,10 @@
     int cb = -7;
 
-    kprintf(("interpretFunctionProlog16(0x%08x, %d):\n"
-             "\t%02x %02x %02x %02x - %02x %02x %02x %02x\n"
-             "\t%02x %02x %02x %02x - %02x %02x %02x %02x\n",
-             pach, fOverload,
-             pach[0], pach[1], pach[2], pach[3], pach[4], pach[5], pach[6], pach[7],
-             pach[8], pach[9], pach[10],pach[11],pach[12],pach[13],pach[14],pach[15]));
+    kprintf2(("interpretFunctionProlog16(0x%08x, %d):\n"
+              "\t%02x %02x %02x %02x - %02x %02x %02x %02x\n"
+              "\t%02x %02x %02x %02x - %02x %02x %02x %02x\n",
+              pach, fOverload,
+              pach[0], pach[1], pach[2], pach[3], pach[4], pach[5], pach[6], pach[7],
+              pach[8], pach[9], pach[10],pach[11],pach[12],pach[13],pach[14],pach[15]));
     /*
      * Check for the well known prolog (the only that is supported now)
@@ -817,5 +905,5 @@
  * @returns   0 if ok. !0 if not ok.
  * @remark    Called from IOCtl.
- *            WARNING! VerifyImporTab32 is called before the initroutine!
+ *            WARNING! This function is called before the initroutine (R0INIT)!
  */
 USHORT _loadds _Far32 _Pascal VerifyImportTab32(void)
@@ -828,20 +916,50 @@
     pulTKSSBase32 = (PULONG)_TKSSBase16;
 
-    /* verify */
+    /* Check that pKrnlOTE is set */
+    if (GetKernelInfo32(NULL) != NO_ERROR)
+        return STATUS_DONE | STERR | 1;
+
+    /*
+     * Verify aImportTab.
+     */
     for (i = 0; i < NBR_OF_KRNLIMPORTS; i++)
     {
-        /* verify that it is found */
+        /*
+         * Debug info
+         */
+        kprintf2(("VerifyImportTab32: procedure no.%d is being checked: %s addr=0x%08x iObj=%d offObj=%d\n",
+                  i, &_aImportTab[i].achName[0], _aImportTab[i].ulAddress,
+                  _aImportTab[i].iObject, _aImportTab[i].offObject));
+
+        /* Verify that it is found */
         if (!_aImportTab[i].fFound)
         {
-            kprintf(("VerifyImportTab32: procedure no.%d was not found!\n", i));
-            return STATUS_DONE | STERR | 1;
+            kprintf(("VerifyImportTab32: procedure no.%d was not fFound!\n", i));
+            return STATUS_DONE | STERR | 2;
         }
 
-        /* verify read/writeable. - FIXME */
+        /* Verify read/writeable. */
+        if (_aImportTab[i].iObject >= pKrnlSMTE->smte_objcnt                                /* object index valid? */
+            || _aImportTab[i].ulAddress < pKrnlOTE[_aImportTab[i].iObject].ote_base         /* address valid? */
+            || _aImportTab[i].ulAddress + 16 > (pKrnlOTE[_aImportTab[i].iObject].ote_base +
+                                                pKrnlOTE[_aImportTab[i].iObject].ote_size)  /* address valid? */
+            || _aImportTab[i].ulAddress - _aImportTab[i].offObject
+               != pKrnlOTE[_aImportTab[i].iObject].ote_base                                 /* offObject ok?  */
+            )
+        {
+            kprintf(("VerifyImportTab32: procedure no.%d has an invalid address or object number.!\n"
+                     "                   %s  addr=0x%08x iObj=%d offObj=%d\n",
+                     i, &_aImportTab[i].achName[0], _aImportTab[i].ulAddress,
+                     _aImportTab[i].iObject, _aImportTab[i].offObject));
+            return STATUS_DONE | STERR | 3;
+        }
+
+
+
         if (_aImportTab[i].ulAddress < 0xffe00000UL)
         {
-            kprintf(("VerifyImportTab32: procedure no.%d has an invlalid address, %#08x!\n",
+            kprintf(("VerifyImportTab32: procedure no.%d has an invalid address, %#08x!\n",
                      i, _aImportTab[i].ulAddress));
-            return STATUS_DONE | STERR | 2;
+            return STATUS_DONE | STERR | 4;
         }
 
@@ -855,10 +973,12 @@
                 if (EPT32BitEntry(_aImportTab[i]))
                 {
-                    cb = interpretFunctionProlog32((char*)_aImportTab[i].ulAddress, _aImportTab[i].fType == EPT_PROC32);
+                    cb = interpretFunctionProlog32((char*)_aImportTab[i].ulAddress,
+                                                   _aImportTab[i].fType == EPT_PROC32);
                     cbmin = 5; /* Size of the jump instruction */
                 }
                 else
                 {
-                    cb = interpretFunctionProlog16((char*)_aImportTab[i].ulAddress, _aImportTab[i].fType == EPT_PROC16);
+                    cb = interpretFunctionProlog16((char*)_aImportTab[i].ulAddress,
+                                                   _aImportTab[i].fType == EPT_PROC16);
                     cbmin = 7; /* Size of the far jump instruction */
                 }
@@ -870,5 +990,5 @@
                 {   /* failed, too small or too large. */
                     kprintf(("VerifyImportTab32: verify failed for procedure no.%d (cd=%d)\n", i, cb));
-                    return STATUS_DONE | STERR | 3;
+                    return STATUS_DONE | STERR | 5;
                 }
                 break;
@@ -881,5 +1001,5 @@
                 kprintf(("VerifyImportTab32: only EPT_PROC is implemented\n",i));
                 Int3(); /* temporary fix! */
-                return STATUS_DONE | STERR | 4;
+                return STATUS_DONE | STERR | 6;
         }
     }
Index: trunk/src/win32k/dev32/devfirst.asm
===================================================================
--- trunk/src/win32k/dev32/devfirst.asm	(revision 2895)
+++ trunk/src/win32k/dev32/devfirst.asm	(revision 2898)
@@ -1,3 +1,3 @@
-; $Id: devfirst.asm,v 1.4 2000-02-21 04:45:46 bird Exp $
+; $Id: devfirst.asm,v 1.5 2000-02-25 18:15:03 bird Exp $
 ;
 ; DevFirst - entrypoint and segment definitions
@@ -28,8 +28,11 @@
     public BSS32START
     public CONST32_ROSTART
+    public _VFTSTART
+    public EH_DATASTART
+
 
     public _strategyAsm0
     public _strategyAsm1
-    public _CallGetOTEs32
+    public _CallGetKernelInfo32
     public _CallElfIOCtl
     public _CallWin32kIOCtl
@@ -42,5 +45,5 @@
 ;
     extrn _TKSSBase16:dword
-    extrn GETOTES32:FAR
+    extrn GETKERNELINFO32:FAR
     extrn ELFIOCTL:FAR
     extrn WIN32KIOCTL:FAR
@@ -86,18 +89,18 @@
 ;;
 ; Thunk procedure for R0Init32.
-; @cproto    USHORT NEAR CallGetOTEs32(ULONG addressOTEBuf);
-; @returns   Same as GetOTEs32.
-; @param     address of OTEBuf  32-bit pointer to request data.
-; @status    completely implemented.
-; @author    knut st. osmundsen
-_CallGetOTEs32 PROC NEAR
+; @cproto    USHORT NEAR CallGetKernelInfo32(ULONG addressKrnlInfoBuf);
+; @returns   Same as GetKernelInfo32.
+; @param     addressKrnlInfoBuf  32-bit pointer to request data on stack.
+; @status    completely implemented.
+; @author    knut st. osmundsen
+_CallGetKernelInfo32 PROC NEAR
     ASSUME CS:CODE16
     push    ds
     push    word ptr [esp+6]            ; push high word.
     push    word ptr [esp+6]            ; push low word.
-    call    far ptr FLAT:GETOTES32
+    call    far ptr FLAT:GETKERNELINFO32
     pop     ds
     retn
-_CallGetOTEs32 ENDP
+_CallGetKernelInfo32 ENDP
 
 
Index: trunk/src/win32k/dev32/devlast.asm
===================================================================
--- trunk/src/win32k/dev32/devlast.asm	(revision 2895)
+++ trunk/src/win32k/dev32/devlast.asm	(revision 2898)
@@ -1,3 +1,3 @@
-; $Id: devlast.asm,v 1.4 2000-02-21 04:45:46 bird Exp $
+; $Id: devlast.asm,v 1.5 2000-02-25 18:15:03 bird Exp $
 ;
 ; DevLast - the object file termintating the resident part of the objects.
@@ -30,4 +30,6 @@
     public BSS32END
     public CONST32_ROEND
+    public _VFTEND
+    public EH_DATAEND
     public _CallR0Init32
     public _CallVerifyImportTab32
@@ -93,9 +95,9 @@
 
 CODE32 segment
-CODE32END db ?
+CODE32END LABEL BYTE
 CODE32 ends
 
 DATA32 segment
-DATA32END  db ?
+DATA32END  LABEL BYTE
 DATA32 ends
 
Index: trunk/src/win32k/include/dev16.h
===================================================================
--- trunk/src/win32k/include/dev16.h	(revision 2895)
+++ trunk/src/win32k/include/dev16.h	(revision 2898)
@@ -1,3 +1,3 @@
-/* $Id: dev16.h,v 1.7 2000-02-21 04:45:46 bird Exp $
+/* $Id: dev16.h,v 1.8 2000-02-25 18:15:04 bird Exp $
  * dev16 - 16-bit specific. Should not be used in 32-bit C/C++.
  *
@@ -13,4 +13,10 @@
 typedef ULONG       LIN;
 typedef ULONG  FAR *PLIN;
+#endif
+#ifndef MAX_DISKDD_CMD   /* macro from reqpkt.h where these normally is declared. */
+typedef void   FAR *PRPINITIN;
+typedef void   FAR *PRPINITOUT;
+typedef void   FAR *PRP_GENIOCTL;
+typedef ULONG       DDHDR;
 #endif
 
@@ -36,11 +42,12 @@
  * Get Kernel OTEs. No params. Data is KRNLOBJTABLE (dev1632.h).
  */
-#define D16_IOCTL_GETKRNLOTES       0x41
+#define D16_IOCTL_GETKRNLINFO       0x41
 
 
 /*
- * Get Kernel OTEs. No params. No data. aImportTab is used.
+ * Verify aImportTab. No params. No data (aImportTab is used).
  */
-#define D16_IOCTL_VERIFYPROCTAB     0x42
+#define D16_IOCTL_VERIFYIMPORTTAB   0x42
+
 
 /**
@@ -112,5 +119,5 @@
  */
 USHORT NEAR CallR0Init32(LIN pRpInit);
-USHORT NEAR CallGetOTEs32(ULONG addressOTEBuf);
+USHORT NEAR CallGetKernelInfo32(ULONG addressKrnlInfoBuf);
 USHORT NEAR CallVerifyImportTab32(void);
 USHORT NEAR CallElfIOCtl(LIN pRpIOCtl);
@@ -132,4 +139,5 @@
 extern USHORT   R0FlatCS16;
 extern USHORT   R0FlatDS16;
+extern BOOL     fInitTime;
 
 
@@ -155,4 +163,6 @@
 extern char PASCAL BSS32START       ;
 extern char PASCAL CONST32_ROSTART  ;
+extern char PASCAL _VFTSTART        ;
+extern char PASCAL EH_DATASTART     ;
 
 extern char PASCAL CODE16END      ;
@@ -166,4 +176,6 @@
 extern char PASCAL BSS32END       ;
 extern char PASCAL CONST32_ROEND  ;
+extern char PASCAL _VFTEND        ;
+extern char PASCAL EH_DATAEND     ;
 
 
Index: trunk/src/win32k/include/dev1632.h
===================================================================
--- trunk/src/win32k/include/dev1632.h	(revision 2895)
+++ trunk/src/win32k/include/dev1632.h	(revision 2898)
@@ -1,3 +1,3 @@
-/* $Id: dev1632.h,v 1.3 2000-02-19 23:52:00 bird Exp $
+/* $Id: dev1632.h,v 1.4 2000-02-25 18:15:04 bird Exp $
  * dev1632.h - Common header file for 16-bit and 32-bit C
  *
@@ -48,13 +48,16 @@
 
 #define MAXKRNLOBJECTS 24
-typedef struct _KRNLOBJTABLE
+typedef struct _KRNLINFO
 {
     unsigned char   cObjects;
+    unsigned char   fDebug;
+    unsigned char   fSMP;
+    unsigned short  usBuild;
     OTE             aObjects[MAXKRNLOBJECTS];
-} KRNLOBJTABLE, FAR * PKRNLOBJTABLE;
+} KRNLINFO, FAR * PKRNLINFO;
 
 #else
 
-#define PKRNLOBJTABLE void *
+#define PKRNLINFO void *
 
 #endif
Index: trunk/src/win32k/include/dev32.h
===================================================================
--- trunk/src/win32k/include/dev32.h	(revision 2895)
+++ trunk/src/win32k/include/dev32.h	(revision 2898)
@@ -1,3 +1,3 @@
-/* $Id: dev32.h,v 1.7 2000-02-21 04:45:46 bird Exp $
+/* $Id: dev32.h,v 1.8 2000-02-25 18:15:04 bird Exp $
  *
  * dev32 - header file for 32-bit part of the driver.
@@ -23,5 +23,5 @@
     #define RP32GENIOCTL    void
     #define PRP32GENIOCTL   void *
-    #define PKRNLOBJTABLE   void *
+    #define PKRNLINFO       void *
 #endif
 
@@ -56,5 +56,5 @@
 #if !defined(__cplusplus) && defined(RING0)
 USHORT _loadds _Far32 _Pascal R0Init32(RP32INIT *pRpInit);
-USHORT _loadds _Far32 _Pascal GetOTEs32(PKRNLOBJTABLE pOTEBuf);
+USHORT _loadds _Far32 _Pascal GetKernelInfo32(PKRNLINFO pKrnlInfo);
 USHORT _loadds _Far32 _Pascal VerifyImportTab32(void);
 USHORT _loadds _Far32 _Pascal ElfIOCtl(PRP32GENIOCTL pRpIOCtl);
@@ -96,3 +96,36 @@
 #endif
 
+
+/*
+ * START and END labels. NOTE: these are not bytes only assembly labels.
+ */
+extern char CODE16START      ;
+extern char DATA16START      ;
+extern char DATA16START      ;
+extern char DATA16_BSSSTART  ;
+extern char DATA16_CONSTSTART;
+extern char CODE16START      ;
+extern char CODE32START      ;
+extern char DATA32START      ;
+extern char BSS32START       ;
+extern char CONST32_ROSTART  ;
+extern char _VFTSTART        ;
+extern char EH_DATASTART     ;
+
+extern char CODE16END      ;
+extern char DATA16END      ;
+extern char DATA16END      ;
+extern char DATA16_BSSEND  ;
+extern char DATA16_CONSTEND;
+extern char CODE16END      ;
+extern char CODE32END      ;
+extern char DATA32END      ;
+extern char BSS32END       ;
+extern char CONST32_ROEND  ;
+extern char _VFTEND        ;
+extern char EH_DATAEND     ;
+
+
+
+
 #endif
Index: trunk/src/win32k/include/log.h
===================================================================
--- trunk/src/win32k/include/log.h	(revision 2895)
+++ trunk/src/win32k/include/log.h	(revision 2898)
@@ -1,8 +1,11 @@
-/* $Id: log.h,v 1.3 1999-10-27 02:02:56 bird Exp $
+/* $Id: log.h,v 1.4 2000-02-25 18:15:04 bird Exp $
  *
  * log - C-style logging - kprintf.
  * Dual mode, RING0 and RING3.
+ * Dual 16 and 32 bit.
  *
- * Copyright (c) 1998-1999 knut st. osmundsen
+ * Define NOLOGGING to disable logging for the given sourcefile or the entire system.
+ *
+ * Copyright (c) 1998-2000 knut st. osmundsen
  *
  * Project Odin Software License can be found in LICENSE.TXT
@@ -28,10 +31,17 @@
  */
 #define dprintf kprintf
-#ifdef DEBUG
-    #include <stdarg.h>
-    #include "vprintf.h"
-    #define kprintf(a)          printf a
+#if defined(DEBUG) && !defined(NOLOGGING)
+    #ifndef INCL_16
+        /* 32-bit */
+        #include <stdarg.h>
+        #include "vprintf.h"
+        #define kprintf(a)          printf a
+    #else
+        /* 16-bit */
+        #include "vprntf16.h"
+        #define kprintf(a)          printf16 a
+    #endif
 #else
-    #define kprintf(a)          (void)0
+    #define kprintf(a)              (void)0
 #endif
 
Index: trunk/src/win32k/include/options.h
===================================================================
--- trunk/src/win32k/include/options.h	(revision 2895)
+++ trunk/src/win32k/include/options.h	(revision 2898)
@@ -1,3 +1,3 @@
-/* $Id: options.h,v 1.9 2000-02-21 15:59:21 bird Exp $
+/* $Id: options.h,v 1.10 2000-02-25 18:15:06 bird Exp $
  *
  * Options.
@@ -16,6 +16,6 @@
 *******************************************************************************/
 /* fKernel */
-#define KF_UNI      0x00000000UL
-#define KF_SMP      0x00000001UL
+#define KF_UNI              0x00000000UL
+#define KF_SMP              0x00000001UL
 
 /* fPE */
@@ -26,35 +26,35 @@
 
 /* ulInfoLevel */
-#define INFOLEVEL_QUIET      0x00000000UL
-#define INFOLEVEL_ERROR      0x00000001UL
-#define INFOLEVEL_WARNING    0x00000002UL
-#define INFOLEVEL_INFO       0x00000003UL
-#define INFOLEVEL_INFOALL    0x00000004UL
+#define INFOLEVEL_QUIET     0x00000000UL
+#define INFOLEVEL_ERROR     0x00000001UL
+#define INFOLEVEL_WARNING   0x00000002UL
+#define INFOLEVEL_INFO      0x00000003UL
+#define INFOLEVEL_INFOALL   0x00000004UL
 
 /* default heapsizes */
-#define CB_SWP_INIT         (1024*512)
-#define CB_SWP_MAX          (1024*1024*16)
-#define CB_RES_INIT         (1024*256)
-#define CB_RES_MAX          (1024*1024*10)
+#define CB_SWP_INIT         (1024*512)      /* 512KB */
+#define CB_SWP_MAX          (1024*1024*16)  /*  16MB  */
+#define CB_RES_INIT         (1024*256)      /* 256KB */
+#define CB_RES_MAX          (1024*1024*10)  /*  10MB  */
 
+/* default assignments */
+#define DEFAULT_OPTION_ASSIGMENTS                           \
+            {FALSE,                 /* fQuiet        */     \
+            OUTPUT_COM2,            /* usCom         */     \
+            FALSE,                  /* fLogging      */     \
+            KF_UNI,                 /* fKernel       */     \
+            ~0UL,                   /* ulBuild       */     \
+            (unsigned short)~0,     /* usVerMajor    */     \
+            (unsigned short)~0,     /* usVerMinor    */     \
+            FLAGS_PE_PE2LX,         /* fPE           */     \
+            INFOLEVEL_QUIET,        /* ulInfoLevel   */     \
+            FALSE,                  /* fElf          */     \
+            TRUE,                   /* fScript       */     \
+            FALSE,                  /* fNoLoader     */     \
+            CB_SWP_INIT,            /* cbSwpHeapInit */     \
+            CB_SWP_MAX,             /* cbSwpHeapMax  */     \
+            CB_RES_INIT,            /* cbResHeapInit */     \
+            CB_RES_MAX}             /* cbResHeapMax  */
 
-/* Set defaults. */
-#define SET_OPTIONS_TO_DEFAULT(o)                   \
-            o.fQuiet        = FALSE;                \
-            o.usCom         = OUTPUT_COM2;          \
-            o.fLogging      = FALSE;                \
-            o.fKernel       = KF_UNI;               \
-            o.ulBuild       = ~0UL;                 \
-            o.usVerMajor    = (unsigned short)~0;   \
-            o.usVerMinor    = (unsigned short)~0;   \
-            o.fPE           = FLAGS_PE_PE2LX;       \
-            o.ulInfoLevel   = INFOLEVEL_QUIET;      \
-            o.fElf          = FALSE;                \
-            o.fScript       = TRUE;                 \
-            o.fNoLoader     = FALSE;                \
-            o.cbSwpHeapInit = CB_SWP_INIT;          \
-            o.cbSwpHeapMax  = CB_SWP_MAX;           \
-            o.cbResHeapInit = CB_RES_INIT;          \
-            o.cbResHeapMax  = CB_RES_MAX;
 
 
@@ -63,12 +63,13 @@
 *******************************************************************************/
 /** Option struct */
+#pragma pack(4)
 struct options
 {
     /** @cat misc */
-    BOOL        fQuiet;                 /* Quiet initialization. */
+    ULONG       fQuiet;                 /* Quiet initialization. */
 
     /** @cat logging options */
     USHORT      usCom;                  /* Output port no. */
-    BOOL        fLogging;               /* Logging. */
+    ULONG       fLogging;               /* Logging. */
 
     /** @cat kernel selection */
@@ -79,15 +80,15 @@
 
     /** @cat Options affecting the generated LX executables */
-    BOOL        fPE;                    /* Flags set the type of conversion. */
+    ULONG       fPE;                    /* Flags set the type of conversion. */
     ULONG       ulInfoLevel;            /* Pe2Lx InfoLevel. */
 
     /** @cat Options affecting the generated ELF executables */
-    BOOL        fElf;                   /* Elf flags. */
+    ULONG       fElf;                   /* Elf flags. */
 
     /** @cat Options affecting the script executables */
-    BOOL        fScript;                /* Script flags. */
+    ULONG       fScript;                /* Script flags. */
 
     /** @cat Options affecting the script executables */
-    BOOL        fNoLoader;              /* No loader stuff. */
+    ULONG       fNoLoader;              /* No loader stuff. */
 
     /** @cat Options affecting the heap. */
@@ -97,9 +98,14 @@
     ULONG       cbResHeapMax;           /* Maxiumem residentheapsize. */
 };
+#pragma pack()
+
 
 /*******************************************************************************
 *   Global Variables                                                           *
 *******************************************************************************/
-extern struct options options;          /* defined in d32globals.c */
+extern struct options options;      /* defined in d32globals.c */
+#if defined(__IBMC__) || defined(__IBMCPP__)
+    #pragma map( options , "_options"  )
+#endif
 
 #endif
Index: trunk/src/win32k/include/probkrnl.h
===================================================================
--- trunk/src/win32k/include/probkrnl.h	(revision 2895)
+++ trunk/src/win32k/include/probkrnl.h	(revision 2898)
@@ -1,3 +1,3 @@
-/* $Id: probkrnl.h,v 1.10 2000-02-21 09:24:00 bird Exp $
+/* $Id: probkrnl.h,v 1.11 2000-02-25 18:15:06 bird Exp $
  *
  * Include file for ProbKrnl.
@@ -61,4 +61,24 @@
 
 
+/*
+ * Database of kernel symbols.
+ */
+#pragma pack(1)
+typedef struct
+{
+    unsigned short usBuild;             /* Build number */
+    unsigned char  chType;              /* R, H, A */
+    unsigned char  fSMP;                /* TRUE / FALSE */
+    unsigned char  cObjects;            /* Count of objects */
+    struct
+    {
+        unsigned char iObject;          /* Object number.  */
+        unsigned long offObject;        /* offset into object of the symbol. */
+    } aSyms[NBR_OF_KRNLIMPORTS];
+
+} KRNLDBENTRY, *PKRNLDBENTRY;
+#pragma pack()
+
+
 
 /*******************************************************************************
@@ -67,9 +87,12 @@
 *******************************************************************************/
 extern IMPORTKRNLSYM _aImportTab[NBR_OF_KRNLIMPORTS]; /* 'aImportTab' in PrbKrnl.c */
-extern unsigned long int  _ulBuild;     /* 'ulBuild'         in PrbKrnl.c */
+extern unsigned short int _usBuild;     /* 'ulBuild'         in PrbKrnl.c */
 extern unsigned short int _usVerMajor;  /* 'usVerMajor'      in PrbKrnl.c */
 extern unsigned short int _usVerMinor;  /* 'usVerMinor'      in PrbKrnl.c */
+extern KRNLDBENTRY aKrnlSymDB[];        /* defined in symdb.c (for 16-bit usage) */
+extern KRNLDBENTRY _aKrnlSymDB[];       /* defined in symdb.c (for 32-bit usage) */
 
-#ifdef INCL_16 /* 16-bit only */
+
+#if defined(INCL_16) && defined(MAX_DISKDD_CMD) /* 16-bit only */
 int ProbeKernel(PRPINITIN pReqPack);
 #endif
Index: trunk/src/win32k/include/vprntf16.h
===================================================================
--- trunk/src/win32k/include/vprntf16.h	(revision 2898)
+++ trunk/src/win32k/include/vprntf16.h	(revision 2898)
@@ -0,0 +1,39 @@
+/* $Id: vprntf16.h,v 1.1 2000-02-25 18:15:06 bird Exp $
+ *
+ * printf/vprintf header file - 16bit.
+ *
+ * WARNING: Do not include stdarg.h! AND it's only for use during init!!!
+ *
+ * Copyright (c) 1999 knut st. osmundsen
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ */
+
+#ifndef _vprintf_h_
+#define _vprintf_h_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Argument definitions.
+ */
+typedef char _far *va_list;
+#define va_start(ap,v) ap = (va_list)&v + sizeof(v)
+#define va_arg(ap, t) ((t _far *)(ap += sizeof(t)))[-1]
+#define va_end(ap) ap = NULL
+
+
+/*
+ * Function prototypes
+ */
+int printf16(const char *pszFormat, ...);
+int vprintf16(const char *pszFormat, va_list args);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif
Index: trunk/src/win32k/win32k.txt
===================================================================
--- trunk/src/win32k/win32k.txt	(revision 2895)
+++ trunk/src/win32k/win32k.txt	(revision 2898)
@@ -1,3 +1,3 @@
-x.0 Win32k.sys - native OS/2 PE-"loader"
+2.3.0 Win32k.sys - native OS/2 PE-"loader"
 ----------------------------------------
 
@@ -5,5 +5,5 @@
 executables by implementing a Ring 0 on-the-fly converter. The converter is
 Pe2Lx.exe. So, everything that works with Pe2Lx will probably work with
-win32k.sys. And vice versa, when Pe2lx don't make it, win32k.sys won't either.
+win32k.sys. And vice versa, when Pe2lx can't handle it, win32k.sys won't either.
 
 You may wonder how you may run a Win32 program using a device driver. You
@@ -22,6 +22,6 @@
 
 
-x.1 WARNING
------------
+2.3.1 WARNING
+-------------
 
 The Win32k.sys is quite alpha software and any bugs which haven't been found
@@ -37,29 +37,38 @@
 
 
-x.2 Requirements
-----------------
+2.3.2 Requirements
+------------------
 
 Win32k should work on any Warp 4 or Warp Server for e-business installations
-which Odin32 works on. It requires only one thing, a kernel symbol file. The
-kernel symbol is looked for in \OS2\PDPSI\PMDF\WARP4 and
-\OS2\PDPSI\PMDF\WARP45_U/S. All warp 4 and WE4eB installations should have
-those direcotries (we hope). It is updated when you install a new fixpack - so
-there is really nothing to worry about for the common user.
+which Odin32 works on. It no longer requires a kernel file for non-debug
+kernels. Win32k does now contain a "database" for the most recent retail
+kernels. Currently this is:
+    Warp 4 fp#5 -> fp#12
+    Aurora GA
+    Warp 3 fp#32-> fp#42
+
+If the running kernel is not found in the "database" or is a debug kernel
+wink32.sys will look for symbolfiles as it allways has.
+If you use the -s:<symfile> argument the given symbol file will be
+investigated before the database is searched.
+
+NOTE! It hasn't been fully verified that all the different national fixpaks
+have the same symbols as the us-english ones. Feedback on this issue is
+appreciated.
 
 For those playing with debug-kernels, make sure that OS2KRNL.SYM is matching
-the running kernel, while this file too is investigated. (The complete list
-is found in src\Win32k\dev16\probkrnl.c,apszSym[] - odin32 source tree.)
+the running kernel.
 
 
-x.2.1 Warp 3
-------------
+2.3.2.1 Warp 3
+--------------
 
-Win32k is not tested with Warp 3. It is supposed to work with Warp 3 provided
-that the os2krnl.sym file is present. Warp Server 4 have this, common Warp 3
-don't.
+Win32k is not tested with Warp 3. It is _supposed_ to work with Warp 3
+provided you are running fixpack 32 or later.
+(Fixpack 32 + y2kclock.exe is required for Y2K readyness anyway so...)
 
 
-x.3 Installation
-----------------
+2.3.3 Installation
+------------------
 
 To use Win32k.sys you have to add the following line into your config.sys:
@@ -69,27 +78,65 @@
 directory.
 
-After doing this you'll have to reboot your machine to load the driver. During
+After doing this, you'll have to reboot your machine to load the driver. During
 the boot process you will on a successful installation see some lines of
 technical info and finally a line saying:
     'Win32k.sys succesfully initiated!'
 
-If you don't see the line above something is wrong!
+If you don't see the line above something is wrong.
 
 
-x.4 Win32k parameters
----------------------
+2.3.4 Win32k parameters
+-----------------------
+
+The Capitalized letters are the one which is tested for when identifying the
+argument.
 
 There are some useful parameters for Win32k:
--Q             Quiet driver initiation. (Default is verbose (-V) initiation.)
--V             Verbose driver initiation. Default.
--S:<filename>  Full path to the current OS/2 kernel symbole file.
--K:<filename>  Full path to the running OS/2 kernel.
+-Quited         Quiet driver initiation.
+                Default: disabled (ie. -V)
+
+-Verbose        Verbose driver initiation.
+                Default: enabled
+
+-S:<filename>   Full path to the current OS/2 kernel symbol file.
+                When this is specified the given
+                Default: symbol "database" and default locations are searched.
+
+Logging parameters:
+-L<:E|:D>       Enables/Disables logging.
+                Default: disabled.
+
+-C<1|2>         Which com-port to log to.
+                Default: -C2
+
+-W<1|2|3|4>     Warning/info level for PE loader. (This is warnings and info
+                which is published thru the com-port as logging information.)
+                Default: -W0
+
+Heap parameters:
+-HEAPMax:       Maximum swappable heap size in bytes.
+                Default: 512KB
+
+-Heapinit:      Initial heapsize in bytes.
+                Default: 16MB
+
+-RESHEAPMax:    Maximum resident heap size in bytes.
+                Default: 256KB
+
+-Resheapinit:   Initial resident in bytes.
+                Default: 16MB
+
+-SCript<:Y|:N>  Enable / disable UNIX script support.
+                Default: Enabled.
+
+Obsolete:
+-K:<filename> Ignored. Win32k scans the kernel image in memory!
 
 
-x.5 Rings - Ring 0 / Ring 3
----------------------------
+2.3.5 Rings - Ring 0 / Ring 3
+-----------------------------
 
 FYI. Ring 0 is the most priveleged level of execution in OS/2. The OS/2 kernel
-and device drivers execute at this level, while user applications executes in
+and device drivers execute at this level, while user applications execute in
 Ring 3, the least priveleged executing level.
 
