Changeset 9502 for trunk/src/win32k


Ignore:
Timestamp:
Dec 16, 2002, 1:46:47 AM (23 years ago)
Author:
bird
Message:

32-bit.

Location:
trunk/src/win32k/kKrnlLib/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/win32k/kKrnlLib/src/MkCallTab.c

    r9125 r9502  
    1 /* $Id: MkCallTab.c,v 1.5 2002-08-24 22:27:16 bird Exp $
     1/* $Id: MkCallTab.c,v 1.6 2002-12-16 00:46:47 bird Exp $
    22 *
    3  * Description:     Generates the calltab.asm from aImportTab.
     3 * Generates the calltab.asm from aImportTab.
    44 *
    5  * Copyright (c) 2000-2001 knut st. osmundsen (kosmunds@csc.com)
     5 * Copyright (c) 2000-2002 knut st. osmundsen <bird@anduin.net>
    66 *
    7  * Project Odin Software License can be found in LICENSE.TXT
     7 *
     8 * This file is part of kKrnlLib.
     9 *
     10 * kKrnlLib is free software; you can redistribute it and/or modify
     11 * it under the terms of the GNU General Public License as published by
     12 * the Free Software Foundation; either version 2 of the License, or
     13 * (at your option) any later version.
     14 *
     15 * kKrnlLib is distributed in the hope that it will be useful,
     16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     18 * GNU General Public License for more details.
     19 *
     20 * You should have received a copy of the GNU General Public License
     21 * along with kKrnlLib; if not, write to the Free Software
     22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    823 *
    924 */
     
    1530#define NOLOGGING 1
    1631
    17 #define fclose(a) DosClose(a)
    18 #define SEEK_SET FILE_BEGIN
    19 #define SEEK_END FILE_END
    20 
    2132
    2233/*
     
    4253#include <os2.h>
    4354
    44 #include <strat2.h>
    45 #include <reqpkt.h>
    46 
    47 #include "devSegDf.h"
    48 #undef  DATA16_INIT
    49 #define DATA16_INIT
    50 #undef  CODE16_INIT
    51 #define CODE16_INIT
     55//#include <strat2.h>
     56//#include <reqpkt.h>
     57
     58#include "krnlImportTable.h"
    5259#include "os2krnl.h"                    /* must be included before dev1632.h! */
    53 #include "probkrnl.h"
    5460#include "dev1632.h"
    55 #include "d16vprintf.h"
    56 #include "d16crt.h"
     61
     62#include <string.h>
     63#include <stdio.h>
    5764
    5865
     
    6168*******************************************************************************/
    6269/* dummy replacement for SymDB.c */
    63 KRNLDBENTRY   DATA16_INIT    aKrnlSymDB[] = {{0}};
     70KRNLDBENTRY     aKrnlSymDB[] = {{0}};
    6471
    6572struct Entry
     
    7481    {   2, "_ulKernelBuild",           "ulKernelBuild",                 EXP_ABSOLUTE32},
    7582    {   3, "_fKernel",                 "flKernel",                      EXP_ABSOLUTE32},
    76     {   4, "_TKSSBase16",              "TKSSBase",                      EXP_ABSOLUTE32},
    77     {   5, "_TKSSBase16",              "_TKSSBase",                     EXP_ABSOLUTE32},
     83    {   4, "_pulTKSSBase32",           "TKSSBase",                      EXP_ABSOLUTE32},
     84    {   5, "_pulTKSSBase32",           "_TKSSBase",                     EXP_ABSOLUTE32},
    7885    {   6, "_R0FlatCS16",              "R0FlatCS",                      EXP_ABSOLUTE16},
    7986    {   7, "_R0FlatDS16",              "R0FlatDS",                      EXP_ABSOLUTE16},
    8087
    8188    /* 16-bit functions */
     89#if 0 /* FIXME: not now */
    8290    {  30, "_printf16",                "_printf16",                     EXP_16},
    8391    {  31, "_vprintf16",               "_vprintf16",                    EXP_16},
     
    97105    {  45, "_kstrcat",                 "_kstrcat",                      EXP_16},
    98106    {  46, "_kstrtok",                 "_kstrtok",                      EXP_16},
     107#endif
    99108
    100109    /* 16-bit crt functions */
     
    347356    else if (argv[1][0] == 't')
    348357        return GenerateTstFakers();
    349     else
    350     {
    351         syntax();
    352         return -2;
    353     }
    354 
    355     return 0;
     358
     359    /* failure */
     360    syntax();
     361    return -2;
    356362}
    357363
     
    362368void syntax(void)
    363369{
    364     printf16("Incorrect parameter!\n"
    365              "Syntax: mkcalltab.exe <tab>\n"
    366              "   Where <tab> is either calltab or tstfakers.\n"
    367              );
     370    printf("Incorrect parameter!\n"
     371           "Syntax: mkcalltab.exe <tab>\n"
     372           "   Where <tab> is either calltab or tstfakers.\n"
     373           );
    368374}
    369375
     
    388394     * Write Start of file.
    389395     */
    390     printf16("; $Id: MkCallTab.c,v 1.5 2002-08-24 22:27:16 bird Exp $\n"
    391              ";\n"
    392              "; Autogenerated calltab file.\n"
    393              ";\n"
    394              "; Generate: mkcalltab.exe > ldr\calltab.asm\n"
    395              ";\n"
    396              "; Copyright (c) 1998-2001 knut st. osmundsen (kosmunds@csc.com)\n"
    397              ";\n"
    398              "; Project Odin Software License can be found in LICENSE.TXT\n"
    399              ";\n"
    400              "    .386p\n"
    401              "\n"
    402              "\n"
    403              ";\n"
    404              "; Include files\n"
    405              ";\n"
    406              "    include devsegdf.inc\n"
    407              "    include options.inc\n"
    408              "\n"
    409              "\n"
    410              ";\n"
    411              "; Exported symbols\n"
    412              ";\n"
    413              "    public callTab\n"
    414              "    public callTabEND\n"
    415              "    public callTab16\n"
    416              "    public callTab16END\n"
    417              "    public auNopFuncs\n"
    418              "\n"
    419              "    extrn _aImportTab:BYTE\n"
    420              "    extrn _options:kKLOptions\n"
    421              "\n"
    422              "\n"
    423              ";\n"
    424              "; Constants\n"
    425              ";\n"
    426              "PROC32_PROLOG         EQU 14h\n"
    427              "PROC16_PROLOG         EQU 14h\n"
    428              "IMPORTH16_PROLOG      EQU 08h\n"
    429              "IMPORTHNR16_PROLOG    EQU 07h\n"
    430              "\n"
    431              "\n"
    432              ";\n"
    433              "; Macros\n"
    434              ";\n"
    435              "\n"
    436              "; Macro which makes a function overload calltable entry\n"
    437              "FnProc32Entry macro fnname\n"
    438              "    public fnname\n"
    439              "    fnname proc near\n"
    440              "        db PROC32_PROLOG dup(0cch)\n"
    441              "    fnname endp\n"
    442              "endm\n"
    443              "\n"
    444              "; Macro which makes a function overload calltable entry\n"
    445              "FnProc16Entry macro fnname\n"
    446              "    public fnname\n"
    447              "    public &fnname&_off\n"
    448              "    public &fnname&_sel\n"
    449              "    fnname proc near\n"
    450              "        db PROC16_PROLOG dup(0cch)\n"
    451              "    fnname endp\n"
    452              "    &fnname&_off         dw  0\n"
    453              "    &fnname&_sel         dw  0\n"
    454              "endm\n"
    455              "\n");
    456     printf16("; Macro which makes a function calltable entry\n"
    457              "FnProcNR32Entry macro fnname\n"
    458              "    f&fnname&            dd  0\n"
    459              "    FnProc32Entry<fnname>\n"
    460              "endm\n"
    461              "\n"
    462              "; Macro which makes a function calltable entry\n"
    463              "FnProcNR16Entry macro fnname\n"
    464              "    f&fnname&            dd  0\n"
    465              "    FnProc16Entry<fnname>\n"
    466              "endm\n"
    467              "\n"
    468              "; Macro which makes a variable calltable entry.\n"
    469              "VariableEntry macro varname\n"
    470              "    public p&varname&\n"
    471              "    p&varname&           dd  0\n"
    472              "    public &varname&_offObject\n"
    473              "    &varname&_offObject  dd  0\n"
    474              "    public _fp&varname&\n"
    475              "    _fp&varname&         dd  0\n"
    476              "    public &varname&_sel\n"
    477              "    &varname&_sel        dw  0\n"
    478              "                         dw  0cch ;alignment\n"
    479              "endm\n"
    480              "\n"
    481              "\n"
    482              "\n"
    483              "DATA32 segment\n"
    484              "    ;assume cs:DATA32, ds:flat, ss:nothing\n"
    485              "    assume ds:flat, ss:nothing\n"
    486              ";\n"
    487              "; callTab is an array of function prologs with a jump to the real function\n"
    488              "; and pointers to real variables.\n"
    489              ";\n"
    490              "; Overrided OS/2 kernel functions are called thru this table.\n"
    491              ";\n"
    492              "db 'callTab',0\n"
    493              "callTab:\n");
     396    printf("; $Id: MkCallTab.c,v 1.6 2002-12-16 00:46:47 bird Exp $\n"
     397           ";\n"
     398           "; Autogenerated calltab file.\n"
     399           ";\n"
     400           "; Copyright (c) 1998-2003 knut st. osmundsen <bird@anduin.net>\n"
     401           ";\n"
     402           ";\n"
     403           "; This file is part of kKrnlLib.\n"
     404           ";\n"
     405           "; kKrnlLib is free software; you can redistribute it and/or modify\n"
     406           "; it under the terms of the GNU General Public License as published by\n"
     407           "; the Free Software Foundation; either version 2 of the License, or\n"
     408           "; (at your option) any later version.\n"
     409           ";\n"
     410           "; kKrnlLib is distributed in the hope that it will be useful,\n"
     411           "; but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
     412           "; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n"
     413           "; GNU General Public License for more details.\n"
     414           ";\n"
     415           "; You should have received a copy of the GNU General Public License\n"
     416           "; along with kKrnlLib; if not, write to the Free Software\n"
     417           "; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\n"
     418           ";\n"
     419           "    .386p\n"
     420           "\n"
     421           "\n"
     422           ";\n"
     423           "; Include files\n"
     424           ";\n"
     425           "    include devsegdf.inc\n"
     426           "    include options.inc\n"
     427           "\n"
     428           "\n"
     429           ";\n"
     430           "; Exported symbols\n"
     431           ";\n"
     432           "    public callTab\n"
     433           "    public callTabEND\n"
     434           "    public callTab16\n"
     435           "    public callTab16END\n"
     436           "    public auNopFuncs\n"
     437           "\n"
     438           "    extrn _aImportTab:BYTE\n"
     439           "    extrn _options:kKLOptions\n"
     440           "\n"
     441           "\n"
     442           ";\n"
     443           "; Constants\n"
     444           ";\n"
     445           "PROC32_PROLOG         EQU 14h\n"
     446           "PROC16_PROLOG         EQU 14h\n"
     447           "IMPORTH16_PROLOG      EQU 08h\n"
     448           "IMPORTHNR16_PROLOG    EQU 07h\n"
     449           "\n"
     450           "\n"
     451           ";\n"
     452           "; Macros\n"
     453           ";\n"
     454           "\n"
     455           "; Macro which makes a function overload calltable entry\n"
     456           "FnProc32Entry macro fnname\n"
     457           "    public fnname\n"
     458           "    fnname proc near\n"
     459           "        db PROC32_PROLOG dup(0cch)\n"
     460           "    fnname endp\n"
     461           "endm\n"
     462           "\n"
     463           "; Macro which makes a function overload calltable entry\n"
     464           "FnProc16Entry macro fnname\n"
     465           "    public fnname\n"
     466           "    public &fnname&_off\n"
     467           "    public &fnname&_sel\n"
     468           "    fnname proc near\n"
     469           "        db PROC16_PROLOG dup(0cch)\n"
     470           "    fnname endp\n"
     471           "    &fnname&_off         dw  0\n"
     472           "    &fnname&_sel         dw  0\n"
     473           "endm\n"
     474           "\n");
     475    printf("; Macro which makes a function calltable entry\n"
     476           "FnProcNR32Entry macro fnname\n"
     477           "    f&fnname&            dd  0\n"
     478           "    FnProc32Entry<fnname>\n"
     479           "endm\n"
     480           "\n"
     481           "; Macro which makes a function calltable entry\n"
     482           "FnProcNR16Entry macro fnname\n"
     483           "    f&fnname&            dd  0\n"
     484           "    FnProc16Entry<fnname>\n"
     485           "endm\n"
     486           "\n"
     487           "; Macro which makes a variable calltable entry.\n"
     488           "VariableEntry macro varname\n"
     489           "    public p&varname&\n"
     490           "    p&varname&           dd  0\n"
     491           "    public &varname&_offObject\n"
     492           "    &varname&_offObject  dd  0\n"
     493           "    public _fp&varname&\n"
     494           "    _fp&varname&         dd  0\n"
     495           "    public &varname&_sel\n"
     496           "    &varname&_sel        dw  0\n"
     497           "                         dw  0cch ;alignment\n"
     498           "endm\n"
     499           "\n"
     500           "\n"
     501           "\n"
     502           "DATA32 segment\n"
     503           "    ;assume cs:DATA32, ds:flat, ss:nothing\n"
     504           "    assume ds:flat, ss:nothing\n"
     505           ";\n"
     506           "; callTab is an array of function prologs with a jump to the real function\n"
     507           "; and pointers to real variables.\n"
     508           ";\n"
     509           "; Overrided OS/2 kernel functions are called thru this table.\n"
     510           ";\n"
     511           "db 'callTab',0\n"
     512           "callTab:\n");
    494513
    495514    /*
     
    511530             * Variable or Function?
    512531             */
    513             printf16("%s<%s%s>%*.s;%d\n",
    514                      pszMacro,
    515                      pszName,
    516                      pszExtra,
    517                      45 - 2 - kstrlen(pszMacro) - aImportTab[i].cchName - kstrlen(pszExtra),
    518                      "",
    519                      i);
     532            printf("%s<%s%s>%*.s;%d\n",
     533                   pszMacro,
     534                   pszName,
     535                   pszExtra,
     536                   45 - 2 - strlen(pszMacro) - aImportTab[i].cchName - strlen(pszExtra),
     537                   "",
     538                   i);
    520539            if ((aImportTab[i].fType & EPT_WRAPPED))
    521540            {
    522                 printf16("extrn %s%s:NEAR\n",
    523                          pszName,
    524                          aImportTab[i].achExtra);
     541                printf("extrn %s%s:NEAR\n",
     542                       pszName,
     543                       aImportTab[i].achExtra);
    525544            }
    526545        }
     
    530549     * Write End of Calltab and start of callTab16.
    531550     */
    532     printf16("\n"
    533              "callTabEND db 'callTabEND',0,0\n"
    534              "DATA32 ENDS\n"
    535              "\n"
    536              "\n"
    537              "CALLTAB16 segment para public 'CALLTAB16_DATA' use16\n"
    538              "    assume ds:nothing, ss:nothing\n"
    539              ";\n"
    540              "; callTab16 is an array of function prologs with a jump to the real function\n"
    541              "; for 16-bit overrides.\n"
    542              ";\n"
    543              "; Overrided 16-bit OS/2 kernel functions are called thru this table.\n"
    544              ";\n"
    545              "callTab16:\n"
    546 
    547              );
     551    printf("\n"
     552           "callTabEND db 'callTabEND',0,0\n"
     553           "DATA32 ENDS\n"
     554           "\n"
     555           "\n"
     556           "CALLTAB16 segment para public 'CALLTAB16_DATA' use16\n"
     557           "    assume ds:nothing, ss:nothing\n"
     558           ";\n"
     559           "; callTab16 is an array of function prologs with a jump to the real function\n"
     560           "; for 16-bit overrides.\n"
     561           ";\n"
     562           "; Overrided 16-bit OS/2 kernel functions are called thru this table.\n"
     563           ";\n"
     564           "callTab16:\n"
     565           );
    548566
    549567    /*
     
    554572        if (EPT16Proc(aImportTab[i]) || EPT16ProcH(aImportTab[i]))
    555573        {
    556             printf16("FnProc16Entry<%s>%*.s;%d\n",
    557                      aImportTab[i].achName,
    558                      45 - 2 - 17 - aImportTab[i].cchName,
    559                      "",
    560                      i);
     574            printf("FnProc16Entry<%s>%*.s;%d\n",
     575                   aImportTab[i].achName,
     576                   45 - 2 - 17 - aImportTab[i].cchName,
     577                   "",
     578                   i);
    561579        }
    562580    }
     
    566584     * Write End of Calltab and start of auFuncs.
    567585     */
    568     printf16("\n"
    569              "callTab16END db 'callTab16END',0,0,0,0\n"
    570              "CALLTAB16 ENDS\n"
    571              "\n"
    572              "\n"
    573              "DATA32 segment\n"
    574              "    assume ds:nothing, es:nothing\n"
    575              "\n"
    576              ";\n"
    577              "; Function table for nop functions.\n"
    578              "; Used by krnlInitImports() in krnlInit.c.\n"
    579              ";\n"
    580              "auNopFuncs:\n"
    581              );
     586    printf("\n"
     587           "callTab16END db 'callTab16END',0,0,0,0\n"
     588           "CALLTAB16 ENDS\n"
     589           "\n"
     590           "\n"
     591           "DATA32 segment\n"
     592           "    assume ds:nothing, es:nothing\n"
     593           "\n"
     594           ";\n"
     595           "; Function table for nop functions.\n"
     596           "; Used by krnlInitImports() in krnlInit.c.\n"
     597           ";\n"
     598           "auNopFuncs:\n"
     599           );
    582600
    583601    /*
     
    592610            char *  pszName     = (*pszPrefix != '\0' ? &aImportTab[i].achName[1] : &aImportTab[i].achName[0]);
    593611
    594             printf16(EPT16BitEntry(aImportTab[i])
    595                      ?  "    extrn %snop%s%s : NEAR\n"
    596                         "    dw  seg CODE%s:%snop%s%s\n"
    597                         "    dw  offset CODE%s:%snop%s%s\n"
    598                      :  "    extrn %snop%s%s : NEAR\n"
    599                         "    dd  offset FLAT:CODE%s:%snop%s%s\n",
    600                      pszPrefix,
    601                      pszName,
    602                      aImportTab[i].achExtra,
    603                      pszSeg,
    604                      pszPrefix,
    605                      pszName,
    606                      aImportTab[i].achExtra);
     612            printf(EPT16BitEntry(aImportTab[i])
     613                   ?  "    extrn %snop%s%s : NEAR\n"
     614                      "    dw  seg CODE%s:%snop%s%s\n"
     615                      "    dw  offset CODE%s:%snop%s%s\n"
     616                   :  "    extrn %snop%s%s : NEAR\n"
     617                      "    dd  offset FLAT:CODE%s:%snop%s%s\n",
     618                   pszPrefix,
     619                   pszName,
     620                   aImportTab[i].achExtra,
     621                   pszSeg,
     622                   pszPrefix,
     623                   pszName,
     624                   aImportTab[i].achExtra);
    607625        }
    608626        else
    609             printf16("    dd  0h\n");
     627            printf("    dd  0h\n");
    610628    }
    611629
     
    614632     * MTE.
    615633     */
    616     printf16("\n"
    617              "\n"
    618              ";\n"
    619              "; kKrnlLib MTE\n"
    620              ";\n"
    621              "public kKrnlLibMTE\n"
    622              "kKrnlLibMTE label byte\n"
    623              "dw  2                                  ; mte_flags2; (MTEFORMATLX)\n"
    624              "dw  0                                  ; mte_handle;\n"
    625              "dd  offset FLAT:KKL_SwapMTE            ; mte_swapmte;\n"
    626              "dd  0                                  ; mte_link;\n"
    627              "dd  0001b180h                          ; mte_flags1; (LIBRARYMOD | LDRINVALID | CLASS_GLOBAL | MTE_MEDIAFIXED | MTEPROCESSED | VDDMOD)\n"
    628              "dd  0                                  ; mte_impmodcnt;\n"
    629              "dw  0                                  ; mte_sfn;\n"
    630              "dw  1                                  ; mte_usecnt;\n"
    631              "db  \"KKRNLLIB\"                         ; mte_modname[8];\n"
    632              "dd  0                                  ; evt. new fields\n"
    633              "dd  0                                  ; evt. new fields\n"
    634              "\n"
    635              "\n");
     634    printf("\n"
     635           "\n"
     636           ";\n"
     637           "; kKrnlLib MTE\n"
     638           ";\n"
     639           "public kKrnlLibMTE\n"
     640           "kKrnlLibMTE label byte\n"
     641           "dw  2                                  ; mte_flags2; (MTEFORMATLX)\n"
     642           "dw  0                                  ; mte_handle;\n"
     643           "dd  offset FLAT:KKL_SwapMTE            ; mte_swapmte;\n"
     644           "dd  0                                  ; mte_link;\n"
     645           "dd  0001b180h                          ; mte_flags1; (LIBRARYMOD | LDRINVALID | CLASS_GLOBAL | MTE_MEDIAFIXED | MTEPROCESSED | VDDMOD)\n"
     646           "dd  0                                  ; mte_impmodcnt;\n"
     647           "dw  0                                  ; mte_sfn;\n"
     648           "dw  1                                  ; mte_usecnt;\n"
     649           "db  \"KKRNLLIB\"                         ; mte_modname[8];\n"
     650           "dd  0                                  ; evt. new fields\n"
     651           "dd  0                                  ; evt. new fields\n"
     652           "\n"
     653           "\n");
    636654
    637655    /*
    638656     * SMTE.
    639657     */
    640     printf16(";\n"
    641              "; kKrnlLIB SwapMTE\n"
    642              ";\n"
    643              "public KKL_SwapMTE\n"
    644              "KKL_SwapMTE label byte\n"
    645              "dd  0                                  ; ULONG   smte_mpages;        /* 00  Module # pages */\n"
    646              "dd  0                                  ; ULONG   smte_startobj;      /* 04  Object # for instruction */\n"
    647              "dd  0                                  ; ULONG   smte_eip;           /* 08  Extended instruction pointer */\n"
    648              "dd  0                                  ; ULONG   smte_stackobj;      /* 0c  Object # for stack pointer */\n"
    649              "dd  0                                  ; ULONG   smte_esp;           /* 10  Extended stack pointer */\n"
    650              "dd  0                                  ; ULONG   smte_pageshift;     /* 14  Page alignment shift in .EXE */\n"
    651              "dd  0                                  ; ULONG   smte_fixupsize;     /* 18  Fixup section size */\n"
    652              "dd  offset FLAT:KKL_ObjTab             ; POTE    smte_objtab;        /* 1c  Object table offset - POINTER */\n"
    653              "dd  5                                  ; ULONG   smte_objcnt;        /* 20  Number of objects in module */\n"
    654              "dd  0                                  ; ULONG   smte_objmap;        /* 24  Object page map offset - POINTER */\n"
    655              "dd  0                                  ; ULONG   smte_itermap;       /* 28  Object iterated data map offset */\n"
    656              "dd  0                                  ; ULONG   smte_rsrctab;       /* 2c  Offset of Resource Table */\n"
    657              "dd  0                                  ; ULONG   smte_rsrccnt;       /* 30  Number of resource entries */\n"
    658              "dd  offset FLAT:KKL_ResNameTab         ; ULONG   smte_restab;        /* 34  Offset of resident name table - POINTER */\n"
    659              "dd  offset FLAT:KKL_EntryTab           ; ULONG   smte_enttab;        /* 38  Offset of Entry Table - POINTER */\n"
    660              "dd  0                                  ; ULONG   smte_fpagetab;      /* 3c  Offset of Fixup Page Table - POINTER */\n"
    661              "dd  0                                  ; ULONG   smte_frectab;       /* 40  Offset of Fixup Record Table - POINTER */\n"
    662              "dd  0                                  ; ULONG   smte_impmod;        /* 44  Offset of Import Module Name Table - POINTER */\n");
    663     printf16("dd  0                                  ; ULONG   smte_impproc;       /* 48  Offset of Imp Procedure Name Tab - POINTER */\n"
    664              "dd  0                                  ; ULONG   smte_datapage;      /* 4c  Offset of Enumerated Data Pages */\n"
    665              "dd  0                                  ; ULONG   smte_nrestab;       /* 50  Offset of Non-resident Names Table */\n"
    666              "dd  0                                  ; ULONG   smte_cbnrestab;     /* 54  Size of Non-resident Name Table */\n"
    667              "dd  0                                  ; ULONG   smte_autods;        /* 58  Object # for automatic data object */\n"
    668              "dd  0                                  ; ULONG   smte_debuginfo;     /* 5c  Offset of the debugging info */\n"
    669              "dd  0                                  ; ULONG   smte_debuglen;      /* 60  The len of the debug info in */\n"
    670              "dd  0                                  ; ULONG   smte_heapsize;      /* 64  use for converted 16-bit modules */\n"
    671              "dd  offset FLAT:KKL_szFn               ; PCHAR   smte_path;          /* 68  full pathname - POINTER */\n"
    672              "dd  0                                  ; USHORT  smte_semcount;      /* 6c  Count of threads waiting on MTE semaphore. 0 => semaphore is free */\n"
    673              "dd  0                                  ; USHORT  smte_semowner;      /* 6e  Slot number of the owner of MTE semahore */\n"
    674              "dd  0                                  ; ULONG   smte_pfilecache;    /* 70  Pointer to file cache for Dos32CacheModule */\n"
    675              "dd  0                                  ; ULONG   smte_stacksize;     /* 74  Thread 1 Stack size from the exe header */\n"
    676              "dd  0                                  ; USHORT  smte_alignshift;    /* 78  use for converted 16-bit modules */\n"
    677              "dd  0                                  ; USHORT  smte_NEexpver;      /* 7a  expver from NE header */\n"
    678              "dd  12                                 ; USHORT  smte_pathlen;       /* 7c  length of full pathname */\n"
    679              "dd  0                                  ; USHORT  smte_NEexetype;     /* 7e  exetype from NE header */\n"
    680              "dd  0                                  ; USHORT  smte_csegpack;      /* 80  count of segs to pack */\n"
    681              "\n");
     658    printf(";\n"
     659           "; kKrnlLIB SwapMTE\n"
     660           ";\n"
     661           "public KKL_SwapMTE\n"
     662           "KKL_SwapMTE label byte\n"
     663           "dd  0                                  ; ULONG   smte_mpages;        /* 00  Module # pages */\n"
     664           "dd  0                                  ; ULONG   smte_startobj;      /* 04  Object # for instruction */\n"
     665           "dd  0                                  ; ULONG   smte_eip;           /* 08  Extended instruction pointer */\n"
     666           "dd  0                                  ; ULONG   smte_stackobj;      /* 0c  Object # for stack pointer */\n"
     667           "dd  0                                  ; ULONG   smte_esp;           /* 10  Extended stack pointer */\n"
     668           "dd  0                                  ; ULONG   smte_pageshift;     /* 14  Page alignment shift in .EXE */\n"
     669           "dd  0                                  ; ULONG   smte_fixupsize;     /* 18  Fixup section size */\n"
     670           "dd  offset FLAT:KKL_ObjTab             ; POTE    smte_objtab;        /* 1c  Object table offset - POINTER */\n"
     671           "dd  5                                  ; ULONG   smte_objcnt;        /* 20  Number of objects in module */\n"
     672           "dd  0                                  ; ULONG   smte_objmap;        /* 24  Object page map offset - POINTER */\n"
     673           "dd  0                                  ; ULONG   smte_itermap;       /* 28  Object iterated data map offset */\n"
     674           "dd  0                                  ; ULONG   smte_rsrctab;       /* 2c  Offset of Resource Table */\n"
     675           "dd  0                                  ; ULONG   smte_rsrccnt;       /* 30  Number of resource entries */\n"
     676           "dd  offset FLAT:KKL_ResNameTab         ; ULONG   smte_restab;        /* 34  Offset of resident name table - POINTER */\n"
     677           "dd  offset FLAT:KKL_EntryTab           ; ULONG   smte_enttab;        /* 38  Offset of Entry Table - POINTER */\n"
     678           "dd  0                                  ; ULONG   smte_fpagetab;      /* 3c  Offset of Fixup Page Table - POINTER */\n"
     679           "dd  0                                  ; ULONG   smte_frectab;       /* 40  Offset of Fixup Record Table - POINTER */\n"
     680           "dd  0                                  ; ULONG   smte_impmod;        /* 44  Offset of Import Module Name Table - POINTER */\n");
     681    printf("dd  0                                  ; ULONG   smte_impproc;       /* 48  Offset of Imp Procedure Name Tab - POINTER */\n"
     682           "dd  0                                  ; ULONG   smte_datapage;      /* 4c  Offset of Enumerated Data Pages */\n"
     683           "dd  0                                  ; ULONG   smte_nrestab;       /* 50  Offset of Non-resident Names Table */\n"
     684           "dd  0                                  ; ULONG   smte_cbnrestab;     /* 54  Size of Non-resident Name Table */\n"
     685           "dd  0                                  ; ULONG   smte_autods;        /* 58  Object # for automatic data object */\n"
     686           "dd  0                                  ; ULONG   smte_debuginfo;     /* 5c  Offset of the debugging info */\n"
     687           "dd  0                                  ; ULONG   smte_debuglen;      /* 60  The len of the debug info in */\n"
     688           "dd  0                                  ; ULONG   smte_heapsize;      /* 64  use for converted 16-bit modules */\n"
     689           "dd  offset FLAT:KKL_szFn               ; PCHAR   smte_path;          /* 68  full pathname - POINTER */\n"
     690           "dd  0                                  ; USHORT  smte_semcount;      /* 6c  Count of threads waiting on MTE semaphore. 0 => semaphore is free */\n"
     691           "dd  0                                  ; USHORT  smte_semowner;      /* 6e  Slot number of the owner of MTE semahore */\n"
     692           "dd  0                                  ; ULONG   smte_pfilecache;    /* 70  Pointer to file cache for Dos32CacheModule */\n"
     693           "dd  0                                  ; ULONG   smte_stacksize;     /* 74  Thread 1 Stack size from the exe header */\n"
     694           "dd  0                                  ; USHORT  smte_alignshift;    /* 78  use for converted 16-bit modules */\n"
     695           "dd  0                                  ; USHORT  smte_NEexpver;      /* 7a  expver from NE header */\n"
     696           "dd  12                                 ; USHORT  smte_pathlen;       /* 7c  length of full pathname */\n"
     697           "dd  0                                  ; USHORT  smte_NEexetype;     /* 7e  exetype from NE header */\n"
     698           "dd  0                                  ; USHORT  smte_csegpack;      /* 80  count of segs to pack */\n"
     699           "\n");
    682700
    683701    /*
    684702     * Filename.
    685703     */
    686     printf16("\n"
    687              ";\n"
    688              "; Filename\n"
    689              ";\n"
    690              "KKL_szFn db \"kKrnlLib.dll\",0\n"
    691              "\n");
     704    printf("\n"
     705           ";\n"
     706           "; Filename\n"
     707           ";\n"
     708           "KKL_szFn db \"kKrnlLib.dll\",0\n"
     709           "\n");
    692710
    693711    /*
    694712     * Object table.
    695713     */
    696     printf16("\n"
    697              ";\n"
    698              "; Externals\n"
    699              ";\n"
    700              "extrn DATA16START:BYTE\n"
    701              "extrn DATA16_GLOBALEND:BYTE\n"
    702              "extrn CODE16START:BYTE\n"
    703              "extrn CODE16END:BYTE\n"
    704              "extrn CODE32START:BYTE\n"
    705              "extrn CODE32END:BYTE\n"
    706              "extrn DATA32START:BYTE\n"
    707              "extrn _end:BYTE\n"
    708              );
    709 
    710     printf16("\n"
    711              ";\n"
    712              "; Object table\n"
    713              ";\n"
    714              "public KKL_ObjTab\n"
    715              "KKL_ObjTab label byte\n"
    716              ";obj 1\n"
    717              "   dd offset FLAT:DATA16:DATA16_GLOBALEND;o32_size; /* Object virtual size */\n"
    718              "   dd offset FLAT:DATA16:DATA16START    ; o32_base; /* Object base virtual address */\n"
    719              "   dd 1003h                       ; o32_flags;      /* Attribute flags */                     \n"
    720              "   dd 0                           ; o32_pagemap;    /* Object page map index */               \n"
    721              "   dd 0                           ; o32_mapsize;    /* Number of entries in object page map */\n"
    722              "   dw seg DATA16                  ; ote_sel;        /* Object Selector */\n"
    723              "   dw 0                           ; ote_hob;        /* Object Handle */\n"
    724              ";obj 2\n"
    725              "   dd offset FLAT:CODE16:CODE16END      ; o32_size; /* Object virtual size */\n"
    726              "   dd offset FLAT:CODE16:CODE16START    ; o32_base; /* Object base virtual address */\n"
    727              "   dd 1005h                       ; o32_flags;      /* Attribute flags */                     \n"
    728              "   dd 0                           ; o32_pagemap;    /* Object page map index */               \n"
    729              "   dd 0                           ; o32_mapsize;    /* Number of entries in object page map */\n"
    730              "   dw seg CODE16                  ; ote_sel;        /* Object Selector */\n"
    731              "   dw 0                           ; ote_hob;        /* Object Handle */\n");
    732     printf16(";obj 3\n"
    733              "   dd offset FLAT:CODE32:CODE32END      ; o32_size; /* Object virtual size */\n"
    734              "   dd offset FLAT:CODE32:CODE32START    ; o32_base; /* Object base virtual address */\n"
    735              "   dd 2005h                       ; o32_flags;      /* Attribute flags */                     \n"
    736              "   dd 0                           ; o32_pagemap;    /* Object page map index */               \n"
    737              "   dd 0                           ; o32_mapsize;    /* Number of entries in object page map */\n"
    738              "   dw seg FLAT:CODE32             ; ote_sel;        /* Object Selector */\n"
    739              "   dw 0                           ; ote_hob;        /* Object Handle */\n"
    740              ";obj 4\n"
    741              "   dd offset FLAT:DATA32:_end     ; o32_size; /* Object virtual size */\n"
    742              "   dd offset FLAT:DATA32:DATA32START    ; o32_base; /* Object base virtual address */\n"
    743              "   dd 2003h                       ; o32_flags;      /* Attribute flags */                     \n"
    744              "   dd 0                           ; o32_pagemap;    /* Object page map index */               \n"
    745              "   dd 0                           ; o32_mapsize;    /* Number of entries in object page map */\n"
    746              "   dw seg FLAT:DATA32             ; ote_sel;        /* Object Selector */\n"
    747              "   dw 0                           ; ote_hob;        /* Object Handle */\n"
    748              ";obj 5\n"
    749              "   dd offset FLAT:CALLTAB16:callTab16END; o32_size; /* Object virtual size */\n"
    750              "   dd offset FLAT:CALLTAB16:callTab16   ; o32_base; /* Object base virtual address */\n"
    751              "   dd 1005h                       ; o32_flags;      /* Attribute flags */                     \n"
    752              "   dd 0                           ; o32_pagemap;    /* Object page map index */               \n"
    753              "   dd 0                           ; o32_mapsize;    /* Number of entries in object page map */\n"
    754              "   dw seg FLAT:CALLTAB16          ; ote_sel;        /* Object Selector */\n"
    755              "   dw 0                           ; ote_hob;        /* Object Handle */\n"
    756              "\n"
    757              "public KKL_ObjTab_DosCalls\n"
    758              "KKL_ObjTab_DosCalls label byte\n"
    759              "db (20 * (4 * 6)) dup(0) ; 4*6 = sizeof(o32_obj); 20 = max objects;\n"
    760              "\n"
    761              "\n");
    762 
    763     /*
    764      * Resident name table.
    765      */
    766     printf16("\n"
    767              ";\n"
    768              "; Resident name table\n"
    769              ";\n"
    770              "public KKL_ResNameTab\n"
    771              "KKL_ResNameTab label byte\n"
    772              "db 8,\"KKRNLLIB\"\n"
    773              "dw 0 ; ordinal #\n");
     714    printf("\n"
     715           ";\n"
     716           "; Externals\n"
     717           ";\n"
     718           "extrn DATA16START:BYTE\n"
     719           "extrn DATA16_GLOBALEND:BYTE\n"
     720           "extrn CODE16START:BYTE\n"
     721           "extrn CODE16END:BYTE\n"
     722           "extrn CODE32START:BYTE\n"
     723           "extrn CODE32END:BYTE\n"
     724           "extrn DATA32START:BYTE\n"
     725           "extrn _end:BYTE\n"
     726           );
     727
     728    printf("\n"
     729           ";\n"
     730           "; Object table\n"
     731           ";\n"
     732           "public KKL_ObjTab\n"
     733           "KKL_ObjTab label byte\n"
     734           ";obj 1\n"
     735           "   dd offset FLAT:DATA16:DATA16_GLOBALEND;o32_size; /* Object virtual size */\n"
     736           "   dd offset FLAT:DATA16:DATA16START    ; o32_base; /* Object base virtual address */\n"
     737           "   dd 1003h                       ; o32_flags;      /* Attribute flags */                     \n"
     738           "   dd 0                           ; o32_pagemap;    /* Object page map index */               \n"
     739           "   dd 0                           ; o32_mapsize;    /* Number of entries in object page map */\n"
     740           "   dw seg DATA16                  ; ote_sel;        /* Object Selector */\n"
     741           "   dw 0                           ; ote_hob;        /* Object Handle */\n"
     742           ";obj 2\n"
     743           "   dd offset FLAT:CODE16:CODE16END      ; o32_size; /* Object virtual size */\n"
     744           "   dd offset FLAT:CODE16:CODE16START    ; o32_base; /* Object base virtual address */\n"
     745           "   dd 1005h                       ; o32_flags;      /* Attribute flags */                     \n"
     746           "   dd 0                           ; o32_pagemap;    /* Object page map index */               \n"
     747           "   dd 0                           ; o32_mapsize;    /* Number of entries in object page map */\n"
     748           "   dw seg CODE16                  ; ote_sel;        /* Object Selector */\n"
     749           "   dw 0                           ; ote_hob;        /* Object Handle */\n");
     750    printf(";obj 3\n"
     751           "   dd offset FLAT:CODE32:CODE32END      ; o32_size; /* Object virtual size */\n"
     752           "   dd offset FLAT:CODE32:CODE32START    ; o32_base; /* Object base virtual address */\n"
     753           "   dd 2005h                       ; o32_flags;      /* Attribute flags */                     \n"
     754           "   dd 0                           ; o32_pagemap;    /* Object page map index */               \n"
     755           "   dd 0                           ; o32_mapsize;    /* Number of entries in object page map */\n"
     756           "   dw seg FLAT:CODE32             ; ote_sel;        /* Object Selector */\n"
     757           "   dw 0                           ; ote_hob;        /* Object Handle */\n"
     758           ";obj 4\n"
     759           "   dd offset FLAT:DATA32:_end     ; o32_size; /* Object virtual size */\n"
     760           "   dd offset FLAT:DATA32:DATA32START    ; o32_base; /* Object base virtual address */\n"
     761           "   dd 2003h                       ; o32_flags;      /* Attribute flags */                     \n"
     762           "   dd 0                           ; o32_pagemap;    /* Object page map index */               \n"
     763           "   dd 0                           ; o32_mapsize;    /* Number of entries in object page map */\n"
     764           "   dw seg FLAT:DATA32             ; ote_sel;        /* Object Selector */\n"
     765           "   dw 0                           ; ote_hob;        /* Object Handle */\n"
     766           ";obj 5\n"
     767           "   dd offset FLAT:CALLTAB16:callTab16END; o32_size; /* Object virtual size */\n"
     768           "   dd offset FLAT:CALLTAB16:callTab16   ; o32_base; /* Object base virtual address */\n"
     769           "   dd 1005h                       ; o32_flags;      /* Attribute flags */                     \n"
     770           "   dd 0                           ; o32_pagemap;    /* Object page map index */               \n"
     771           "   dd 0                           ; o32_mapsize;    /* Number of entries in object page map */\n"
     772           "   dw seg FLAT:CALLTAB16          ; ote_sel;        /* Object Selector */\n"
     773           "   dw 0                           ; ote_hob;        /* Object Handle */\n"
     774           "\n"
     775           "public KKL_ObjTab_DosCalls\n"
     776           "KKL_ObjTab_DosCalls label byte\n"
     777           "db (20 * (4 * 6)) dup(0) ; 4*6 = sizeof(o32_obj); 20 = max objects;\n"
     778           "\n"
     779           "\n");
     780
     781    /*
     782     * Resent name table.
     783     */
     784    printf("\n"
     785           ";\n"
     786           "; Resident name table\n"
     787           ";\n"
     788           "public KKL_ResNameTab\n"
     789           "KKL_ResNameTab label byte\n"
     790           "db 8,\"KKRNLLIB\"\n"
     791           "dw 0 ; ordinal #\n");
    774792    #ifdef DEBUG
    775793    iOrdMax = findMaxOrdinal();
     
    778796         iOrd = findNextOrdinal(iOrd, &szName[0], &szNameExp[0], NULL, NULL))
    779797    {
    780         printf16(
    781             "db %d, '%s'\n"
    782             "dw %d\n",
    783             kstrlen(szNameExp), szNameExp, iOrd);
     798        printf("db %d, '%s'\n"
     799               "dw %d\n",
     800               strlen(szNameExp), szNameExp, iOrd);
    784801    }
    785802    #endif
    786     printf16("db 0 ; terminator\n"
    787              "public KKL_ResNameTabEND\n"
    788              "KKL_ResNameTabEND label byte\n"
    789              "\n"
    790              "DATA32 ends\n"
    791              "\n"
    792              "\n");
     803    printf("db 0 ; terminator\n"
     804           "public KKL_ResNameTabEND\n"
     805           "KKL_ResNameTabEND label byte\n"
     806           "\n"
     807           "DATA32 ends\n"
     808           "\n"
     809           "\n");
    793810
    794811    /*
    795812     * Entry table.
    796813     */
    797     printf16("KKLENTRY segment\n"
    798              "public KKL_EntryTab\n"
    799              "KKL_EntryTab label byte\n"
    800              "KKLENTRY ends\n"
    801              "\n"
    802              "KKLENTRYFIXUPS segment\n"
    803              "public KKL_EntryTabFixups\n"
    804              "KKL_EntryTabFixups label byte\n"
    805              "KKLENTRYFIXUPS ends\n"
    806              "\n");
     814    printf("KKLENTRY segment\n"
     815           "public KKL_EntryTab\n"
     816           "KKL_EntryTab label byte\n"
     817           "KKLENTRY ends\n"
     818           "\n"
     819           "KKLENTRYFIXUPS segment\n"
     820           "public KKL_EntryTabFixups\n"
     821           "KKL_EntryTabFixups label byte\n"
     822           "KKLENTRYFIXUPS ends\n"
     823           "\n");
    807824    iOrdMax = findMaxOrdinal();
    808825    for (iOrd = findNextOrdinal(0, &szName[0], &szNameExp[0], &fType, &iIndex), iPrevBundle = 0;
     
    883900        {
    884901            int cSkips = iOrd - iPrevBundle >= 255 ? 255 : iOrd - iPrevBundle - 1;
    885             printf16("\n"
    886                      "KKLENTRY segment\n"
    887                      "db %d ; skips ordinals %d to %d\n"
    888                      "db 0\n"
    889                      "KKLENTRY ends\n",
    890                      cSkips,
    891                      iPrevBundle + 1,
    892                      iPrevBundle + cSkips);
     902            printf("\n"
     903                   "KKLENTRY segment\n"
     904                   "db %d ; skips ordinals %d to %d\n"
     905                   "db 0\n"
     906                   "KKLENTRY ends\n",
     907                   cSkips,
     908                   iPrevBundle + 1,
     909                   iPrevBundle + cSkips);
    893910            iPrevBundle += cSkips;
    894911        }
     
    899916        if (fType < EXP_IMPORT_FIRST)
    900917        {
    901             printf16("\n"
    902                      "%s segment\n",
    903                      aszSeg2[fType]);
     918            printf("\n"
     919                   "%s segment\n",
     920                   aszSeg2[fType]);
    904921            for (i = iOrd; i < iBundle + iOrd; i++)
    905922            {
     
    912929                    case EXP_ABSOLUTE32:
    913930                    case EXP_32:
    914                         if (!kstrchr(szName, '.'))
    915                             printf16("  extrn %s:NEAR\n",
    916                                      szName);
     931                        if (!strchr(szName, '.'))
     932                            printf("  extrn %s:NEAR\n",
     933                                   szName);
    917934                        break;
    918935                    case EXP_ABSOLUTE16:
    919936                    case EXP_16:
    920                         if (!kstrchr(szName, '.'))
    921                             printf16("  extrn %s:FAR\n",
    922                                      szName);
     937                        if (!strchr(szName, '.'))
     938                            printf("  extrn %s:FAR\n",
     939                                   szName);
    923940                        break;
    924941                }
    925942            }
    926             printf16("\n"
    927                      "%s ENDS\n",
    928                      aszSeg2[fType]);
     943            printf("\n"
     944                   "%s ENDS\n",
     945                   aszSeg2[fType]);
    929946        }
    930947
     
    933950         * Write bundle header.
    934951         */
    935         printf16("\n"
    936                  "KKLENTRY segment\n"
    937                  "bundle%d label byte\n"
    938                  "db %d ; ordinal %d to %d\n"
    939                  "db %d ; %s\n"
    940                  "dw seg %s ; object\n",
    941                  iOrd,
    942                  iBundle,
    943                  iOrd,
    944                  iOrd + iBundle - 1,
    945                  fType == EXP_ABSOLUTE16 || fType == EXP_16 || fType == EXP_VAR16 || fType == EXP_PROC16 || fType == EXP_ORGPROC16
    946                     ? 1
    947                     : 3,
    948                  aszType[fType],
    949                  aszSeg[fType]
    950                  );
     952        printf("\n"
     953               "KKLENTRY segment\n"
     954               "bundle%d label byte\n"
     955               "db %d ; ordinal %d to %d\n"
     956               "db %d ; %s\n"
     957               "dw seg %s ; object\n",
     958               iOrd,
     959               iBundle,
     960               iOrd,
     961               iOrd + iBundle - 1,
     962               fType == EXP_ABSOLUTE16 || fType == EXP_16 || fType == EXP_VAR16 || fType == EXP_PROC16 || fType == EXP_ORGPROC16
     963                  ? 1
     964                  : 3,
     965               aszType[fType],
     966               aszSeg[fType]
     967               );
    951968        for (i = iOrd; i < iBundle + iOrd; i++)
    952969        {
     
    955972
    956973            findNextOrdinal(i - 1, szName, szNameExp, &fType, &iIndex);
    957             printf16("  db 1\n");
     974            printf("  db 1\n");
    958975            switch (fType)
    959976            {
     
    961978                case EXP_32:
    962979                case EXP_ORGPROC32:
    963                     printf16(
    964                          "  dd offset FLAT:%s\n",
    965                          szName);
     980                    printf("  dd offset FLAT:%s\n",
     981                           szName);
    966982                    break;
    967983                case EXP_ABSOLUTE16:
    968984                case EXP_16:
    969985                case EXP_ORGPROC16:
    970                     printf16(
    971                          "  dw offset %s\n",
    972                          szName,
    973                          szName);
     986                    printf("  dw offset %s\n",
     987                           szName,
     988                           szName);
    974989                    break;
    975990
    976991                case EXP_PROC16:
    977992                case EXP_VAR16:
    978                     printf16(
    979                          "  dw %d ; %s\n",
    980                          iIndex,
    981                          szName);
     993                    printf("  dw %d ; %s\n",
     994                           iIndex,
     995                           szName);
    982996                    break;
    983997                case EXP_PROC32:
    984998                case EXP_VAR32:
    985                     printf16(
    986                          "  dd %d ; %s\n",
    987                          iIndex,
    988                          szName);
     999                    printf("  dd %d ; %s\n",
     1000                           iIndex,
     1001                           szName);
    9891002                    break;
    9901003            }
     
    9941007         * Write bundle fixups.
    9951008         */
    996         printf16("KKLENTRY ends\n"
    997                  "KKLENTRYFIXUPS segment\n"
    998                  "db %d ; type\n"
    999                  "dw offset FLAT:bundle%d - offset FLAT:KKL_EntryTab ; bundle offset\n"
    1000                  "KKLENTRYFIXUPS ends\n",
    1001                  fType,
    1002                  iOrd);
     1009        printf("KKLENTRY ends\n"
     1010               "KKLENTRYFIXUPS segment\n"
     1011               "db %d ; type\n"
     1012               "dw offset FLAT:bundle%d - offset FLAT:KKL_EntryTab ; bundle offset\n"
     1013               "KKLENTRYFIXUPS ends\n",
     1014               fType,
     1015               iOrd);
    10031016
    10041017        iPrevBundle += iBundle;
     
    10081021     * Write stop bundles.
    10091022     */
    1010     printf16("KKLENTRY segment\n"
    1011              "db 0  ; end bundle\n"
    1012              "dw 0  ; end bundle\n"
    1013              "public KKL_EntryTabEND\n"
    1014              "KKL_EntryTabEND db 0ffh\n"
    1015              "KKLENTRY ends\n"
    1016              "KKLENTRYFIXUPS segment\n"
    1017              "db 0 ; end type\n"
    1018              "KKLENTRYFIXUPS ends\n");
     1023    printf("KKLENTRY segment\n"
     1024           "db 0  ; end bundle\n"
     1025           "dw 0  ; end bundle\n"
     1026           "public KKL_EntryTabEND\n"
     1027           "KKL_EntryTabEND db 0ffh\n"
     1028           "KKLENTRY ends\n"
     1029           "KKLENTRYFIXUPS segment\n"
     1030           "db 0 ; end type\n"
     1031           "KKLENTRYFIXUPS ends\n");
    10191032
    10201033    /*
    10211034     * End of file
    10221035     */
    1023     printf16("\n"
    1024              "end\n"
    1025              "\n");
     1036    printf("\n"
     1037           "end\n"
     1038           "\n");
    10261039
    10271040    return 0;
     
    10901103        {
    10911104            iOrdRet = aEntries[i].iOrdinal;
    1092             kstrcpy(pszName, aEntries[i].szName);
    1093             kstrcpy(pszNameExp, aEntries[i].szNameExp);
     1105            strcpy(pszName, aEntries[i].szName);
     1106            strcpy(pszNameExp, aEntries[i].szNameExp);
    10941107            *pfType = aEntries[i].fFlags;
    10951108            *piIndex = i;
     
    10971110        else if (aEntries[i].iOrdinal == iOrdRet)
    10981111        {
    1099             printf16("Fatal Error: Duplicate ordinal detected (ord=%d)\n", iOrdRet);
     1112            printf("Fatal Error: Duplicate ordinal detected (ord=%d)\n", iOrdRet);
    11001113            DosExit(EXIT_PROCESS, iOrdRet);
    11011114        }
     
    11081121        {
    11091122            iOrdRet = aImportTab[i].iOrdinal;
    1110             kstrcpy(pszName, aImportTab[i].achName);
    1111             kstrcat(pszName, /*EPTWrapped(aImportTab[i]) ? "_wrapped" :*/ aImportTab[i].achExtra);
    1112             kstrcpy(pszNameExp, aImportTab[i].achName);
    1113             kstrcat(pszNameExp, aImportTab[i].achExtra);
     1123            strcpy(pszName, aImportTab[i].achName);
     1124            strcat(pszName, /*EPTWrapped(aImportTab[i]) ? "_wrapped" :*/ aImportTab[i].achExtra);
     1125            strcpy(pszNameExp, aImportTab[i].achName);
     1126            strcat(pszNameExp, aImportTab[i].achExtra);
    11141127            if (EPTVar(aImportTab[i]))
    11151128                *pfType = EPT16BitEntry(aImportTab[i]) ? EXP_VAR16 : EXP_VAR32;
     
    11361149            {
    11371150                iOrdRet = aImportTab[i].iOrdinal + ORD_ORGDISPLACEMENT;
    1138                 kstrcpy(pszName, aImportTab[i].achName);
    1139                 kstrcat(pszName, /*EPTWrapped(aImportTab[i]) ? "_wrapped" :*/ aImportTab[i].achExtra);
     1151                strcpy(pszName, aImportTab[i].achName);
     1152                strcat(pszName, /*EPTWrapped(aImportTab[i]) ? "_wrapped" :*/ aImportTab[i].achExtra);
    11401153
    11411154                if (aImportTab[i].achName[0] == '_')
    11421155                {
    1143                     kstrcpy(pszNameExp, "_Org");
    1144                     kstrcpy(pszNameExp + 4, &aImportTab[i].achName[1]);
     1156                    strcpy(pszNameExp, "_Org");
     1157                    strcpy(pszNameExp + 4, &aImportTab[i].achName[1]);
    11451158                }
    11461159                else
    11471160                {
    1148                     kstrcpy(pszNameExp, "Org");
    1149                     kstrcpy(pszNameExp + 3, &aImportTab[i].achName[0]);
     1161                    strcpy(pszNameExp, "Org");
     1162                    strcpy(pszNameExp + 3, &aImportTab[i].achName[0]);
    11501163                }
    1151                 kstrcat(pszNameExp, aImportTab[i].achExtra);
     1164                strcat(pszNameExp, aImportTab[i].achExtra);
    11521165
    11531166                *pfType = EPT16BitEntry(aImportTab[i]) ? EXP_ORGPROC16 : EXP_ORGPROC32;
     
    11721185    char    szNameExp[64];
    11731186
    1174     printf16(";/* $Id: MkCallTab.c,v 1.5 2002-08-24 22:27:16 bird Exp $\n"
    1175              "; *\n"
    1176              "; * Autogenerated .c file.\n"
    1177              "; *\n"
    1178              "; * Generate: mkcalltab.exe deffile > kKrnlLibImp.def\n"
    1179              "; *\n"
    1180              "; * Copyright (c) 2001 knut st. osmundsen (kosmunds@csc.com)\n"
    1181              "; *\n"
    1182              "; * Project Odin Software License can be found in LICENSE.TXT\n"
    1183              "; *\n"
    1184              "; */\n"
    1185              "LIBRARY KKRNLLIB\n"
    1186              "EXPORTS\n");
     1187    printf("; $Id: MkCallTab.c,v 1.6 2002-12-16 00:46:47 bird Exp $\n"
     1188           ";\n"
     1189           "; Autogenerated import definition file.\n"
     1190           ";\n"
     1191           "; Generate: mkcalltab.exe def > kKrnlLibImplib.def\n"
     1192           ";\n"
     1193           "; Copyright (c) 1998-2003 knut st. osmundsen <bird@anduin.net>\n"
     1194           ";\n"
     1195           ";\n"
     1196           "; This file is part of kKrnlLib.\n"
     1197           ";\n"
     1198           "; kKrnlLib is free software; you can redistribute it and/or modify\n"
     1199           "; it under the terms of the GNU General Public License as published by\n"
     1200           "; the Free Software Foundation; either version 2 of the License, or\n"
     1201           "; (at your option) any later version.\n"
     1202           ";\n"
     1203           "; kKrnlLib is distributed in the hope that it will be useful,\n"
     1204           "; but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
     1205           "; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n"
     1206           "; GNU General Public License for more details.\n"
     1207           ";\n"
     1208           "; You should have received a copy of the GNU General Public License\n"
     1209           "; along with kKrnlLib; if not, write to the Free Software\n"
     1210           "; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\n"
     1211           ";\n"
     1212           "LIBRARY KKRNLLIB\n"
     1213           "EXPORTS\n");
    11871214
    11881215    iOrdMax = findMaxOrdinal();
     
    11911218         iOrd = findNextOrdinal(iOrd, &szName[0], &szNameExp[0], NULL, NULL))
    11921219    {
    1193         printf16("    %30s @%d\n", szNameExp, iOrd);
     1220        printf("    %30s @%d\n", szNameExp, iOrd);
    11941221    }
    11951222    return 0;
     
    12081235     * Write Start of file.
    12091236     */
    1210     printf16("/* $Id: MkCallTab.c,v 1.5 2002-08-24 22:27:16 bird Exp $\n"
    1211              " *\n"
    1212              " * Autogenerated TstFakers.c file.\n"
    1213              " *\n"
    1214              " * Generate: mkcalltab.exe fake > test\TstFakers.c\n"
    1215              " *\n"
    1216              " * Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@mynd.no)\n"
    1217              " *\n"
    1218              " * Project Odin Software License can be found in LICENSE.TXT\n"
    1219              " *\n"
    1220              " */\n"
    1221              "\n"
    1222              "\n"
    1223              "/*******************************************************************************\n"
    1224              "*   Defined Constants And Macros                                               *\n"
    1225              "*******************************************************************************/\n"
    1226              "#define INCL_NOPMAPI\n"
    1227              "#define LDR_INCL_INITONLY\n"
    1228              "#define INCL_OS2KRNL_ALL\n"
    1229              "\n"
    1230              "/*******************************************************************************\n"
    1231              "*   Header Files                                                               *\n"
    1232              "*******************************************************************************/\n"
    1233              "#include <os2.h>\n"
    1234              "\n"
    1235              "#include \"devSegDf.h\"\n"
    1236              "#include \"OS2Krnl.h\"\n"
    1237              "#include \"dev1632.h\"\n"
    1238              "#include \"dev32.h\"\n"
    1239              "#include \"dev32Hlp.h\"\n"
    1240              "#include \"ProbKrnl.h\"\n"
    1241              "#include \"testcase.h\"\n"
    1242              "\n"
    1243              "\n"
    1244              "TSTFAKER aTstFakers[NBR_OF_KRNLIMPORTS] =\n"
    1245              "{\n");
     1237    printf("/* $Id: MkCallTab.c,v 1.6 2002-12-16 00:46:47 bird Exp $\n"
     1238           " *\n"
     1239           " * Autogenerated TstFakers file.\n"
     1240           " *\n"
     1241           " * Generate: mkcalltab.exe fake > test\\TstFakers.c\n"
     1242           " *\n"
     1243           " * Copyright (c) 1998-2003 knut st. osmundsen <bird@anduin.net>\n"
     1244           " *\n"
     1245           " *\n"
     1246           " * This file is part of kKrnlLib.\n"
     1247           " *\n"
     1248           " * kKrnlLib is free software; you can redistribute it and/or modify\n"
     1249           " * it under the terms of the GNU General Public License as published by\n"
     1250           " * the Free Software Foundation; either version 2 of the License, or\n"
     1251           " * (at your option) any later version.\n"
     1252           " *\n"
     1253           " * kKrnlLib is distributed in the hope that it will be useful,\n"
     1254           " * but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
     1255           " * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n"
     1256           " * GNU General Public License for more details.\n"
     1257           " *\n"
     1258           " * You should have received a copy of the GNU General Public License\n"
     1259           " * along with kKrnlLib; if not, write to the Free Software\n"
     1260           " * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\n"
     1261           " */\n"
     1262           "\n"
     1263           "\n"
     1264           "/*******************************************************************************\n"
     1265           "*   Defined Constants And Macros                                               *\n"
     1266           "*******************************************************************************/\n"
     1267           "#define INCL_NOPMAPI\n"
     1268           "#define LDR_INCL_INITONLY\n"
     1269           "#define INCL_OS2KRNL_ALL\n"
     1270           "\n"
     1271           "\n"
     1272           "/*******************************************************************************\n"
     1273           "*   Header Files                                                               *\n"
     1274           "*******************************************************************************/\n"
     1275           "#include <os2.h>\n"
     1276           "\n"
     1277           "#include \"OS2Krnl.h\"\n"
     1278           "#include \"dev1632.h\"\n"
     1279           "#include \"dev32.h\"\n"
     1280           "#include \"dev32Hlp.h\"\n"
     1281           "#include \"ProbKrnl.h\"\n"
     1282           "#include \"testcase.h\"\n"
     1283           "\n"
     1284           "\n"
     1285           "TSTFAKER aTstFakers[NBR_OF_KRNLIMPORTS] =\n"
     1286           "{\n");
    12461287
    12471288    /*
     
    12601301         * Variable or Function?
    12611302         */
    1262         printf16("    {(unsigned)%sfake%s,%*.s%d}%s\n",
    1263                  (aImportTab[i].fType & EPT_VAR) ? "&" : "",
    1264                  psz,
    1265                  45 - 21 - kstrlen(psz) - ((aImportTab[i].fType & EPT_VAR) == EPT_VAR),
    1266                  "",
    1267                  iSeg,
    1268                  i + 1 == NBR_OF_KRNLIMPORTS ? "" : ",");
     1303        printf("    {(unsigned)%sfake%s,%*.s%d}%s\n",
     1304               (aImportTab[i].fType & EPT_VAR) ? "&" : "",
     1305               psz,
     1306               45 - 21 - strlen(psz) - ((aImportTab[i].fType & EPT_VAR) == EPT_VAR),
     1307               "",
     1308               iSeg,
     1309               i + 1 == NBR_OF_KRNLIMPORTS ? "" : ",");
    12691310    }
    12701311
     
    12721313     * Write End of file.
    12731314     */
    1274     printf16("};\n"
    1275              "\n");
     1315    printf("};\n"
     1316           "\n");
    12761317
    12771318    return 0;
  • trunk/src/win32k/kKrnlLib/src/MkCallTab.mak

    r9124 r9502  
    1 # $Id: MkCallTab.mak,v 1.11 2002-08-24 22:07:40 bird Exp $
     1# $Id: MkCallTab.mak,v 1.12 2002-12-16 00:46:47 bird Exp $
    22
    33#
     
    1212# Setup config
    1313#
    14 #!if [SET INCLUDE=]
    15 #!endif
    16 BUILD_ENV_FORCE = MSCV6-16
     14BUILD_ENV_FORCE = VAC308
    1715PATH_ROOT       = ..\..\..\..
    1816!include $(PATH_ROOT)\$(BUILD_SETUP_MAK)
     
    2624TARGET_PUB_DIR  = $(PATH_TOOLS)
    2725MAKEFILE        = $(TARGET_NAME).mak
    28 CC_INCLUDES     = -I../include -I../kLib/include -I$(PATH_DDKBASE)/h -I$(PATH_MSC)/include -I$(PATH_TOOLKIT)/h
     26CC_INCLUDES     = -I../include -I../kLib/include
    2927ALL_DEFINES     = -DMKCALLTAB
    3028
     
    3230$(PATH_TARGET)\MkCallTab.$(EXT_OBJ)\
    3331$(PATH_TARGET)\krnlImportTable.$(EXT_OBJ)\
    34 $(PATH_TARGET)\d16ProbeKrnl.$(EXT_OBJ)\
    35 $(PATH_TARGET)\d16globl.$(EXT_OBJ)\
    36 $(PATH_TARGET)\d16crt.$(EXT_OBJ)\
    37 $(PATH_TARGET)\d16vprintf.$(EXT_OBJ)\
    3832
    3933TARGET_LIBS     =\
Note: See TracChangeset for help on using the changeset viewer.