Changeset 9514 for trunk/src


Ignore:
Timestamp:
Dec 16, 2002, 3:25:07 AM (23 years ago)
Author:
bird
Message:

Cleanup/Backup.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/win32k/kKrnlLib/include/OS2KSEM.h

    r7383 r9514  
    1 /* $Id: OS2KSEM.h,v 1.4 2001-11-19 03:04:52 bird Exp $
     1/* $Id: OS2KSEM.h,v 1.5 2002-12-16 02:25:05 bird Exp $
    22 *
    33 * OS/2 kernel Semaphore functions.
     
    157157extern ULONG KRNLCALL KSEMRequestMutex(HKSEMMTX hkmtx, ULONG ulTimeout);
    158158extern ULONG KRNLCALL OrgKSEMRequestMutex(HKSEMMTX hkmtx, ULONG ulTimeout);
    159 extern VOID  KRNLCALL KSEMReleaseMutex(HKSEMMTX hkmtx);
    160 extern VOID  KRNLCALL OrgKSEMReleaseMutex(HKSEMMTX hkmtx);
     159extern void  KRNLCALL KSEMReleaseMutex(HKSEMMTX hkmtx);
     160extern void  KRNLCALL OrgKSEMReleaseMutex(HKSEMMTX hkmtx);
    161161extern ULONG KRNLCALL KSEMQueryMutex(HKSEMMTX hkmtx, PUSHORT pcusNest);
    162162extern ULONG KRNLCALL OrgKSEMQueryMutex(HKSEMMTX hkmtx, PUSHORT pcusNest);
     
    166166 * Event semaphores.
    167167 */
    168 extern VOID  KRNLCALL KSEMResetEvent(HKSEMEVT hkev);
    169 extern VOID  KRNLCALL OrgKSEMResetEvent(HKSEMEVT hkev);
    170 extern VOID  KRNLCALL KSEMPostEvent(HKSEMEVT hkev);
    171 extern VOID  KRNLCALL OrgKSEMPostEvent(HKSEMEVT hkev);
     168extern void  KRNLCALL KSEMResetEvent(HKSEMEVT hkev);
     169extern void  KRNLCALL OrgKSEMResetEvent(HKSEMEVT hkev);
     170extern void  KRNLCALL KSEMPostEvent(HKSEMEVT hkev);
     171extern void  KRNLCALL OrgKSEMPostEvent(HKSEMEVT hkev);
    172172extern ULONG KRNLCALL KSEMWaitEvent(HKSEMEVT hkev, ULONG ulTimeout);
    173173extern ULONG KRNLCALL OrgKSEMWaitEvent(HKSEMEVT hkev, ULONG ulTimeout);
     
    189189extern ULONG KRNLCALL KSEMAlloc(PHKSEM phksem, ULONG p1, ULONG p2);
    190190extern ULONG KRNLCALL KSEMCreate(PHKSEM phksem, ULONG type);
    191 extern VOID  KRNLCALL KSEMDestroy(HKSEM hksem);
     191extern void  KRNLCALL KSEMDestroy(HKSEM hksem);
    192192#endif
    193 extern VOID  KRNLCALL KSEMInit(PKSEM pksem, ULONG fulType, ULONG fulFlags);
    194 extern VOID  KRNLCALL OrgKSEMInit(PKSEM pksem, ULONG fulType, ULONG fulFlags);
    195 extern VOID  KRNLCALL KSEMRelease(HKSEM hksem);
    196 extern VOID  KRNLCALL OrgKSEMRelease(HKSEM hksem);
    197 extern VOID  KRNLCALL KSEMQuery(HKSEM hksem, PULONG pul);
    198 extern VOID  KRNLCALL OrgKSEMQuery(HKSEM hksem, PULONG pul);
     193extern void  KRNLCALL KSEMInit(PKSEM pksem, ULONG fulType, ULONG fulFlags);
     194extern void  KRNLCALL OrgKSEMInit(PKSEM pksem, ULONG fulType, ULONG fulFlags);
     195extern void  KRNLCALL KSEMRelease(HKSEM hksem);
     196extern void  KRNLCALL OrgKSEMRelease(HKSEM hksem);
     197extern void  KRNLCALL KSEMQuery(HKSEM hksem, PULONG pul);
     198extern void  KRNLCALL OrgKSEMQuery(HKSEM hksem, PULONG pul);
    199199
    200200#endif
  • trunk/src/win32k/kKrnlLib/include/OS2Krnl.h

    r6815 r9514  
    1 /* $Id: OS2Krnl.h,v 1.3 2001-09-26 03:52:36 bird Exp $
     1/* $Id: OS2Krnl.h,v 1.4 2002-12-16 02:25:06 bird Exp $
    22 *
    33 * OS/2 kernel structures, typedefs and macros.
    4  *
    54 * Top-level include file.
    65 *
    7  * Project Odin Software License can be found in LICENSE.TXT
     6 * Copyright (c) 1999-2003 knut st. osmundsen <bird@anduin.net>
     7 *
     8 *
     9 * This file is part of kKrnlLib.
     10 *
     11 * kKrnlLib is free software; you can redistribute it and/or modify
     12 * it under the terms of the GNU General Public License as published by
     13 * the Free Software Foundation; either version 2 of the License, or
     14 * (at your option) any later version.
     15 *
     16 * kKrnlLib is distributed in the hope that it will be useful,
     17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     19 * GNU General Public License for more details.
     20 *
     21 * You should have received a copy of the GNU General Public License
     22 * along with kKrnlLib; if not, write to the Free Software
     23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    824 *
    925 */
     
    98114
    99115#ifdef INCL_OS2KRNL_IO
    100     #include <OS2KIO.h>
     116    #include "OS2KIO.h"
    101117#endif
    102118
    103119#ifdef INCL_OS2KRNL_VM
    104     #include <OS2KVM.h>
     120    #include "OS2KVM.h"
    105121#endif
    106122
    107123#ifdef INCL_OS2KRNL_VMOWNER
    108     #include <OS2KOwn.h>
     124    #include "OS2KOwn.h"
    109125#endif
    110126
    111127#ifdef INCL_OS2KRNL_SM
    112     #include <OS2KSM.h>
     128    #include "OS2KSM.h"
    113129#endif
    114130
    115131#ifdef INCL_OS2KRNL_SEM
    116     #include <OS2KSEM.h>
     132    #include "OS2KSEM.h"
    117133#endif
    118134
    119135#ifdef INCL_OS2KRNL_PTDA
    120     #include <OS2KPTDA.h>
     136    #include "OS2KPTDA.h"
    121137#endif
    122138
    123139#ifdef INCL_OS2KRNL_TCB
    124     #include <OS2KTCB.h>
     140    #include "OS2KTCB.h"
    125141#endif
    126142
    127143#ifdef INCL_OS2KRNL_PG
    128     #include <OS2KPG.h>
     144    #include "OS2KPG.h"
    129145#endif
    130146
    131147#ifdef INCL_OS2KRNL_SEL
    132     #include <OS2KSEL.h>
     148    #include "OS2KSEL.h"
    133149#endif
    134150
    135151#ifdef INCL_OS2KRNL_TK
    136     #include <OS2KTK.h>
     152    #include "OS2KTK.h"
    137153#endif
    138154
    139155#ifdef INCL_OS2KRNL_LDR
    140     #include <OS2KLDR.h>
     156    #include "OS2KLDR.h"
    141157#endif
    142158
    143159#ifdef INCL_OS2KRNL_SEC
    144     #include <OS2KSEC.h>
     160    #include "OS2KSEC.h"
    145161#endif
    146162
  • trunk/src/win32k/kKrnlLib/include/dev16.h

    r7400 r9514  
    1 /* $Id: dev16.h,v 1.4 2001-11-20 03:43:51 bird Exp $
    2  * dev16 - 16-bit specific. Should not be used in 32-bit C/C++.
     1/* $Id: dev16.h,v 1.5 2002-12-16 02:25:06 bird Exp $
    32 *
    4  * Copyright (c) 1999 knut st. osmundsen
     3 * 16 bit device stuff.
    54 *
    6  * Project Odin Software License can be found in LICENSE.TXT
     5 * Copyright (c) 2002 knut st. osmundsen <bird@anduin.net>
     6 *
     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
    723 *
    824 */
     25
    926#ifndef _d16_h_
    1027#define _d16_h_
     
    104121extern DDHDR    aDevHdrs[2];
    105122extern PFN      Device_Help;
    106 extern ULONG    TKSSBase16;
     123extern ULONG    pulTKSSBase32;
    107124extern USHORT   R0FlatCS16;
    108125extern USHORT   R0FlatDS16;
     
    127144extern char PASCAL DATA16_BSSSTART  ;
    128145extern char PASCAL DATA16_CONSTSTART;
    129 extern char PASCAL DATA16_INITSTART      ;
    130 extern char PASCAL DATA16_INIT_BSSSTART  ;
    131 extern char PASCAL DATA16_INIT_CONSTSTART;
    132146extern char PASCAL CODE16START      ;
    133 extern char PASCAL CODE16_INITSTART      ;
    134147extern char PASCAL CODE32START      ;
    135148extern char PASCAL DATA32START      ;
     
    143156extern char PASCAL DATA16_BSSEND  ;
    144157extern char PASCAL DATA16_CONSTEND;
    145 extern char PASCAL DATA16_INITEND      ;
    146 extern char PASCAL DATA16_INIT_BSSEND  ;
    147 extern char PASCAL DATA16_INIT_CONSTEND;
     158extern char PASCAL DATA16_ENDEND      ;
    148159extern char PASCAL CODE16END      ;
    149 extern char PASCAL CODE16_INITEND      ;
     160extern char PASCAL CODE16_ENDEND      ;
    150161extern char PASCAL CODE32END      ;
    151162extern char PASCAL DATA32END      ;
     
    156167
    157168
    158 
    159169#endif
  • trunk/src/win32k/kKrnlLib/include/dev1632.h

    r7387 r9514  
    1 /* $Id: dev1632.h,v 1.2 2001-11-19 03:07:59 bird Exp $
     1/* $Id: dev1632.h,v 1.3 2002-12-16 02:25:06 bird Exp $
    22 * dev1632.h - Common header file for 16-bit and 32-bit C
    33 *
     
    8181 * Global data...
    8282 */
    83 extern CHAR DATA16_GLOBAL   szBuildDate[];
    84 extern CHAR DATA16_GLOBAL   szBuildTime[];
     83extern CHAR     szBuildDate[];
     84extern CHAR     szBuildTime[];
    8585#if defined(__IBMC__) || defined(__IBMCPP__)
    8686    #pragma map( szBuildDate , "_szBuildDate" )
  • trunk/src/win32k/kKrnlLib/include/dev32.h

    r7388 r9514  
    1 /* $Id: dev32.h,v 1.8 2001-11-19 03:08:35 bird Exp $
     1/* $Id: dev32.h,v 1.9 2002-12-16 02:25:06 bird Exp $
    22 *
    33 * dev32 - header file for 32-bit part of the driver.
     
    8484extern PSMTE   pKrnlSMTE;               /* d32init.c */
    8585#endif
    86 extern PULONG TKSSBase16;
     86
     87extern ULONG  Device_Help;
    8788#if defined(__IBMC__) || defined(__IBMCPP__)
    88     #pragma map( TKSSBase16 , "_TKSSBase16"  )
     89    #pragma map( Device_Help , "_Device_Help"  )
    8990#endif
    90 #ifndef SSToDS
    91 extern PULONG pulTKSSBase32;
     91
     92extern PULONG  pulTKSSBase32;
     93#if defined(__IBMC__) || defined(__IBMCPP__)
     94    #pragma map( pulTKSSBase32 , "_pulTKSSBase32"  )
     95#endif
    9296extern USHORT CallGateGDT;
    9397
     98#ifndef SSToDS
    9499/*
    95100 * SSToDS( stack pointer )
  • trunk/src/win32k/kKrnlLib/include/kKLFunc.h

    r6730 r9514  
    1 /* $Id: kKLFunc.h,v 1.2 2001-09-17 00:11:09 bird Exp $
     1/* $Id: kKLFunc.h,v 1.3 2002-12-16 02:25:06 bird Exp $
    22 *
    33 * Function overloading functions.
    44 *
    5  * Copyright (c) 2001 knut st. osmundsen (kosmunds@csc.com)
     5 * Copyright (c) 2001-2003 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 */
     
    1631*   Functions                                                                  *
    1732*******************************************************************************/
    18 BOOL kKLOverload32(ULONG ulFuncAddr, ULONG ulOverloaderAddr);
    19 BOOL kKLRestore32(ULONG ulFuncAddr, ULONG ulOverloaderAddr);
    20 BOOL kKLOverload16(ULONG ulFuncFarAddr, ULONG ulOverloaderFarAddr);
    21 BOOL kKLRestore16(ULONG ulFuncFarAddr, ULONG ulOverloaderFarAddr);
    22 BOOL kKLOverload16H(ULONG ulFuncFarAddr, ULONG ulOverloaderFarAddr);
    23 BOOL kKLRestore16H(ULONG ulFuncFarAddr, ULONG ulOverloaderFarAddr);
     33KBOOL kKLOverload32( unsigned long ulFuncAddr,    unsigned long ulOverloaderAddr);
     34KBOOL kKLRestore32(  unsigned long ulFuncAddr,    unsigned long ulOverloaderAddr);
     35KBOOL kKLOverload16( unsigned long ulFuncFarAddr, unsigned long ulOverloaderFarAddr);
     36KBOOL kKLRestore16(  unsigned long ulFuncFarAddr, unsigned long ulOverloaderFarAddr);
     37KBOOL kKLOverload16H(unsigned long ulFuncFarAddr, unsigned long ulOverloaderFarAddr);
     38KBOOL kKLRestore16H( unsigned long ulFuncFarAddr, unsigned long ulOverloaderFarAddr);
    2439
    2540
  • trunk/src/win32k/kKrnlLib/include/kKLkernel.h

    r8188 r9514  
    1 /* $Id: kKLkernel.h,v 1.2 2002-04-01 13:51:16 bird Exp $
     1/* $Id: kKLkernel.h,v 1.3 2002-12-16 02:25:06 bird Exp $
     2 *
     3 * OS2 Kernel Info.
     4 *
     5 * Copyright (c) 2002 knut st. osmundsen <bird@anduin.net>
    26 *
    37 *
     8 * This file is part of kKrnlLib.
    49 *
    5  * Copyright (c) 2002 knut st. osmundsen (bird@anduin.net)
     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.
    614 *
    7  * Project Odin Software License can be found in LICENSE.TXT
     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 */
    1025#ifndef _kKLkernel_h_
     26#define _kKLkernel_h_
    1127
    1228/*******************************************************************************
     
    6278*   Global Variables                                                           *
    6379*******************************************************************************/
    64 #ifndef DATA16_GLOBAL
    65     extern unsigned long                fKernel;
    66     extern unsigned long                ulKernelBuild;
    67 #else
    68     extern unsigned long DATA16_GLOBAL  fKernel;
    69     extern unsigned long DATA16_GLOBAL  ulKernelBuild;
    70 #endif
     80extern unsigned long        fKernel;
     81extern unsigned long        ulKernelBuild;
    7182
    7283#if defined(KKRNLLIB) && defined(RING0)
     
    7889
    7990#endif
     91
  • trunk/src/win32k/kKrnlLib/include/kKrnlLib.h

    r8188 r9514  
    1 /* $Id: kKrnlLib.h,v 1.7 2002-04-01 13:51:16 bird Exp $
     1/* $Id: kKrnlLib.h,v 1.8 2002-12-16 02:25:07 bird Exp $
    22 *
    33 * Top level header file for kKrnlLib exports.
     
    66 *       Everything goes thru this header file.
    77 *
    8  * Copyright (c) 2002 knut st. osmundsen (bird@anduin.net)
     8 * Copyright (c) 2002-2003 knut st. osmundsen <bird@anduin.net>
    99 *
    10  * GPL
     10 *
     11 * This file is part of kKrnlLib.
     12 *
     13 * kKrnlLib is free software; you can redistribute it and/or modify
     14 * it under the terms of the GNU General Public License as published by
     15 * the Free Software Foundation; either version 2 of the License, or
     16 * (at your option) any later version.
     17 *
     18 * kKrnlLib is distributed in the hope that it will be useful,
     19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     21 * GNU General Public License for more details.
     22 *
     23 * You should have received a copy of the GNU General Public License
     24 * along with kKrnlLib; if not, write to the Free Software
     25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    1126 *
    1227 */
     28
    1329#ifndef _kKrnlLib_h_
    1430#define _kKrnlLib_h_
     
    4157 */
    4258#ifndef NO_KKL_KERNEL
    43     #include <kKLkernel.h>
     59    #include "kKLkernel.h"
    4460#endif
    4561
     
    4965 */
    5066#ifndef NO_KKL_STDARG
    51     #include "kKLstdarg.h"
     67    #include <kLib/kStdArg.h>
    5268#endif
    5369
     
    7086 */
    7187#ifdef INCL_KKL_SPRINTF
    72     #include "kKLsprintf.h"
     88    #include <kLib/kString.h>
     89    #define sprintf     kStrFormat
     90    #define vsprintf    kStrVFormat
    7391#endif
    74 #ifdef INCL_KKL_PRINTF
    75     #include "kKLprintf.h"
    76 #endif
     92// replaced by kLib/kLog.h
     93//#ifdef INCL_KKL_PRINTF
     94//    #include "kKLprintf.h"
     95//#endif
    7796
    7897
     
    108127#endif
    109128
    110 
    111 
    112129#endif
    113130
  • trunk/src/win32k/kKrnlLib/include/krnlImportTable.h

    r9501 r9514  
    1 /* $Id: krnlImportTable.h,v 1.1 2002-12-16 00:28:03 bird Exp $
     1/* $Id: krnlImportTable.h,v 1.2 2002-12-16 02:25:07 bird Exp $
    22 *
    33 * krnlImportTable definitions.
     
    166166*   NOTE! These are only available at init time!                               *
    167167*******************************************************************************/
    168 extern IMPORTKRNLSYM        aImportTab[NBR_OF_KRNLIMPORTS]; /* Defined in ProbKrnl.c */
    169 extern char                 szSymbolFile[60];               /* Defined in ProbKrnl.c */
     168extern IMPORTKRNLSYM        aImportTab[NBR_OF_KRNLIMPORTS]; /* Defined in krnlImportTable.c */
    170169extern const KRNLDBENTRY    aKrnlSymDB32[];                 /* Defined in symdb32.c */
    171170
    172171#if defined(__IBMC__) || defined(__IBMCPP__)
    173172    #pragma map( aImportTab , "_aImportTab"  )
    174     #pragma map( szSymbolFile,"_szSymbolFile")
    175 #endif
    176 
    177 /*
    178  * 16-bit init time functions.
    179  */
    180 #if defined(INCL_16) && defined(MAX_DISKDD_CMD) /* 16-bit only */
    181     int             ProbeKernel(PRPINITIN pReqPack);
    182     const char *    GetErrorMsg(short sErr);
    183     #ifdef _kKLInitHlp_h_
    184         int         DoDevIOCtl(KKLR0INITPARAM  *pParam, KKLR0INITDATA *pData);
    185     #endif
    186173#endif
    187174
  • trunk/src/win32k/kKrnlLib/include/krnlPrivate.h

    r6821 r9514  
    1 /* $Id: krnlPrivate.h,v 1.3 2001-09-26 04:01:36 bird Exp $
     1/* $Id: krnlPrivate.h,v 1.4 2002-12-16 02:25:07 bird Exp $
    22 *
    33 * Private header file for the krnl*.c* files.
     
    2222*   Global Variables                                                           *
    2323*******************************************************************************/
     24#ifdef _OS2KSEM_h_
    2425extern KSEMMTX                  kmtxImports;
     26#endif
    2527
    2628extern char                     KKL_EntryTab[1];                /* calltaba.asm */
    2729extern char                     KKL_EntryTabEND[1];             /* calltaba.asm */
    28 extern char DATA16_INIT         KKL_EntryTabFixups[1];          /* calltaba.asm */
     30extern char                     KKL_EntryTabFixups[1];          /* calltaba.asm */
    2931#ifdef _OS2KLDR_H_
    3032extern MTE                      kKrnlLibMTE;                    /* calltaba.asm */
     
    4547*   Functions                                                                  *
    4648*******************************************************************************/
    47 extern void _Optlink LockedWrite(unsigned long ulAddr, unsigned char chOpcode, unsigned long ulDword);
    48 extern int  _Optlink MakeCalltab16CodeSegment(void);
     49extern void _Optlink    LockedWrite(unsigned long ulAddr, unsigned char chOpcode, unsigned long ulDword);
     50extern int  _Optlink    MakeCalltab16CodeSegment(void);
     51extern int              krnlLoadKernelSym(void);
     52extern int              krnlLoadKernelSymFile(const char *pszFilename);
    4953
    5054#endif
  • trunk/src/win32k/kKrnlLib/include/options.h

    r9507 r9514  
    1 /* $Id: options.h,v 1.4 2002-12-16 01:37:07 bird Exp $
     1/* $Id: options.h,v 1.5 2002-12-16 02:25:07 bird Exp $
    22 *
    33 * Options.
     
    5252{
    5353    /** @cat misc */
    54     ULONG       fQuiet;                 /* Quiet initialization. */
     54    unsigned long   fQuiet;             /* Quiet initialization. */
    5555
    5656    /** @cat logging options */
    57     USHORT      usCom;                  /* Output port no. */
    58     USHORT      fLogging;               /* Logging. */
     57    unsigned short  usCom;              /* Output port no. */
     58    unsigned short  fLogging;           /* Logging. */
    5959
    6060    /** @cat Options affecting the heap. */
    61     ULONG       cbSwpHeapInit;          /* Initial heapsize. */
    62     ULONG       cbSwpHeapMax;           /* Maximum heapsize. */
    63     ULONG       cbResHeapInit;          /* Initial residentheapsize. */
    64     ULONG       cbResHeapMax;           /* Maxiumem residentheapsize. */
     61    unsigned long   cbSwpHeapInit;      /* Initial heapsize. */
     62    unsigned long   cbSwpHeapMax;       /* Maximum heapsize. */
     63    unsigned long   cbResHeapInit;      /* Initial residentheapsize. */
     64    unsigned long   cbResHeapMax;       /* Maxiumem residentheapsize. */
    6565};
    6666#pragma pack()
     
    7171/* NOINC */
    7272extern struct kKLOptions    options;  /* defined in d16Globl.c */
    73 extern USHORT               usVerMajor;
    74 extern USHORT               usVerMinor;
     73extern unsigned short       usVerMajor; /* obsolete? */
     74extern unsigned short       usVerMinor; /* obsolete? */
    7575extern char                 szSymbolFile[128];
    7676
  • trunk/src/win32k/kKrnlLib/src/Extract.mak

    r9124 r9514  
    1 # $Id: Extract.mak,v 1.10 2002-08-24 22:07:40 bird Exp $
     1# $Id: Extract.mak,v 1.11 2002-12-16 02:24:27 bird Exp $
    22
    33#
    44# kKrnlLib/krnl makefile.
    55#
    6 # Copyright (c) 1999-2002 knut st. osmundsen (bird@anduin.net)
     6# Copyright (c) 1999-2003 knut st. osmundsen (bird@anduin.net)
    77#
    88# GPL
     
    1212# Setup config
    1313#
    14 #!include ..\..\makefile.inc
    1514ALL_INCLUDES    = -I../include -I../kLib/include
    1615ALL_DEFINES     = -DEXTRACT -DLOGGING_DISABLED
     
    2524TARGET_MODE     = EXE
    2625TARGET_PUB_DIR  = $(PATH_TOOLS)
    27 TARGET_STACKSIZE= 0x2000
    2826MAKEFILE        = $(TARGET_NAME).mak
    29 PREMAKEFILES_LIB= Extract16.mak
    3027
    3128TARGET_OBJS =\
    32 $(PATH_ROOT)\obj\$(SHT_TRGPLTFRM)$(SHT_BLDMD)mscv6-16\Extract16.$(EXT_LIB)\Extract16.$(EXT_LIB)\
    3329$(PATH_TARGET)\Extract32.$(EXT_OBJ)\
    3430$(PATH_TARGET)\krnlPrologs.$(EXT_OBJ)\
     31$(PATH_TARGET)\krnlImportTable.$(EXT_OBJ)\
    3532
    3633TARGET_LIBS =\
    37 $(PATH_TOOLKIT)\lib\os2286.$(EXT_LIB)\
    38 $(PATH_MSC)\lib\clibcep.$(EXT_LIB)\
    3934$(LIB_OS)\
    4035$(LIB_C_NRE)\
  • trunk/src/win32k/kKrnlLib/src/Makefile

    r9124 r9514  
    1 # $Id: Makefile,v 1.11 2002-08-24 22:07:40 bird Exp $
     1# $Id: Makefile,v 1.12 2002-12-16 02:24:27 bird Exp $
    22
    33#
     
    2828
    2929PREMAKEFILES_LIB    =\
    30     newdbg.mak \
    31     newrel.mak \
     30#    newdbg.mak \
     31#    newrel.mak \
    3232    Dev16.mak \
    3333
     
    6161$(PATH_TARGET)\vprintf.$(EXT_OBJ)\
    6262$(PATH_TARGET)\vsprintf.$(EXT_OBJ)\
    63 $(PATH_OBJ)\$(TARGET_SUB)\newdbg.$(EXT_LIB)\newdbg.$(EXT_LIB)\
    64 $(PATH_OBJ)\$(TARGET_SUB)\newrel.$(EXT_LIB)\newrel.$(EXT_LIB)\
     63#$(PATH_OBJ)\$(TARGET_SUB)\newdbg.$(EXT_LIB)\newdbg.$(EXT_LIB)\
     64#$(PATH_OBJ)\$(TARGET_SUB)\newrel.$(EXT_LIB)\newrel.$(EXT_LIB)\
    6565\
    66 $(PATH_ROOT)\obj\$(SHT_TRGPLTFRM)$(SHT_BLDMD)mscv6-16\$(TARGET_SUB)\dev16.$(EXT_LIB)\dev16.$(EXT_LIB)\
     66$(PATH_ROOT)\obj\$(SHT_TRGPLTFRM)$(SHT_BLDMD)mscv6_16\$(TARGET_SUB)\dev16.$(EXT_LIB)\dev16.$(EXT_LIB)\
    6767\
    6868$(PATH_TARGET)\SymDB32.$(EXT_OBJ)\
  • trunk/src/win32k/kKrnlLib/src/MkCallTab.mak

    r9504 r9514  
    1 # $Id: MkCallTab.mak,v 1.13 2002-12-16 00:48:05 bird Exp $
     1# $Id: MkCallTab.mak,v 1.14 2002-12-16 02:24:27 bird Exp $
    22
    33#
     
    4949# kKrnlLib Import library definition file.
    5050..\kKrnlLibimplib.$(EXT_DEF): $(TARGET_PUBNAME)
    51     $(TARGET_PUBNAME) deffile > $@
     51    $(TARGET) deffile > $@
    5252
    5353# Generate calltaba.asm
    5454calltaba.asm:           $(TARGET_PUBNAME)
    55     $(TARGET_PUBNAME) calltab > $@
     55    $(TARGET) calltab > $@
    5656
    5757# Generate TstFakers.c
    5858TstFakers.c:            $(TARGET_PUBNAME)
    59     $(TARGET_PUBNAME) tstfakers > $@
     59    $(TARGET) tstfakers > $@
    6060
    6161!endif # !BUILD_FORWARDING
  • trunk/src/win32k/kKrnlLib/src/abort.c

    r8140 r9514  
    1 /* $Id: abort.c,v 1.2 2002-03-31 19:01:12 bird Exp $
     1/* $Id: abort.c,v 1.3 2002-12-16 02:24:27 bird Exp $
    22 *
    33 * Abort replacement.
    44 *
    5  * Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@mynd.no)
     5 * Copyright (c) 1998-2003 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 */
    1025#ifndef NOFILEID
    11 static const char szFileId[] = "$Id: abort.c,v 1.2 2002-03-31 19:01:12 bird Exp $";
     26static const char szFileId[] = "$Id: abort.c,v 1.3 2002-12-16 02:24:27 bird Exp $";
    1227#endif
    1328
     
    1631*   Internal Functions                                                         *
    1732*******************************************************************************/
    18 #include <os2.h>
    19 #include "devSegDf.h"                   /* Win32k segment definitions. */
    20 #include "dev32.h"
    2133#include <kLib/kTypes.h>
    2234#include <kLib/kLog.h>
    23 
    24 #include <builtin.h>
     35#include <kLib/kDevHlp.h>
    2536
    2637
     
    3445    KLOGENTRY0("void");
    3546    kprintf(("!Internal Processing Error! should not be here! - abort!\n"));
    36     INT3();
     47    kBreakPoint();
    3748    KLOGEXITVOID();
    3849}
     50
  • trunk/src/win32k/kKrnlLib/src/d16ProbeKrnl.c

    r8188 r9514  
    1 /* $Id: d16ProbeKrnl.c,v 1.3 2002-04-01 13:51:17 bird Exp $
     1/* $Id: d16ProbeKrnl.c,v 1.4 2002-12-16 02:24:27 bird Exp $
    22 *
    33 * Description:   Autoprobes the os2krnl file and os2krnl[*].sym files.
     
    137137
    138138/*
    139  *
    140  */
    141 static struct
    142 {
    143     short       sErr;
    144     const char *pszMsg;
    145 } DATA16_INIT aErrorMsgs[] =
    146 {
    147     {ERROR_PROB_KRNL_OPEN_FAILED,       "(Krnl) Failed to open kernel file."},
    148     {ERROR_PROB_KRNL_SEEK_SIZE,         "(Krnl) Failed to seek to end to of file."},
    149     {ERROR_PROB_KRNL_SEEK_FIRST,        "(Krnl) Failed to start of file."},
    150     {ERROR_PROB_KRNL_READ_FIRST,        "(Krnl) Failed to read (first)."},
    151     {ERROR_PROB_KRNL_READ_NEXT,         "(Krnl) Failed to read."},
    152     {ERROR_PROB_KRNL_TAG_NOT_FOUND,     "(Krnl) Build level tag was not found."},
    153     {ERROR_PROB_KRNL_INV_SIGANTURE,     "(Krnl) Invalid build level signature."},
    154     {ERROR_PROB_KRNL_INV_BUILD_NBR,     "(Krnl) Invalid build level number."},
    155     {ERROR_PROB_KRNL_BUILD_VERSION,     "(Krnl) Invalid build level version."},
    156     {ERROR_PROB_KRNL_MZ_SEEK,           "(Krnl) Failed to seek to start of file. (MZ)"},
    157     {ERROR_PROB_KRNL_MZ_READ,           "(Krnl) Failed to read MZ header."},
    158     {ERROR_PROB_KRNL_NEOFF_INVALID,     "(Krnl) Invalid new-header offset in MZ header."},
    159     {ERROR_PROB_KRNL_NEOFF_SEEK,        "(Krnl) Failed to seek to new-header offset."},
    160     {ERROR_PROB_KRNL_LX_READ,           "(Krnl) Failed to read LX header."},
    161     {ERROR_PROB_KRNL_LX_SIGNATURE,      "(Krnl) Invalid LX header signature."},
    162     {ERROR_PROB_KRNL_OBJECT_CNT,        "(Krnl) Object count don't match the running kernel."},
    163     {ERROR_PROB_KRNL_OBJECT_CNR_10,     "(Krnl) Less than 10 objects - not a valid kernel file!"},
    164     {ERROR_PROB_KRNL_OTE_SEEK,          "(Krnl) Failed to seek to OTEs."},
    165     {ERROR_PROB_KRNL_OTE_READ,          "(Krnl) Failed to read OTEs."},
    166     {ERROR_PROB_KRNL_OTE_SIZE_MIS,      "(Krnl) Size of a OTE didn't match the running kernel."},
    167 
    168     /*
    169      * ProbeSymFile error messages + some extra ones.
    170      */
    171     {ERROR_D16_THUNKING_FAILED,         "(Init) Request packed thunking failed."},
    172     {ERROR_D16_OPEN_DEV_FAILED,         "(Init) Failed to open helper driver ($KrnlHlp)."},
    173     {ERROR_D16_IOCTL_FAILED,            "(Init) IOCtl call to helper driver ($KrnlHlp) failed."},
    174 
    175     {ERROR_PROB_SYM_FILE_NOT_FOUND,     "(Sym) Symbol file was not found."},
    176     {ERROR_PROB_SYM_READERROR,          "(Sym) Read failed."},
    177     {ERROR_PROB_SYM_INVALID_MOD_NAME,   "(Sym) Invalid module name (not OS2KRNL)."},
    178     {ERROR_PROB_SYM_SEGS_NE_OBJS,       "(Sym) Number of segments don't match the object count of the kernel."},
    179     {ERROR_PROB_SYM_SEG_DEF_SEEK,       "(Sym) Failed to seek to a segment definition."},
    180     {ERROR_PROB_SYM_SEG_DEF_READ,       "(Sym) Failed to read a segment definition."},
    181     {ERROR_PROB_SYM_IMPORTS_NOTFOUND,   "(Sym) Some of the imports wasn't found."},
    182 
    183     {ERROR_D32_GETOS2KRNL_FAILED   ,    "(KrnlInfo) Failed to get the kernel MTE."},
    184     {ERROR_D32_NO_SWAPMTE          ,    "(KrnlInfo) No swap MTE pointer in kernel MTE."},
    185     {ERROR_D32_TOO_MANY_OBJECTS    ,    "(KrnlInfo) Too many kernel objects."},
    186     {ERROR_D32_NO_OBJECT_TABLE     ,    "(KrnlInfo) No object table pointer.."},
    187     {ERROR_D32_BUILD_INFO_NOT_FOUND,    "(KrnlInfo) Didn't find build info."},
    188     {ERROR_D32_INVALID_BUILD       ,    "(KrnlInfo) Invalid build info."},
    189 
    190     {ERROR_D32_VERIFY_FAILED  ,         "(InitR0) Reverify of kernel entrypoints failed."},
    191     {ERROR_D32_IPE            ,         "(InitR0) Internal Processing Error."},
    192     {ERROR_D32_HEAPINIT_FAILED,         "(InitR0) Heap Init failed."},
    193     {ERROR_D32_LDR_INIT_FAILED,         "(InitR0) Loader init failed."},
    194 
    195     {ERROR_D32_PROC_NOT_FOUND     ,     "(Verify32) Procedure not found."},
    196     {ERROR_D32_INVALID_OBJ_OR_ADDR,     "(Verify32) Invalid object or address."},
    197     {ERROR_D32_INVALID_ADDRESS    ,     "(Verify32) Invalid address."},
    198     {ERROR_D32_TOO_INVALID_PROLOG ,     "(Verify32) Invalid procedure prolog."},
    199     {ERROR_D32_NOT_IMPLEMENTED    ,     "(Verify32) Entrytype is not implemented."},
    200 
    201 #ifdef DB_16BIT
    202     {ERROR_PROB_SYMDB_KRNL_NOT_FOUND,   "(SymDB) Kernel was not found."}
    203 #else
    204     {ERROR_D32_SYMDB_NOT_FOUND,         "(SymDB32) Not found."},
    205 #endif
    206 };
    207 
    208 /*
    209139 * Fake data for Ring-3 testing.
    210140 */
     
    247177*   Implementation of Internal Helper Functions                                *
    248178*******************************************************************************/
    249 /**
    250  * Get the message text for an error message.
    251  * @returns Pointer to error text. NULL if not found.
    252  * @param   sErr  Error code id.
    253  * @status  completely implemented.
    254  * @author  knut st. osmundsen (kosmunds@csc.com)
    255  */
    256 const char * GetErrorMsg(short sErr)
    257 {
    258     int i;
    259     for (i = 0; i < sizeof(aErrorMsgs) / sizeof(aErrorMsgs[0]); i++)
    260     {
    261         if (aErrorMsgs[i].sErr == sErr)
    262             return aErrorMsgs[i].pszMsg;
    263     }
    264     return NULL;
    265 }
    266 
    267 
    268 /**
    269  * Does the dev ioctl call to the helper driver for calling
    270  * a 32-bit Ring-0 worker.
    271  * @returns error code from DosOpen or DosDevIOCtl.
    272  * @param   pParam  Pointer to parameter buffer.
    273  * @param   pData   Pointer to data buffer.
    274  * @author  knut st. osmundsen (kosmunds@csc.com)
    275  */
    276 int DoDevIOCtl(KKLR0INITPARAM  *pParam, KKLR0INITDATA *pData)
    277 {
    278     APIRET          rc;
    279     HFILE           hDev0 = 0;
    280     USHORT          usAction = 0;
    281 
    282     /* Open the kKrnlHlp device driver. */
    283     rc = DosOpen(KKL_DEVICE_NAME, &hDev0, &usAction, 0UL, FILE_NORMAL,
    284                  OPEN_ACTION_FAIL_IF_NEW | OPEN_ACTION_OPEN_IF_EXISTS,
    285                  OPEN_SHARE_DENYNONE | OPEN_ACCESS_READONLY,
    286                  0UL);
    287     if (rc == NO_ERROR)
    288     {
    289         pData->ulRc = 0;
    290         rc = DosDevIOCtl(pData, pParam, KKL_IOCTL_RING0INIT, KKL_IOCTL_CAT, hDev0);
    291         DosClose(hDev0);
    292         if (rc != NO_ERROR)
    293         {
    294             dprintf(("DosDevIOCtl failed with rc=%d\n", rc));
    295             rc = ERROR_D16_IOCTL_FAILED;
    296         }
    297     }
    298     else
    299     {
    300         dprintf(("DosOpen Failed with rc=%d\n", rc));
    301         rc = ERROR_D16_OPEN_DEV_FAILED;
    302     }
    303 
    304     return rc;
    305 }
    306179
    307180
  • trunk/src/win32k/kKrnlLib/src/d16Strat.c

    r8140 r9514  
    1 /* $Id: d16Strat.c,v 1.2 2002-03-31 19:01:15 bird Exp $
     1/* $Id: d16Strat.c,v 1.3 2002-12-16 02:24:28 bird Exp $
    22 *
    33 * d16strat.c - 16-bit strategy routine, device headers, device_helper (ptr)
     
    3636
    3737/*******************************************************************************
    38 *   Global Variables                                                           *
    39 *******************************************************************************/
    40 #if 0 /* moved to devfirst.asm */
    41 extern DDHDR _far aDevHdrs[2];
    42 DDHDR aDevHdrs[2] = /* This is the first piece data in the driver!!!!!!! */
    43 {
    44     {
    45         &aDevHdrs[1], /* NextHeader */
    46         DEVLEV_3 | DEV_30 | DEV_CHAR_DEV,           /* SDevAtt */
    47         (unsigned short)(void _near *)strategyAsm0, /* StrategyEP */
    48         0,                                          /* InterruptEP */
    49         "$KrnlHlp",                                 /* DevName */
    50         0,                                          /* SDevProtCS */
    51         0,                                          /* SDevProtDS */
    52         0,                                          /* SDevRealCS */
    53         0,                                          /* SDevRealDS */
    54         DEV_16MB | DEV_IOCTL2                       /* SDevCaps */
    55     },
    56     {
    57         ~0UL,                                       /* NextHeader */
    58         DEVLEV_3 | DEV_30 | DEV_CHAR_DEV,           /* SDevAtt */
    59         (unsigned short)(void _near *)strategyAsm1, /* StrategyEP */
    60         0,                                          /* InterruptEP */
    61         "$KrnlLib",                                 /* DevName */
    62         0,                                          /* SDevProtCS */
    63         0,                                          /* SDevProtDS */
    64         0,                                          /* SDevRealCS */
    65         0,                                          /* SDevRealDS */
    66         DEV_16MB | DEV_IOCTL2                       /* SDevCaps */
    67     }
    68 };
    69 #endif
    70 
    71 
    72 /*******************************************************************************
    7338*   Internal Functions                                                         *
    7439*******************************************************************************/
     
    8853    {
    8954        case CMDInit:                   /* INIT command */
    90             if (fInitTime)
    91             {
    92                 if (usDev == 0)
    93                     return dev0Init((PRPINITIN)pRpH, (PRPINITOUT)pRpH);
    94                 return dev1Init((PRPINITIN)pRpH, (PRPINITOUT)pRpH);
    95             }
    96             break;
     55            if (usDev == 0)
     56                return dev0Init((PRPINITIN)pRpH, (PRPINITOUT)pRpH);
     57            return dev1Init((PRPINITIN)pRpH, (PRPINITOUT)pRpH);
    9758
    9859        case CMDGenIOCTL:               /* Generic IOCTL */
    99             if (fInitTime)
    100                 return devGenIOCtl((PRP_GENIOCTL)pRpH);
    101             break;
     60            return devGenIOCtl((PRP_GENIOCTL)pRpH);
    10261
    10362        case CMDOpen:                   /* device open */
     
    11069
    11170        case CMDInitBase:
    112         {
    113             MSGTABLE    msg = { 1178, 1, "kKrnlLib.sys is not yet capable of being a BASEDEV." };
    114             DevHelp_Save_Message( &msg );
    115             break;
    116         }
     71            if (usDev == 0)
     72                return dev0Init((PRPINITIN)pRpH, (PRPINITOUT)pRpH);
     73            return dev1Init((PRPINITIN)pRpH, (PRPINITOUT)pRpH);
    11774    }
    11875
     
    144101             */
    145102            case KKL_IOCTL_RING0INIT:
    146                 if (TKSSBase16 == 0)
     103                if (pulTKSSBase32 == 0)
    147104                    initGetDosTableData();
    148105                /*
  • trunk/src/win32k/kKrnlLib/src/d16crt.c

    r8140 r9514  
    1 /* $Id: d16crt.c,v 1.1 2002-03-31 19:01:15 bird Exp $
     1/* $Id: d16crt.c,v 1.2 2002-12-16 02:24:28 bird Exp $
    22 *
    33 * Moved all the crt replacements used by the 16-bit part into one file.
    44 *
    5  * Copyright (c) 1998-2002 knut st. osmundsen (bird@anduin.net)
    6  *
    7  * Project Odin Software License can be found in LICENSE.TXT
     5 * Copyright (c) 1998-2003 knut st. osmundsen <bird@anduin.net>
     6 *
     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 */
  • trunk/src/win32k/kKrnlLib/src/devFirst.asm

    r8140 r9514  
    1 ; $Id: devFirst.asm,v 1.2 2002-03-31 19:01:15 bird Exp $
    2 ;
    3 ; DevFirst - entrypoint and segment definitions
    4 ;
    5 ; Copyright (c) 1999 knut st. osmundsen
    6 ;
    7 ; Project Odin Software License can be found in LICENSE.TXT
     1; $Id: devFirst.asm,v 1.3 2002-12-16 02:24:28 bird Exp $
     2;
     3; DevFirst - entrypoint, helper code, and segment definitions.
     4;
     5;
     6; Copyright (c) 1998-2003 knut st. osmundsen <bird@anduin.net>
     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
     23;
    824;
    925    .386p
     
    2036;
    2137    public CODE16START
    22     public CODE16_INITSTART
    23     public DATA16START
    2438    public DATA16START
    2539    public DATA16_BSSSTART
    2640    public DATA16_CONSTSTART
    2741    public DATA16_GLOBALSTART
    28     public DATA16_INITSTART
    2942    public CODE16START
    3043    public CODE32START
     
    5467; Externs
    5568;
    56 DATA16 segment
    57     extrn _TKSSBase16:dword
    58 DATA16 ends
    5969DATA32 segment
    60     extrn pulTKSSBase32:dword
     70    extrn _pulTKSSBase32:dword
    6171DATA32 ends
    6272    extrn R0Init:near
     
    121131_SSToDS_16a proc NEAR
    122132    assume CS:CODE16, DS:DATA16, ES:NOTHING
    123     mov     edx, ds:_TKSSBase16         ; get pointer held by _TKSSBase16 (pointer to stack base)
     133    mov     edx, ds:_pulTKSSBase32      ; get pointer held by _pulTKSSBase32 (pointer to stack base)
    124134    call    far ptr FLAT:far_getCS      ; get flat selector.
    125135    push    es
     
    244254    mov     fs, cx      ;?
    245255    ASSUME  ds:FLAT, es:FLAT, fs:NOTHING
    246 
    247     ; make sure pulTKSSBase32 is ok.
    248     cmp     pulTKSSBase32, 0
    249     jnz     pulTKSSBase32_OK
    250     mov     ecx, _TKSSBase16
    251     mov     pulTKSSBase32, ecx
    252     xor     ecx, ecx
    253 
    254 pulTKSSBase32_OK:
    255256
    256257    ; do the call. (_System or _Optlink)
     
    445446
    446447
    447 CODE16_INIT segment
    448 CODE16_INITSTART db 'CODE16_INITSTART',0
    449 CODE16_INIT ends
    450 
    451448DATA16 segment
    452449DATA16START label byte                  ; Note. no start string here!
     
    496493DATA16_GLOBAL ends
    497494
    498 DATA16_INIT segment
    499 DATA16_INITSTART db 'DATA16_INITSTART',0
    500 DATA16_INIT ends
    501 
    502495BSS32 segment
    503496BSS32START db 'BSS32START',0
  • trunk/src/win32k/kKrnlLib/src/devLast.asm

    r8056 r9514  
    1 ; $Id: devLast.asm,v 1.1 2002-03-10 02:45:54 bird Exp $
     1; $Id: devLast.asm,v 1.2 2002-12-16 02:24:28 bird Exp $
    22;
    3 ; DevLast - the object file termintating the resident part of the objects.
    4 ; Code after the ???END labes and object files and which are linked in
    5 ; after this file is discarded after init.
     3; Segment endmarkers.
    64;
    7 ; Copyright (c) 1999 knut st. osmundsen
     5; NOTE: This file must be put into an library to get be linked in last.
    86;
    9 ; Project Odin Software License can be found in LICENSE.TXT
     7; Copyright (c) 1999-2002 knut st. osmundsen <bird@anduin.net>
     8;
     9;
     10; This file is part of kLib.
     11;
     12; kLib is free software; you can redistribute it and/or modify
     13; it under the terms of the GNU General Public License as published by
     14; the Free Software Foundation; either version 2 of the License, or
     15; (at your option) any later version.
     16;
     17; kLib is distributed in the hope that it will be useful,
     18; but WITHOUT ANY WARRANTY; without even the implied warranty of
     19; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     20; GNU General Public License for more details.
     21;
     22; You should have received a copy of the GNU General Public License
     23; along with kLib; if not, write to the Free Software
     24; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
     25;
    1026;
    1127       .model flat
     
    2541    public DATA16_CONSTEND
    2642    public DATA16_GLOBALEND
    27     public DATA16_INITEND
    28     public DATA16_INIT_BSSEND
    29     public DATA16_INIT_CONSTEND
     43    public DATA16_ENDEND
    3044    public CODE16END
    31     public CODE16_INITEND
     45    public CODE16_ENDEND
    3246    public CODE32END
    3347    public DATA32END
     
    6276DATA16_GLOBAL ends
    6377
    64 DATA16_INIT segment
    65 db 'DATA16_INITEND'
    66 DATA16_INITEND db 0
    67 DATA16_INIT ends
     78DATA16_END segment
     79db 'DATA16_ENDEND'
     80DATA16_ENDEND db 0
     81DATA16_END ends
    6882
    69 DATA16_INIT_BSS segment
    70 db 'DATA16_INIT_BSSEND'
    71 DATA16_INIT_BSSEND db 0
    72 DATA16_INIT_BSS ends
    73 
    74 DATA16_INIT_CONST segment
    75 db 'DATA16_CONSTEND'
    76 DATA16_INIT_CONSTEND db 0
    77 DATA16_INIT_CONST ends
    7883
    7984CODE16 segment
     
    8287CODE16 ends
    8388
    84 CODE16_INIT segment
    85 db 'CODE16_INITEND'
    86 CODE16_INITEND db 0
    87 CODE16_INIT ends
    88 
     89CODE16_END segment
     90db 'CODE16_ENDEND'
     91CODE16_ENDEND db 0
     92CODE16_END ends
    8993
    9094CODE32 segment
  • trunk/src/win32k/kKrnlLib/src/extract.c

    r9084 r9514  
    1 /* $Id: extract.c,v 1.3 2002-08-22 02:55:26 bird Exp $
    2  *
    3  * Description:     SymDB entry generator.
    4  *                  Builds SymDB entry from one or more symbol files.
    5  *
    6  * WARNING: For some stupid reason we usually crash when not redirecting STDOUT.
    7  *
    8  * Copyright (c) 2000-2001 knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    9  *
    10  * Project Odin Software License can be found in LICENSE.TXT
     1/* $Id: extract.c,v 1.4 2002-12-16 02:24:28 bird Exp $
     2 *
     3 * SymDB32 entry generator.
     4 * Buils SymDB32 entries from one ofr more symbol files.
     5 *
     6 * Copyright (c) 1999-2003 knut st. osmundsen <bird@anduin.net>
     7 *
     8 *
     9 * This file is part of kKrnlLib.
     10 *
     11 * kKrnlLib is free software; you can redistribute it and/or modify
     12 * it under the terms of the GNU General Public License as published by
     13 * the Free Software Foundation; either version 2 of the License, or
     14 * (at your option) any later version.
     15 *
     16 * kKrnlLib is distributed in the hope that it will be useful,
     17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     19 * GNU General Public License for more details.
     20 *
     21 * You should have received a copy of the GNU General Public License
     22 * along with kKrnlLib; if not, write to the Free Software
     23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    1124 *
    1225 */
     26
    1327
    1428/*******************************************************************************
     
    1933
    2034#define DB_ASM
    21 
    22 #define fclose(a) DosClose(a)
    23 #define SEEK_SET FILE_BEGIN
    24 #define SEEK_END FILE_END
    25 
    26 #define WORD unsigned short int
    27 #define DWORD unsigned long int
    2835
    2936#define INCL_BASE
     
    3744#include <os2.h>
    3845
    39 #include <strat2.h>
    40 #include <reqpkt.h>
    41 
    42 #include "devSegDf.h"
    43 #undef  DATA16_INIT
    44 #define DATA16_INIT
    45 #undef  CODE16_INIT
    46 #define CODE16_INIT
    4746#include "os2Krnl.h"                    /* must be included before dev1632.h! */
    48 #include "probkrnl.h"
     47#include "krnlImportTable.h"
    4948#include "dev1632.h"
    5049#include "options.h"
    51 #include "d16vprintf.h"
    52 #include "d16crt.h"
    5350
    5451#include <kKLkernel.h>
     52
     53#include <string.h>
     54#include <stdio.h>
     55#include <stdlib.h>
    5556
    5657
     
    6566
    6667/* dummy replacement for SymDB.c */
    67 KRNLDBENTRY   DATA16_INIT    aKrnlSymDB[] = {{0}};
     68KRNLDBENTRY aKrnlSymDB[] = {{0}};
    6869
    6970/*******************************************************************************
     
    7778*******************************************************************************/
    7879/* Workers */
    79 extern  int      ProbeSymFile(const char *pszFilename);
    80 
    81 /* 32-bit functions */
    82 extern USHORT cdecl far GetOpcodes(const char far * pszKrnlFile, unsigned short cSymObjects);
    83 extern void   cdecl far Init32bitCrt(void);
     80extern int  ProbeSymFile(const char *pszFilename);
     81extern int  GetOpcodes(const char *pszKrnlFile, unsigned int cSymObjects);
    8482
    8583
     
    10199static int processFile(const char *pszFilename)
    102100{
    103     APIRET   rc;
    104     int      cch;
    105     int      cchNum;
    106     const char *psz = pszFilename + kstrlen(pszFilename);
     101    int     rc;
     102    int     cch;
     103    int     cchNum;
     104    const char *psz = pszFilename + strlen(pszFilename);
    107105
    108106    /* find filename */
     
    114112
    115113    /* Progress information */
    116     DosWrite(2, (char*)pszFilename, cch, &rc);
    117     DosWrite(2, "\r\n", 2, &rc);
     114    fprintf(stderr, "%s\n", pszFilename);
    118115
    119116    /* Filename check */
     
    130127        )
    131128    {
    132         printf16("invalid filename: %s\n", pszFilename);
     129        fprintf(stderr, "invalid filename: %s\n", pszFilename);
    133130        return 2;
    134131    }
     
    161158         * Call 32-bit helper to check if there is a kernel.
    162159         */
    163         kstrcpy(szKrnlFile, pszFilename);
    164         szKrnlFile[kstrlen(szKrnlFile) - 4] = '\0';
     160        strcpy(szKrnlFile, pszFilename);
     161        szKrnlFile[strlen(szKrnlFile) - 4] = '\0';
    165162        if (GetOpcodes(szKrnlFile, cObjects))
    166163        {
    167             printf16("GetOpcodes failed: %s\n", szKrnlFile);
     164            fprintf(stderr, "GetOpcodes failed: %s\n", szKrnlFile);
    168165            return 3;
    169166        }
     
    175172         * is enclaved within an "#ifdef ALLKERNELS ... #endif".
    176173         */
    177         #ifndef DB_ASM
    178             if (psz[cchNum] != 'R')
    179                 printf16("#ifdef ALLKERNELS\n");
    180 
    181             printf16("    { /* %s */\n"
    182                      "        %.*s, ",
    183                      psz,
    184                      cchNum, &psz[0]    /* build number */
    185                      );
    186 
    187             switch (psz[cchNum + 1])
    188             {
    189                 case 'S':   printf16("KF_SMP"); break;
    190                 case '4':   printf16("KF_UNI | KF_W4"); break;
    191                 case 'U':   printf16("KF_UNI"); break;
    192             }
    193             switch (psz[cchNum])
    194             {
    195                 case 'A':   printf16(" | KF_ALLSTRICT"); break;
    196                 case 'H':   printf16(" | KF_HALFSTRICT"); break;
    197             }
    198             if (psz[cchNum + 2] >= 'A' && psz[cchNum + 2] <= 'Z')
    199                 printf16(" | KF_REV_%c", psz[cchNum + 2]);
    200 
    201             printf16(", %d,\n"
    202                      "        {\n",
    203                      cObjects);
    204 
    205             for (i = 0; i < NBR_OF_KRNLIMPORTS; i++)
    206             {
    207                 char *psz = aImportTab[i].achName;
    208                 printf16("            {%-2d, 0x%08lx, 0x%02x}, /* %s */\n",
    209                          aImportTab[i].fFound ? aImportTab[i].iObject   : 0,
    210                          aImportTab[i].fFound ? aImportTab[i].offObject : 0xFFFFFFFFUL,
    211                          aImportTab[i].fFound ? aImportTab[i].chOpcode  : OPCODE_IGNORE,
    212                          (char *)&aImportTab[i].achName[0]
    213                          );
    214             }
    215             printf16("        }\n"
    216                      "    },\n");
    217 
    218             /** @remark
    219              * We generate #ifdef ALLKERNELS for debug kernels since we usually
    220              * don't include symbol info in the database.
    221              * OLD:
    222              * Currently information for retail kernels are usable, but we'll
    223              * generate it for the debug kernels too, but this information
    224              * is enclaved within an "#ifdef ALLKERNELS ... #endif".
    225              */
    226             if (psz[cchNum] != 'R')
    227                 printf16("#endif\n");
    228         #else
    229             if (psz[cchNum] != 'R')
    230                 printf16("ifdef ALLKERNELS\n");
    231 
    232             printf16(";/* %s */\n"
    233                      "  dw %.*s %*s; build no.\n",
    234                      psz,
    235                      cchNum, &psz[0], 4-cchNum, ""
    236                      );
    237 
    238             i = 0;                      /* flags */
    239             switch (psz[cchNum + 1])
    240             {
    241                 case 'S':   i |= KF_SMP; break;
    242                 case '4':   i |= KF_UNI | KF_W4; break;
    243                 case 'U':   i |= KF_UNI; break;
    244             }
    245             switch (psz[cchNum])
    246             {
    247                 case 'A':   i |= KF_ALLSTRICT; break;
    248                 case 'H':   i |= KF_HALFSTRICT; break;
    249             }
    250             if (psz[cchNum + 2] >= 'A' && psz[cchNum + 2] <= 'Z')
    251                 i |= (psz[cchNum + 2] - 'A' + (KF_REV_A >> KF_REV_SHIFT)) << KF_REV_SHIFT;
    252 
    253             printf16("  dw 0%04xh ; fKernel\n"
    254                      "  db 0%2xh   ; cObjects\n",
    255                      i,
    256                      cObjects);
    257 
    258             for (i = 0; i < NBR_OF_KRNLIMPORTS; i++)
    259             {
    260                 PIMPORTKRNLSYM  pEntry = &aImportTab[i];
    261                 printf16("    db 0%02xh      ; %s\n"
    262                          "    db 0%02xh\n"
    263                          "    dd 0%08lxh\n",
    264                          pEntry->fFound ? pEntry->iObject   : 0,
    265                          pEntry->achName,
    266                          pEntry->fFound ? pEntry->chOpcode  : OPCODE_IGNORE,
    267                          pEntry->fFound ? pEntry->offObject : 0xFFFFFFFFUL
    268                          );
    269             }
    270 
    271             /** @remark
    272              * We generate #ifdef ALLKERNELS for debug kernels since we usually
    273              * don't include symbol info in the database.
    274              * OLD:
    275              * Currently information for retail kernels are usable, but we'll
    276              * generate it for the debug kernels too, but this information
    277              * is enclaved within an "#ifdef ALLKERNELS ... #endif".
    278              */
    279             if (psz[cchNum] != 'R')
    280                 printf16("endif\n");
    281         #endif
     174        if (psz[cchNum] != 'R')
     175            printf("ifdef ALLKERNELS\n");
     176
     177        printf(";/* %s */\n"
     178               "  dw %.*s %*s; build no.\n",
     179               psz,
     180               cchNum, &psz[0], 4-cchNum, ""
     181               );
     182
     183        i = 0;                      /* flags */
     184        switch (psz[cchNum + 1])
     185        {
     186            case 'S':   i |= KF_SMP; break;
     187            case '4':   i |= KF_UNI | KF_W4; break;
     188            case 'U':   i |= KF_UNI; break;
     189        }
     190        switch (psz[cchNum])
     191        {
     192            case 'A':   i |= KF_ALLSTRICT; break;
     193            case 'H':   i |= KF_HALFSTRICT; break;
     194        }
     195        if (psz[cchNum + 2] >= 'A' && psz[cchNum + 2] <= 'Z')
     196            i |= (psz[cchNum + 2] - 'A' + (KF_REV_A >> KF_REV_SHIFT)) << KF_REV_SHIFT;
     197
     198        printf("  dw 0%04xh ; fKernel\n"
     199               "  db 0%2xh   ; cObjects\n",
     200               i,
     201               cObjects);
     202
     203        for (i = 0; i < NBR_OF_KRNLIMPORTS; i++)
     204        {
     205            PIMPORTKRNLSYM  pEntry = &aImportTab[i];
     206            printf("    db 0%02xh      ; %s\n"
     207                   "    db 0%02xh\n"
     208                   "    dd 0%08lxh\n",
     209                   pEntry->fFound ? pEntry->iObject   : 0,
     210                   pEntry->achName,
     211                   pEntry->fFound ? pEntry->chOpcode  : OPCODE_IGNORE,
     212                   pEntry->fFound ? pEntry->offObject : 0xFFFFFFFFUL
     213                   );
     214        }
     215
     216        /** @remark
     217         * We generate #ifdef ALLKERNELS for debug kernels since we usually
     218         * don't include symbol info in the database.
     219         * OLD:
     220         * Currently information for retail kernels are usable, but we'll
     221         * generate it for the debug kernels too, but this information
     222         * is enclaved within an "#ifdef ALLKERNELS ... #endif".
     223         */
     224        if (psz[cchNum] != 'R')
     225            printf("endif\n");
    282226
    283227        /* update size */
     
    287231    }
    288232    else
    289         printf16("ProbeSymFile failed with rc=%d\n", rc);
     233        fprintf(stderr, "ProbeSymFile failed with rc=%d\n", rc);
    290234
    291235    return rc;
     
    311255     * Set paKrnlOTEs to point to an zeroed array of OTEs.
    312256     */
    313     static KRNLINFO DATA16_INIT  KrnlInfo = {0};
     257    static KRNLINFO KrnlInfo = {0};
    314258    paKrnlOTEs = &KrnlInfo.aObjects[0];
    315259    cbAllSize = cbSize = 0;
    316260
    317     /*
    318      * Init 32-bit CRT.
    319      */
    320     Init32bitCrt();
    321261
    322262    /*
     
    325265    for (i = 0; i < NBR_OF_KRNLIMPORTS; i++)
    326266    {
    327         if (kstrlen(aImportTab[i].achName) != (int)aImportTab[i].cchName)
    328         {
    329             printf16("internal error - bad length of entry %d - %s. %d should be %d.\n",
    330                      i, aImportTab[i].achName, aImportTab[i].cchName, kstrlen(aImportTab[i].achName));
     267        if (strlen(aImportTab[i].achName) != (int)aImportTab[i].cchName)
     268        {
     269            fprintf(stderr,
     270                    "internal error - bad length of entry %d - %s. %d should be %d.\n",
     271                    i, aImportTab[i].achName, aImportTab[i].cchName, strlen(aImportTab[i].achName));
    331272            return -1;
    332273        }
     
    347288            if (rc != NO_ERROR)
    348289            {
    349                 printf16("processFile failed with rc=%d for file %s\n",
    350                          rc, argv[i]);
    351                 if (psz = GetErrorMsg(rc))
    352                     printf16("%s\n", psz);
     290                fprintf(stderr, "processFile failed with rc=%d for file %s\n",
     291                        rc, argv[i]);
     292                //if (psz = GetErrorMsg(rc))
     293                //    fprintf(stderr, "%s\n", psz);
    353294                return rc;
    354295            }
     
    363304         *
    364305         */
    365         USHORT      usSearch = 1;
    366         HDIR        hDir = HDIR_CREATE;
    367         FILEFINDBUF ffb;
    368         int         i;
    369 
    370         #ifndef DB_ASM
    371             printf16("/* $Id: extract.c,v 1.3 2002-08-22 02:55:26 bird Exp $\n"
    372                      "*\n"
    373                      "* Autogenerated kernel symbol database.\n"
    374                      "*\n"
    375                      "* Copyright (c) 2000-2001 knut st. osmundsen (kosmunds@csc.com)\n"
    376                      "*\n"
    377                      "* Project Odin Software License can be found in LICENSE.TXT\n"
    378                      "*\n"
    379                      "*/\n");
    380 
    381             printf16("\n"
    382                      "#define INCL_NOPMAPI\n"
    383                      "#define INCL_NOBASEAPI\n"
    384                      "#include <os2.h>\n"
    385                      "#include \"DevSegDf.h\"\n"
    386                      "#include \"probkrnl.h\"\n"
    387                      "#include \"options.h\"\n"
    388                      "\n");
    389 
    390             #ifdef DB_16BIT
    391             printf16("const KRNLDBENTRY DATA16_INIT aKrnlSymDB[] = \n"
    392                      "{\n");
    393             #else /* 32-bit */
    394             printf16("#pragma data_seg(SYMBOLDB32)\n"
    395                      "const KRNLDBENTRY aKrnlSymDB32[] = \n"
    396                      "{\n");
    397             #endif
    398         #else
    399             printf16(";/* $Id: extract.c,v 1.3 2002-08-22 02:55:26 bird Exp $\n"
    400                      ";*\n"
    401                      ";* Autogenerated kernel symbol database.\n"
    402                      ";*\n"
    403                      ";* Copyright (c) 2000-2001 knut st. osmundsen (kosmunds@csc.com)\n"
    404                      ";*\n"
    405                      ";* Project Odin Software License can be found in LICENSE.TXT\n"
    406                      ";*\n"
    407                      ";*/\n");
    408 
    409             printf16("    .386p\n"
    410                      "\n"
    411                      ";\n"
    412                      "; Include files\n"
    413                      ";\n"
    414                      "    include devsegdf.inc\n"
    415                      "\n"
    416                      "\n"
    417                      ";\n"
    418                      "; Exported symbols\n"
    419                      ";\n"
    420             #ifdef DB_16BIT
    421                      "    public _aKrnlSymDB\n"
    422             #else /* 32-bit */
    423                      "    public aKrnlSymDB32\n"
    424             #endif
    425                      "\n"
    426                      "\n");
    427 
    428             #ifdef DB_16BIT
    429             printf16("DATA16_INIT segment\n"
    430                      "_aKrnlSymDB:\n");
    431             #else /* 32-bit */
    432             printf16("SYMBOLDB32 segment\n"
    433                      "aKrnlSymDB32:\n");
    434             #endif
    435         #endif
    436 
    437         rc = DosFindFirst("*.sym", &hDir, FILE_NORMAL,
    438                           &ffb, sizeof(ffb),
    439                           &usSearch, 0UL);
    440         while (rc == NO_ERROR & usSearch > 0)
     306        ULONG           cFiles = 1;
     307        HDIR            hDir = HDIR_CREATE;
     308        FILEFINDBUF3    ffb;
     309        int             i;
     310
     311        printf(";/* $Id: extract.c,v 1.4 2002-12-16 02:24:28 bird Exp $\n"
     312               ";*\n"
     313               ";* Autogenerated kernel symbol database.\n"
     314               ";*\n"
     315               ";* Copyright (c) 2000-2001 knut st. osmundsen (kosmunds@csc.com)\n"
     316               ";*\n"
     317               ";* Project Odin Software License can be found in LICENSE.TXT\n"
     318               ";*\n"
     319               ";*/\n");
     320
     321        printf("    .386p\n"
     322               "\n"
     323               ";\n"
     324               "; Include files\n"
     325               ";\n"
     326               "    include devsegdf.inc\n"
     327               "\n"
     328               "\n"
     329               ";\n"
     330               "; Exported symbols\n"
     331               ";\n"
     332               "    public aKrnlSymDB32\n"
     333               "\n"
     334               "\n");
     335
     336        printf("SYMBOLDB32 segment\n"
     337               "aKrnlSymDB32:\n");
     338
     339        rc = DosFindFirst("*.sym", &hDir, FILE_NORMAL, &ffb, sizeof(ffb), &cFiles, 0UL);
     340        while (rc == NO_ERROR & cFiles > 0)
    441341        {
    442342            rc = processFile(&ffb.achName[0]);
    443343            if (rc != NO_ERROR)
    444344            {
    445                 printf16("processFile failed with rc=%d for file %s\n",
    446                          rc, &ffb.achName[0]);
    447                 if (psz = GetErrorMsg(rc))
    448                     printf16("%s\n", psz);
     345                fprintf(stderr, "processFile failed with rc=%d for file %s\n",
     346                        rc, &ffb.achName[0]);
     347                //if (psz = GetErrorMsg(rc))
     348                //    printf("%s\n", psz);
    449349                return rc;
    450350            }
    451351
    452352            /* next file */
    453             rc = DosFindNext(hDir, &ffb, sizeof(ffb), &usSearch);
     353            rc = DosFindNext(hDir, &ffb, sizeof(ffb), &cFiles);
    454354        }
    455355        DosFindClose(hDir);
    456356
    457         #ifndef DB_ASM
    458             printf16("    { /* Terminating entry */\n"
    459                      "        0,0,0,\n"
    460                      "        {\n");
    461             for (i = 0; i < NBR_OF_KRNLIMPORTS; i++)
    462                 printf16("            {0,0,0},\n");
    463             printf16("        }\n"
    464                      "    }\n"
    465             #ifdef DB_16BIT
    466                      "}; /* end of aKrnlSymDB[] */\n"
    467             #else
    468                      "}; /* end of aKrnlSymDB32[] */\n"
    469             #endif
    470                      );
    471         #else
    472             printf16(";/* Terminating entry */\n"
    473                      "    db %d dup(0)\n",
    474                      sizeof(KRNLDBENTRY));
    475             i = i;
    476         #endif
     357        printf(";/* Terminating entry */\n"
     358               "    db %d dup(0)\n",
     359               sizeof(KRNLDBENTRY));
     360        i = i;
    477361
    478362        cbSize += sizeof(KRNLDBENTRY);
     
    480364    }
    481365
    482     #ifndef DB_ASM
    483         printf16("\n"
    484                  "/* cbAllSize = %ld  %ld\n"
    485                  " * cbSize = %ld      %ld\n"
    486                  " */\n",
    487                  cbAllSize,  cbAllSize / sizeof(KRNLDBENTRY),
    488                  cbSize,     cbSize    / sizeof(KRNLDBENTRY));
    489     #else
    490         printf16("\n"
    491                  ";/* cbAllSize = %ld  %ld\n"
    492                  "; * cbSize = %ld      %ld\n"
    493                  "; */\n"
    494         #ifdef DB_16BIT
    495                  "DATA16_INIT ends\n"
    496         #else /* 32-bit */
    497                  "SYMBOLDB32 ends\n"
    498         #endif
    499                  "end\n",
    500                  cbAllSize,  cbAllSize / sizeof(KRNLDBENTRY),
    501                  cbSize,     cbSize    / sizeof(KRNLDBENTRY));
    502     #endif
     366    printf("\n"
     367           ";/* cbAllSize = %ld  %ld\n"
     368           "; * cbSize = %ld      %ld\n"
     369           "; */\n"
     370           "SYMBOLDB32 ends\n"
     371           "end\n",
     372           cbAllSize,  cbAllSize / sizeof(KRNLDBENTRY),
     373           cbSize,     cbSize    / sizeof(KRNLDBENTRY));
    503374
    504375    return rc;
  • trunk/src/win32k/kKrnlLib/src/krnlInit.c

    r8140 r9514  
    1 /* $Id: krnlInit.c,v 1.2 2002-03-31 19:01:16 bird Exp $
    2  *
    3  * krnlInit - Initiates the
    4  *
    5  * Copyright (c) 1998-1999 knut st. osmundsen
    6  *
    7  * Project Odin Software License can be found in LICENSE.TXT
     1/* $Id: krnlInit.c,v 1.3 2002-12-16 02:24:29 bird Exp $
     2 *
     3 * Init the OS2 Kernel facilities; identify it, find symbols, import table.
     4 *
     5 * Copyright (c) 1998-2003 knut st. osmundsen <bird@anduin.net>
     6 *
     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 */
     25
    1026#ifndef NOFILEID
    11 static const char szFileId[] = "$Id: krnlInit.c,v 1.2 2002-03-31 19:01:16 bird Exp $";
     27static const char szFileId[] = "$Id: krnlInit.c,v 1.3 2002-12-16 02:24:29 bird Exp $";
    1228#endif
    1329
     
    2238#endif
    2339
    24 #define DWORD   ULONG                   /* exe386.h fixes */
    25 #define WORD    USHORT
    26 
    2740/*******************************************************************************
    2841*   Header Files                                                               *
    2942*******************************************************************************/
     43#include <kLib/format/LXexe.h>
     44#include <kLib/kTypes.h>
     45#include <kLib/kDevHlp.h>
     46
    3047#define INCL_DOSERRORS
    3148#define INCL_NOPMAPI
    3249#include <os2.h>
    33 #include <exe386.h>
    3450#include <string.h>
    3551
     
    4359#include "kKrnlLib.h"
    4460
    45 #include "devSegDf.h"
    4661#include "dev1632.h"
    4762#include "dev32.h"
    48 #include "dev32Hlp.h"
    4963#include "ProbKrnl.h"
    5064#include "ProbKrnlErrors.h"
     
    6377KSEMMTX     kmtxImports;
    6478
     79PMTE        pKrnlMTE = NULL;            /* Initiated by krnlGetKernelInfo */
     80PSMTE       pKrnlSMTE = NULL;           /* Initiated by krnlGetKernelInfo */
     81POTE        pKrnlOTE = NULL;            /* Initiated by krnlGetKernelInfo */
     82ULONG       cKernelObjects = 0;         /* Initiated by krnlGetKernelInfo */
     83
     84extern char callTab[1];
     85
    6586
    6687/*******************************************************************************
    6788*   Internal Functions                                                         *
    6889*******************************************************************************/
    69 int     krnlInitImports(void);
    70 int     krnlInitExports(void);
     90int         krnlGetKernelInfo(void);
     91int         krnlLookupKernel(void);
     92int         krnlVerifyImportTab(void);
     93
     94int         krnlInitImports(void);
     95int         krnlInitExports(void);
    7196
    7297#ifdef R3TST
    73 void    R3TstFixImportTab(void);
     98PMTE        GetOS2KrnlMTETst(void)
     99void        R3TstFixImportTab(void);
    74100#endif
     101
     102/**
     103 * Initiates the imported functions.
     104 * @returns 0 on success.
     105 *          -1 on failure.
     106 */
     107int krnlInit(void)
     108{
     109    KLOGENTRY0("int");
     110    int     rc;
     111
     112    /*
     113     * Identify the kernel.
     114     */
     115    rc = krnlGetKernelInfo();
     116    if (rc)
     117        return rc;
     118
     119    /*
     120     * Lookup the kernel in the Database
     121     */
     122    rc = krnlLookupKernel();
     123    if (rc)
     124    {
     125        #if 0 /* FIXME */
     126        int rc2 = krnlLoadKernelSym();
     127        if (rc2)
     128        {
     129            kDH_SaveMessage();
     130            return rc;
     131        }
     132        #else
     133        return rc;
     134        #endif
     135    }
     136
     137    /*
     138     * Init imports.
     139     */
     140    rc = krnlInitImports();
     141
     142    /*
     143     * Init the import semaphore.
     144     */
     145    KSEMInit((PKSEM)(void*)&kmtxImports, KSEM_MUTEX, 0);
     146
     147    KLOGEXIT(rc);
     148    return rc;
     149}
     150
     151
     152/**
     153 * Get kernel OTEs
     154 * This function set pKrnlMTE, pKrnlSMTE and pKrnlOTE, fKernel, ulKernelBuild and cKernelObjects.
     155 *
     156 * @returns   Strategy return code:
     157 *            STATUS_DONE on success.
     158 *            STATUS_DONE | STERR | errorcode on failure.
     159 * @status    completely implemented and tested.
     160 * @author    knut st. osmundsen
     161 */
     162int krnlGetKernelInfo(void)
     163{
     164    KLOGENTRY0("int");
     165    int     i;
     166    ULONG   rc;
     167
     168    /* Find the kernel OTE table */
     169#ifndef R3TST
     170    pKrnlMTE = GetOS2KrnlMTE();
     171#else
     172    pKrnlMTE = GetOS2KrnlMTETst();
     173#endif
     174    if (pKrnlMTE != NULL)
     175    {
     176        pKrnlSMTE = pKrnlMTE->mte_swapmte;
     177        if (pKrnlSMTE != NULL)
     178        {
     179            if (pKrnlSMTE->smte_objcnt <= MAXKRNLOBJECTS)
     180            {
     181                pKrnlOTE = pKrnlSMTE->smte_objtab;
     182                if (pKrnlOTE != NULL)
     183                {
     184                    BOOL    fKrnlTypeOk;
     185
     186                    cKernelObjects = (unsigned char)pKrnlSMTE->smte_objcnt;
     187                    rc = 0;
     188
     189                    /*
     190                     * Search for internal revision stuff AND 'SAB KNL?' signature in the two first objects.
     191                     */
     192                    fKrnlTypeOk = FALSE;
     193                    fKernel = 0;
     194                    ulKernelBuild = 0;
     195                    for (i = 0; i < 2 && ulKernelBuild == 0; i++)
     196                    {
     197                        const char *psz = (const char*)pKrnlOTE[i].ote_base;
     198                        const char *pszEnd = psz + pKrnlOTE[i].ote_size - 50; /* Last possible search position. */
     199
     200                        while (psz < pszEnd)
     201                        {
     202                            if (strncmp(psz, "Internal revision ", 18) == 0 && (psz[18] >= '0' && psz[18] <= '9'))
     203                            {
     204                                int j;
     205                                kprintf2(("krnlGetKernelInfo: found internal revision: '%s'\n", psz));
     206
     207                                /* skip to end of "Internal revision " string. */
     208                                psz += 18;
     209
     210                                /* Read number*/
     211                                while ((*psz >= '0' && *psz <= '9') || *psz == '.')
     212                                {
     213                                    if (*psz != '.')
     214                                        ulKernelBuild = (unsigned short)(ulKernelBuild * 10 + (*psz - '0'));
     215                                    psz++;
     216                                }
     217
     218                                /* Check if build number seems valid. */
     219                                if (   !(ulKernelBuild >=  8254 && ulKernelBuild <  8383) /* Warp 3 fp 32 -> fp 60 */
     220                                    && !(ulKernelBuild >=  9023 && ulKernelBuild <= 9036) /* Warp 4 GA -> fp 12 */
     221                                    && !(ulKernelBuild >= 14039 && ulKernelBuild < 14150) /* Warp 4.5 GA -> ?? */
     222                                    && !(ulKernelBuild >=  6600 && ulKernelBuild <= 6678) /* Warp 2.1x fix?? (just for fun!) */
     223                                      )
     224                                {
     225                                    kprintf(("krnlGetKernelInfo: info summary: Build %d is invalid - invalid fixpack?\n", ulKernelBuild));
     226                                    rc = ERROR_D32_INVALID_BUILD;
     227                                    break;
     228                                }
     229
     230                                /* Check for any revision flag */
     231                                if ((*psz >= 'A' && *psz <= 'Z') || (*psz >= 'a' && *psz <= 'z'))
     232                                {
     233                                    fKernel |= (USHORT)((*psz - (*psz >= 'a' ? 'a'-1 : 'A'-1)) << KF_REV_SHIFT);
     234                                    psz++;
     235                                }
     236                                if (*psz == ',') /* This is ignored! */
     237                                    *psz++;
     238
     239                                /* If this is an Aurora/Warp 4.5 or Warp 3 kernel there is more info! */
     240                                if (psz[0] == '_' && (psz[1] == 'S' || psz[1] == 's'))  /* _SMP  */
     241                                    fKernel |= KF_SMP;
     242                                else
     243                                    if (*psz != ','
     244                                        && (   (psz[0] == '_' && psz[1] == 'W' && psz[2] == '4')  /* _W4 */
     245                                            || (psz[0] == '_' && psz[1] == 'U' && psz[2] == 'N' && psz[3] == 'I' && psz[4] == '4')  /* _UNI4 */
     246                                            )
     247                                        )
     248                                    fKernel |= KF_W4 | KF_UNI;
     249                                else
     250                                    fKernel |= KF_UNI;
     251
     252
     253                                /* Check if its a debug kernel (look for DEBUG at start of object 3-5) */
     254                                if (!fKrnlTypeOk)
     255                                {
     256                                    j = 3;
     257                                    while (j < 5)
     258                                    {
     259                                        /* There should be no iopl object preceding the debugger data object. */
     260                                        if ((pKrnlOTE[j].ote_flags & OBJIOPL) != 0)
     261                                            break;
     262                                        /* Is this is? */
     263                                        if ((pKrnlOTE[j].ote_flags & OBJINVALID) == 0
     264                                            && (pKrnlOTE[j].ote_flags & (OBJREAD | OBJWRITE)) == (OBJREAD | OBJWRITE)
     265                                            && strncmp((char*)pKrnlOTE[j].ote_base, "DEBUG", 5) == 0)
     266                                        {
     267                                            fKernel |= KF_DEBUG;
     268                                            break;
     269                                        }
     270                                        j++;
     271                                    }
     272                                }
     273
     274                                /* Display info */
     275                                kprintf(("krnlGetKernelInfo: info summary: Build %d, fKernel=0x%x\n",
     276                                         ulKernelBuild, fKernel));
     277
     278                                /* Break out */
     279                                break;
     280                            }
     281
     282                            /*
     283                             * Look for the SAB KNL? signature to check which kernel type we're
     284                             * dealing with. This could also be reached thru the selector found
     285                             * in the first element for the SAS_tables_area array.
     286                             */
     287                            if (!fKrnlTypeOk && strncmp(psz, "SAB KNL", 7) == 0)
     288                            {
     289                                fKrnlTypeOk = TRUE;
     290                                if (psz[7] == 'D')
     291                                    fKernel |= KF_ALLSTRICT;
     292                                else if (psz[7] == 'B')
     293                                    fKernel |= KF_HALFSTRICT;
     294                                else if (psz[7] != 'R')
     295                                    fKrnlTypeOk = FALSE;
     296                            }
     297
     298                            /* next */
     299                            psz++;
     300                        } /* while loop searching for "Internal revision " */
     301                    } /* for loop on objects 0-1. */
     302
     303                    /* Set error code if not found */
     304                    if (ulKernelBuild == 0)
     305                    {
     306                        rc = ERROR_D32_BUILD_INFO_NOT_FOUND;
     307                        kprintf(("krnlGetKernelInfo: Internal revision was not found!\n"));
     308                    }
     309                }
     310                else
     311                    rc = ERROR_D32_NO_OBJECT_TABLE;
     312            }
     313            else
     314                rc = ERROR_D32_TOO_MANY_OBJECTS;
     315        }
     316        else
     317            rc = ERROR_D32_NO_SWAPMTE;
     318    }
     319    else
     320        rc = ERROR_D32_GETOS2KRNL_FAILED;
     321
     322    if (rc != NO_ERROR)
     323        kprintf(("krnlGetKernelInfo: failed. rc = %d\n", rc));
     324
     325    KLOGEXIT(rc);
     326    return (rc);
     327}
     328
     329#ifdef R3TST
     330/**
     331 * Creates a fake kernel MTE, SMTE and OTE for use while testing in Ring3.
     332 * @returns Pointer to the fake kernel MTE.
     333 * @status  completely implemented.
     334 * @author  knut st. osmundsen (knut.stange.osmundsen@mynd.no)
     335 */
     336PMTE GetOS2KrnlMTETst(void)
     337{
     338    KLOGENTRY0("PMTE");
     339    static MTE    KrnlMTE;
     340    static SMTE   KrnlSMTE;
     341
     342    KrnlMTE.mte_swapmte = &KrnlSMTE;
     343    KrnlSMTE.smte_objtab = &aKrnlOTE[0];
     344    KrnlSMTE.smte_objcnt = cObjectsFake;
     345
     346    KLOGEXIT(&KrnlMTE);
     347    return &KrnlMTE;
     348}
     349
     350#endif
     351
     352
     353/**
     354 * Lookups a kernel in the 32-bit symbol database.
     355 *
     356 * @returns NO_ERROR on success.
     357 * @returns ERROR_PROB_SYMDB_KRNL_NOT_FOUND if not found.
     358 * @returns Low word: error code. High word: function number. Other errors.
     359 *
     360 * @remark  Supports multiple kernels with same build, type and object count.
     361 *          Hence all kernels are searched.
     362 * @remark  Uses ulKernelBuild, fKernel, cKernelObjects.
     363 */
     364int krnlLookupKernel(void)
     365{
     366    KLOGENTRY0("int");
     367    int     i;
     368    ULONG   rc = ERROR_PROB_SYMDB_KRNL_NOT_FOUND;
     369
     370
     371    /*
     372     * Loop tru the DB entries until a NULL pointer is found.
     373     */
     374    for (i = 0; aKrnlSymDB32[i].usBuild != 0; i++)
     375    {
     376        if (   aKrnlSymDB32[i].usBuild  == (USHORT)ulKernelBuild
     377            && aKrnlSymDB32[i].fKernel  == fKernel
     378            && aKrnlSymDB32[i].cObjects == (char)cKernelObjects)
     379        {   /* found matching entry! */
     380            int                 j;
     381            const KRNLDBENTRY * pEntry = &aKrnlSymDB32[i];
     382
     383            kprintf(("Found entry for this kernel!\n"));
     384
     385            /*
     386             * Copy symbol data from the DB to aImportTab.
     387             */
     388            for (j = 0; j < NBR_OF_KRNLIMPORTS; j++)
     389            {
     390                aImportTab[j].offObject  = pEntry->aSyms[j].offObject;
     391                aImportTab[j].iObject    = pEntry->aSyms[j].iObject;
     392                aImportTab[j].chOpcode   = pEntry->aSyms[j].chOpcode;
     393                aImportTab[j].ulAddress  = pKrnlOTE[pEntry->aSyms[j].iObject].ote_base
     394                                           + pEntry->aSyms[j].offObject;
     395                aImportTab[j].usSel      = pKrnlOTE[pEntry->aSyms[j].iObject].ote_sel;
     396                aImportTab[j].fFound     = (char)((aImportTab[j].offObject != 0xFFFFFFFFUL) ? 1 : 0);
     397
     398                kprintf2(("  %-3d addr=0x%08lx off=0x%08lx  %s\n",
     399                          j, aImportTab[j].ulAddress, aImportTab[j].offObject,
     400                          aImportTab[j].achName));
     401            }
     402
     403            /*
     404             * Verify prologs and return if successful.
     405             */
     406            rc = krnlVerifyImportTab();
     407            if (!rc)
     408            {
     409                KLOGEXIT(rc);
     410                return rc;
     411            }
     412        }
     413    }
     414
     415    KLOGEXIT(rc);
     416    return rc;
     417}
    75418
    76419
    77420/**
    78421 * Verifies the aImportTab.
     422 *
    79423 * @returns   16-bit errorcode where the high byte is the procedure number which
    80424 *            the error occured on and the low byte the error code.
     
    82426 *            WARNING! This function is called before the initroutine (R0INIT)!
    83427 */
    84 ULONG VerifyImportTab32(void)
     428int krnlVerifyImportTab(void)
    85429{
    86     KLOGENTRY0("ULONG");
    87     ULONG   rc;
     430    KLOGENTRY0("int");
    88431    int     i;
    89432    int     cb;
    90433    int     cbmax;
    91 
    92     /* VerifyImporTab32 is called before the initroutine! */
    93     pulTKSSBase32 = TKSSBase16;
    94 
    95     /* Check that pKrnlOTE is set */
    96     rc = GetKernelInfo32(NULL);
    97     if (rc != NO_ERROR)
    98     {
    99         KLOGEXIT(rc);
    100         return rc;
    101     }
    102434
    103435    /*
     
    203535
    204536
    205 /**
    206  * Lookups a kernel in the 32-bit symbol database.
    207  * @returns NO_ERROR on success.
    208  *          ERROR_PROB_SYMDB_KRNL_NOT_FOUND if not found.
    209  *          Low word: error code. High word: function number. Other errors.
    210  *
    211  * @param   plke32Param Pointer to parameters (in resident memory please).
    212  * @author  knut st. osmundsen (kosmunds@csc.com)
    213  * @remark  Supports multiple kernels with same build, type and object count.
    214  *          Hence all kernels are searched.
    215  * @remark  - Why don't we simply ask for the kernel data from the 32-bit work our self?
    216  *          * Maybe because this allows the caller to pass in other data...
    217  *          - Which will not happen...
    218  */
    219 ULONG LookupKrnlEntry32(PLKE32PARAM plke32Param)
    220 {
    221 #ifndef DB_16BIT
    222     KLOGENTRY1("ULONG","PLKE32PARAM plke32Param", plke32Param);
    223     int     i;
    224     ULONG   rc = ERROR_PROB_SYMDB_KRNL_NOT_FOUND;
    225     USHORT  usBuild  = plke32Param->usBuild;
    226     USHORT  fKernel  = plke32Param->fKernel;
    227     CHAR    cObjects = plke32Param->cObjects;
    228 
    229 
    230     /*
    231      * Loop tru the DB entries until a NULL pointer is found.
    232      */
    233     for (i = 0; aKrnlSymDB32[i].usBuild != 0; i++)
    234     {
    235         if (   aKrnlSymDB32[i].usBuild  == usBuild
    236             && aKrnlSymDB32[i].fKernel  == fKernel
    237             && aKrnlSymDB32[i].cObjects == cObjects)
    238         {   /* found matching entry! */
    239             int                 j;
    240             const KRNLDBENTRY * pEntry = &aKrnlSymDB32[i];
    241 
    242             kprintf(("Found entry for this kernel!\n"));
    243 
    244             /*
    245              * Copy symbol data from the DB to aImportTab.
    246              */
    247             for (j = 0; j < NBR_OF_KRNLIMPORTS; j++)
    248             {
    249                 aImportTab[j].offObject  = pEntry->aSyms[j].offObject;
    250                 aImportTab[j].iObject    = pEntry->aSyms[j].iObject;
    251                 aImportTab[j].chOpcode   = pEntry->aSyms[j].chOpcode;
    252                 aImportTab[j].ulAddress  = pKrnlOTE[pEntry->aSyms[j].iObject].ote_base
    253                                            + pEntry->aSyms[j].offObject;
    254                 aImportTab[j].usSel      = pKrnlOTE[pEntry->aSyms[j].iObject].ote_sel;
    255                 aImportTab[j].fFound     = (char)((aImportTab[j].offObject != 0xFFFFFFFFUL) ? 1 : 0);
    256 
    257                 kprintf2(("  %-3d addr=0x%08lx off=0x%08lx  %s\n",
    258                           j, aImportTab[j].ulAddress, aImportTab[j].offObject,
    259                           aImportTab[j].achName));
    260             }
    261 
    262             /*
    263              * Verify prologs and return if successful.
    264              */
    265             rc = VerifyImportTab32();
    266             if (!rc)
    267             {
    268                 KLOGEXIT(rc);
    269                 return rc;
    270             }
    271         }
    272     }
    273 
    274     KLOGEXIT(rc);
    275     return rc;
    276 #else
    277     return -1;
    278 #endif
    279 }
    280 
    281 
    282 /**
    283  * Initiates the imported functions.
    284  * @returns 0 on success.
    285  *          -1 on failure.
    286  */
    287 int krnlInit(void)
    288 {
    289     KLOGENTRY0("int");
    290     int     rc;
    291 
    292     /*
    293      * Init imports.
    294      */
    295     rc = krnlInitImports();
    296 
    297     /*
    298      * Init the import semaphore.
    299      */
    300     KSEMInit((PKSEM)(void*)&kmtxImports, KSEM_MUTEX, 0);
    301 
    302     KLOGEXIT(rc);
    303     return rc;
    304 }
     537
     538
    305539
    306540
     
    333567    char *      pchCTEntry;             /* Pointer to current 32-bit calltab entry. */
    334568    char *      pchCTEntry16;           /* Pointer to current 16-bit calltab entry. */
    335     LOCKHANDLE  lhCT16;                 /* Lock handle for the 16-bit calltable */
     569    KDHVMLOCK   lhCT16;                 /* Lock handle for the 16-bit calltable */
    336570
    337571
     
    339573     * verify aImportTab
    340574     */
    341     rc = VerifyImportTab32();
     575    rc = krnlVerifyImportTab();
    342576    if (rc)
    343577    {
    344         kprintf(("VerifyImportTab32 failed with rc=%d\n", rc));
     578        kprintf(("krnlVerifyImportTab failed with rc=0x%x\n", rc));
    345579        INT3();
    346580        KLOGEXIT(rc);
     
    352586     * Lock the 16-bit calltab segment.
    353587     */
    354     rc = D32Hlp_VMLock2(&callTab16[0], &callTab16END[0] - &callTab16[0], VMDHL_WRITE | VMDHL_LONG, SSToDS(&lhCT16));
     588    rc = kDH_VMLock2(&callTab16[0], &callTab16END[0] - &callTab16[0], VMDHL_WRITE | VMDHL_LONG, SSToDS(&lhCT16));
    355589    if (rc)
    356590    {
  • trunk/src/win32k/kKrnlLib/src/krnlPrologs.c

    r8056 r9514  
    1 /* $Id: krnlPrologs.c,v 1.1 2002-03-10 02:45:56 bird Exp $
     1/* $Id: krnlPrologs.c,v 1.2 2002-12-16 02:24:29 bird Exp $
    22 *
    33 * krnlPrologs - Kernel Prolog Recognizer.
    44 *
    5  * Copyright (c) 1998-2001 knut st. osmundsen
    6  *
    7  * Project Odin Software License can be found in LICENSE.TXT
     5 * Copyright (c) 1999-2003 knut st. osmundsen <bird@anduin.net>
     6 *
     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 */
     25
    1026#ifndef NOFILEID
    11 static const char szFileId[] = "$Id: krnlPrologs.c,v 1.1 2002-03-10 02:45:56 bird Exp $";
     27static const char szFileId[] = "$Id: krnlPrologs.c,v 1.2 2002-12-16 02:24:29 bird Exp $";
    1228#endif
    1329
     
    2642*   Header Files                                                               *
    2743*******************************************************************************/
    28 #define INCL_DOSERRORS
    29 #define INCL_NOPMAPI
    30 #include <os2.h>
    31 #include <string.h>
    32 
    3344#define INCL_KKL_LOG
    3445#include "kKrnlLib.h"
     
    3950*   Internal Functions                                                         *
    4051*******************************************************************************/
    41 _Inline int     ModR_M_32bit(char bModRM);
    42 _Inline int     ModR_M_16bit(char bModRM);
    43 int             interpretFunctionProlog32(char *pach);
    44 int             interpretFunctionProlog16(char *pach);
     52INLINE int  ModR_M_32bit(char bModRM);
     53INLINE int  ModR_M_16bit(char bModRM);
     54int         interpretFunctionProlog32(char *pach);
     55int         interpretFunctionProlog16(char *pach);
    4556
    4657
     
    228239        )
    229240    {
    230         BOOL fForce = FALSE;
     241        KBOOL fForce = FALSE;
    231242        int  cbWord = 4;
    232243        cb = 0;
     
    455466        )
    456467    {
    457         BOOL fForce;
     468        KBOOL fForce;
    458469        int  cOpPrefix = 0;
    459470        cb = 0;
Note: See TracChangeset for help on using the changeset viewer.