Index: trunk/src/win32k/dev16/mkcalltab.c
===================================================================
--- trunk/src/win32k/dev16/mkcalltab.c	(revision 5184)
+++ trunk/src/win32k/dev16/mkcalltab.c	(revision 5185)
@@ -1,3 +1,3 @@
-/* $Id: mkcalltab.c,v 1.3 2001-02-11 15:15:12 bird Exp $
+/* $Id: mkcalltab.c,v 1.4 2001-02-19 05:56:00 bird Exp $
  *
  * Description:     Generates the calltab.asm from aImportTab.
@@ -113,5 +113,5 @@
      * Write Start of file.
      */
-    printf16("; $Id: mkcalltab.c,v 1.3 2001-02-11 15:15:12 bird Exp $\n"
+    printf16("; $Id: mkcalltab.c,v 1.4 2001-02-19 05:56:00 bird Exp $\n"
              ";\n"
              "; Autogenerated calltab file.\n"
@@ -136,4 +136,5 @@
              ";\n"
              "    public callTab\n"
+             "    public callTab16\n"
              "    public auFuncs\n"
              "\n"
@@ -143,5 +144,5 @@
              ";\n"
              "OVERLOAD32_PROLOG     EQU 14h\n"
-             "OVERLOAD16_PROLOG     EQU 18h\n"
+             "OVERLOAD16_PROLOG     EQU 14h\n"
              "IMPORT32_PROLOG       EQU 08h\n"
              "NRIMPORT32_PROLOG     EQU 06h\n"
@@ -165,7 +166,11 @@
              "FnOverload16Entry macro fnname\n"
              "    public fnname\n"
+             "    public &fnname&_off\n"
+             "    public &fnname&_sel\n"
              "    fnname proc near\n"
              "        db OVERLOAD16_PROLOG dup(0cch)\n"
              "    fnname endp\n"
+             "    &fnname&_off         dw  0\n"
+             "    &fnname&_sel         dw  0\n"
              "endm\n"
              "\n"
@@ -231,35 +236,74 @@
 
     /*
-     * Process aImportTab.
+     * Process aImportTab - all but 16-bit overrides.
      */
     for (i = 0; i < NBR_OF_KRNLIMPORTS; i++)
     {
-        char *pszMacro = (aImportTab[i].fType & EPT_VARIMPORT) ?
-                                "VariableEntry"
-                            : (  (aImportTab[i].fType & EPT_PROCIMPORT) ?
-                               ( (aImportTab[i].fType & EPT_NOT_REQ) ?
-                                (EPT16BitEntry(aImportTab[i]) ? "FnNRImport16Entry" : "FnNRImport32Entry")
-                            :   (EPT16BitEntry(aImportTab[i]) ? "FnImport16Entry"   : "FnImport32Entry"))
-                            :   (EPT16BitEntry(aImportTab[i]) ? "FnOverload16Entry" : "FnOverload32Entry"));
-        char *pszName = &aImportTab[i].achName[(aImportTab[i].fType & EPT_VARIMPORT) && aImportTab[i].achName[0] == '_'];
-        char *pszExtra = (aImportTab[i].fType & EPT_WRAPPED) ? "_wrapped" : aImportTab[i].achExtra;
-
-        /*
-         * Variable or Function?
-         */
-        printf16("%s<%s%s>%*.s;%d\n",
-                 pszMacro,
-                 pszName,
-                 pszExtra,
-                 45 - 2 - kstrlen(pszMacro) - aImportTab[i].cchName - kstrlen(pszExtra),
-                 "",
-                 i);
-    }
-
-    /*
-     * Write End of Calltab and start of auFuncs.
+        if (!EPT16Proc(aImportTab[i]))
+        {
+            char *pszMacro = (aImportTab[i].fType & EPT_VARIMPORT) ?
+                                    "VariableEntry"
+                                : (  (aImportTab[i].fType & EPT_PROCIMPORT) ?
+                                   ( (aImportTab[i].fType & EPT_NOT_REQ) ?
+                                    (EPT16BitEntry(aImportTab[i]) ? "FnNRImport16Entry" : "FnNRImport32Entry")
+                                :   (EPT16BitEntry(aImportTab[i]) ? "FnImport16Entry"   : "FnImport32Entry"))
+                                :   (EPT16BitEntry(aImportTab[i]) ? "FnOverload16Entry" : "FnOverload32Entry"));
+            char *pszName = &aImportTab[i].achName[(aImportTab[i].fType & EPT_VARIMPORT) && aImportTab[i].achName[0] == '_'];
+            char *pszExtra = (aImportTab[i].fType & EPT_WRAPPED) ? "_wrapped" : aImportTab[i].achExtra;
+
+            /*
+             * Variable or Function?
+             */
+            printf16("%s<%s%s>%*.s;%d\n",
+                     pszMacro,
+                     pszName,
+                     pszExtra,
+                     45 - 2 - kstrlen(pszMacro) - aImportTab[i].cchName - kstrlen(pszExtra),
+                     "",
+                     i);
+        }
+    }
+
+    /*
+     * Write End of Calltab and start of callTab16.
      */
     printf16("\n"
              "CALLTAB ENDS\n"
+             "\n"
+             "\n"
+             "DATA16 SEGMENT\n"
+             "    assume ds:nothing, ss:nothing\n"
+             ";\n"
+             "; callTab16 is an array of function prologs with a jump to the real function\n"
+             "; for 16-bit overrides.\n"
+             ";\n"
+             "; Overrided 16-bit OS/2 kernel functions are called thru this table.\n"
+             ";\n"
+             "callTab16:\n"
+
+             );
+
+    /*
+     * Process aImportTab - 16 bit overrides.
+     */
+    for (i = 0; i < NBR_OF_KRNLIMPORTS; i++)
+    {
+        if (EPT16Proc(aImportTab[i]))
+        {
+
+            printf16("FnOverload16Entry<%s>%*.s;%d\n",
+                     aImportTab[i].achName,
+                     45 - 2 - 17 - aImportTab[i].cchName,
+                     "",
+                     i);
+        }
+    }
+
+
+    /*
+     * Write End of Calltab and start of auFuncs.
+     */
+    printf16("\n"
+             "DATA16 ENDS\n"
              "\n"
              "\n"
@@ -283,5 +327,34 @@
         char *  pszName     = (*pszPrefix != '\0' ? &aImportTab[i].achName[1] : &aImportTab[i].achName[0]);
 
-        if (!(aImportTab[i].fType & (EPT_PROCIMPORT | EPT_VARIMPORT | EPT_NOT_REQ)))
+        if (EPT16Proc(aImportTab[i]))
+        {   /* Overload procedure (Overloader function) */
+            #if 1
+            printf16("    extrn %smy%s%s : FAR\n"
+                     "    dw  offset CODE%s:%smy%s%s\n"
+                     "    dw  seg CODE%s:%smy%s%s\n",
+                     pszPrefix,
+                     pszName,
+                     aImportTab[i].achExtra,
+                     pszSeg,
+                     pszPrefix,
+                     pszName,
+                     aImportTab[i].achExtra,
+                     pszSeg,
+                     pszPrefix,
+                     pszName,
+                     aImportTab[i].achExtra);
+            #else
+            printf16("    extrn %smy%s%s : FAR\n"
+                     "    dd  far ptr CODE%s:%smy%s%s\n",
+                     pszPrefix,
+                     pszName,
+                     aImportTab[i].achExtra,
+                     pszSeg,
+                     pszPrefix,
+                     pszName,
+                     aImportTab[i].achExtra);
+            #endif
+        }
+        else if (!(aImportTab[i].fType & (EPT_PROCIMPORT | EPT_VARIMPORT | EPT_NOT_REQ)))
         {   /* Overload procedure (Overloader function) */
             printf16("    extrn %smy%s%s : NEAR\n"
@@ -335,5 +408,5 @@
      * Write Start of file.
      */
-    printf16("/* $Id: mkcalltab.c,v 1.3 2001-02-11 15:15:12 bird Exp $\n"
+    printf16("/* $Id: mkcalltab.c,v 1.4 2001-02-19 05:56:00 bird Exp $\n"
              " *\n"
              " * Autogenerated TstFakers.c file.\n"
