Changeset 6841 for branches


Ignore:
Timestamp:
Sep 27, 2001, 5:08:35 AM (24 years ago)
Author:
bird
Message:

Win32k/kKrnlLib splittup: done the major stuff.

Location:
branches/splittup/src/win32k
Files:
62 deleted
59 edited

Legend:

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

    r6637 r6841  
    1 # $Id: Makefile,v 1.71 2001-09-05 09:29:06 bird Exp $
     1# $Id: Makefile,v 1.71.2.1 2001-09-27 03:08:07 bird Exp $
    22
    33#
     
    2929#
    3030!include makefile.inc
    31 !if [..\..\tools\bin\Exists.cmd $(WIN32KINCLUDE)\OS2Krnl.h] == 1
     31!if [..\..\tools\bin\Exists.cmd $(KKRNLLIBINCLUDE)\OS2Krnl.h] == 1
    3232!   if [echo Bad makefile.inc - Reconfiguring Win32k... & configure.cmd -noninteractive]
    3333!   endif
     
    4242#
    4343SUBDIRS = \
     44.\kKrnlLib \
    4445.\lib \
    4546.\rexx \
     
    5253all:
    5354!if "$(DDKPATH)" == "" || "$(MSCPATH)" == ""  || "$(TOOLKIT)" == "" || "$(VACPATH)" == ""
     55    $(DODIRS) "lib" $(MAKE_CMD)
    5456    $(MAKE_CMD) -f xx2lx.mak
    55     $(DODIRS) "lib" $(MAKE_CMD)
    5657!else
     58    $(DODIRS) "$(SUBDIRS)" $(MAKE_CMD)
    5759    $(MAKE_CMD) -f win32k.mak
    5860    $(MAKE_CMD) -f xx2lx.mak
    59     $(DODIRS) "$(SUBDIRS)" $(MAKE_CMD)
    6061!endif
    6162
     
    6970
    7071$(WIN32KBIN)\win32ktst.exe win32ktst.exe win32ktst \
    71 $(WIN32KBIN)\extact.exe    extract.exe   extract \
    72 $(WIN32KBIN)\mkcalltab.exe mkcalltab.exe mkcalltab \
    7372$(WIN32KBIN)\libconv.exe   libconv.exe   libconv \
    7473clfix.exe: .force
     
    8079    $(MAKE_CMD) -f win32k.mak $(WIN32KINCLUDE)\$(@B).inc
    8180
    82 $(WIN32KBASE)\ldr\calltaba.asm ldr\calltaba.asm: .force
    83     $(MAKE_CMD) -f $(WIN32KBASE)\ldr\calltaba.asm
    84 
    85 $(WIN32KBASE)\test\TstFakers.c test\TstFakers.c: .force
    86     $(MAKE_CMD) -f $(WIN32KBASE)\test\TstFakers.c
    87 
    8881win32kcc.exe win32kcc:
    8982    $(DODIRS) "utils" $(MAKE_CMD)
     
    9487#
    9588lib:
    96     $(DODIRS) ".\lib" $(MAKE_CMD) lib
     89    $(DODIRS) ".\KrnlLib .\lib" $(MAKE_CMD) lib
    9790
    9891
     
    107100        $(ODIN32_BIN)\win32k.ddp
    108101!if "$(WIN32KBIN)" != ""
    109     $(RM) $(WIN32KBIN)\*.*
     102    $(RM) $(WIN32KBIN)\*
    110103!endif
    111104!if "$(WIN32KOBJ)" != ""
    112     $(RM) $(WIN32KOBJ)\*obj* \
    113         $(WIN32KOBJ)\*lnk* \
    114         $(WIN32KOBJ)\*res* \
    115         $(WIN32KOBJ)\*lib* \
    116         $(WIN32KOBJ)\*def*
     105    $(RM) $(WIN32KOBJ)\*
    117106!endif
    118107!if "$(WIN32KLIST)" != ""
    119     $(RM) $(WIN32KLIST)\*lst* \
    120         $(WIN32KLIST)\*.s* \
    121         $(WIN32KLIST)\*as*
     108    $(RM) $(WIN32KLIST)\*
    122109!endif
    123 !if "$(WIN32KBASE)" != ""
    124     $(RM) $(WIN32KBASE)\ldr\calltaba.asm $(WIN32KBASE)\test\TstFakers.c
     110!if "$(WIN32KINCLUDE)" != ""
     111    $(RM) $(WIN32KBIN)\options.inc \
     112          $(WIN32KBIN)\api.inc \
     113          $(WIN32KBIN)\win32k.inc
    125114!endif
    126115    $(DODIRS) "$(SUBDIRS)" $(MAKE_CMD) clean
     
    131120#
    132121dep:
     122    $(RM) .depend
    133123    $(ODIN32_TOOLS)\fastdep @<<
    134         -o$$(WIN32KOBJ) $(CINCLUDES) -xldr\calltaba.asm -xtest\TstFakers.c
     124        -o$$(WIN32KOBJ) $(CINCLUDES)
    135125        misc\*.c* ldr\*.c* dev32\*.c* pe2lx\*.c* k32\*.c* elf2lx\*.c* test\*.c*
    136126        -objobj_tst
    137127        misc\*.c* ldr\*.c* dev32\*.c* pe2lx\*.c* k32\*.c* elf2lx\*.c* test\*.c*
    138128        $(WIN32KINCLUDE)\*.h
     129        $(KKRNLLIBINCLUDE)\*.h
    139130<<
    140131    $(ODIN32_TOOLS)\fastdep @<<
    141132        -a+ -o$$(WIN32KOBJ) -I$(WIN32KINCLUDE) -I$(DDKPATH)\inc
    142         -xldr\calltaba.asm -xtest\TstFakers.c
    143133        dev16\*.asm ldr\*.asm misc\*.asm dev32\*.asm pe2lx\*.asm k32\*.asm elf2lx\*.asm test\*.asm
    144134        $(WIN32KINCLUDE)\*.inc
     
    169159    ..\..\tools\bin\StateUpd.exe -Dll:Win32k dev16 dev32 misc ldr elf2lx mmf k32
    170160    ..\..\tools\bin\StateUpd.exe -Dll:Pe2Lx Pe2Lx
    171 
    172 #
    173 # Documentation generation - require SDS - http://www.ii.uib.no/~stig/
    174 #  (Old SDS 0.33 - don't work anylonger.)
    175 #
    176 lxdoc:
    177     cpp2sds -o DocsA\ -i include\modulebase.h include\pe2lx.h ldr\modulebase.cpp pe2lx\pe2lx.cpp
    178     cd DocsA
    179     exp sds2doc -ai *.sds
    180 
    181 fulldoc:
    182     exp cpp2sds -o DocsA\ -i include\*.h *.cpp ldr\*.cpp misc\*.cpp pe2lx\*.cpp
    183     cd DocsA
    184     exp sds2doc -ai *.sds
     161    $(DODIRS) ".\kKrnlLib" $(MAKE_CMD) $@
    185162
    186163
     
    196173$(COMMONRULES:clean dep lib all=):
    197174
    198 
  • branches/splittup/src/win32k/Xx2Lx.mak

    r5293 r6841  
    1 # $Id: Xx2Lx.mak,v 1.1 2001-03-11 16:37:17 bird Exp $
     1# $Id: Xx2Lx.mak,v 1.1.2.1 2001-09-27 03:08:06 bird Exp $
    22
    33#
     
    3333# Tools and Flags Addjustments
    3434#
    35 CINCLUDES   = -I$(WIN32KINCLUDE) $(CINCLUDES)
     35CINCLUDES   = -I$(WIN32KINCLUDE) -I$(KKRNLLIBINCLUDE) $(CINCLUDES)
    3636CDEFINES    = $(CDEFINES) -DRING3 -DXX2LX
    3737!if "$(VAC3)" == "1" || "$(VAC36)" == "1"
  • branches/splittup/src/win32k/calltrees.txt

    r2933 r6841  
     1OBSOLETE! (Sep 27 2001 2:01am)
     2
    13A overview of the win32k device driver.
    24----------------------------------------
  • branches/splittup/src/win32k/configure.cmd

    r5945 r6841  
    1 /* $Id: configure.cmd,v 1.21 2001-06-10 01:43:36 bird Exp $
     1/* $Id: configure.cmd,v 1.21.2.1 2001-09-27 03:08:06 bird Exp $
    22 *
    33 * Configuration script.
     
    3737                when (ch = '?' | ch = 'H' | substr(sArg, 1, 2) = '-H') then
    3838                do
    39                     say 'Odin32 Configure.cmd. $Revision: 1.21 $.'
     39                    say 'Odin32 Configure.cmd. $Revision: 1.21.2.1 $.'
    4040                    say 'syntax: Configure.cmd [-n] [-w]'
    4141                    say '  -n   Noninteractive.'
     
    7474        call lineout sIncFile, 'WIN32KELF2LX     =' sWin32kBase'\elf2lx'
    7575        call lineout sIncFile, 'WIN32KINCLUDE    =' sWin32kBase'\include'
     76        call lineout sIncFile, 'KKRNLLIBINCLUDE =' sWin32kBase'\kKrnlLib\include'
    7677        call lineout sIncFile, 'WIN32KK32        =' sWin32kBase'\k32'
    7778        call lineout sIncFile, 'WIN32KLDR        =' sWin32kBase'\ldr'
  • branches/splittup/src/win32k/dev16/d16globl.c

    r5000 r6841  
    1 /* $Id: d16globl.c,v 1.4 2001-01-21 07:54:37 bird Exp $
     1/* $Id: d16globl.c,v 1.4.2.1 2001-09-27 03:08:10 bird Exp $
    22 *
    33 * d16globals - global data (16-bit)
    44 *
    5  * Copyright (c) 1999 knut st. osmundsen
     5 * Copyright (c) 1999-2001 knut st. osmundsen (kosmunds@csc.com)
    66 *
    77 * Project Odin Software License can be found in LICENSE.TXT
     
    2020#include "devSegDf.h"
    2121#include "options.h"
    22 #include "log.h"
    2322
    2423
     
    3029 *       Uninitialized variables ends up in DATA32. */
    3130PFN         Device_Help = NULL;
    32 ULONG       TKSSBase16  = 0;
    33 USHORT      R0FlatCS16  = 0;
    34 USHORT      R0FlatDS16  = 0;
    3531BOOL        fInitTime   = TRUE;
    36 struct options
     32struct Win32kOptions
    3733            DATA16_GLOBAL options = DEFAULT_OPTION_ASSIGMENTS;
    3834
    3935CHAR        szBuildDate[] = {__DATE__};
    4036CHAR        szBuildTime[] = {__TIME__};
    41 CHAR        szWin32kIni[160] = {"\win32k.ini"};
    4237
  • branches/splittup/src/win32k/dev16/d16init.c

    r6431 r6841  
    1 /* $Id: d16init.c,v 1.12 2001-07-31 21:36:37 bird Exp $
     1/* $Id: d16init.c,v 1.12.2.1 2001-09-27 03:08:10 bird Exp $
    22 *
    33 * d16init - init routines for both drivers.
     
    66 *            completed. CodeEnd and DataEnd should not be set here.?
    77 *
    8  * Copyright (c) 1999-2000 knut st. osmundsen (knut.stange.osmundsen@mynd.no)
     8 * Copyright (c) 1999-2001 knut st. osmundsen (kosmunds@csc.com)
    99 *
    1010 * Project Odin Software License can be found in LICENSE.TXT
     
    3737
    3838#include "devSegDf.h"
    39 #undef  DATA16_INIT
     39/*#undef  DATA16_INIT
    4040#define DATA16_INIT
    4141#undef  CODE16_INIT
    42 #define CODE16_INIT
    43 #include "probkrnl.h"
     42#define CODE16_INIT*/
    4443#include "dev1632.h"
    4544#include "dev16.h"
    4645#include "vprntf16.h"
    47 #include "log.h"
    4846#include "options.h"
    49 #include "errors.h"
    5047
    51 
    52 /**
    53  * init function - device 0.
    54  * Does nothing else than setting the device_help variable and
    55  * fill the request packet.
    56  * @returns   Status word.
    57  * @param     pRpIn   Pointer to input request packet.  Actually the same memory as pRpOut but another struct.
    58  * @param     pRpOut  Pointer to output request packet. Actually the same memory as pRpIn  but another struct.
    59  * @remark    pRpIn and pRpOut points to the same memory.
    60  */
    61 USHORT NEAR dev0Init(PRPINITIN pRpIn, PRPINITOUT pRpOut)
    62 {
    63     APIRET  rc;
    64     Device_Help = pRpIn->DevHlpEP;
    65 
    66     /*
    67      * Does this work at Ring-3 (inittime)?
    68      * If this work we could be saved from throuble!
    69      */
    70     rc = initGetDosTableData();
    71     if (rc != NO_ERROR)
    72         printf16("win32k - elf$: initGetDosTableData failed with rc=%d\n", rc);
    73 
    74     pRpOut->BPBArray = NULL;
    75     pRpOut->CodeEnd = (USHORT)&CODE16_INITSTART;
    76     pRpOut->DataEnd = (USHORT)&DATA16_INITSTART;
    77     pRpOut->Unit     = 0;
    78     pRpOut->rph.Status = STATUS_DONE;
    79     return STATUS_DONE;
    80 }
     48#include "kKLInitHlp.h"
    8149
    8250
     
    9058 * @remark    pRpIn and pRpOut points to the same memory.
    9159 */
    92 USHORT NEAR dev1Init(PRPINITIN pRpIn, PRPINITOUT pRpOut)
     60USHORT NEAR devInit(PRPINITIN pRpIn, PRPINITOUT pRpOut)
    9361{
    94     APIRET          rc;
    95     D16R0INITPARAM  param;
    96     D16R0INITDATA   data = {0};
    97     HFILE           hDev0 = 0;
     62    ULONG           rc;
     63    KKLR0INITPARAM  param;
     64    KKLR0INITDATA   data = {0UL};
     65    HFILE           hKrnlLib = 0;
    9866    USHORT          usAction = 0;
    9967    NPSZ            npszErrMsg = NULL;
    100     const char *    npszErrMsg2 = NULL;
    10168
    10269    /*
    103      * Probe kernel data.
     70     * Open and send a Ring-0 init packet to kKrnlHlp.
     71     * If this succeeds win32k$ init succeeds.
    10472     */
    105     rc = ProbeKernel(pRpIn);
     73    rc = DosOpen(KKL_DEVICE_NAME, &hKrnlLib, &usAction, 0UL, FILE_NORMAL,
     74                 OPEN_ACTION_FAIL_IF_NEW | OPEN_ACTION_OPEN_IF_EXISTS,
     75                 OPEN_SHARE_DENYNONE | OPEN_ACCESS_READONLY,
     76                 0UL);
    10677    if (rc == NO_ERROR)
    10778    {
    10879        /*
    109          * Open and send a Ring-0 init packet to elf$.
    110          * If this succeeds win32k$ init succeeds.
     80         * Create new 32-bit init packet - Parameter pointer is thunked.
    11181         */
    112         rc = DosOpen("\\dev\\elf$", &hDev0, &usAction, 0UL, FILE_NORMAL,
    113                      OPEN_ACTION_FAIL_IF_NEW | OPEN_ACTION_OPEN_IF_EXISTS,
    114                      OPEN_SHARE_DENYNONE | OPEN_ACCESS_READONLY,
    115                      0UL);
    116         if (rc == NO_ERROR)
    117         {
    118             param.pRpInitIn = pRpIn;
    119             rc = DosDevIOCtl(&data, &param, D16_IOCTL_RING0INIT, D16_IOCTL_CAT, hDev0);
     82        RP32INIT        rp32init;
     83        RP32INIT FAR *  fprp32init = &rp32init;
     84
     85        _fmemcpy(fprp32init, pRpIn, sizeof(RPINITIN));
     86        if ((   pRpIn->InitArgs == NULL
     87             || !(rc = DevHelp_VirtToLin(SELECTOROF(rp32init.InitArgs), OFFSETOF(rp32init.InitArgs), (PLIN)&rp32init.InitArgs))
     88             )
     89            &&  !(rc = DevHelp_VirtToLin(SELECTOROF(fprp32init), OFFSETOF(fprp32init), (PLIN)&param.ulParam))
     90           )
     91        {   /* call 32-bit init routine and set 32 bit rc. */
     92            param.pfn = GetR0InitPtr();
     93            rc = DosDevIOCtl(&data, &param, KKL_IOCTL_RING0INIT, KKL_IOCTL_CAT, hKrnlLib);
    12094            if (rc == NO_ERROR)
    12195            {
    122                 if (data.usRcInit32 == NO_ERROR)
     96                if (data.ulRc == NO_ERROR)
    12397                {
    12498                    if (!options.fQuiet)
     
    129103                {
    130104                    /* set correct error message and rc */
    131                     rc = data.usRcInit32;
    132                     npszErrMsg = "Ring-0 initiation failed. rc=%x\n";
    133                     if (rc >= ERROR_D32_FIRST && rc <= ERROR_D32_LAST)
    134                         npszErrMsg2 =
    135                         GetErrorMsg(
    136                         data.usRcInit32
    137                         + ERROR_PROB_SYM_D32_FIRST
    138                         - ERROR_D32_FIRST
    139                         );
     105                    rc = data.ulRc;
     106                    npszErrMsg = "Ring-0 initiation failed. rc=%ld\n";
    140107                }
    141108            }
    142109            else
    143                 npszErrMsg = "Ring-0 init: DosDevIOCtl failed. rc=%d\n";
    144             DosClose(hDev0);
     110                npszErrMsg = "Ring-0 init: DosDevIOCtl failed. rc=%ld\n";
    145111        }
    146112        else
    147             npszErrMsg = "Ring-0 init: DosOpen failed. rc=%d\n";
     113            npszErrMsg = "Ring-0 init: Argument thunking failed. rc=%ld\n";
     114
     115        DosClose(hKrnlLib);
    148116    }
    149117    else
    150         npszErrMsg = ""; /* ProbeKrnl do its own complaining, but we need something here to indicate failure. */
     118        npszErrMsg = "Ring-0 init: DosOpen failed. rc=%ld\n";
     119
    151120
    152121    /*
     
    164133    {
    165134        printf16(npszErrMsg, rc);
    166         if (npszErrMsg2)
    167             printf16("%s\n", npszErrMsg2);
    168135        pRpOut->Status = pRpOut->rph.Status = STATUS_DONE | STERR | ERROR_I24_GEN_FAILURE;
    169136    }
     
    177144}
    178145
    179 
    180 
    181 /**
    182  * R0 16-bit initiation.
    183  * This gets TKSSBase, thunks parameters and calls R0 32-bit initiation function.
    184  * @returns     Status word. We don't fail on R0Init32 but forwards the result
    185  *              using the usRcInit32.
    186  * @param       pRp     Generic IO Control request packet.
    187  */
    188 USHORT NEAR  R0Init16(PRP_GENIOCTL pRp)
    189 {
    190     USHORT usRc = STATUS_DONE;
    191     APIRET rc;
    192 
    193     /* First we're to get the DosTable2 stuff. */
    194     rc = initGetDosTableData();
    195     if (rc == NO_ERROR)
    196     {
    197         ULONG cPages;
    198         char  hLockParm[12] = {0};
    199         ULONG ulLinParm;
    200         char  hLockData[12] = {0};
    201         ULONG ulLinData;
    202 
    203         /*
    204          * Thunk the request packet and lock userdata.
    205          */
    206         if (!DevHelp_VirtToLin(SELECTOROF(pRp->ParmPacket), OFFSETOF(pRp->ParmPacket), &ulLinParm)
    207             &&
    208             !DevHelp_VirtToLin(SELECTOROF(pRp->DataPacket), OFFSETOF(pRp->DataPacket), &ulLinData)
    209             )
    210         {
    211             if (!(rc = DevHelp_VMLock(VMDHL_LONG | VMDHL_WRITE,
    212                                 ulLinParm, sizeof(D16R0INITPARAM),
    213                                 (LIN)~0UL, SSToDS_16(&hLockParm[0]), &cPages))
    214                 &&
    215                 !DevHelp_VMLock(VMDHL_LONG | VMDHL_WRITE,
    216                                 ulLinData, sizeof(D16R0INITDATA),
    217                                 (LIN)~0UL, SSToDS_16(&hLockData[0]), &cPages)
    218                 )
    219             {
    220                 /*
    221                  * -data and param is locked (do we need to lock the request packet too ?).-
    222                  * Create new 32-bit init packet - Parameter pointer is thunked.
    223                  */
    224                 RP32INIT rp32init;
    225 
    226                 _fmemcpy(&rp32init, ((PD16R0INITPARAM)pRp->ParmPacket)->pRpInitIn, sizeof(RPINITIN));
    227                 if (((PD16R0INITPARAM)pRp->ParmPacket)->pRpInitIn->InitArgs == NULL ||
    228                     !DevHelp_VirtToLin(SELECTOROF(rp32init.InitArgs), OFFSETOF(rp32init.InitArgs), (PLIN)&rp32init.InitArgs)
    229                    )
    230                 {   /* call 32-bit init routine and set 32 bit rc. */
    231                     usRc = CallR0Init32(SSToDS_16(&rp32init));
    232                     ((PD16R0INITDATA)pRp->DataPacket)->usRcInit32 = usRc;
    233 
    234                     /* set status to done (success).  (R0Init32 RC is return as usRcInit32.)  */
    235                     usRc = STATUS_DONE;
    236                 }
    237                 else
    238                     usRc |= STERR | ERROR_I24_INVALID_PARAMETER;
    239 
    240 
    241                 /*
    242                  * finished - unlock data and parm;
    243                  */
    244                 DevHelp_VMUnLock((LIN)SSToDS_16(&hLockParm[0]));
    245                 DevHelp_VMUnLock((LIN)SSToDS_16(&hLockData[0]));
    246             }
    247             else
    248                 usRc |= STERR | ERROR_I24_INVALID_PARAMETER;
    249         }
    250         else
    251             usRc |= STERR | ERROR_I24_INVALID_PARAMETER;
    252     }
    253     else
    254         usRc |= STERR | ERROR_I24_GEN_FAILURE;
    255 
    256     return usRc;
    257 }
    258 
    259 
    260 
    261 /**
    262  * Gets the data we need from the DosTables.
    263  * This data is TKSSBase16, R0FlatCS16 and R0FlatDS16.
    264  * @returns   Same as DevHelp_GetDosVar.
    265  * @status    completely implemented.
    266  * @author    knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    267  * @remark    If you are not sure if TKSSBase16 is set or not, call this.
    268  *            After R0Init16 is called TKSSBase16 _is_ set.
    269  *            IMPORTANT! This function must _not_ be called after the initiation of the second device driver!!!
    270  *                       (Since this is init code not present after init...)
    271  */
    272 USHORT NEAR  initGetDosTableData(void)
    273 {
    274     APIRET     rc;
    275     PDOSTABLE  pDT;
    276     PDOSTABLE2 pDT2;
    277 
    278     if (TKSSBase16 != 0)
    279         return NO_ERROR;
    280     /*
    281     _asm {
    282         int 3;
    283     }
    284     */
    285 
    286     /* First we're to get the DosTable2 stuff. */
    287     rc = DevHelp_GetDOSVar(9, 0, &pDT);
    288     if (rc == NO_ERROR)
    289     {
    290         pDT2 = (PDOSTABLE2)((char FAR *)pDT + pDT->cul*4 + 1);
    291         TKSSBase16 = (ULONG)pDT2->pTKSSBase;
    292         R0FlatCS16 = (USHORT)pDT2->R0FlatCS;
    293         R0FlatDS16 = (USHORT)pDT2->R0FlatDS;
    294     }
    295     return rc;
    296 }
    297 
  • branches/splittup/src/win32k/dev16/d16strat.c

    r6220 r6841  
    1 /* $Id: d16strat.c,v 1.12 2001-07-08 02:57:42 bird Exp $
     1/* $Id: d16strat.c,v 1.12.2.1 2001-09-27 03:08:11 bird Exp $
    22 *
    33 * d16strat.c - 16-bit strategy routine, device headers, device_helper (ptr)
     
    3939*   Global Variables                                                           *
    4040*******************************************************************************/
    41 extern DDHDR _far aDevHdrs[2];
    42 DDHDR aDevHdrs[2] = /* This is the first piece data in the driver!!!!!!! */
     41DDHDR aDevHdrs[1] = /* This is the first piece data in the driver!!!!!!! */
    4342{
    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         "elf$    ",                                 /* DevName */
    50         0,                                          /* SDevProtCS */
    51         0,                                          /* SDevProtDS */
    52         0,                                          /* SDevRealCS */
    53         0,                                          /* SDevRealDS */
    54         DEV_16MB | DEV_IOCTL2                       /* SDevCaps */
    55     },
    5643    {
    5744        ~0UL,                                       /* NextHeader */
    5845        DEVLEV_3 | DEV_30 | DEV_CHAR_DEV,           /* SDevAtt */
    59         (unsigned short)(void _near *)strategyAsm1, /* StrategyEP */
     46        (unsigned short)(void _near *)strategyAsm, /* StrategyEP */
    6047        0,                                          /* InterruptEP */
    6148        "win32k$ ",                                 /* DevName */
     
    7360*   Internal Functions                                                         *
    7461*******************************************************************************/
    75 USHORT NEAR dev0GenIOCtl(PRP_GENIOCTL pRp);
    76 USHORT NEAR dev1GenIOCtl(PRP_GENIOCTL pRp);
     62USHORT NEAR devGenIOCtl(PRP_GENIOCTL pRp);
    7763
    7864
     
    8167 * @returns   Status word.
    8268 * @param     pRpH   Pointer to request packed header. (Do not change the pointer!)
    83  * @parma     usDev  Device number.
    8469 * @remark    This function is called from the entrypoint in dev1st.asm
    8570 */
    86 USHORT NEAR strategy(PRPH pRpH, unsigned short usDev)
     71USHORT NEAR strategy(PRPH pRpH)
    8772{
    8873    switch (pRpH->Cmd)
     
    9075        case CMDInit:                   /* INIT command */
    9176            if (fInitTime)
    92             {
    93                 if (usDev == 0)
    94                     return dev0Init((PRPINITIN)pRpH, (PRPINITOUT)pRpH);
    95                 return dev1Init((PRPINITIN)pRpH, (PRPINITOUT)pRpH);
    96             }
     77                return devInit((PRPINITIN)pRpH, (PRPINITOUT)pRpH);
    9778            break;
    9879
    9980        case CMDGenIOCTL:               /* Generic IOCTL */
    100             if (usDev == 0)
    101                 return dev0GenIOCtl((PRP_GENIOCTL)pRpH);
    102             return dev1GenIOCtl((PRP_GENIOCTL)pRpH);
     81            return devGenIOCtl((PRP_GENIOCTL)pRpH);
    10382
    10483        case CMDOpen:                   /* device open */
    10584        case CMDClose:                  /* device close */
    106             if (usDev == 1)
    107             {
    108                 RP32OPENCLOSE rp32OpenClose = {0};
    109                 rp32OpenClose.rph.Len = pRpH->Len;
    110                 rp32OpenClose.rph.Unit = pRpH->Unit;
    111                 rp32OpenClose.rph.Cmd = pRpH->Cmd;
    112                 rp32OpenClose.rph.Status = pRpH->Status;
    113                 rp32OpenClose.rph.Flags = pRpH->Flags;
    114                 rp32OpenClose.rph.Link = (ULONG)pRpH->Link;
    115                 rp32OpenClose.sfn = ((PRP_OPENCLOSE)pRpH)->sfn;
    116                 if (pRpH->Cmd == CMDOpen)
    117                     return CallWin32kOpen(SSToDS_16a(&rp32OpenClose));
    118                 return CallWin32kClose(SSToDS_16a(&rp32OpenClose));
    119             }
    120             return STATUS_DONE;
     85        {
     86            RP32OPENCLOSE rp32OpenClose = {0};
     87            rp32OpenClose.rph.Len = pRpH->Len;
     88            rp32OpenClose.rph.Unit = pRpH->Unit;
     89            rp32OpenClose.rph.Cmd = pRpH->Cmd;
     90            rp32OpenClose.rph.Status = pRpH->Status;
     91            rp32OpenClose.rph.Flags = pRpH->Flags;
     92            rp32OpenClose.rph.Link = (ULONG)pRpH->Link;
     93            rp32OpenClose.sfn = ((PRP_OPENCLOSE)pRpH)->sfn;
     94            if (pRpH->Cmd == CMDOpen)
     95                return CallWin32kOpen(SSToDS_16a(&rp32OpenClose));
     96            return CallWin32kClose(SSToDS_16a(&rp32OpenClose));
     97        }
    12198
    12299        case CMDDeInstall:              /* De-Install driver */
     
    132109
    133110/**
    134  * Generic I/O Control - device 0.
    135  * This will only handle the request for Ring-0 initiation.
    136  * @returns   Status word.
    137  * @param     pRp  Request packet.
    138  */
    139 USHORT NEAR dev0GenIOCtl(PRP_GENIOCTL pRp)
    140 {
    141     USHORT rc;
    142 
    143     if (pRp->Category == D16_IOCTL_CAT)
    144     {
    145         switch (pRp->Function)
    146         {
    147             /*
    148              * This is the IOCtl which does the R0-initiation of the device driver.
    149              * Only available at init time...
    150              */
    151             case D16_IOCTL_RING0INIT:
    152                 if (fInitTime)
    153                 {
    154                     rc = R0Init16(pRp);
    155                     return rc;
    156                 }
    157                 break;
    158 
    159             /*
    160              * This is the IOCtl collects info of the running kernel.
    161              * Only available at init time.
    162              *
    163              * Since this IOCtl is issued before R0-Init is done, we'll have to
    164              * init TKSSBase for both 16-bit and 32-bit code and be a bit carefull.
    165              */
    166             case D16_IOCTL_GETKRNLINFO:
    167                 if (fInitTime)
    168                 {
    169                     ULONG ulLin;
    170                     if (fInitTime && TKSSBase16 == 0)
    171                         initGetDosTableData();
    172                     if (DevHelp_VirtToLin(SELECTOROF(pRp->DataPacket), OFFSETOF(pRp->DataPacket),
    173                                           &ulLin) != NO_ERROR)
    174                         return STATUS_DONE | STERR | ERROR_I24_INVALID_PARAMETER;
    175                     return CallGetKernelInfo32(ulLin);
    176                 }
    177                 break;
    178 
    179             /*
    180              * This is the IOCtl verifies the data in the ImportTab.
    181              * Only available at init time.
    182              *
    183              * Since this IOCtl is issued before R0-Init is done, we'll have to
    184              * init TKSSBase for both 16-bit and 32-bit code and be a bit carefull.
    185              */
    186             case D16_IOCTL_VERIFYIMPORTTAB:
    187                 if (fInitTime)
    188                 {
    189                     if (TKSSBase16 == 0)
    190                         initGetDosTableData();
    191                     rc = CallVerifyImportTab32();
    192                     if (pRp->DataPacket)
    193                         ((PD16VERIFYIMPORTTABDATA)pRp->DataPacket)->usRc = rc;
    194                     return STATUS_DONE;
    195                 }
    196                 break;
    197         }
    198     }
    199     else if (pRp->Category == IOCTL_W32K_K32 || pRp->Category == IOCTL_W32K_ELF)
    200     {
    201         RP32GENIOCTL rp32Init = {0};
    202         rp32Init.rph.Len = pRp->rph.Len;
    203         rp32Init.rph.Unit = pRp->rph.Unit;
    204         rp32Init.rph.Cmd = pRp->rph.Cmd;
    205         rp32Init.rph.Status = pRp->rph.Status;
    206         rp32Init.rph.Flags = pRp->rph.Flags;
    207         rp32Init.rph.Link = (ULONG)pRp->rph.Link;
    208         rp32Init.Category = pRp->Category;
    209         rp32Init.Function = pRp->Function;
    210         rp32Init.sfn = pRp->sfn;
    211         rp32Init.DataLen = pRp->DataLen;
    212         rp32Init.ParmLen = pRp->ParmLen;
    213 
    214         if (DevHelp_VirtToLin(SELECTOROF(pRp->DataPacket), OFFSETOF(pRp->DataPacket),
    215                               (PLIN)&rp32Init.DataPacket) != NO_ERROR)
    216             return STATUS_DONE | STERR | ERROR_I24_INVALID_PARAMETER;
    217         if (DevHelp_VirtToLin(SELECTOROF(pRp->ParmPacket), OFFSETOF(pRp->ParmPacket),
    218                               (PLIN)&rp32Init.ParmPacket) != NO_ERROR)
    219             return STATUS_DONE | STERR | ERROR_I24_INVALID_PARAMETER;
    220 
    221         if (pRp->Category == IOCTL_W32K_ELF)
    222             rc = CallElfIOCtl(SSToDS_16a(&rp32Init));
    223         else
    224             rc = CallWin32kIOCtl(SSToDS_16a(&rp32Init));
    225 
    226         return rc;
    227     }
    228 
    229 
    230     return STATUS_DONE | STERR | ERROR_I24_INVALID_PARAMETER;
    231 }
    232 
    233 
    234 /**
    235  * Generic I/O Control - device 0.
     111 * Generic I/O Control.
    236112 * This will forward requests to 32-bit counterpart.
    237113 * @returns   Status word.
    238114 * @param     pRp  Request packet.
    239115 */
    240 USHORT NEAR dev1GenIOCtl(PRP_GENIOCTL pRp)
     116USHORT NEAR devGenIOCtl(PRP_GENIOCTL pRp)
    241117{
    242     if (pRp->Category == IOCTL_W32K_K32 || pRp->Category == IOCTL_W32K_ELF)
     118    if (pRp->Category == IOCTL_W32K_K32)
    243119    {
    244         USHORT          rc;
    245120        RP32GENIOCTL    rp32Init = {0};
    246121        rp32Init.rph.Len = pRp->rph.Len;
     
    263138            return STATUS_DONE | STERR | ERROR_I24_INVALID_PARAMETER;
    264139
    265         if (pRp->Category == IOCTL_W32K_ELF)
    266             rc = CallElfIOCtl(SSToDS_16a(&rp32Init));
    267         else
    268             rc = CallWin32kIOCtl(SSToDS_16a(&rp32Init));
    269 
    270         return rc;
     140        return CallWin32kIOCtl(SSToDS_16a(&rp32Init));
    271141    }
    272142
  • branches/splittup/src/win32k/dev16/vprntf16.c

    r5529 r6841  
    1 /* $Id: vprntf16.c,v 1.6 2001-04-16 23:05:31 bird Exp $
     1/* $Id: vprntf16.c,v 1.6.2.1 2001-09-27 03:08:12 bird Exp $
    22 *
    33 * vprintf and printf - 16-bit.
     
    4141#ifdef RING0
    4242#include "options.h"
     43#define COMPORT 0x2f8
    4344#include "conio.h"
    4445#endif
     
    487488            if (ch == '\n')
    488489            {
    489                 while (!(inp(options.usCom + 5) & 0x20));  /* Waits for the port to be ready. */
    490                 outp(options.usCom, chReturn);             /* Put the char. */
     490                while (!(inp(COMPORT + 5) & 0x20));  /* Waits for the port to be ready. */
     491                outp(COMPORT, chReturn);             /* Put the char. */
    491492            }
    492             while (!(inp(options.usCom + 5) & 0x20));  /* Waits for the port to be ready. */
    493             outp(options.usCom, ch);                   /* Put the char. */
     493            while (!(inp(COMPORT + 5) & 0x20));  /* Waits for the port to be ready. */
     494            outp(COMPORT, ch);                   /* Put the char. */
    494495            /* Yield(); - no 16-bit yield */
    495496        }
     
    531532            for (ul = 0; ul < cch; ul++)
    532533            {
    533                 while (!(inp(options.usCom + 5) & 0x20));  /* Waits for the port to be ready. */
    534                 outp(options.usCom, psz[ul]);              /* Put the char. */
     534                while (!(inp(COMPORT + 5) & 0x20));  /* Waits for the port to be ready. */
     535                outp(COMPORT, psz[ul]);              /* Put the char. */
    535536            }
    536537
     
    540541                if (psz[cch] == '\n')
    541542                {
    542                     while (!(inp(options.usCom + 5) & 0x20));  /* Waits for the port to be ready. */
    543                     outp(options.usCom, chReturn);             /* Put the char. */
    544                     while (!(inp(options.usCom + 5) & 0x20));  /* Waits for the port to be ready. */
    545                     outp(options.usCom, chNewLine);            /* Put the char. */
     543                    while (!(inp(COMPORT + 5) & 0x20));  /* Waits for the port to be ready. */
     544                    outp(COMPORT, chReturn);             /* Put the char. */
     545                    while (!(inp(COMPORT + 5) & 0x20));  /* Waits for the port to be ready. */
     546                    outp(COMPORT, chNewLine);            /* Put the char. */
    546547                    cchYield ++;
    547548                }
  • branches/splittup/src/win32k/dev32/d32CallGate.asm

    r6280 r6841  
    1 ; $Id: d32CallGate.asm,v 1.5 2001-07-10 05:19:33 bird Exp $
     1; $Id: d32CallGate.asm,v 1.5.2.1 2001-09-27 03:08:12 bird Exp $
    22;
    33; 32-bit CallGate used to communitcate fast between Ring-3 and Ring-0.
     
    3939;
    4040    extrn  _Device_Help:dword
    41     extrn  pulTKSSBase32:dword
     41    extrn  _TKSSBase:dword
    4242
    4343    extrn  KMEnterKmodeSEF:near
     
    316316    mov     ecx, acbK32Params[eax*4]    ; ecx <- size of parameter packet.
    317317    sub     esp, ecx                    ; Reserve stack space for the parameter packet.
    318     mov     eax, [pulTKSSBase32]        ; Calculate the FLAT address of esp.
    319     mov     eax, [eax]
     318    mov     eax, _TKSSBase              ; Calculate the FLAT address of esp.
    320319    add     eax, esp                    ; eax <- flat address of ss:esp
    321320    push    ecx                         ; Save the size.
  • branches/splittup/src/win32k/dev32/d32Events.asm

    r5247 r6841  
    1 ; $Id: d32Events.asm,v 1.2 2001-02-23 02:57:53 bird Exp $
     1; $Id: d32Events.asm,v 1.2.2.1 2001-09-27 03:08:13 bird Exp $
    22;
    33; d32Events - Code for overriding system events.
     
    2525;
    2626    extrn   aSysEventsOverrides:dword
    27     extrn    _TKSSBase16:dword
    2827    extrn   dh_SendEvent:near
    2928    extrn   dh_SendEvent_sel:word
  • branches/splittup/src/win32k/dev32/d32Win32kIOCtl.c

    r5224 r6841  
    1 /* $Id: d32Win32kIOCtl.c,v 1.7 2001-02-21 07:44:57 bird Exp $
     1/* $Id: d32Win32kIOCtl.c,v 1.7.2.1 2001-09-27 03:08:13 bird Exp $
    22 *
    33 * Win32k driver IOCtl handler function.
     
    2424*******************************************************************************/
    2525#include <os2.h>
     26#include <OS2Krnl.h>
     27#include <kKrnlLib.h>
    2628
    2729#include "devSegDf.h"
    2830#include "dev1632.h"
    2931#include "dev32.h"
    30 #include "OS2Krnl.h"
    3132#include "Win32k.h"
    3233#include "k32.h"
    33 #include "log.h"
    34 #include "asmutils.h"
    3534
    3635
  • branches/splittup/src/win32k/dev32/d32Win32kOpenClose.c

    r6296 r6841  
    1 /* $Id: d32Win32kOpenClose.c,v 1.2 2001-07-10 16:39:16 bird Exp $
     1/* $Id: d32Win32kOpenClose.c,v 1.2.2.1 2001-09-27 03:08:13 bird Exp $
    22 *
    33 * Open and Close handlers for the Win32k driver.
     
    1919#define INCL_OS2KRNL_LDR
    2020#define INCL_OS2KRNL_PTDA
     21#define INCL_KKL_AVL
     22#define INCL_KKL_LOG
    2123
    2224#define NO_WIN32K_LIB_FUNCTIONS
     
    2729*******************************************************************************/
    2830#include <os2.h>
     31#include <OS2Krnl.h>
     32#include <kKrnlLib.h>
    2933
    3034#include "devSegDf.h"
     
    3236#include "dev1632.h"
    3337#include "dev32.h"
    34 #include "OS2Krnl.h"
    3538#include "Win32k.h"
    36 #include "log.h"
    37 #include "asmutils.h"
    38 #include "avl.h"
    3939#include "PerTaskW32kData.h"
    4040
  • branches/splittup/src/win32k/dev32/d32globals.c

    r5224 r6841  
    1 /* $Id: d32globals.c,v 1.6 2001-02-21 07:44:57 bird Exp $
     1/* $Id: d32globals.c,v 1.6.2.1 2001-09-27 03:08:13 bird Exp $
    22 *
    33 * d32globals - global data (32-bit)
    44 *
    5  * Copyright (c) 1999 knut st. osmundsen
     5 * Copyright (c) 1999-2001 knut st. osmundsen (kosmunds@csc.com)
    66 *
    77 * Project Odin Software License can be found in LICENSE.TXT
     
    2222*   Global Variables                                                           *
    2323*******************************************************************************/
    24 /*
    25  * This is the pointer to the TK(TasK)SS(Stack Segment) FLAT Base address variable.
    26  * It is used by the SSToDS macro to convert stack based addresses to FLAT ds
    27  * based addressed.
    28  */
    29 PULONG          pulTKSSBase32;
     24/* currently there is nothing here! */
    3025
  • branches/splittup/src/win32k/dev32/d32init.c

    r6278 r6841  
    1 /* $Id: d32init.c,v 1.41 2001-07-10 05:18:04 bird Exp $
     1/* $Id: d32init.c,v 1.41.2.1 2001-09-27 03:08:14 bird Exp $
    22 *
    33 * d32init.c - 32-bits init routines.
     
    1212*   Defined Constants                                                          *
    1313*******************************************************************************/
    14 /*
    15  * Calltab entry sizes.
    16  */
    17 #define OVERLOAD16_ENTRY    0x18        /* This is intentionally 4 bytes larger than the one defined in calltaba.asm. */
    18 #define OVERLOAD32_ENTRY    0x14
    19 #define IMPORT16_ENTRY      0x08
    20 #define IMPORTH16_ENTRY     0x08
    21 #define IMPORT32_ENTRY      0x08
    22 #define VARIMPORT_ENTRY     0x10
    23 
    24 #if  0
    25     #define kprintf2(a) kprintf
    26 #else
    27     #define kprintf2(a) (void)0
    28 #endif
    29 
    3014#define INCL_DOSERRORS
    3115#define INCL_NOPMAPI
     
    3317#define INCL_OS2KRNL_ALL
    3418#define INCL_OS2KRNL_LDR
     19#define INCL_KKL_LOG
    3520
    3621/*******************************************************************************
     
    3823*******************************************************************************/
    3924#include <os2.h>
     25#include <OS2Krnl.h>
     26#include <kKrnlLib.h>
    4027
    4128#include <string.h>
    4229
    4330#include "devSegDf.h"
    44 #include "OS2Krnl.h"
    4531#include "options.h"
    4632#include "dev1632.h"
    4733#include "dev32.h"
    4834#include "dev32hlp.h"
    49 #include "probkrnl.h"
    50 #include "log.h"
    51 #include "asmutils.h"
    52 #include "malloc.h"
    5335#include "ldr.h"
    54 #include "macros.h"
    55 #include "errors.h"
    56 
    57 #ifdef R3TST
    58     #include "test.h"
    59     #define x86DisableWriteProtect() 0
    60     #define x86RestoreWriteProtect(a) (void)0
    61 #endif
    6236
    6337
     
    7044static char * apszInfoLevel[] = {"INFOLEVEL_QUIET", "INFOLEVEL_ERROR", "INFOLEVEL_WARNING", "INFOLEVEL_INFO", "INFOLEVEL_INFOALL", "!invalid!"};
    7145#endif
    72 PMTE    pKrnlMTE = NULL;
    73 PSMTE   pKrnlSMTE = NULL;
    74 POTE    pKrnlOTE = NULL;
    7546
    7647
     
    7950*******************************************************************************/
    8051 ULONG          readnum(const char *pszNum);
    81 _Inline int     ModR_M_32bit(char bModRM);
    82 _Inline int     ModR_M_16bit(char bModRM);
    83 int             interpretFunctionProlog32(char *pach, BOOL fOverload);
    84 int             interpretFunctionProlog16(char *pach, BOOL fOverload);
    85 int             importTabInit(void);
    86 #ifdef R3TST
    87 PMTE            GetOS2KrnlMTETst(void);
    88 void            R3TstFixImportTab(void);
    89 #endif
    90 PSZ SECCALL     nopSecPathFromSFN(SFN hFile);
    91 
    92 
    93 
    94 /* externs located in 16-bit data segement in ProbKrnl.c */
    95 extern ULONG    _TKSSBase16;
    96 extern USHORT   _R0FlatCS16;
    97 extern USHORT   _R0FlatDS16;
    98 
    99 /* extern(s) located in calltab.asm */
    100 extern char     callTab[1];
    101 extern char     callTab16[1];
    102 extern unsigned auFuncs[NBR_OF_KRNLIMPORTS];
    103 
    104 
    105 /**
     52
     53
     54/*
    10655 * Ring-0, 32-bit, init function.
    10756 * @returns   Status word.
     
    11766 * @author    knut st. osmundsen
    11867 */
    119 USHORT _loadds _Far32 _Pascal R0Init32(RP32INIT *pRpInit)
     68ULONG _System R0Init(RP32INIT *pRpInit)
    12069{
    12170    char *      pszTmp2;
    12271    char *      pszTmp;
    123     ULONG       ul;
    12472    APIRET      rc;
    12573    LOCKHANDLE  lockhandle;
    126 
    127     pulTKSSBase32 = (PULONG)_TKSSBase16;
    12874
    12975    /*---------------------*/
     
    14894                break;
    14995
    150             case 'c':
    151             case 'C': /* -C[1|2|3|4] or -Com:[1|2|3|4]  -  com-port no, def:-C2 */
    152                 pszTmp2 = strpbrk(pszTmp, ":=/- ");
    153                 if (pszTmp2 != NULL && (*pszTmp2 == ':' || *pszTmp2 == '='))
    154                     pszTmp2++;
    155                 else
    156                     pszTmp2 = pszTmp + 1;
    157                 ul = readnum(pszTmp2);
    158                 switch (ul)
    159                 {
    160                     case 1: options.usCom = OUTPUT_COM1; break;
    161                     case 2: options.usCom = OUTPUT_COM2; break;
    162                     case 3: options.usCom = OUTPUT_COM3; break;
    163                     case 4: options.usCom = OUTPUT_COM4; break;
    164                 }
    165                 break;
    166 
    16796            case 'd':
    16897            case 'D':
     
    202131                else
    203132                    options.fForcePreload = FALSE;
    204                 break;
    205 
    206             case 'h':
    207             case 'H': /* Heap options */
    208                 pszTmp2 = strpbrk(pszTmp, ":=/- ");
    209                 if (pszTmp2 != NULL && (*pszTmp2 == ':' || *pszTmp2 == '='))
    210                 {
    211                     ul = readnum(pszTmp2 + 1);
    212                     if (ul > 0x1000UL && ul < 0x2000000UL) /* 4KB < ul < 32MB */
    213                     {
    214                         if (strnicmp(pszTmp, "heapm", 5) == 0)
    215                             options.cbSwpHeapMax = ul;
    216                         else
    217                             options.cbSwpHeapInit = ul;
    218                     }
    219                 }
    220133                break;
    221134
     
    284197                        && (pszTmp2[1] == 'Y' || pszTmp2[1] == 'y');
    285198                }
    286                 else
    287                 {   /* ResHeap options */
    288                     if (pszTmp2 != NULL && (*pszTmp2 == ':' || *pszTmp2 == '='))
    289                     {
    290                         ul = readnum(pszTmp2 + 1);
    291                         if (ul > 0x1000UL && ul < 0x700000UL) /* 4KB < ul < 7MB */
    292                         {
    293                             if (strnicmp(pszTmp, "resheapm", 8) == 0)
    294                                 options.cbResHeapMax = ul;
    295                             else
    296                                 options.cbResHeapInit = ul;
    297                         }
    298                     }
    299                 }
    300199                break;
    301200
    302201            case 's':
    303             case 'S': /* Sym:<filename> or Script:<Yes|No> or Smp */
    304                 /* SMP kernel */
    305                 pszTmp2 = strpbrk(pszTmp, ":=/- ");
    306                 if (pszTmp[1] == 'c' || pszTmp[1] == 'C')
    307                 {
    308                     options.fUNIXScript =
    309                         pszTmp2 != NULL
    310                         && (int)(pszTmp2-pszTmp) < cch-1
    311                         && (*pszTmp2 == ':' || *pszTmp2 == '=')
    312                         && (pszTmp2[1] == 'Y' || pszTmp2[1] == 'y');
    313                 }
     202            case 'S': /* Script:<Yes|No> */
     203                pszTmp2 = strpbrk(pszTmp, ":=/- ");
     204                options.fUNIXScript =
     205                    pszTmp2 != NULL
     206                    && (int)(pszTmp2-pszTmp) < cch-1
     207                    && (*pszTmp2 == ':' || *pszTmp2 == '=')
     208                    && (pszTmp2[1] == 'Y' || pszTmp2[1] == 'y');
    314209                break;
    315210
     
    339234        pszTmp = strpbrk(pszTmp, "-/");
    340235    }
    341 
    342     /* heap min/max corrections */
    343     if (options.cbSwpHeapInit > options.cbSwpHeapMax)
    344         options.cbSwpHeapMax = options.cbSwpHeapInit;
    345     if (options.cbResHeapInit > options.cbResHeapMax)
    346         options.cbResHeapMax = options.cbResHeapInit;
    347236
    348237    /* Log option summary */
     
    358247    else
    359248        kprintf(("\tlogging disabled\n"));
    360     kprintf(("\tCom port no.%03xh\n", options.usCom));
    361 
    362     kprintf(("\tKernel: v%d.%d  build %d%c type ",
    363                 options.usVerMajor,
    364                 options.usVerMinor,
    365                 options.ulBuild,
    366                 (options.fKernel & KF_REV_MASK)
    367                     ? ((options.fKernel & KF_REV_MASK) >> KF_REV_SHIFT) + 'a'-1
    368                     : ' '
    369                 ));
    370     if (options.fKernel & KF_SMP)
    371         kprintf(("SMP "));
    372     else if (options.fKernel & KF_W4)
    373         kprintf(("W4 "));
    374     else
    375         kprintf(("UNI "));
    376     if (options.fKernel & KF_DEBUG)
    377         kprintf(("DEBUG\n"));
    378     else
    379         kprintf(("\n"));
    380 
    381     kprintf(("\tfPE=%d (%s)\n",     options.fPE, apszPE[MIN(options.fPE, 5)]));
    382     kprintf(("\tfPEOneObject=%d (%s)\n",     options.fPEOneObject, apszPEOneObject[MIN(options.fPEOneObject, 3)]));
    383     kprintf(("\tulInfoLevel=%d (%s)\n", options.ulInfoLevel, apszInfoLevel[MIN(options.ulInfoLevel, 5)]));
     249
     250    kprintf(("\tfPE=%d (%s)\n",     options.fPE, apszPE[KMIN(options.fPE, 5)]));
     251    kprintf(("\tfPEOneObject=%d (%s)\n",     options.fPEOneObject, apszPEOneObject[KMIN(options.fPEOneObject, 3)]));
     252    kprintf(("\tulInfoLevel=%d (%s)\n", options.ulInfoLevel, apszInfoLevel[KMIN(options.ulInfoLevel, 5)]));
    384253    kprintf(("\tfElf=%d\n",         options.fElf));
    385254    kprintf(("\tfUNIXScript=%d\n",  options.fUNIXScript));
     
    387256    kprintf(("\tfJAVA=%d\n",        options.fJava));
    388257    kprintf(("\tfNoLoader=%d\n",    options.fNoLoader));
    389     kprintf(("\tcbSwpHeapInit=0x%08x  cbSwpHeapMax=0x%08x\n",
    390              options.cbSwpHeapInit, options.cbSwpHeapMax));
    391     kprintf(("\tcbResHeapInit=0x%08x  cbResHeapMax=0x%08x\n",
    392              options.cbResHeapInit, options.cbResHeapMax));
    393258    kprintf(("Options - Summary - End\n"));
    394259    #endif /* debug */
     
    399264     * init sub-parts
    400265     */
    401     /* heap */
    402     if (heapInit(options.cbResHeapInit, options.cbResHeapMax,
    403                  options.cbSwpHeapInit, options.cbSwpHeapMax) != NO_ERROR)
    404         return ERROR_D32_HEAPINIT_FAILED;
    405 
    406266    /* loader */
    407     if (ldrInit() != NO_ERROR)
    408         return ERROR_D32_LDR_INIT_FAILED;
    409 
    410     /* functionoverrides */
    411     if ((rc = importTabInit()) != NO_ERROR)
    412         return (USHORT)rc;
     267    if ((rc = ldrInit()) != NO_ERROR)
     268        return rc;
    413269
    414270    /* apis */
    415271    #if 0
    416272    if ((rc = APIInit()) != NO_ERROR)
    417         return (USHORT)rc;
     273        return rc;
    418274    #endif
    419275
     
    423279    {
    424280        kprintf(("R0Init32: InitCallGate failed with rc=%d\n", rc));
    425         return (USHORT)rc;
     281        return rc;
    426282    }
    427283    #endif
     
    442298    /* 32-bit data segment */
    443299    memset(SSToDS(&lockhandle), 0, sizeof(lockhandle));
    444     rc = D32Hlp_VMLock2(callTab,
    445                         &CONST32_ROEND - (char*)callTab,
     300    rc = D32Hlp_VMLock2(&DATA32START,
     301                        &CONST32_ROEND - &DATA32START,
    446302                        VMDHL_LONG | VMDHL_WRITE,
    447303                        SSToDS(&lockhandle));
     
    496352}
    497353
    498 
    499 /**
    500  * Get kernel OTEs
    501  * This function set pKrnlMTE, pKrnlSMTE and pKrnlOTE.
    502  * @returns   Strategy return code:
    503  *            STATUS_DONE on success.
    504  *            STATUS_DONE | STERR | errorcode on failure.
    505  * @param     pKrnlInfo  Pointer to output buffer.
    506  *                       If NULL only the three global variables are set.
    507  * @status    completely implemented and tested.
    508  * @author    knut st. osmundsen
    509  * @remark    Called from IOCtl.
    510  *            WARNING! This function is called before the initroutine (R0INIT)!
    511  */
    512 USHORT _loadds _Far32 _Pascal GetKernelInfo32(PKRNLINFO pKrnlInfo)
    513 {
    514     int     i;
    515     USHORT  usRc;
    516 
    517     /* VerifyImportTab32 is called before the initroutine! */
    518     pulTKSSBase32 = (PULONG)_TKSSBase16;
    519 
    520     /* Find the kernel OTE table */
    521 #ifndef R3TST
    522     pKrnlMTE = GetOS2KrnlMTE();
    523 #else
    524     pKrnlMTE = GetOS2KrnlMTETst();
    525 #endif
    526     if (pKrnlMTE != NULL)
    527     {
    528         pKrnlSMTE = pKrnlMTE->mte_swapmte;
    529         if (pKrnlSMTE != NULL)
    530         {
    531             if (pKrnlSMTE->smte_objcnt <= MAXKRNLOBJECTS)
    532             {
    533                 pKrnlOTE = pKrnlSMTE->smte_objtab;
    534                 if (pKrnlOTE != NULL)
    535                 {
    536                     BOOL    fKrnlTypeOk;
    537 
    538                     /*
    539                      * Thats all?
    540                      */
    541                     if (pKrnlInfo == NULL)
    542                         return NO_ERROR;
    543 
    544                     pKrnlInfo->cObjects = (unsigned char)pKrnlSMTE->smte_objcnt;
    545 
    546                     /*
    547                      * Copy OTEs
    548                      */
    549                     for (i = 0; i < pKrnlInfo->cObjects; i++)
    550                     {
    551                         memcpy((void*)&pKrnlInfo->aObjects[i], &pKrnlOTE[i], sizeof(OTE));
    552                         kprintf2(("GetKernelInfo32: %d base=0x%08x size=0x%08x flags=0x%08x\n",
    553                                   i, pKrnlOTE[i].ote_base, pKrnlOTE[i].ote_size, pKrnlOTE[i].ote_flags));
    554                     }
    555                     usRc = 0;
    556 
    557                     /*
    558                      * Search for internal revision stuff AND 'SAB KNL?' signature in the two first objects.
    559                      */
    560                     fKrnlTypeOk = FALSE;
    561                     pKrnlInfo->fKernel = 0;
    562                     pKrnlInfo->ulBuild = 0;
    563                     for (i = 0; i < 2 && pKrnlInfo->ulBuild == 0; i++)
    564                     {
    565                         const char *psz = (const char*)pKrnlOTE[i].ote_base;
    566                         const char *pszEnd = psz + pKrnlOTE[i].ote_size - 50; /* Last possible search position. */
    567 
    568                         while (psz < pszEnd)
    569                         {
    570                             if (strncmp(psz, "Internal revision ", 18) == 0 && (psz[18] >= '0' && psz[18] <= '9'))
    571                             {
    572                                 int j;
    573                                 kprintf2(("GetKernelInfo32: found internal revision: '%s'\n", psz));
    574 
    575                                 /* skip to end of "Internal revision " string. */
    576                                 psz += 18;
    577 
    578                                 /* Read number*/
    579                                 while ((*psz >= '0' && *psz <= '9') || *psz == '.')
    580                                 {
    581                                     if (*psz != '.')
    582                                         pKrnlInfo->ulBuild = (unsigned short)(pKrnlInfo->ulBuild * 10 + (*psz - '0'));
    583                                     psz++;
    584                                 }
    585 
    586                                 /* Check if build number seems valid. */
    587                                 if (   !(pKrnlInfo->ulBuild >=  8254 && pKrnlInfo->ulBuild <  8383) /* Warp 3 fp 32 -> fp 60 */
    588                                     && !(pKrnlInfo->ulBuild >=  9023 && pKrnlInfo->ulBuild <= 9036) /* Warp 4 GA -> fp 12 */
    589                                     && !(pKrnlInfo->ulBuild >= 14039 && pKrnlInfo->ulBuild < 14100) /* Warp 4.5 GA -> fp 40 */
    590                                     && !(pKrnlInfo->ulBuild >=  6600 && pKrnlInfo->ulBuild <= 6678) /* Warp 2.1x fix?? (just for fun!) */
    591                                       )
    592                                 {
    593                                     kprintf(("GetKernelInfo32: info summary: Build %d is invalid - invalid fixpack?\n", pKrnlInfo->ulBuild));
    594                                     usRc = ERROR_D32_INVALID_BUILD;
    595                                     break;
    596                                 }
    597 
    598                                 /* Check for any revision flag */
    599                                 if ((*psz >= 'A' && *psz <= 'Z') || (*psz >= 'a' && *psz <= 'z'))
    600                                 {
    601                                     pKrnlInfo->fKernel |= (USHORT)((*psz - (*psz >= 'a' ? 'a'-1 : 'A'-1)) << KF_REV_SHIFT);
    602                                     psz++;
    603                                 }
    604                                 if (*psz == ',') /* This is ignored! */
    605                                     *psz++;
    606 
    607                                 /* If this is an Aurora/Warp 4.5 or Warp 3 kernel there is more info! */
    608                                 if (psz[0] == '_' && (psz[1] == 'S' || psz[1] == 's'))  /* _SMP  */
    609                                     pKrnlInfo->fKernel |= KF_SMP;
    610                                 else
    611                                     if (*psz != ','
    612                                         && (   (psz[0] == '_' && psz[1] == 'W' && psz[2] == '4')  /* _W4 */
    613                                             || (psz[0] == '_' && psz[1] == 'U' && psz[2] == 'N' && psz[3] == 'I' && psz[4] == '4')  /* _UNI4 */
    614                                             )
    615                                         )
    616                                     pKrnlInfo->fKernel |= KF_W4 | KF_UNI;
    617                                 else
    618                                     pKrnlInfo->fKernel |= KF_UNI;
    619 
    620 
    621                                 /* Check if its a debug kernel (look for DEBUG at start of object 3-5) */
    622                                 if (!fKrnlTypeOk)
    623                                 {
    624                                     j = 3;
    625                                     while (j < 5)
    626                                     {
    627                                         /* There should be no iopl object preceding the debugger data object. */
    628                                         if ((pKrnlOTE[j].ote_flags & OBJIOPL) != 0)
    629                                             break;
    630                                         /* Is this is? */
    631                                         if ((pKrnlOTE[j].ote_flags & OBJINVALID) == 0
    632                                             && (pKrnlOTE[j].ote_flags & (OBJREAD | OBJWRITE)) == (OBJREAD | OBJWRITE)
    633                                             && strncmp((char*)pKrnlOTE[j].ote_base, "DEBUG", 5) == 0)
    634                                         {
    635                                             pKrnlInfo->fKernel |= KF_DEBUG;
    636                                             break;
    637                                         }
    638                                         j++;
    639                                     }
    640                                 }
    641 
    642                                 /* Display info */
    643                                 kprintf(("GetKernelInfo32: info summary: Build %d, fKernel=0x%x\n",
    644                                          pKrnlInfo->ulBuild, pKrnlInfo->fKernel));
    645 
    646                                 /* Break out */
    647                                 break;
    648                             }
    649 
    650                             /*
    651                              * Look for the SAB KNL? signature to check which kernel type we're
    652                              * dealing with. This could also be reached thru the selector found
    653                              * in the first element for the SAS_tables_area array.
    654                              */
    655                             if (!fKrnlTypeOk && strncmp(psz, "SAB KNL", 7) == 0)
    656                             {
    657                                 fKrnlTypeOk = TRUE;
    658                                 if (psz[7] == 'D')
    659                                     pKrnlInfo->fKernel |= KF_ALLSTRICT;
    660                                 else if (psz[7] == 'B')
    661                                     pKrnlInfo->fKernel |= KF_HALFSTRICT;
    662                                 else if (psz[7] != 'R')
    663                                     fKrnlTypeOk = FALSE;
    664                             }
    665 
    666                             /* next */
    667                             psz++;
    668                         } /* while loop searching for "Internal revision " */
    669                     } /* for loop on objects 0-1. */
    670 
    671                     /* Set error code if not found */
    672                     if (pKrnlInfo->ulBuild == 0)
    673                     {
    674                         usRc = ERROR_D32_BUILD_INFO_NOT_FOUND;
    675                         kprintf(("GetKernelInfo32: Internal revision was not found!\n"));
    676                     }
    677                 }
    678                 else
    679                     usRc = ERROR_D32_NO_OBJECT_TABLE;
    680             }
    681             else
    682                 usRc = ERROR_D32_TOO_MANY_OBJECTS;
    683         }
    684         else
    685             usRc = ERROR_D32_NO_SWAPMTE;
    686     }
    687     else
    688         usRc = ERROR_D32_GETOS2KRNL_FAILED;
    689 
    690     if (usRc != NO_ERROR)
    691         kprintf(("GetKernelInfo32: failed. usRc = %d\n", usRc));
    692 
    693     return (USHORT)(usRc | (usRc != NO_ERROR ? STATUS_DONE | STERR : STATUS_DONE));
    694 }
    695 
    696 
    697 
    698 /**
    699  * Functions which cacluates the instructionsize given a ModR/M byte.
    700  * @returns   Number of bytes to add to cb and pach.
    701  * @param     bModRM  ModR/M byte.
    702  * @status    completely implemented.
    703  * @author    knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    704  */
    705 int ModR_M_32bit(char bModRM)
    706 {
    707     if ((bModRM & 0xc0) == 0x80  /* ex. mov ax,[ebp+11145543h] */
    708         || ((bModRM & 0xc0) == 0 && (bModRM & 0x07) == 5)) /* ex. mov ebp,[0ff231234h] */
    709     {   /* 32-bit displacement */
    710         return 5 + ((bModRM & 0x7) == 0x4); // + SIB
    711     }
    712     else if ((bModRM & 0xc0) == 0x40) /* ex. mov ecx,[esi]+4fh */
    713     {   /* 8-bit displacement */
    714         return 2 + ((bModRM & 0x7) == 0x4); // + SIB
    715     }
    716     /* no displacement (only /r byte) */
    717     return 1;
    718 }
    719 
    720 
    721 /**
    722  * Functions which cacluates the instructionsize given a ModR/M byte.
    723  * @returns   Number of bytes to add to cb and pach.
    724  * @param     bModRM  ModR/M byte.
    725  * @status    completely implemented.
    726  * @author    knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    727  */
    728 int ModR_M_16bit(char bModRM)
    729 {
    730     if ((bModRM & 0xc0) == 0x80  /* ex. mov ax,[ebp+11145543h] */
    731         || ((bModRM & 0xc0) == 0 && (bModRM & 0x07) == 5)) /* ex. mov ebp,[0ff231234h] */
    732     {   /* 16-bit displacement */
    733         return 4;
    734     }
    735     else if ((bModRM & 0xc0) == 0x40) /* ex. mov ecx,[esi]+4fh */
    736     {   /* 8-bit displacement */
    737         return 2;
    738     }
    739     /* no displacement (only /r byte) */
    740     return 1;
    741 }
    742 
    743 
    744 
    745 
    746 
    747 /**
    748  * 32-bit! Interpret function prolog to find where to jmp back.
    749  * @returns   Length of prolog need to be copied - which is also the offset of
    750  *            where the jmp instr should be placed.
    751  *            On error it returns 0.
    752  * @param     pach       Pointer to prolog.
    753  * @param     fOverload  TRUE:  Function is to be overloaded.
    754  *                       FALSE: Function is to be imported.
    755  */
    756 int interpretFunctionProlog32(char *pach, BOOL fOverload)
    757 {
    758     int cb = -3;
    759     kprintf2(("interpretFunctionProlog32(0x%08x, %d):\n"
    760               "\t%02x %02x %02x %02x - %02x %02x %02x %02x\n"
    761               "\t%02x %02x %02x %02x - %02x %02x %02x %02x\n",
    762               pach, fOverload,
    763               pach[0], pach[1], pach[2], pach[3], pach[4], pach[5], pach[6], pach[7],
    764               pach[8], pach[9], pach[10],pach[11],pach[12],pach[13],pach[14],pach[15]));
    765 
    766     /*
    767      * check for the well known prolog (the only that is supported now)
    768      * which is:
    769      *     push ebp
    770      *     mov ebp,esp
    771      *  or
    772      *     push ebp
    773      *     mov eax, dword ptr [xxxxxxxx]
    774      *  or
    775      *     sub esp, imm8
    776      *     push ebx
    777      *     push edi
    778      *
    779      * These are allowed when not overloading:
    780      *     mov eax, imm32
    781      *     jmp short
    782      *  or
    783      *     mov eax, imm32
    784      *     push ebp
    785      *  or
    786      *     mov ecx, r/m32
    787      *  or
    788      *     jmp dword
    789      *  or
    790      *     sub esp, imm8
    791      *  or
    792      *     call ptr16:32
    793      *  or
    794      *     enter imm16, imm8    (2.1x)
    795      *  or
    796      *     mov eax, imm32       (2.1x)
    797      *     <anything>
    798      *  or
    799      *     xor r32, r/m32
    800      *  or
    801      *     mov eax, msoff32
    802      *  or
    803      *     push edi
    804      *     mov eax, dword ptr [xxxxxxxx]
    805      *  or
    806      *     movzx esp, sp
    807      *  or
    808      *     call rel32
    809      *     popf
    810      */
    811     if ((pach[0] == 0x55 && (pach[1] == 0x8b || pach[1] == 0xa1)) /* the two first prologs */
    812         ||
    813         (pach[0] == 0x83 &&  pach[3] == 0x53 && pach[4] == 0x57)  /* the third prolog */
    814         ||
    815         (pach[0] == 0xB8 && (pach[5] == 0xEB || pach[5] == 0x55) && !fOverload) /* the two next prologs */
    816         ||
    817         (pach[0] == 0x8B && !fOverload) /* the next prolog */
    818         ||
    819         (pach[0] == 0xFF && !fOverload) /* the next prolog */
    820         ||
    821         (pach[0] == 0x83 && !fOverload) /* the next prolog */
    822         ||
    823         (pach[0] == 0x9a && !fOverload) /* the next prolog */
    824         ||
    825         (pach[0] == 0xc8)               /* the next prolog */
    826         ||
    827         (pach[0] == 0xB8 && !fOverload) /* the next prolog */
    828         ||
    829         (pach[0] == 0x33 && !fOverload) /* the next prolog */
    830         ||
    831         (pach[0] == 0xa1 && !fOverload) /* the next prolog */
    832         ||
    833         (pach[0] == 0x57 &&  pach[1] == 0x8b && !fOverload) /* the next prolog */
    834         ||
    835         (pach[0] == 0x0f &&  pach[1] == 0xb7 && pach[2] == 0xe4 && !fOverload) /* the next prolog */
    836         ||
    837         (pach[0] == 0xe8 &&  pach[5] == 0x9d && !fOverload) /* the next prolog */
    838         /*      push ebx
    839          *      push edi
    840          *      push imm32
    841          */
    842         || (pach[0] == 0x53 &&  pach[1] == 0x57 &&  pach[2] == 0x68 && !fOverload)
    843         /*      push ebx
    844          *      push edi
    845          *      push esi
    846          *      mov /r
    847          */
    848         || (pach[0] == 0x53 &&  pach[1] == 0xe8 && !fOverload)
    849         /*      push ebx
    850          *      push edi
    851          *      push esi
    852          *      mov /r
    853          */
    854         || (pach[0] == 0x53 &&  pach[1] == 0x57 &&  pach[2] == 0x56 &&  pach[3] == 0x8b  && !fOverload)
    855         /*      pop  eax
    856          *      push imm8
    857          *      push eax
    858          *      jmp  imm32
    859          */
    860         ||  (pach[0] == 0x58 &&  pach[1] == 0x6a &&  pach[3] == 0x50 &&  pach[4] == 0xe9  && !fOverload)
    861         /*      push imm32
    862          *      call imm32
    863          */
    864         || (pach[0] == 0x68 && pach[5] == 0xe8 && !fOverload)
    865         )
    866     {
    867         BOOL fForce = FALSE;
    868         int  cbWord = 4;
    869         cb = 0;
    870         while (cb < 5 || fForce)                  /* 5 is the size of a jump instruction. */
    871         {
    872             int cb2;
    873             if (!fForce && cbWord != 4)
    874                 cbWord = 4;
    875             fForce = FALSE;
    876             switch (*pach)
    877             {
    878                 case 0x0f:
    879                     if (pach[1] != 0xb7 && pach[2] != 0xe4) /* movzx esp, sp */
    880                     {
    881                         kprintf(("interpretFunctionProlog32: unknown instruction 0x%x 0x%x 0x%x\n", pach[0], pach[1], pach[2]));
    882                         return -11;
    883                     }
    884                     pach += 2;
    885                     cb += 2;
    886                     break;
    887 
    888 
    889                 /* simple one byte prefixes */
    890                 case 0x2e:              /* cs segment override */
    891                 case 0x36:              /* ss segment override */
    892                 case 0x3e:              /* ds segment override */
    893                 case 0x26:              /* es segment override */
    894                 case 0x64:              /* fs segment override */
    895                 case 0x65:              /* gs segment override */
    896                     fForce = TRUE;
    897                     break;
    898 
    899                 case 0x66:              /* 16 bit */
    900                     fForce = TRUE;
    901                     cbWord = 2;
    902                     break;
    903 
    904                 /* simple one byte instructions e*/
    905                 case 0x50:              /* push eax */
    906                 case 0x51:              /* push ecx */
    907                 case 0x52:              /* push edx */
    908                 case 0x53:              /* push ebx */
    909                 case 0x54:              /* push esp */
    910                 case 0x55:              /* push ebp */
    911                 case 0x56:              /* push esi */
    912                 case 0x57:              /* push edi */
    913                 case 0x58:              /* pop  eax */
    914                 case 0x59:              /* pop  ecx */
    915                 case 0x5a:              /* pop  edx */
    916                 case 0x5b:              /* pop  ebx */
    917                 case 0x06:              /* push es */
    918                 case 0x0e:              /* push cs */
    919                 case 0x1e:              /* push ds */
    920                 case 0x16:              /* push ss */
    921                     break;
    922 
    923                 /* simple two byte instructions */
    924                 case 0xb0:              /* mov al, imm8 */
    925                 case 0xb1:              /* mov cl, imm8 */
    926                 case 0xb2:              /* mov dl, imm8 */
    927                 case 0xb3:              /* mov bl, imm8 */
    928                 case 0xb4:              /* mov ah, imm8 */
    929                 case 0xb5:              /* mov ch, imm8 */
    930                 case 0xb6:              /* mov dh, imm8 */
    931                 case 0xb7:              /* mov bh, imm8 */
    932                 case 0x2c:              /* sub al, imm8 */
    933                 case 0x34:              /* xor al, imm8 */
    934                 case 0x3c:              /* cmp al, imm8 */
    935                 case 0x6a:              /* push <byte> */
    936                 case 0xa0:              /* mov al, moffs8 */
    937                 case 0xa2:              /* mov moffs8, al */
    938                     pach++;
    939                     cb++;
    940                     break;
    941 
    942                 /* simple five byte instructions */
    943                 case 0xb8:              /* mov eax, imm32 */
    944                 case 0xb9:              /* mov ecx, imm32 */
    945                 case 0xba:              /* mov edx, imm32 */
    946                 case 0xbb:              /* mov ebx, imm32 */
    947                 case 0xbc:              /* mov esx, imm32 */
    948                 case 0xbd:              /* mov ebx, imm32 */
    949                 case 0xbe:              /* mov esi, imm32 */
    950                 case 0xbf:              /* mov edi, imm32 */
    951                 case 0xe9:              /* jmp rel32 */
    952                 case 0x2d:              /* sub eax, imm32 */
    953                 case 0x35:              /* xor eax, imm32 */
    954                 case 0x3d:              /* cmp eax, imm32 */
    955                 case 0x68:              /* push <dword> */
    956                 case 0xa1:              /* mov eax, moffs16 */
    957                 case 0xa3:              /* mov moffs16, eax */
    958                     pach += cbWord;
    959                     cb += cbWord;
    960                     break;
    961 
    962                 /* fixed five byte instructions */
    963                 case 0xe8:              /* call imm32 */
    964                     pach += 4;
    965                     cb += 4;
    966                     break;
    967 
    968                 /* complex sized instructions -  "/r" */
    969                 case 0x30:              /* xor r/m8,  r8 */
    970                 case 0x31:              /* xor r/m32, r32 */
    971                 case 0x32:              /* xor r8,  r/m8 */
    972                 case 0x33:              /* xor r32, r/m32 */
    973                 case 0x38:              /* cmp r/m8, r8 */
    974                 case 0x39:              /* cmp r/m32, r32 */
    975                 case 0x3a:              /* cmp r8, r/m8 */
    976                 case 0x3b:              /* cmp r32, r/m32 */
    977                 case 0x28:              /* sub r/m8, r8 */
    978                 case 0x29:              /* sub r/m32, r32 */
    979                 case 0x2a:              /* sub r8, r/m8 */
    980                 case 0x2b:              /* sub r32, r/m32 */
    981                 case 0x8b:              /* mov /r */
    982                 case 0x8d:              /* lea /r */
    983                     cb += cb2 = ModR_M_32bit(pach[1]);
    984                     pach += cb2;
    985                     break;
    986 
    987                 /* complex sized instruction - "/5 ib" */
    988                 case 0x80:              /* 5: sub r/m8, imm8  7: cmp r/m8, imm8 */
    989                 case 0x83:              /* 5: sub r/m32, imm8 7: cmp r/m32, imm8 */
    990                     if ((pach[1] & 0x38) == (5<<3)
    991                         || (pach[1] & 0x38) == (7<<3)
    992                         )
    993                     {
    994                         cb += cb2 = 1 + ModR_M_32bit(pach[1]); /* 1 is the size of the imm8 */
    995                         pach += cb2;
    996                     }
    997                     else
    998                     {
    999                         kprintf(("interpretFunctionProlog32: unknown instruction (-3) 0x%x 0x%x 0x%x\n", pach[0], pach[1], pach[2]));
    1000                         return -3;
    1001                     }
    1002                     break;
    1003 
    1004                 /* complex sized instruction - "/digit id" */
    1005                 case 0x81:              /* sub r/m32, imm32 + more instructions! */
    1006                     if ((pach[1] & 0x38) == (5<<3)       /* sub r/m32, imm32  */
    1007                         || (pach[1] & 0x38) == (7<<3)    /* cmp r/m32, imm32  */
    1008                         )
    1009                     {
    1010                         cb += cb2 = cbWord + ModR_M_32bit(pach[1]); /* cbWord is the size of the imm32/imm16 */
    1011                         pach += cb2;
    1012                     }
    1013                     else
    1014                     {
    1015                         kprintf(("interpretFunctionProlog32: unknown instruction (-2) 0x%x 0x%x 0x%x\n", pach[0], pach[1], pach[2]));
    1016                         return -2;
    1017                     }
    1018                     break;
    1019 
    1020                 case 0x9a:              /* call ptr16:32 */
    1021                     cb += cb2 = 6;
    1022                     pach += cb2;
    1023                     break;
    1024 
    1025                 case 0xc8:              /* enter imm16, imm8 */
    1026                     cb += cb = 3;
    1027                     pach += cb2;
    1028                     break;
    1029 
    1030                 /*
    1031                  * jmp /digit
    1032                  */
    1033                 case 0xff:
    1034                     cb += cb2 = cbWord + ModR_M_32bit(pach[1]); /* cbWord is the size of the imm32/imm16 */
    1035                     pach += cb2;
    1036                     break;
    1037 
    1038                 default:
    1039                     kprintf(("interpretFunctionProlog32: unknown instruction 0x%x 0x%x 0x%x\n", pach[0], pach[1], pach[2]));
    1040                     return 0;
    1041             }
    1042             pach++;
    1043             cb++;
    1044         }
    1045     }
    1046     else
    1047     {
    1048         kprintf(("interpretFunctionProlog32: unknown prolog start. 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x\n",
    1049                  pach[0], pach[1], pach[2], pach[3], pach[4], pach[5]));
    1050         cb = 0;
    1051     }
    1052     return cb;
    1053 }
    1054 
    1055 
    1056 /**
    1057  * 16-bit! Interpret function prolog to find where to jmp back.
    1058  * @returns   Length of prolog need to be copied - which is also the offset of
    1059  *            where the jmp instr should be placed.
    1060  *            On error it returns 0.
    1061  * @param     pach       Pointer to prolog.
    1062  * @param     fOverload  TRUE:  Function is to be overloaded.
    1063  *                       FALSE: Function is to be imported.
    1064  */
    1065 int interpretFunctionProlog16(char *pach, BOOL fOverload)
    1066 {
    1067     int cb = -7;
    1068 
    1069     kprintf2(("interpretFunctionProlog16(0x%08x, %d):\n"
    1070               "\t%02x %02x %02x %02x - %02x %02x %02x %02x\n"
    1071               "\t%02x %02x %02x %02x - %02x %02x %02x %02x\n",
    1072               pach, fOverload,
    1073               pach[0], pach[1], pach[2], pach[3], pach[4], pach[5], pach[6], pach[7],
    1074               pach[8], pach[9], pach[10],pach[11],pach[12],pach[13],pach[14],pach[15]));
    1075     /*
    1076      * Check for the well known prolog (the only that is supported now)
    1077      * which is:
    1078      */
    1079     if ((*pach == 0x6A && !fOverload)       /* push 2 (don't check for the 2) */
    1080         ||
    1081         *pach == 0x60                       /* pushf */
    1082         ||
    1083         (*pach == 0x53 && pach[1] == 0x51)  /* push bx, push cx */
    1084         ||
    1085         (*pach == 0x8c && pach[1] == 0xd8)  /* mov ax, ds */
    1086         ||
    1087         (*pach == 0xb8)                     /* mov ax, imm16 */
    1088         )
    1089     {
    1090         BOOL fForce;
    1091         int  cOpPrefix = 0;
    1092         cb = 0;
    1093         while (cb < 5  || fForce)       /* 5 is the size of a 16:16 far jump instruction. */
    1094         {
    1095             int cb2;
    1096             fForce = FALSE;
    1097             switch (*pach)
    1098             {
    1099                 case 0x06:              /* push es */
    1100                 case 0x0e:              /* push cs */
    1101                 case 0x1e:              /* push ds */
    1102                 case 0x16:              /* push ss */
    1103                     break;
    1104 
    1105                 case 0x0f:              /* push gs and push fs */
    1106                     if (pach[1] != 0xA0 && pach[1] != 0xA8)
    1107                     {
    1108                         kprintf(("interpretFunctionProlog16: unknown instruction 0x%x 0x%x 0x%x\n", pach[0], pach[1], pach[2]));
    1109                         return -11;
    1110                     }
    1111                     pach++;
    1112                     cb++;
    1113                     break;
    1114 
    1115                 case 0x50:              /* push ax */
    1116                 case 0x51:              /* push cx */
    1117                 case 0x52:              /* push dx */
    1118                 case 0x53:              /* push bx */
    1119                 case 0x54:              /* push sp */
    1120                 case 0x55:              /* push bp */
    1121                 case 0x56:              /* push si */
    1122                 case 0x57:              /* push di */
    1123                 case 0x60:              /* pusha */
    1124                     break;
    1125 
    1126                 /* simple three byte instructions */
    1127                 case 0xb8:              /* mov eax, imm16 */
    1128                 case 0xb9:              /* mov ecx, imm16 */
    1129                 case 0xba:              /* mov edx, imm16 */
    1130                 case 0xbb:              /* mov ebx, imm16 */
    1131                 case 0xbc:              /* mov esx, imm16 */
    1132                 case 0xbd:              /* mov ebx, imm16 */
    1133                 case 0xbe:              /* mov esi, imm16 */
    1134                 case 0xbf:              /* mov edi, imm16 */
    1135                 case 0x2d:              /* sub eax, imm16 */
    1136                 case 0x35:              /* xor eax, imm16 */
    1137                 case 0x3d:              /* cmp eax, imm16 */
    1138                 case 0x68:              /* push <dword> */
    1139                 case 0xa1:              /* mov eax, moffs16 */
    1140                 case 0xa3:              /* mov moffs16, eax */
    1141                     if (cOpPrefix > 0)  /* FIXME see 32-bit interpreter. */
    1142                     {
    1143                         pach += 2;
    1144                         cb += 2;
    1145                     }
    1146                     pach += 2;
    1147                     cb += 2;
    1148                     break;
    1149 
    1150                 case 0x2e:              /* cs segment override */
    1151                 case 0x36:              /* ss segment override */
    1152                 case 0x3e:              /* ds segment override */
    1153                 case 0x26:              /* es segment override */
    1154                 case 0x64:              /* fs segment override */
    1155                 case 0x65:              /* gs segment override */
    1156                     fForce = TRUE;
    1157                     if (cOpPrefix > 0)
    1158                         cOpPrefix++;
    1159                     break;
    1160 
    1161                 case 0x66:
    1162                     cOpPrefix = 2;      /* it's decremented once before it's used. */
    1163                     fForce = TRUE;
    1164                     break;
    1165 
    1166                 case 0x6a:              /* push <byte> */
    1167                 case 0x3c:              /* mov al, imm8 */
    1168                     pach++;
    1169                     cb++;
    1170                     break;
    1171 
    1172                 case 0x8b:              /* mov /r */
    1173                 case 0x8c:              /* mov r/m16,Sreg  (= mov /r) */
    1174                 case 0x8e:              /* mov Sreg, r/m16 (= mov /r) */
    1175                     if ((pach[1] & 0xc0) == 0x80  /* ex. mov ax,bp+1114h */
    1176                         || ((pach[1] & 0xc0) == 0 && (pach[1] & 0x7) == 6)) /* ex. mov bp,0ff23h */
    1177                     {   /* 16-bit displacement */
    1178                         if (cOpPrefix > 0)
    1179                         {
    1180                             pach += 2;
    1181                             cb += 2;
    1182                         }
    1183                         pach += 3;
    1184                         cb += 3;
    1185                     }
    1186                     else
    1187                         if ((pach[1] & 0xc0) == 0x40) /* ex. mov ax,[si]+4fh */
    1188                     {   /* 8-bit displacement */
    1189                         pach += 2;
    1190                         cb += 2;
    1191                     }
    1192                     else
    1193                     {   /* no displacement (only /r byte) */
    1194                         pach++;
    1195                         cb++;
    1196                     }
    1197                     break;
    1198 
    1199                 /* complex sized instruction - "/5 ib" */
    1200                 case 0x80:              /* 5: sub r/m8, imm8  7: cmp r/m8, imm8 */
    1201                 case 0x83:              /* 5: sub r/m16, imm8 7: cmp r/m16, imm8 */
    1202                     if ((pach[1] & 0x38) == (5<<3)
    1203                         || (pach[1] & 0x38) == (7<<3)
    1204                         )
    1205                     {
    1206                         cb += cb2 = 1 + ModR_M_16bit(pach[1]); /* 1 is the size of the imm8 */
    1207                         pach += cb2;
    1208                     }
    1209                     else
    1210                     {
    1211                         kprintf(("interpretFunctionProlog16: unknown instruction (-3) 0x%x 0x%x 0x%x\n", pach[0], pach[1], pach[2]));
    1212                         return -3;
    1213                     }
    1214                     break;
    1215 
    1216                 case 0x9a:              /* call ptr16:16 */
    1217                     cb += cb2 = 4;
    1218                     pach += cb2;
    1219                     break;
    1220 
    1221                 default:
    1222                     kprintf(("interpretFunctionProlog16: unknown instruction 0x%x 0x%x 0x%x\n", pach[0], pach[1], pach[2]));
    1223                     return 0;
    1224             }
    1225             pach++;
    1226             cb++;
    1227             if (cOpPrefix > 0)
    1228                 cOpPrefix--;
    1229         }
    1230     }
    1231     else
    1232         kprintf(("interpretFunctionProlog16: unknown prolog 0x%x 0x%x 0x%x\n", pach[0], pach[1], pach[2]));
    1233 
    1234 
    1235     fOverload = fOverload;
    1236     return cb;
    1237 }
    1238 
    1239 
    1240 /**
    1241  * Verifies the aImportTab.
    1242  * @returns   16-bit errorcode where the high byte is the procedure number which
    1243  *            the error occured on and the low byte the error code.
    1244  * @remark    Called from IOCtl.
    1245  *            WARNING! This function is called before the initroutine (R0INIT)!
    1246  */
    1247 USHORT _loadds _Far32 _Pascal VerifyImportTab32(void)
    1248 {
    1249     USHORT  usRc;
    1250     int     i;
    1251     int     cb;
    1252     int     cbmax;
    1253 
    1254     /* VerifyImporTab32 is called before the initroutine! */
    1255     pulTKSSBase32 = (PULONG)_TKSSBase16;
    1256 
    1257     /* Check that pKrnlOTE is set */
    1258     usRc = GetKernelInfo32(NULL);
    1259     if (usRc != NO_ERROR)
    1260         return usRc;
    1261 
    1262     /*
    1263      * Verify aImportTab.
    1264      */
    1265     for (i = 0; i < NBR_OF_KRNLIMPORTS; i++)
    1266     {
    1267         /*
    1268          * Debug info
    1269          */
    1270         kprintf2(("VerifyImportTab32: procedure no.%d is being checked: %s addr=0x%08x iObj=%d offObj=%d\n",
    1271                   i, &aImportTab[i].achName[0], aImportTab[i].ulAddress,
    1272                   aImportTab[i].iObject, aImportTab[i].offObject));
    1273 
    1274         /* Verify that it is found */
    1275         if (!aImportTab[i].fFound)
    1276         {
    1277             if (EPTNotReq(aImportTab[i]))
    1278                 continue;
    1279             else
    1280             {
    1281                 kprintf(("VerifyImportTab32: procedure no.%d was not fFound!\n", i));
    1282                 return (USHORT)(ERROR_D32_PROC_NOT_FOUND | (i << ERROR_D32_PROC_SHIFT) | ERROR_D32_PROC_FLAG);
    1283             }
    1284         }
    1285 
    1286         /* Verify read/writeable. */
    1287         if (   aImportTab[i].iObject >= pKrnlSMTE->smte_objcnt                                /* object index valid? */
    1288             || aImportTab[i].ulAddress < pKrnlOTE[aImportTab[i].iObject].ote_base          /* address valid? */
    1289             || aImportTab[i].ulAddress + 16 > (pKrnlOTE[aImportTab[i].iObject].ote_base +
    1290                                                 pKrnlOTE[aImportTab[i].iObject].ote_size)  /* address valid? */
    1291             || aImportTab[i].ulAddress - aImportTab[i].offObject
    1292                != pKrnlOTE[aImportTab[i].iObject].ote_base                                 /* offObject ok?  */
    1293             )
    1294         {
    1295             kprintf(("VerifyImportTab32: procedure no.%d has an invalid address or object number.!\n"
    1296                      "                   %s  addr=0x%08x iObj=%d offObj=%d\n",
    1297                      i, &aImportTab[i].achName[0], aImportTab[i].ulAddress,
    1298                      aImportTab[i].iObject, aImportTab[i].offObject));
    1299             return (USHORT)(ERROR_D32_INVALID_OBJ_OR_ADDR | (i << ERROR_D32_PROC_SHIFT) | ERROR_D32_PROC_FLAG);
    1300         }
    1301 
    1302 
    1303         #ifndef R3TST
    1304         if (aImportTab[i].ulAddress < 0xff400000UL)
    1305         {
    1306             kprintf(("VerifyImportTab32: procedure no.%d has an invalid address, %#08x!\n",
    1307                      i, aImportTab[i].ulAddress));
    1308             return (USHORT)(ERROR_D32_INVALID_ADDRESS | (i << ERROR_D32_PROC_SHIFT) | ERROR_D32_PROC_FLAG);
    1309         }
    1310         #endif
    1311 
    1312         switch (aImportTab[i].fType & ~(EPT_BIT_MASK | EPT_NOT_REQ | EPT_WRAPPED | EPT_PROCIMPORTH))
    1313         {
    1314             case EPT_PROC:
    1315             case EPT_PROCIMPORT:
    1316                 /*
    1317                  * Verify known function prolog.
    1318                  */
    1319                 if (EPT32BitEntry(aImportTab[i]))
    1320                 {
    1321                     cb = interpretFunctionProlog32((char*)aImportTab[i].ulAddress, EPT32Proc(aImportTab[i]));
    1322                     cbmax = OVERLOAD32_ENTRY - 5; /* 5 = Size of the jump instruction */
    1323                 }
    1324                 else
    1325                 {
    1326                     cb = interpretFunctionProlog16((char*)aImportTab[i].ulAddress, EPT16Proc(aImportTab[i]));
    1327                     cbmax = OVERLOAD16_ENTRY - 5; /* 5 = Size of the jump instruction */
    1328                 }
    1329 
    1330                 /*
    1331                  * Check result of the function prolog interpretations.
    1332                  */
    1333                 if (cb <= 0 || cb > cbmax)
    1334                 {   /* failed, too small or too large. */
    1335                     kprintf(("VerifyImportTab32/16: verify failed for procedure no.%d (cb=%d), %s\n", i, cb, aImportTab[i].achName));
    1336                     return (USHORT)(ERROR_D32_TOO_INVALID_PROLOG | (i << ERROR_D32_PROC_SHIFT) | ERROR_D32_PROC_FLAG);
    1337                 }
    1338                 break;
    1339 
    1340             case EPT_VARIMPORT:
    1341                 /* do nothing! */
    1342                 break;
    1343 
    1344             default:
    1345                 kprintf(("VerifyImportTab32: invalid type/type not implemented. Proc no.%d, %s\n",i, aImportTab[i].achName));
    1346                 Int3(); /* temporary fix! */
    1347                 return (USHORT)(ERROR_D32_NOT_IMPLEMENTED | (i << ERROR_D32_PROC_SHIFT) | ERROR_D32_PROC_FLAG);
    1348         }
    1349     }
    1350 
    1351     return NO_ERROR;
    1352 }
    1353 
    1354 
    1355 /**
    1356  * Initiates the overrided functions.
    1357  * @returns   16-bit errorcode where the high byte is the procedure number which
    1358  *            the error occured on and the low byte the error code.
    1359  */
    1360 int importTabInit(void)
    1361 {
    1362     int     i;
    1363     int     cb;
    1364     int     cbmax;
    1365     char *  pchCTEntry;                 /* Pointer to current 32-bit calltab entry. */
    1366     char *  pchCTEntry16;               /* Pointer to current 16-bit calltab entry. */
    1367     ULONG   flWP;                       /* CR0 WP flag restore value. */
    1368 
    1369     /*
    1370      * Apply build specific changes to the auFuncs table
    1371      */
    1372     if (options.ulBuild < 14053)
    1373     {
    1374         #ifdef DEBUG
    1375         if (auFuncs[0] != (unsigned)myldrOpenPath)
    1376         {
    1377             kprintf(("importTabInit: ASSERTION FAILED auFuncs don't point at myldrOpenPath\n"));
    1378             Int3();
    1379         }
    1380         #endif
    1381         auFuncs[0] = (unsigned)myldrOpenPath_old;
    1382     }
    1383 
    1384 #ifdef R3TST
    1385     R3TstFixImportTab();
    1386 #endif
    1387 
    1388     /*
    1389      * verify proctable
    1390      */
    1391     for (i = 0; i < NBR_OF_KRNLIMPORTS; i++)
    1392     {
    1393         /* EPT_VARIMPORTs are skipped */
    1394         if ((aImportTab[i].fType & ~(EPT_BIT_MASK | EPT_NOT_REQ)) == EPT_VARIMPORT)
    1395             continue;
    1396         /* EPT_NOT_REQ which is not found are set pointing to the nop function provided. */
    1397         if (!aImportTab[i].fFound && EPTNotReq(aImportTab[i]))
    1398             continue;
    1399 
    1400         if (EPT32BitEntry(aImportTab[i]))
    1401         {
    1402             cb = interpretFunctionProlog32((char*)aImportTab[i].ulAddress, EPT32Proc(aImportTab[i]));
    1403 
    1404             cbmax = OVERLOAD16_ENTRY - 5; /* 5 = Size of the jump instruction */
    1405         }
    1406         else
    1407         {
    1408             cb = interpretFunctionProlog16((char*)aImportTab[i].ulAddress, EPT16Proc(aImportTab[i]));
    1409             cbmax = OVERLOAD16_ENTRY - 5; /* 5 = Size of the jump instruction */
    1410         }
    1411         if (cb <= 0 || cb > cbmax)
    1412         {
    1413             kprintf(("ImportTabInit: Verify failed for procedure no.%d, cb=%d\n", i, cb));
    1414             return ERROR_D32_VERIFY_FAILED | (i << ERROR_D32_PROC_SHIFT) | ERROR_D32_PROC_FLAG;
    1415         }
    1416     }
    1417 
    1418     /*
    1419      * rehook / import
    1420      */
    1421     pchCTEntry = &callTab[0];
    1422     pchCTEntry16 = &callTab16[0];
    1423     flWP = x86DisableWriteProtect();
    1424     for (i = 0; i < NBR_OF_KRNLIMPORTS; i++)
    1425     {
    1426         switch (aImportTab[i].fType & ~EPT_WRAPPED)
    1427         {
    1428             /*
    1429              * 32-bit procedure overload.
    1430              * The overloading procedure is found in the auFuncs table (at the same index
    1431              *   as the overloaded procedure has in aImportTab).
    1432              * The overloaded procedure is called by issuing a call to the callTab entry.
    1433              */
    1434             case EPT_PROC32:
    1435             {
    1436                 cb = interpretFunctionProlog32((char*)aImportTab[i].ulAddress, TRUE);
    1437                 aImportTab[i].cbProlog = (char)cb;
    1438                 if (cb >= 5 && cb + 5 < OVERLOAD32_ENTRY) /* 5(1st): size of jump instruction in the function prolog which jumps to my overloading function */
    1439                 {                                         /* 5(2nd): size of jump instruction which jumps back to the original function after executing the prolog copied to the callTab entry for this function. */
    1440                     /*
    1441                      * Copy function prolog which will be overwritten by the jmp to calltabl.
    1442                      */
    1443                     memcpy(pchCTEntry, (void*)aImportTab[i].ulAddress, (size_t)cb);
    1444 
    1445                     /*
    1446                      * Make jump instruction which jumps from calltab to original function.
    1447                      * 0xE9 <four bytes displacement>
    1448                      * Note: the displacement is relative to the next instruction
    1449                      */
    1450                     pchCTEntry[cb] = 0xE9; /* jmp */
    1451                     *(unsigned long*)(void*)&pchCTEntry[cb+1] = aImportTab[i].ulAddress + cb - (unsigned long)&pchCTEntry[cb+5];
    1452 
    1453                     /*
    1454                      * Jump from original function to my function - an cli(?) could be needed here
    1455                      */
    1456                     *(char*)aImportTab[i].ulAddress = 0xE9; /* jmp */
    1457                     *(unsigned long*)(aImportTab[i].ulAddress + 1) = auFuncs[i] - (aImportTab[i].ulAddress + 5);
    1458                 }
    1459                 else
    1460                 {   /* !fatal! - this could never happen really... */
    1461                     kprintf(("ImportTabInit: FATAL verify failed for procedure no.%d when rehooking it!\n", i));
    1462                     Int3(); /* ipe - later! */
    1463                     x86RestoreWriteProtect(flWP);
    1464                     return ERROR_D32_IPE | (i << ERROR_D32_PROC_SHIFT) | ERROR_D32_PROC_FLAG;
    1465                 }
    1466                 pchCTEntry += OVERLOAD32_ENTRY;
    1467                 break;
    1468             }
    1469 
    1470 
    1471             /*
    1472              * 16-bit procedure overload.
    1473              * Currently disabled due to expected problems when calltab is a 32-bit segment.
    1474              */
    1475             case EPT_PROC16:
    1476             {
    1477                 cb = interpretFunctionProlog16((char*)aImportTab[i].ulAddress, TRUE);
    1478                 aImportTab[i].cbProlog = (char)cb;
    1479                 if (cb >= 5 && cb + 5 < OVERLOAD16_ENTRY) /* 5:    size of a 16:16 jump which jumps to my overloading function */
    1480                 {                                         /* cb+5: size of a 16:16 jump which is added to the call tab */
    1481                     /*
    1482                      * Copy function prolog which is to be overwritten.
    1483                      */
    1484                     memcpy(pchCTEntry16, (void*)aImportTab[i].ulAddress, (size_t)cb);
    1485 
    1486                     /*
    1487                      * Create far jump from calltab to original function.
    1488                      * 0xEA <two byte target address> <two byte target selector>
    1489                      */
    1490                     pchCTEntry16[cb] = 0xEA; /* jmp far ptr */
    1491                     *(unsigned short*)(void*)&pchCTEntry16[cb+1] = (unsigned short)aImportTab[i].offObject + cb;
    1492                     *(unsigned short*)(void*)&pchCTEntry16[cb+3] = aImportTab[i].usSel;
    1493 
    1494                     /*
    1495                      * We store the far 16:16 pointer to the function in the last four
    1496                      * bytes of the entry. Set them!
    1497                      */
    1498                     *(unsigned short*)(void*)&pchCTEntry16[OVERLOAD16_ENTRY-4] = (unsigned short)aImportTab[i].offObject;
    1499                     *(unsigned short*)(void*)&pchCTEntry16[OVERLOAD16_ENTRY-2] = aImportTab[i].usSel;
    1500 
    1501                     /*
    1502                      * jump from original function to my function - an cli(?) could be needed here
    1503                      * 0xEA <two byte target address> <two byte target selector>
    1504                      */
    1505                     *(char*)(aImportTab[i].ulAddress) = 0xEA;    /* jmp far ptr */
    1506                     *(unsigned long*)(aImportTab[i].ulAddress + 1) = auFuncs[i]; /* The auFuncs entry is a far pointer. */
    1507                 }
    1508                 else
    1509                 {   /* !fatal! - this could never happen really... */
    1510                     kprintf(("ImportTabInit: FATAL verify failed for procedure no.%d when rehooking it!\n", i));
    1511                     Int3(); /* ipe - later! */
    1512                     x86RestoreWriteProtect(flWP);
    1513                     return ERROR_D32_IPE | (i << ERROR_D32_PROC_SHIFT) | ERROR_D32_PROC_FLAG;
    1514                 }
    1515                 pchCTEntry16 += OVERLOAD16_ENTRY;
    1516                 break;
    1517             }
    1518 
    1519 
    1520             /*
    1521              * 32-bit imported procedure.
    1522              * This is called by issuing a near call to the callTab entry.
    1523              */
    1524             case EPT_PROCIMPORTNR32:     /* Not required */
    1525                 if (!(pchCTEntry[6] = aImportTab[i].fFound))
    1526                     aImportTab[i].ulAddress = auFuncs[i];
    1527             case EPT_PROCIMPORT32:
    1528             {
    1529                 cb = interpretFunctionProlog32((char*)aImportTab[i].ulAddress, FALSE);
    1530                 aImportTab[i].cbProlog = (char)cb;
    1531                 if (cb > 0) /* Since no prolog part is copied to the function table, it's ok as long as the prolog has been recognzied. */
    1532                 {
    1533                     /*
    1534                      * Make jump instruction which jumps from calltab to original function.
    1535                      * 0xE9 <four bytes displacement>
    1536                      * Note: the displacement is relative to the next instruction
    1537                      */
    1538                     pchCTEntry[0] = 0xE9; /* jmp */
    1539                     *(unsigned*)(void*)&pchCTEntry[1] = aImportTab[i].ulAddress - (unsigned)&pchCTEntry[5];
    1540                 }
    1541                 else
    1542                 {   /* !fatal! - this should never really happen... */
    1543                     kprintf(("ImportTabInit: FATAL verify failed for procedure no.%d when importing it!\n", i));
    1544                     Int3(); /* ipe - later! */
    1545                     x86RestoreWriteProtect(flWP);
    1546                     return ERROR_D32_IPE | (i << ERROR_D32_PROC_SHIFT) | ERROR_D32_PROC_FLAG;
    1547                 }
    1548                 pchCTEntry += IMPORT32_ENTRY;
    1549                 break;
    1550             }
    1551 
    1552 
    1553             /*
    1554              * 16-bit imported procedure.
    1555              * This is called by issuing a far call to the calltab entry.
    1556              */
    1557             case EPT_PROCIMPORTNR16:    /* Not required */
    1558                 if (!(pchCTEntry[7] = aImportTab[i].fFound))
    1559                 {
    1560                     aImportTab[i].ulAddress = auFuncs[i];
    1561                     Int3();
    1562                     break;
    1563                 }
    1564             case EPT_PROCIMPORT16:
    1565             {
    1566                 cb = interpretFunctionProlog16((char*)aImportTab[i].ulAddress, FALSE);
    1567                 aImportTab[i].cbProlog = (char)cb;
    1568                 if (cb > 0) /* Since no prolog part is copied to the function table, it's ok as long as the prolog has been recognzied. */
    1569                 {
    1570                     /*
    1571                      * Create far jump from calltab to original function.
    1572                      * 0xEA <four byte target address> <two byte target selector>
    1573                      */
    1574                     pchCTEntry[0] = 0xEA; /* jmp far ptr */
    1575                     *(unsigned long*)(void*)&pchCTEntry[1] = aImportTab[i].offObject;
    1576                     *(unsigned short*)(void*)&pchCTEntry[5] = aImportTab[i].usSel;
    1577                 }
    1578                 else
    1579                 {   /* !fatal! - this should never really happen... */
    1580                     kprintf(("ImportTabInit: FATAL verify failed for procedure no.%d when importing it!\n", i));
    1581                     Int3(); /* ipe - later! */
    1582                     x86RestoreWriteProtect(flWP);
    1583                     return ERROR_D32_IPE | (i << ERROR_D32_PROC_SHIFT) | ERROR_D32_PROC_FLAG;
    1584                 }
    1585                 pchCTEntry += IMPORT16_ENTRY;
    1586                 break;
    1587             }
    1588 
    1589 
    1590             /*
    1591              * 16-bit imported hybrid procedure.
    1592              * This is called by issuing a far call to the 16-bit calltab entry.
    1593              */
    1594             case EPT_PROCIMPORTH16:
    1595             {
    1596                 cb = interpretFunctionProlog16((char*)aImportTab[i].ulAddress, FALSE);
    1597                 aImportTab[i].cbProlog = (char)cb;
    1598                 if (cb > 0) /* Since no prolog part is copied to the function table, it's ok as long as the prolog has been recognzied. */
    1599                 {
    1600                     /*
    1601                      * Create far jump from calltab to original function.
    1602                      * 0xEA <four byte target address> <two byte target selector>
    1603                      */
    1604                     pchCTEntry16[0] = 0xEA; /* jmp far ptr */
    1605                     *(unsigned short*)(void*)&pchCTEntry16[1] = aImportTab[i].offObject;
    1606                     *(unsigned short*)(void*)&pchCTEntry16[3] = aImportTab[i].usSel;
    1607                 }
    1608                 else
    1609                 {   /* !fatal! - this should never really happen... */
    1610                     kprintf(("ImportTabInit: FATAL verify failed for procedure no.%d when importing it!\n", i));
    1611                     Int3(); /* ipe - later! */
    1612                     x86RestoreWriteProtect(flWP);
    1613                     return ERROR_D32_IPE | (i << ERROR_D32_PROC_SHIFT) | ERROR_D32_PROC_FLAG;
    1614                 }
    1615                 pchCTEntry16 += IMPORTH16_ENTRY;
    1616                 break;
    1617             }
    1618 
    1619 
    1620             /*
    1621              * 16/32-bit importe variable.
    1622              * This is used by accessing the 32-bit flat address in the callTab.
    1623              * callTab-entry + 4 holds the offset of the variable into the object.
    1624              * callTab-entry + 8 holds the selector for the object. (These two fields is the 16:32-bit pointer to the variable.)
    1625              * callTab-entry + a holds the 16-bit offset for the variable.
    1626              * callTab-entry + c holds the selector for the object. (These two fields is the 16:16-bit pointer to the variable.)
    1627              */
    1628             case EPT_VARIMPORTNR32:
    1629             case EPT_VARIMPORTNR16:
    1630                 if (!aImportTab[i].fFound)
    1631                 {
    1632                     memset(pchCTEntry, 0, VARIMPORT_ENTRY);
    1633                     pchCTEntry += VARIMPORT_ENTRY;
    1634                     break;
    1635                 }
    1636             case EPT_VARIMPORT32:
    1637             case EPT_VARIMPORT16:
    1638                 aImportTab[i].cbProlog = (char)0;
    1639                 *(unsigned long*)(void*)&pchCTEntry[0] = aImportTab[i].ulAddress;
    1640                 *(unsigned long*)(void*)&pchCTEntry[4] = aImportTab[i].offObject;
    1641                 *(unsigned short*)(void*)&pchCTEntry[8] = aImportTab[i].usSel;
    1642                 *(unsigned short*)(void*)&pchCTEntry[0xa] = (unsigned short)aImportTab[i].offObject;
    1643                 *(unsigned short*)(void*)&pchCTEntry[0xc] = aImportTab[i].usSel;
    1644                 pchCTEntry += VARIMPORT_ENTRY;
    1645                 break;
    1646 
    1647             default:
    1648                 kprintf(("ImportTabInit: unsupported type. (procedure no.%d, cb=%d)\n", i, cb));
    1649                 Int3(); /* ipe - later! */
    1650                 x86RestoreWriteProtect(flWP);
    1651                 return ERROR_D32_IPE | (i << ERROR_D32_PROC_SHIFT) | ERROR_D32_PROC_FLAG;
    1652         } /* switch - type */
    1653     }   /* for */
    1654 
    1655     x86RestoreWriteProtect(flWP);
    1656 
    1657     return NO_ERROR;
    1658 }
    1659 
    1660 
    1661 #ifdef R3TST
    1662 /**
    1663  * Creates a fake kernel MTE, SMTE and OTE for use while testing in Ring3.
    1664  * @returns Pointer to the fake kernel MTE.
    1665  * @status  completely implemented.
    1666  * @author  knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    1667  */
    1668 PMTE GetOS2KrnlMTETst(void)
    1669 {
    1670     static MTE    KrnlMTE;
    1671     static SMTE   KrnlSMTE;
    1672 
    1673     KrnlMTE.mte_swapmte = &KrnlSMTE;
    1674     KrnlSMTE.smte_objtab = &aKrnlOTE[0];
    1675     KrnlSMTE.smte_objcnt = cObjectsFake;
    1676 
    1677     return &KrnlMTE;
    1678 }
    1679 
    1680 /**
    1681  * -Ring-3 testing-
    1682  * Changes the entries in aImportTab to point to their fake equivalents.
    1683  * @returns void
    1684  * @param   void
    1685  * @status  completely implemented.
    1686  * @author  knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    1687  * @remark  Called before the aImportTab array is used/verified.
    1688  */
    1689 VOID R3TstFixImportTab(VOID)
    1690 {
    1691     int i;
    1692 
    1693     for (i = 0; i < NBR_OF_KRNLIMPORTS; i++)
    1694     {
    1695         switch (aImportTab[i].fType & ~EPT_NOT_REQ)
    1696         {
    1697             case EPT_PROC32:
    1698                 if (aTstFakers[i].fObj != 1)
    1699                     kprintf(("R3TstFixImportTab: invalid segment config for entry %i. (PROC32)\n", i));
    1700                 break;
    1701             case EPT_PROCIMPORT32:
    1702                 if (aTstFakers[i].fObj != 1)
    1703                     kprintf(("R3TstFixImportTab: invalid segment config for entry %i. (PROCIMPORT32)\n", i));
    1704                 break;
    1705             case EPT_PROCIMPORT16:
    1706                 if (aTstFakers[i].fObj != 2)
    1707                     kprintf(("R3TstFixImportTab: invalid segment config for entry %i. (PROCIMPORT16)\n", i));
    1708                 break;
    1709             case EPT_VARIMPORT32:
    1710             case EPT_VARIMPORT16:
    1711                 if (aTstFakers[i].fObj != 3 && aTstFakers[i].fObj != 4)
    1712                     kprintf(("R3TstFixImportTab: invalid segment config for entry %i. (VARIMPORT32/16)\n", i));
    1713                 break;
    1714         } /* switch - type */
    1715 
    1716         aImportTab[i].ulAddress = aTstFakers[i].uAddress;
    1717         switch (aTstFakers[i].fObj)
    1718         {
    1719             case 1:
    1720                 aImportTab[i].usSel = GetSelectorCODE32();
    1721                 aImportTab[i].offObject = aTstFakers[i].uAddress - (unsigned)&CODE32START;
    1722                 break;
    1723             case 2:
    1724                 aImportTab[i].usSel = GetSelectorCODE16();
    1725                 aImportTab[i].offObject = aTstFakers[i].uAddress - (unsigned)&CODE16START;
    1726                 break;
    1727             case 3:
    1728                 aImportTab[i].usSel = GetSelectorDATA32();
    1729                 aImportTab[i].offObject = aTstFakers[i].uAddress - (unsigned)&DATA32START;
    1730                 break;
    1731             case 4:
    1732                 aImportTab[i].usSel = GetSelectorDATA16();
    1733                 aImportTab[i].offObject = aTstFakers[i].uAddress - (unsigned)&DATA16START;
    1734                 break;
    1735             default:
    1736                 kprintf(("R3TstFixImportTab: invalid segment config for entry %i.\n", i));
    1737         }
    1738     } /* for */
    1739 }
    1740 #endif
    1741 
    1742 /**
    1743  * Dummy nop function if SecPathFromSFN isn't found.
    1744  */
    1745 PSZ SECCALL nopSecPathFromSFN(SFN hFile)
    1746 {
    1747     NOREF(hFile);
    1748     return NULL;
    1749 }
  • branches/splittup/src/win32k/dev32/devfirst.asm

    r6280 r6841  
    1 ; $Id: devfirst.asm,v 1.9 2001-07-10 05:19:34 bird Exp $
     1; $Id: devfirst.asm,v 1.9.2.1 2001-09-27 03:08:14 bird Exp $
    22;
    33; DevFirst - entrypoint and segment definitions
     
    3333    public EH_DATASTART
    3434
    35 
    36     public _strategyAsm0
    37     public _strategyAsm1
    38     public _CallGetKernelInfo32
    39     public _CallElfIOCtl
     35    public _strategyAsm
    4036    public _CallWin32kIOCtl
    4137    public _CallWin32kOpen
    4238    public _CallWin32kClose
    4339    public _SSToDS_16a
    44     public GetOS2KrnlMTE
    45     public x86DisableWriteProtect
    46     public x86RestoreWriteProtect
    4740
    4841
     
    5043; Externs
    5144;
    52     extrn _TKSSBase16:dword
    53     extrn GETKERNELINFO32:FAR
    54     extrn ELFIOCTL:FAR
     45    extrn _TKSSBase:dword
    5546    extrn WIN32KIOCTL:FAR
    5647    extrn WIN32KOPEN:FAR
     
    6455    ASSUME CS:CODE16, DS:DATA16, ES:NOTHING, SS:NOTHING
    6556
    66 CODE16START label byte
     57CODE16START db 'CODE16START',0
     58
    6759
    6860    .286p
    69 ;$win32ki entry point
    70 _strategyAsm0:
    71 ;    int 3
    72     push    0
    73     jmp     _strategyAsm
    74 
    75 ;$win32k entry point
    76 _strategyAsm1:
    77 ;    int 3
    78     push    1
    79     jmp     _strategyAsm
    80 
    8161;;
    8262; Stub which pushes parameters onto the stack and call the 16-bit C strategy routine.
     
    9979    .386p
    10080;;
    101 ; Thunk procedure for R0Init32.
    102 ; @cproto    USHORT NEAR CallGetKernelInfo32(ULONG addressKrnlInfoBuf);
    103 ; @returns   Same as GetKernelInfo32.
    104 ; @param     addressKrnlInfoBuf  32-bit pointer to request data on stack.
    105 ; @status    completely implemented.
    106 ; @author    knut st. osmundsen
    107 _CallGetKernelInfo32 PROC NEAR
    108     ASSUME CS:CODE16
    109     push    ds
    110     push    word ptr [esp+6]            ; push high word.
    111     push    word ptr [esp+6]            ; push low word.
    112     call    far ptr FLAT:GETKERNELINFO32
    113     pop     ds
    114     ret
    115 _CallGetKernelInfo32 ENDP
    116 
    117 
    118 
    119 
    120 ;;
    121 ; Thunk procedure for .
    122 ; @cproto    USHORT NEAR CallElfIOCtl(void);
    123 ; @returns   Same as ElfIOCtl
    124 ; @param     address of IOCtl request packet (32-bit pointer).
    125 ; @status    completely implemented.
    126 ; @author    knut st. osmundsen
    127 _CallElfIOCtl PROC NEAR
    128     ASSUME CS:CODE16
    129     push    ds
    130     push    word ptr [esp+6]            ; push high word.
    131     push    word ptr [esp+6]            ; push low word.
    132     call    far ptr FLAT:ELFIOCTL
    133     pop     ds
    134     retn
    135 _CallElfIOCtl ENDP
    136 
    137 ;;
    13881; Thunk procedure for .
    13982; @cproto    USHORT NEAR CallWin32kIOCtl(void);
     
    189132
    190133
    191 
    192134;;
    193135; SSToDS - stack pointer to Flat pointer.
     
    204146_SSToDS_16a proc NEAR
    205147    assume CS:CODE16, DS:DATA16, ES:NOTHING
    206     mov     edx, ds:_TKSSBase16         ; get pointer held by _TKSSBase16 (pointer to stack base)
    207148    call    far ptr FLAT:far_getCS      ; get flat selector.
    208149    push    es
    209150    mov     es,  ax
    210151    assume  es:FLAT
    211     mov     eax, es:[edx]               ; get pointer to stack base
     152    mov     eax, es:_TKSSBase           ; get pointer to stack base
    212153    pop     es
    213154    movzx   edx, word ptr ss:[esp + 2]  ; 16-bit stack pointer (parameter)
     
    262203    ret
    263204GetOS2KrnlMTE ENDP
    264 
    265 
    266 ;;
    267 ; Disables the ring-0 write protection.
    268 ; It's used to help us write to readonly code segments and objects.
    269 ; @cproto   extern ULONG    _Optlink x86DisableWriteProtect(void);
    270 ; @return   Previous write protection flag setting.
    271 ; @uses     eax, edx
    272 ; @status   completely implemented.
    273 ; @author   knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    274 ; @remark   Used by importTabInit.
    275 x86DisableWriteProtect proc near
    276     cli
    277     mov     edx, cr0                    ; Get current cr0
    278     test    edx, 000010000h             ; Test for the WriteProtect flag (bit 16)
    279     setnz   al
    280     movzx   eax, al                     ; Old flag setting in eax (return value)
    281     and     edx, 0fffeffffh             ; Clear the 16th (WP) bit.
    282     mov     cr0, edx                    ;
    283     sti
    284     ret                                 ; return eax holds previous WP value.
    285 x86DisableWriteProtect endp
    286 
    287 
    288 ;;
    289 ; Restore the WP flag of CR0 to it's previous state.
    290 ; The call is intent only to be called with the result from x86DisableWriteProtect,
    291 ; and will hence only enable the WP flag.
    292 ; @cproto   extern ULONG    _Optlink x86RestoreWriteProtect(ULONG flWP);
    293 ; @return   Previous write protection flag setting.
    294 ; @param    eax - flWP  Boolean value. (1 = WP was set, 0 WP was clear)
    295 ; @uses     eax
    296 ; @status   completely implemented.
    297 ; @author   knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    298 ; @remark   Used by importTabInit.
    299 x86RestoreWriteProtect proc near
    300     test    eax, eax                    ; Check if the flag was previously clear
    301     jnz     x86RWP_set                  ; If set Then Set it back.
    302     jmp     x86RWP_end                  ; If clear Then nothing to do.
    303 x86RWP_set:
    304     cli
    305     mov     eax, cr0                    ; Get current cr0.
    306     or      eax, 000010000h             ; The the 16-bit (WP) bit.
    307     mov     cr0, eax                    ; Update cr0.
    308     sti
    309 
    310 x86RWP_end:
    311     ret
    312 x86RestoreWriteProtect endp
    313205
    314206
     
    367259
    368260CODE16_INIT segment
    369 CODE16_INITSTART label byte
     261CODE16_INITSTART db 'CODE16_INITSTART',0
    370262CODE16_INIT ends
    371263
    372264DATA16 segment
    373 DATA16START label byte
     265DATA16START label byte ; no string here!!
    374266DATA16 ends
    375267
    376268DATA16_BSS segment
    377 DATA16_BSSSTART label byte
     269DATA16_BSSSTART db 'DATA16_BSSSTART',0
    378270DATA16_BSS ends
    379271
    380272DATA16_CONST segment
    381 DATA16_CONSTSTART label byte
     273DATA16_CONSTSTART db 'DATA16_CONSTSTART', 0
    382274DATA16_CONST ends
    383275
    384276DATA16_INIT segment
    385 DATA16_INITSTART label byte
     277DATA16_INITSTART db 'DATA16_INITSTART',0
    386278DATA16_INIT ends
    387279
    388280DATA32 segment
    389 DATA32START label byte
     281DATA32START db 'DATA32START',0
    390282DATA32 ends
    391283
    392284BSS32 segment
    393 BSS32START label byte
     285BSS32START db 'BSS32START',0
    394286BSS32 ends
    395287
    396288CONST32_RO segment
    397 CONST32_ROSTART label byte
     289CONST32_ROSTART db 'CONST32_ROSTART',0
    398290CONST32_RO ends
    399291
    400292_VFT segment
    401 _VFTSTART LABEL BYTE
     293_VFTSTART db '_VFTSTART',0
    402294_VFT ends
    403295
    404296EH_DATA segment
    405 EH_DATASTART LABEL BYTE
     297EH_DATASTART db 'EH_DATASTART',0
    406298EH_DATA ends
    407299
  • branches/splittup/src/win32k/dev32/devlast.asm

    r4164 r6841  
    1 ; $Id: devlast.asm,v 1.6 2000-09-02 21:07:58 bird Exp $
     1; $Id: devlast.asm,v 1.6.2.1 2001-09-27 03:08:15 bird Exp $
    22;
    33; DevLast - the object file termintating the resident part of the objects.
     
    55; after this file is discarded after init.
    66;
    7 ; Copyright (c) 1999 knut st. osmundsen
     7; Copyright (c) 1999-2001 knut st. osmundsen (kosmunds@csc.com)
    88;
    99; Project Odin Software License can be found in LICENSE.TXT
     
    3636    public EH_DATAEND
    3737
    38     public _CallR0Init32
    39     public _CallVerifyImportTab32
     38    public _GetR0InitPtr
    4039
    41 
     40;
     41;   External Functions
     42;
     43    extrn R0Init:PROC
    4244
    4345;
     
    4547;
    4648DATA16 segment
    47 DATA16END db ?
     49db 'DATA16END'
     50DATA16END db 0
    4851DATA16 ends
    4952
    5053DATA16_BSS segment
    51 DATA16_BSSEND db ?
     54db 'DATA16_BSSEND'
     55DATA16_BSSEND db 0
    5256DATA16_BSS ends
    5357
    5458DATA16_CONST segment
    55 DATA16_CONSTEND db ?
     59db 'DATA16_CONSTEND'
     60DATA16_CONSTEND db 0
    5661DATA16_CONST ends
    5762
    5863DATA16_INIT segment
    59 DATA16_INITEND db ?
     64db 'DATA16_INITEND'
     65DATA16_INITEND db 0
    6066DATA16_INIT ends
    6167
    6268DATA16_INIT_BSS segment
    63 DATA16_INIT_BSSEND db ?
     69db 'DATA16_INIT_BSSEND'
     70DATA16_INIT_BSSEND db 0
    6471DATA16_INIT_BSS ends
    6572
    6673DATA16_INIT_CONST segment
    67 DATA16_INIT_CONSTEND db ?
     74db 'DATA16_INIT_CONSTEND'
     75DATA16_INIT_CONSTEND db 0
    6876DATA16_INIT_CONST ends
    6977
    7078CODE16 segment
    71 CODE16END db ?
     79db 'CODE16END'
     80CODE16END db 0
    7281CODE16 ends
    7382
    74 extrn R0INIT32:FAR
    75 extrn VERIFYIMPORTTAB32:FAR
    7683
    7784CODE16_INIT segment
    7885;;
    79 ; Thunk procedure for R0Init32.
    80 ; @cproto    USHORT NEAR CallR0Init32(LIN pRpInit);
    81 ; @returns   Same as R0Init32.
    82 ; @param     pRpInit  32-bit pointer to request packet.
    83 ; @status    completely implemented.
    84 ; @author    knut st. osmundsen
    85 _CallR0Init32 PROC NEAR
    86     ASSUME CS:CODE16_INIT
    87     push    ds
    88     push    word ptr [esp+6]            ; push high word.
    89     push    word ptr [esp+6]            ; push low word.
    90     call    far ptr FLAT:R0INIT32
    91     pop     ds
     86; Gets the 32-bit flat pointer of R0Init. (32-bit init function)
     87; @cproto   ULONG GetR0InitPtr(void);
     88; @returns  Flat pointer to R0Init. (ax:dx)
     89; @uses     uses eax, edx.
     90; @author   knut st. osmundsen (kosmunds@csc.com)
     91_GetR0InitPtr PROC NEAR
     92    assume ds:nothing, ss:nothing, es:nothing
     93    mov     eax, offset FLAT:CODE32:R0Init
     94    mov     edx, eax
     95    shr     edx, 16
    9296    ret
    93 _CallR0Init32 ENDP
     97_GetR0InitPtr ENDP
    9498
    95 
    96 ;;
    97 ; Thunk procedure for VerifyImportTab32.
    98 ; @cproto    USHORT NEAR CallVerifyImportTab32(void);
    99 ; @returns   Same as VerifyImportTab32.
    100 ; @status    completely implemented.
    101 ; @author    knut st. osmundsen
    102 _CallVerifyImportTab32 PROC NEAR
    103     ASSUME CS:CODE16_INIT
    104     push    ds
    105     call    far ptr FLAT:VERIFYIMPORTTAB32
    106     pop     ds
    107     ret
    108 _CallVerifyImportTab32 ENDP
    109 
    110 CODE16_INITEND LABEL BYTE
     99db 'CODE16_INITEND'
     100CODE16_INITEND db 0
    111101CODE16_INIT ends
    112102
    113103
    114104CODE32 segment
    115 CODE32END LABEL BYTE
     105db 'CODE32END'
     106CODE32END db 0
    116107CODE32 ends
    117108
    118109DATA32 segment
    119 DATA32END  LABEL BYTE
     110db 'DATA32END'
     111DATA32END  db 0
    120112DATA32 ends
    121113
    122114BSS32 segment
    123 BSS32END  LABEL BYTE
     115db 'BSS32END'
     116BSS32END  db 0
    124117BSS32 ends
    125118
    126119CONST32_RO segment
    127 CONST32_ROEND LABEL BYTE
     120db 'CONST32_ROEND'
     121CONST32_ROEND db 0
    128122CONST32_RO ends
    129123
    130124_VFT segment
    131 _VFTEND LABEL BYTE
     125db '_VFTEND'
     126_VFTEND db 0
    132127_VFT ends
    133128
    134129EH_DATA segment
    135 EH_DATAEND LABEL BYTE
     130db 'EH_DATAEND'
     131EH_DATAEND db 0
    136132EH_DATA ends
    137133
  • branches/splittup/src/win32k/include/PerTaskW32kData.h

    r6296 r6841  
    1 /* $Id: PerTaskW32kData.h,v 1.2 2001-07-10 16:41:10 bird Exp $
     1/* $Id: PerTaskW32kData.h,v 1.2.2.1 2001-09-27 03:08:17 bird Exp $
    22 *
    33 * Per Task (Win32k) Data.
     
    1818typedef struct _PerTaskData
    1919{
    20     AVLNODECORE     core;
     20    AVLPVNODECORE   core;
    2121    ULONG           cUsage;             /* Usage counter. */
    2222    PPTDA           pPTDA;              /* Also in core.Key */
  • branches/splittup/src/win32k/include/dev16.h

    r6227 r6841  
    1 /* $Id: dev16.h,v 1.11 2001-07-08 03:05:28 bird Exp $
     1/* $Id: dev16.h,v 1.11.2.1 2001-09-27 03:08:17 bird Exp $
    22 * dev16 - 16-bit specific. Should not be used in 32-bit C/C++.
    33 *
    4  * Copyright (c) 1999 knut st. osmundsen
     4 * Copyright (c) 1999-2001 knut st. osmundsen (kosmunds@csc.com)
    55 *
    66 * Project Odin Software License can be found in LICENSE.TXT
     
    2121#endif
    2222
    23 /*
    24  * Ring 0 init IOCtl (dev1 -> dev0)
    25  */
    26 #define D16_IOCTL_CAT               0xC0
    27 #define D16_IOCTL_RING0INIT         0x40
    28 typedef struct _D16R0INITDATA
    29 {
    30     USHORT usRcInit32;
    31 } D16R0INITDATA;
    32 typedef D16R0INITDATA FAR *PD16R0INITDATA;
    33 
    34 typedef struct _D16R0INITPARAM
    35 {
    36     PRPINITIN pRpInitIn;
    37 } D16R0INITPARAM;
    38 typedef D16R0INITPARAM FAR *PD16R0INITPARAM;
    39 
    40 
    41 /*
    42  * Get Kernel OTEs. No params. Data is KRNLOBJTABLE (dev1632.h).
    43  */
    44 #define D16_IOCTL_GETKRNLINFO       0x41
    45 
    46 
    47 /*
    48  * Verify aImportTab. No params. No data (aImportTab is used).
    49  */
    50 #define D16_IOCTL_VERIFYIMPORTTAB   0x42
    51 typedef struct _D16VERIFYIMPORTTABDATA
    52 {
    53     USHORT usRc;
    54 } D16VERIFYIMPORTTABDATA;
    55 typedef D16VERIFYIMPORTTABDATA FAR *PD16VERIFYIMPORTTABDATA;
    56 
    57 
    58 /**
    59  * Regards goes to Matthieu Willm for (parts of) this!
    60  */
    61 #ifdef INCL_16
    62     typedef void FAR * FPVOID;
    63 #else
    64     typedef ULONG FPVOID;
    65 #endif
    66 typedef struct _DosTable /* dt */
    67 {
    68     UCHAR  cul;             /* count of entries (dwords) in this table.*/
    69     FPVOID fph_HardError;
    70     FPVOID fph_UCase;
    71     ULONG  UnknownOrReserved1;
    72     ULONG  UnknownOrReserved2;
    73     ULONG  UnknownOrReserved3;
    74     FPVOID fph_MemMapAlias;
    75     FPVOID fph_MemUnmapAlias;
    76     FPVOID fph_GoProtAll;
    77     FPVOID fph_GoRealAll;
    78     FPVOID fph_doshlp_RedirDev;
    79     ULONG  UnknownOrReserved4;
    80     ULONG  UnknownOrReserved5;
    81     FPVOID fph_SFFromSFN;
    82     FPVOID fph_SegGetInfo;
    83     FPVOID fph_AsgCheckDrive;
    84     ULONG  UnknownOrReserved6;
    85     ULONG  UnknownOrReserved7;
    86 } DOSTABLE, FAR *PDOSTABLE , NEAR *NPDOSTABLE;
    87 
    88 typedef struct _DosTable2 /* dt2 */
    89 {
    90     UCHAR  cul;             /* count of entries (dwords) in this table.*/
    91     FPVOID fpErrMap24;
    92     FPVOID fpErrMap24End;
    93     FPVOID fpErr_Table_24;
    94     FPVOID fpCDSAddr;
    95     FPVOID fpGDT_RDR1;
    96     FPVOID fpInterrupLevel;
    97     FPVOID fp_cInDos;
    98     ULONG  UnknownOrReserved1;
    99     ULONG  UnknownOrReserved2;
    100     ULONG  R0FlatCS;
    101     ULONG  R0FlatDS;
    102     LIN    pTKSSBase;
    103     LIN    pintSwitchStack;
    104     LIN    pprivatStack;
    105     FPVOID fpPhysDiskTablePtr;
    106     LIN    pforceEMHandler;
    107     LIN    pReserveVM;
    108     LIN    p_pgpPageDir;
    109     ULONG  UnknownOrReserved3;
    110 } DOSTABLE2, FAR *PDOSTABLE2 , NEAR *NPDOSTABLE2;
    111 
    11223
    11324/*
    11425 * init functions
    11526 */
    116 USHORT NEAR dev0Init(PRPINITIN pRpIn, PRPINITOUT pRpOut);
    117 USHORT NEAR dev1Init(PRPINITIN pRpIn, PRPINITOUT pRpOut);
    118 USHORT NEAR R0Init16(PRP_GENIOCTL pRp);
    119 USHORT NEAR initGetDosTableData(void);
    120 #if 0 /*ndef CODE16_INIT*/
    121 #pragma alloc_text(CODE16_INIT, dev0Init, dev1Init, R0Init16, initGetDosTableData)
    122 #endif
     27USHORT NEAR devInit(PRPINITIN pRpIn, PRPINITOUT pRpOut);
     28
    12329
    12430/*
     
    12632 */
    12733USHORT NEAR CallR0Init32(LIN pRpInit);
    128 USHORT NEAR CallGetKernelInfo32(ULONG addressKrnlInfoBuf);
    129 USHORT NEAR CallVerifyImportTab32(void);
    130 USHORT NEAR CallElfIOCtl(LIN pRpIOCtl);
    13134USHORT NEAR CallWin32kIOCtl(LIN pRpIOCtl);
    13235USHORT NEAR CallWin32kOpen(LIN pRpOpen);
    13336USHORT NEAR CallWin32kClose(LIN pRpClose);
    134 #if 0 /*ndef CODE16_INIT*/
    135 #pragma alloc_text(CODE16_INIT, CallR0Init32, CallVerifyImportTab32, CallGetKernelInfo32)
    136 #endif
     37ULONG  NEAR GetR0InitPtr(void);
    13738
    13839
     
    14041 * These are only for use in the 'aDevHdrs'.
    14142 */
    142 extern void NEAR strategyAsm0(void);
    143 extern void NEAR strategyAsm1(void);
     43extern void NEAR strategyAsm(void);
    14444
    14545/*
    14646 * Global data.
    14747 */
    148 extern DDHDR    aDevHdrs[2];
     48extern DDHDR    aDevHdrs[1];
    14949extern PFN      Device_Help;
    150 extern ULONG    TKSSBase16;
    151 extern USHORT   R0FlatCS16;
    152 extern USHORT   R0FlatDS16;
    15350extern BOOL     fInitTime;
    15451
     
    15754 * Stack to Flat DS - 16-bit version.
    15855 */
    159 /*#define SSToDS_16(pStackVar) ((LIN)(getTKSSBaseValue() + (ULONG)(USHORT)(pStackVar)))*/
    16056#define SSToDS_16(pStackVar) (SSToDS_16a((void NEAR *)pStackVar))
    16157
  • branches/splittup/src/win32k/include/dev1632.h

    r6226 r6841  
    1 /* $Id: dev1632.h,v 1.8 2001-07-08 03:03:51 bird Exp $
     1/* $Id: dev1632.h,v 1.8.2.1 2001-09-27 03:08:17 bird Exp $
    22 * dev1632.h - Common header file for 16-bit and 32-bit C
    33 *
     
    4949} RP32OPENCLOSE, *PRP32OPENCLOSE;
    5050
    51 #ifdef _OS2KLDR_H_
    52 
    53 
    54 #define MAXKRNLOBJECTS 24
    55 typedef struct _KRNLINFO
    56 {
    57     unsigned long   ulBuild;
    58     unsigned short  fKernel;
    59     unsigned char   cObjects;
    60     unsigned char   chPadding;
    61     OTE             aObjects[MAXKRNLOBJECTS];
    62 } KRNLINFO, FAR * PKRNLINFO;
    63 
    64 #else
    65 
    66 #define PKRNLINFO void *
    67 
    68 #endif
    69 
    7051#pragma pack()
    7152
  • branches/splittup/src/win32k/include/dev32.h

    r6225 r6841  
    1 /* $Id: dev32.h,v 1.12 2001-07-08 03:03:14 bird Exp $
     1/* $Id: dev32.h,v 1.12.2.1 2001-09-27 03:08:18 bird Exp $
    22 *
    33 * dev32 - header file for 32-bit part of the driver.
     
    6060#if !defined(__cplusplus) && defined(RING0)
    6161USHORT _loadds _Far32 _Pascal R0Init32(RP32INIT *pRpInit);
    62 USHORT _loadds _Far32 _Pascal GetKernelInfo32(PKRNLINFO pKrnlInfo);
    63 USHORT _loadds _Far32 _Pascal VerifyImportTab32(void);
    64 USHORT _loadds _Far32 _Pascal ElfIOCtl(PRP32GENIOCTL pRpIOCtl);
    6562USHORT _loadds _Far32 _Pascal Win32kIOCtl(PRP32GENIOCTL pRpIOCtl);
    6663USHORT _loadds _Far32 _Pascal Win32kOpen(PRP32OPENCLOSE pRpOpen);
    6764USHORT _loadds _Far32 _Pascal Win32kClose(PRP32OPENCLOSE pRpClose);
    6865#endif
    69 #ifdef _OS2KLDR_H_
    70 PMTE _System GetOS2KrnlMTE(void); /* (devfirst.asm) */
    71 #endif
    7266ULONG  _Optlink InitCallGate(void);
    73 ULONG  _Optlink x86DisableWriteProtect(void);
    74 ULONG  _Optlink x86RestoreWriteProtect(ULONG flWP);
    7567
    7668
     
    7971 * Global variables
    8072 */
    81 extern PULONG pulTKSSBase32;
    8273extern USHORT CallGateGDT;
    8374
     
    9788 * @returns    32-bit FLAT pointer.
    9889 */
    99 #ifdef RING0
    100     #define SSToDS(a)   ((PVOID)((ULONG)(a) + *pulTKSSBase32))
    101 #else
    102     #define SSToDS(a)   ((PVOID)(a))
     90#ifndef SSToDS
     91    #ifdef RING0
     92        #define SSToDS(a)   ((PVOID)((ULONG)(a) + TKSSBase))
     93    #else
     94        #define SSToDS(a)   ((PVOID)(a))
     95    #endif
    10396#endif
    10497
  • branches/splittup/src/win32k/include/ldr.h

    r4785 r6841  
    1 /* $Id: ldr.h,v 1.7 2000-12-11 06:44:35 bird Exp $
     1/* $Id: ldr.h,v 1.7.2.1 2001-09-27 03:08:18 bird Exp $
    22 *
    33 * ldr - Our loader "subsystem" public header file.
     
    2323 * Fail if dependent header files is missing
    2424 */
    25 #ifndef _AVL_H_
    26 #error "You'll have to include avl.h before ldr.h!"
     25#ifndef _kAVL_h_
     26#error "You'll have to include kKrnlLib.h with INCL_KKL_AVL before ldr.h!"
    2727#endif
    2828
     
    170170typedef struct _Module
    171171{
    172     AVLNODECORE     coreKey;    /* Key is hFile. */
    173     AVLNODECORE     coreMTE;    /* Key is pMTE. */
     172    AVLULNODECORE   coreKey;    /* Key is hFile. */
     173    AVLULNODECORE   coreMTE;    /* Key is pMTE. */
    174174
    175175    SFN             hFile;      /* System file number or file handle if you prefer that. */
     
    239239ULONG       ldrInit(void);
    240240
     241
     242
     243/*
     244 * Overriding functions.
     245 */
     246extern ULONG LDRCALL myldrOpen(PSFN phFile, PSZ pszFilename, PULONG pfl);
     247
    241248#ifdef __cplusplus
    242249}
  • branches/splittup/src/win32k/include/options.h

    r6003 r6841  
    1 /* $Id: options.h,v 1.22 2001-06-14 01:06:47 bird Exp $
     1/* $Id: options.h,v 1.22.2.1 2001-09-27 03:08:19 bird Exp $
    22 *
    33 * Options.
     
    1717*   Defined Constants And Macros                                               *
    1818*******************************************************************************/
    19 /* fKernel */
    20 #define KF_UNI              0x0000
    21 #define KF_SMP              0x0001
    22 #define KF_W4               0x0002
    23 #define KF_REV_MASK         0x0FF0
    24 #define KF_REV_SHIFT        4
    25 #define KF_REV_0            0x0000
    26 #define KF_REV_A            0x0010
    27 #define KF_REV_B            0x0020
    28 #define KF_REV_C            0x0030
    29 #define KF_REV_D            0x0040
    30 #define KF_REV_E            0x0050
    31 #define KF_REV_F            0x0060
    32 #define KF_REV_G            0x0070
    33 #define KF_REV_H            0x0080
    34 #define KF_REV_I            0x0090
    35 #define KF_REV_J            0x00a0
    36 #define KF_REV_K            0x00b0
    37 #define KF_REV_L            0x00c0
    38 #define KF_REV_M            0x00d0
    39 #define KF_REV_N            0x00e0
    40 #define KF_REV_O            0x00f0
    41 #define KF_REV_P            0x0100
    42 #define KF_REV_Q            0x0110
    43 #define KF_REV_R            0x0120
    44 #define KF_REV_S            0x0130
    45 #define KF_REV_T            0x0140
    46 #define KF_REV_U            0x0150
    47 #define KF_REV_V            0x0160
    48 #define KF_REV_W            0x0170
    49 #define KF_REV_X            0x0180
    50 #define KF_REV_Y            0x0190
    51 #define KF_REV_Z            0x01a0
    52 #define KF_REV_ECS          0x0900
    53 #define KF_DEBUG            0x1000
    54 #define KF_HAS_DEBUGTYPE    0x2000
    55 #define KF_ALLSTRICT        0x3000
    56 #define KF_HALFSTRICT       0x7000
    57 
    5819/* fPE */
    5920#define FLAGS_PE_NOT        0x00000000UL
     
    7435#define INFOLEVEL_INFOALL   0x00000004UL
    7536
    76 /* default heapsizes */
    77 #define CB_SWP_INIT         ((unsigned long)1024*512)      /* 512KB */
    78 #define CB_SWP_MAX          ((unsigned long)1024*1024*16)  /*  16MB  */
    79 #define CB_RES_INIT         ((unsigned long)1024*256)      /* 256KB */
    80 #define CB_RES_MAX          ((unsigned long)1024*1024*10)  /*  10MB  */
    81 
    8237/* NOINC */
    8338/* default assignments */
    8439#define DEFAULT_OPTION_ASSIGMENTS                           \
    8540            {FALSE,                 /* fQuiet        */     \
    86             OUTPUT_COM2,            /* usCom         */     \
    8741            FALSE,                  /* fLogging      */     \
    88             KF_UNI,                 /* fKernel       */     \
    89             ~0UL,                   /* ulBuild       */     \
    90             (unsigned short)~0,     /* usVerMajor    */     \
    91             (unsigned short)~0,     /* usVerMinor    */     \
    9242            FLAGS_PE_PE,            /* fPE           */     \
    9343            FLAGS_PEOO_FORCED,      /* fPEOneObject  */     \
     
    10151            TRUE,                   /* fExeFixes     */     \
    10252            FALSE,                  /* fForcePreload */     \
    103             FALSE,                  /* fApiEnh       */     \
    104             CB_SWP_INIT,            /* cbSwpHeapInit */     \
    105             CB_SWP_MAX,             /* cbSwpHeapMax  */     \
    106             CB_RES_INIT,            /* cbResHeapInit */     \
    107             CB_RES_MAX}             /* cbResHeapMax  */
     53            FALSE                   /* fApiEnh       */     \
     54            }
    10855
    10956#define isAnyLoaderEnabled()        (!options.fNoLoader && \
     
    12673#define isJAVAEnabled()             (options.fJava)
    12774
    128 #define isSMPKernel()               (options.fKernel & KF_SMP)
    129 #define isUNIKernel()               (!(options.fKernel & KF_SMP))
    130 
    131 #define isHighMemorySupported()     (options.ulBuild >= 14000 || isSMPKernel())
    132 
    13375#define isDllFixesEnabled()         (options.fDllFixes)
    13476#define isDllFixesDisabled()        (!options.fDllFixes)
     
    15092/** Option struct */
    15193#pragma pack(4)
    152 struct options
     94struct Win32kOptions
    15395{
    15496    /** @cat misc */
     
    15698
    15799    /** @cat logging options */
    158     USHORT      usCom;                  /* Output port no. */
    159100    USHORT      fLogging;               /* Logging. */
    160 
    161     /** @cat kernel selection */
    162     ULONG       fKernel;                /* Smp or uni kernel. */
    163     ULONG       ulBuild;                /* Kernel build. */
    164     USHORT      usVerMajor;             /* OS/2 major ver - 20 */
    165     USHORT      usVerMinor;             /* OS/2 minor ver - 30,40 */
    166101
    167102    /** @cat Options affecting the generated LX executables */
     
    190125    ULONG       fForcePreload;          /* Forces the loader to preload executable images. Handy for ICAT Ring-3 debugging. */
    191126    ULONG       fApiEnh;                /* Enables the API enhancements */
    192 
    193     /** @cat Options affecting the heap. */
    194     ULONG       cbSwpHeapInit;          /* Initial heapsize. */
    195     ULONG       cbSwpHeapMax;           /* Maximum heapsize. */
    196     ULONG       cbResHeapInit;          /* Initial residentheapsize. */
    197     ULONG       cbResHeapMax;           /* Maxiumem residentheapsize. */
    198127};
    199128#pragma pack()
     
    203132*******************************************************************************/
    204133/* NOINC */
    205 extern struct options DATA16_GLOBAL options;    /* defined in d16globals.c */
     134extern struct Win32kOptions DATA16_GLOBAL options;    /* defined in d16globals.c */
    206135extern char   szWin32kIni[160];                 /* defined in d16globals.c */
    207136#ifdef RING0
  • branches/splittup/src/win32k/include/test.h

    r6285 r6841  
    1 /* $Id: test.h,v 1.10 2001-07-10 05:24:18 bird Exp $
     1/* $Id: test.h,v 1.10.2.1 2001-09-27 03:08:20 bird Exp $
    22 *
    33 * Definitions and declarations for test moduls.
     
    158158ULONG KRNLCALL  fakeTKSuFuBuff(PVOID pvUsr, PVOID pv, ULONG cb, ULONG fl);
    159159ULONG KRNLCALL  fakeTKPidToPTDA(PID pid, PPPTDA ppPTDA);
     160ULONG KRNLCALL  fakeTKScanTasks(ULONG flFlags, ULONG id, PTKSCANTASKWORKER pfnWorker, ULONG ulArg);
    160161void KRNLCALL   fakeTKForceThread(ULONG flFlag, PTCB pTCB);
    161162void KRNLCALL   fakeTKForceTask(ULONG flFlag, PPTDA pPTDA, BOOL fForce);
  • branches/splittup/src/win32k/k32/k32AllocMemEx.cpp

    r5179 r6841  
    1 /* $Id: k32AllocMemEx.cpp,v 1.5 2001-02-19 05:49:05 bird Exp $
     1/* $Id: k32AllocMemEx.cpp,v 1.5.2.1 2001-09-27 03:08:21 bird Exp $
    22 *
    33 * k32AllocMemEx - Equivalent to DosAllocMem, but this one
     
    1818#define INCL_OS2KRNL_VM
    1919#define INCL_OS2KRNL_TK
    20 
    2120#define NO_WIN32K_LIB_FUNCTIONS
    22 
     21#define INCL_KKL_LOG
    2322
    2423
     
    2726*******************************************************************************/
    2827#include <os2.h>
     28#include <OS2Krnl.h>
     29#include <kKrnlLib.h>
     30
    2931#include "devSegDf.h"                   /* Win32k segment definitions. */
    30 #include "OS2Krnl.h"
    3132#include "win32k.h"
    3233#include "k32.h"
    3334#include "options.h"
    3435#include "dev32.h"
    35 #include "log.h"
    36 #include "macros.h"
    3736
    3837
     
    159158        if (    vmac.ac_va < 0x10000
    160159            ||  vmac.ac_va + cb < vmac.ac_va
    161             ||  vmac.ac_va + cb > ((vmac.ac_va >= 0x20000000 && pahvmhShr) ? pahvmhShr : pahvmShr)->ah_laddrMax
     160            ||  vmac.ac_va + cb > ((vmac.ac_va >= 0x20000000 && &ahvmhShr) ? ahvmhShr.ah_laddrMax : ahvmShr.ah_laddrMax)
    162161                )
    163162        {
     
    186185
    187186    flVMFlags =  VMA_USER | VMA_ZEROFILL | VMA_LOWMEM2 | VMA_ARENAPRIVATE /* 0x02010084*/
    188         | ((flFlags & OBJ_ANY) && pahvmhShr ? VMA_ARENAHIGHA : VMA_SELALLOC | VMA_ALIGNSEL)
     187        | ((flFlags & OBJ_ANY) && &ahvmhShr ? VMA_ARENAHIGHA : VMA_SELALLOC | VMA_ALIGNSEL)
    189188        | vmApiF0[flFlags  & (PAG_READ | PAG_WRITE | PAG_EXECUTE | PAG_GUARD)]
    190189        | vmApiF1[(flFlags & (PAG_COMMIT | PAG_DECOMMIT | OBJ_TILE | OBJ_PROTECTED)) >> 4];
  • branches/splittup/src/win32k/k32/k32HandleSystemEvent.cpp

    r5169 r6841  
    1 /* $Id: k32HandleSystemEvent.cpp,v 1.1 2001-02-18 15:26:38 bird Exp $
     1/* $Id: k32HandleSystemEvent.cpp,v 1.1.2.1 2001-09-27 03:08:22 bird Exp $
    22 *
    33 * k32HandleSystemEvent - Override system events like Ctrl-Alt-Delete
     
    1919#define INCL_OS2KRNL_TK
    2020#define INCL_OS2KRNL_SEM
    21 
    2221#define NO_WIN32K_LIB_FUNCTIONS
     22#define INCL_KKL_LOG
    2323
    2424/*******************************************************************************
     
    2626*******************************************************************************/
    2727#include <os2.h>
     28#include <OS2Krnl.h>
     29#include <kKrnlLib.h>
     30
    2831#include "devSegDf.h"                   /* Win32k segment definitions. */
    29 #include "OS2Krnl.h"
    3032#include "win32k.h"
    3133#include "k32.h"
    3234#include "options.h"
    3335#include "dev32.h"
    34 #include "log.h"
    3536
    3637
  • branches/splittup/src/win32k/k32/k32KillProcessEx.cpp

    r6286 r6841  
    1 /* $Id: k32KillProcessEx.cpp,v 1.1 2001-07-10 05:20:59 bird Exp $
     1/* $Id: k32KillProcessEx.cpp,v 1.1.2.1 2001-09-27 03:08:22 bird Exp $
    22 *
    33 * k32KillProcessEx - DosKillProcessEx extention.
     
    2020#define NO_WIN32K_LIB_FUNCTIONS
    2121
     22#define INCL_KKL_LOG
     23
    2224
    2325
     
    2628*******************************************************************************/
    2729#include <os2.h>
     30#include <OS2Krnl.h>
     31#include <kKrnlLib.h>
     32
    2833#include "devSegDf.h"                   /* Win32k segment definitions. */
    29 #include "OS2Krnl.h"
    3034#include "win32k.h"
    3135#include "k32.h"
    3236#include "options.h"
    3337#include "dev32.h"
    34 #include "log.h"
    35 #include "macros.h"
    3638
    3739
  • branches/splittup/src/win32k/k32/k32ProcessReadWrite.cpp

    r5086 r6841  
    1 /* $Id: k32ProcessReadWrite.cpp,v 1.2 2001-02-10 11:11:44 bird Exp $
     1/* $Id: k32ProcessReadWrite.cpp,v 1.2.2.1 2001-09-27 03:08:22 bird Exp $
    22 *
    33 * k32ProcessReadWrite  -  Read or write to another process.
     
    2222#define INCL_OS2KRNL_LDR
    2323#define NO_WIN32K_LIB_FUNCTIONS
     24#define INCL_KKL_LOG
    2425
    2526/*******************************************************************************
     
    2728*******************************************************************************/
    2829#include <os2.h>
     30#include <OS2Krnl.h>
     31#include <kKrnlLib.h>
    2932
    3033#include "devSegDf.h"                   /* Win32k segment definitions. */
    31 #include "OS2Krnl.h"
    3234#include "win32k.h"
    3335#include "k32.h"
    3436#include "options.h"
    3537#include "dev32.h"
    36 #include "log.h"
    3738
    3839
  • branches/splittup/src/win32k/k32/k32QueryCallGate.cpp

    r5250 r6841  
    1 /* $Id: k32QueryCallGate.cpp,v 1.3 2001-02-23 04:01:48 bird Exp $
     1/* $Id: k32QueryCallGate.cpp,v 1.3.2.1 2001-09-27 03:08:22 bird Exp $
    22 *
    33 * k32QueryCallGate - Query the callgate selector for the callgate to the k32 APIs.
     
    2525*******************************************************************************/
    2626#include <os2.h>
     27#include <OS2Krnl.h>
     28#include <kKrnlLib.h>
     29
    2730#include "devSegDf.h"                   /* Win32k segment definitions. */
    28 #include "OS2Krnl.h"
    2931#include "win32k.h"
    3032#include "k32.h"
    3133#include "options.h"
    3234#include "dev32.h"
    33 #include "log.h"
    34 #include "macros.h"
    3535
    3636
  • branches/splittup/src/win32k/k32/k32QueryOTEs.cpp

    r5086 r6841  
    1 /* $Id: k32QueryOTEs.cpp,v 1.3 2001-02-10 11:11:44 bird Exp $
     1/* $Id: k32QueryOTEs.cpp,v 1.3.2.1 2001-09-27 03:08:22 bird Exp $
    22 *
    33 * k32QueryOTEs  -  Get's the object table entries (OTEs) for a given
     
    2020#define INCL_OS2KRNL_SEM
    2121#define INCL_OS2KRNL_LDR
    22 
    2322#define NO_WIN32K_LIB_FUNCTIONS
     23#define INCL_KKL_LOG
    2424
    2525/*******************************************************************************
     
    2727*******************************************************************************/
    2828#include <os2.h>
     29#include <OS2Krnl.h>
     30#include <kKrnlLib.h>
     31
    2932#include "devSegDf.h"                   /* Win32k segment definitions. */
    30 #include "OS2Krnl.h"
    3133#include "win32k.h"
    3234#include "k32.h"
    3335#include "options.h"
    3436#include "dev32.h"
    35 #include "log.h"
    3637
    3738
  • branches/splittup/src/win32k/k32/k32QueryOptionsStatus.cpp

    r5118 r6841  
    1 /* $Id: k32QueryOptionsStatus.cpp,v 1.7 2001-02-11 23:43:00 bird Exp $
     1/* $Id: k32QueryOptionsStatus.cpp,v 1.7.2.1 2001-09-27 03:08:23 bird Exp $
    22 *
    33 * k32QueryOptionsStatus  - Queries the options and/or the status of
     
    2121#define INCL_OS2KRNL_SEM
    2222#define INCL_OS2KRNL_LDR
    23 
    2423#define NO_WIN32K_LIB_FUNCTIONS
     24#define INCL_KKL_LOG
     25#define INCL_KKL_HEAP
     26#define INCL_KKL_AVL
    2527
    2628/*******************************************************************************
     
    3234#include <newexe.h>                     /* OS/2 NE structs and definitions. */
    3335#include <exe386.h>                     /* OS/2 LX structs and definitions. */
     36#include <OS2Krnl.h>
     37#include <kKrnlLib.h>
    3438
    3539#include "devSegDf.h"                   /* Win32k segment definitions. */
    36 
    37 #include "malloc.h"                     /* win32k malloc (resident). Not C library! */
    38 #include "smalloc.h"                    /* win32k swappable heap. */
    39 #include "rmalloc.h"                    /* win32k resident heap. */
    4040
    4141#include <string.h>                     /* C library string.h. */
     
    4444#include <stdarg.h>                     /* C library stdarg.h. */
    4545
    46 #include "vprintf.h"                    /* win32k printf and vprintf. Not C library! */
    4746#include "dev1632.h"                    /* Common 16- and 32-bit parts */
    4847#include "dev32.h"                      /* 32-Bit part of the device driver. (SSToDS) */
    49 #include "OS2Krnl.h"                    /* kernel structs.  (SFN) */
    50 #include "log.h"                        /* Logging. */
    51 #include "avl.h"                        /* AVL tree. (ldr.h need it) */
    5248#include "ldr.h"                        /* ldr helpers. (ldrGetExePath) */
    53 #include "env.h"                        /* Environment helpers. */
     49#include "env.h" //todo                       /* Environment helpers. */
    5450#include "modulebase.h"                 /* ModuleBase class definitions, ++. */
    5551#include "pe2lx.h"                      /* Pe2Lx class definitions, ++. */
     
    5753#include "options.h"                    /* Win32k options. */
    5854
    59 #include "ProbKrnl.h"                   /* ProbKrnl variables and definitions. */
    6055#include "win32k.h"                     /* Win32k API structures.  */
    6156#include "k32.h"                        /* Internal Win32k API structures.  */
     
    126121
    127122        TmpOptions.cb           = sizeof(K32OPTIONS);
     123        #if 0
    128124        TmpOptions.usCom        = options.usCom;
     125        #endif
    129126        TmpOptions.fLogging     = options.fLogging;
    130127        TmpOptions.fPE          = options.fPE;
     
    140137        TmpOptions.fForcePreload= options.fForcePreload;
    141138        TmpOptions.fApiEnh      = options.fApiEnh;
     139        #if 0
    142140        TmpOptions.cbSwpHeapMax = options.cbSwpHeapMax;
    143141        TmpOptions.cbResHeapMax = options.cbResHeapMax;
     142        #endif
    144143
    145144        rc = TKSuBuff(pOptions, SSToDS(&TmpOptions), sizeof(K32OPTIONS), TK_FUSU_NONFATAL);
     
    162161        /* options */
    163162        TmpStatus.fQuiet            = options.fQuiet;
     163        #if 0 //todo
    164164        TmpStatus.fKernel           = options.fKernel;              /* Smp or uni kernel. */
    165165        TmpStatus.ulBuild           = options.ulBuild;              /* Kernel build. */
    166166        TmpStatus.usVerMajor        = options.usVerMajor;           /* OS/2 major ver - 20 */
    167167        TmpStatus.usVerMinor        = options.usVerMinor;           /* OS/2 minor ver - 30,40 */
     168        #endif
    168169
    169170        /* swappable heap */
    170171        if (_swp_state((PHEAPSTATE)SSToDS(&HeapState)) == 0)
    171172        {
     173            #if 0
    172174            TmpStatus.cbSwpHeapInit  = options.cbSwpHeapInit;       /* Initial heapsize. */
     175            #endif
    173176            TmpStatus.cbSwpHeapFree  = HeapState.cbHeapFree;        /* Amount of used space. */
    174177            TmpStatus.cbSwpHeapUsed  = HeapState.cbHeapUsed;        /* Amount of free space reserved. */
     
    181184        if (_res_state((PHEAPSTATE)SSToDS(&HeapState)) == 0)
    182185        {
     186            #if 0
    183187            TmpStatus.cbResHeapInit  = options.cbResHeapInit;       /* Initial heapsize. */
     188            #endif
    184189            TmpStatus.cbResHeapFree  = HeapState.cbHeapFree;        /* Amount of used space. */
    185190            TmpStatus.cbResHeapUsed  = HeapState.cbHeapUsed;        /* Amount of free space reserved. */
     
    193198        strcpy((char*)SSToDS(TmpStatus.szBuildTime), szBuildTime);  /* Time of the win32k build. */
    194199        TmpStatus.ulVersion         = PE2LX_VERSION;                /* Win32k version */
     200        #if 0
    195201        strcpy((char*)SSToDS(TmpStatus.szSymFile), szSymbolFile);   /* The name of the symbol file or sym database. */
     202        #endif
    196203
    197204        /* Module counts */
  • branches/splittup/src/win32k/k32/k32QuerySystemMemInfo.cpp

    r5289 r6841  
    1 /* $Id: k32QuerySystemMemInfo.cpp,v 1.2 2001-03-07 21:55:30 bird Exp $
     1/* $Id: k32QuerySystemMemInfo.cpp,v 1.2.2.1 2001-09-27 03:08:23 bird Exp $
    22 *
    33 * k32QuerySystemMemInfo - Collects more or less useful information on the
     
    2424#define INCL_OS2KRNL_SEM
    2525#define INCL_OS2KRNL_LDR
    26 
    2726#define NO_WIN32K_LIB_FUNCTIONS
     27#define INCL_KKL_LOG
    2828
    2929/*******************************************************************************
     
    3535#include <newexe.h>                     /* OS/2 NE structs and definitions. */
    3636#include <exe386.h>                     /* OS/2 LX structs and definitions. */
     37#include <OS2Krnl.h>
     38#include <kKrnlLib.h>
    3739
    3840#include "devSegDf.h"                   /* Win32k segment definitions. */
    39 
    40 #include "malloc.h"                     /* win32k malloc (resident). Not C library! */
    41 #include "smalloc.h"                    /* win32k swappable heap. */
    42 #include "rmalloc.h"                    /* win32k resident heap. */
    4341
    4442#include <string.h>                     /* C library string.h. */
    4543#include <stdlib.h>                     /* C library stdlib.h. */
    4644#include <stddef.h>                     /* C library stddef.h. */
    47 #include <stdarg.h>                     /* C library stdarg.h. */
    4845
    49 #include "vprintf.h"                    /* win32k printf and vprintf. Not C library! */
    5046#include "dev1632.h"                    /* Common 16- and 32-bit parts */
    5147#include "dev32.h"                      /* 32-Bit part of the device driver. (SSToDS) */
    52 #include "OS2Krnl.h"                    /* kernel structs.  (SFN) */
    53 #include "log.h"                        /* Logging. */
    5448#include "options.h"                    /* Win32k options. */
    5549
    56 #include "ProbKrnl.h"                   /* ProbKrnl variables and definitions. */
    5750#include "win32k.h"                     /* Win32k API structures.  */
    5851#include "k32.h"                        /* Internal Win32k API structures.  */
     
    147140        MemInfo.ulAddressLimit          = VirtualAddressLimit;
    148141        vmRecalcShrBound(VMRSBF_ARENASHR, (PULONG)SSToDS(&MemInfo.ulVMArenaPrivMax));
    149         MemInfo.ulVMArenaSharedMin      = pahvmShr->ah_laddrMin;
    150         MemInfo.ulVMArenaSharedMax      = pahvmShr->ah_laddrMax;
    151         MemInfo.ulVMArenaSystemMin      = pahvmSys->ah_laddrMin;
    152         MemInfo.ulVMArenaSystemMax      = pahvmSys->ah_laddrMax;
    153         if (pahvmhShr && VirtualAddressLimit > 0x20000000) /* Not valid if less or equal to 512MB user memory */
     142        MemInfo.ulVMArenaSharedMin      = ahvmShr.ah_laddrMin;
     143        MemInfo.ulVMArenaSharedMax      = ahvmShr.ah_laddrMax;
     144        MemInfo.ulVMArenaSystemMin      = ahvmSys.ah_laddrMin;
     145        MemInfo.ulVMArenaSystemMax      = ahvmSys.ah_laddrMax;
     146        if (&ahvmhShr && VirtualAddressLimit > 0x20000000) /* Not valid if less or equal to 512MB user memory */
    154147        {
    155             MemInfo.ulVMArenaHighSharedMin  = pahvmhShr->ah_laddrMin;
    156             MemInfo.ulVMArenaHighSharedMax  = pahvmhShr->ah_laddrMax;
     148            MemInfo.ulVMArenaHighSharedMin  = ahvmhShr.ah_laddrMin;
     149            MemInfo.ulVMArenaHighSharedMax  = ahvmhShr.ah_laddrMax;
    157150            vmRecalcShrBound(VMRSBF_ARENAHIGH, (PULONG)SSToDS(&MemInfo.ulVMArenaHighPrivMax));
    158151        }
  • branches/splittup/src/win32k/k32/k32SetEnvironment.cpp

    r6296 r6841  
    1 /* $Id: k32SetEnvironment.cpp,v 1.2 2001-07-10 16:39:17 bird Exp $
     1/* $Id: k32SetEnvironment.cpp,v 1.2.2.1 2001-09-27 03:08:23 bird Exp $
    22 *
    33 * k32SetEnvironment - Sets the Odin32 environment for a process.
     
    1919#define INCL_OS2KRNL_LDR
    2020#define NO_WIN32K_LIB_FUNCTIONS
     21#define INCL_KKL_LOG
     22#define INCL_KKL_AVL
    2123
    2224
     
    2527*******************************************************************************/
    2628#include <os2.h>
     29#include <OS2Krnl.h>
     30#include <kKrnlLib.h>
     31
    2732#include <memory.h>
    2833#include "devSegDf.h"                   /* Win32k segment definitions. */
    29 #include "OS2Krnl.h"
    3034#include "win32k.h"
    3135#include "k32.h"
     
    3337#include "dev32.h"
    3438#include "dev32hlp.h"
    35 #include "log.h"
    36 #include "macros.h"
    37 #include "avl.h"
    3839#include "PerTaskW32kData.h"
    3940
  • branches/splittup/src/win32k/k32/k32SetOptions.cpp

    r5118 r6841  
    1 /* $Id: k32SetOptions.cpp,v 1.7 2001-02-11 23:43:00 bird Exp $
     1/* $Id: k32SetOptions.cpp,v 1.7.2.1 2001-09-27 03:08:23 bird Exp $
    22 *
    33 * k32SetOptions - Sets the changable options of win32k.sys the options.
     
    2020#define INCL_OS2KRNL_SEM
    2121#define INCL_OS2KRNL_LDR
    22 
    2322#define NO_WIN32K_LIB_FUNCTIONS
     23#define INCL_KKL_LOG
     24#define INCL_KKL_AVL
    2425
    2526/*******************************************************************************
     
    3132#include <newexe.h>                     /* OS/2 NE structs and definitions. */
    3233#include <exe386.h>                     /* OS/2 LX structs and definitions. */
     34#include <OS2Krnl.h>
     35#include <kKrnlLib.h>
    3336
    3437#include "devSegDf.h"                   /* Win32k segment definitions. */
    35 
    36 #include "malloc.h"                     /* win32k malloc (resident). Not C library! */
    37 #include "smalloc.h"                    /* win32k swappable heap. */
    38 #include "rmalloc.h"                    /* win32k resident heap. */
    3938
    4039#include <string.h>                     /* C library string.h. */
     
    4342#include <stdarg.h>                     /* C library stdarg.h. */
    4443
    45 #include "vprintf.h"                    /* win32k printf and vprintf. Not C library! */
    4644#include "dev1632.h"                    /* Common 16- and 32-bit parts */
    4745#include "dev32.h"                      /* 32-Bit part of the device driver. (SSToDS) */
    48 #include "OS2Krnl.h"                    /* kernel structs.  (SFN) */
    49 #include "log.h"                        /* Logging. */
    50 #include "avl.h"                        /* AVL tree. (ldr.h need it) */
    5146#include "ldr.h"                        /* ldr helpers. (ldrGetExePath) */
    52 #include "env.h"                        /* Environment helpers. */
     47#include "env.h" //todo                       /* Environment helpers. */
    5348#include "modulebase.h"                 /* ModuleBase class definitions, ++. */
    5449#include "pe2lx.h"                      /* Pe2Lx class definitions, ++. */
     
    5651#include "options.h"                    /* Win32k options. */
    5752
    58 #include "ProbKrnl.h"                   /* ProbKrnl variables and definitions. */
    5953#include "win32k.h"                     /* Win32k API structures.  */
    6054#include "k32.h"                        /* Internal Win32k API structures.  */
     
    10397         * Validate contents.
    10498         */
     99        #if 0
    105100        if (    TmpOptions.usCom != OUTPUT_COM1
    106101            &&  TmpOptions.usCom != OUTPUT_COM2
     
    108103            &&  TmpOptions.usCom != OUTPUT_COM4)
    109104            return ERROR_INVALID_PARAMETER;
     105        #endif
    110106        if (TmpOptions.fLogging > 1)
    111107            return ERROR_INVALID_PARAMETER;
     
    136132        if (TmpOptions.fApiEnh > 1)
    137133            return ERROR_INVALID_PARAMETER;
     134        #if 0
    138135        if (TmpOptions.cbSwpHeapMax > (32768*1024) || TmpOptions.cbSwpHeapMax < options.cbSwpHeapInit)
    139136            return ERROR_INVALID_PARAMETER;
    140137        if (TmpOptions.cbResHeapMax > (32768*1024) || TmpOptions.cbResHeapMax < options.cbResHeapInit)
    141138            return ERROR_INVALID_PARAMETER;
     139        #endif
    142140
    143141        /*
     
    155153         * Apply changes
    156154         */
     155        #if 0
    157156        options.usCom       = TmpOptions.usCom;         /* Output port no. */
     157        #endif
    158158        options.fLogging    = (USHORT)TmpOptions.fLogging;/* Logging. */
    159159        options.fPE         = TmpOptions.fPE;           /* Flags set the type of conversion. */
     
    170170        options.fApiEnh     = TmpOptions.fApiEnh;       /* Enables the API enhancements */
    171171
     172        #if 0
    172173        options.cbSwpHeapMax = TmpOptions.cbSwpHeapMax; /* Maximum heapsize. */
    173174        cbSwpHeapMax = (unsigned)options.cbSwpHeapMax;
    174175        options.cbResHeapMax = TmpOptions.cbResHeapMax; /* Maxiumem residentheapsize. */
    175176        cbResHeapMax = (unsigned)options.cbResHeapMax;
     177        #endif
    176178
    177179        /*
  • branches/splittup/src/win32k/ldr/ModuleBase.cpp

    r5086 r6841  
    1 /* $Id: ModuleBase.cpp,v 1.7 2001-02-10 11:11:44 bird Exp $
     1/* $Id: ModuleBase.cpp,v 1.7.2.1 2001-09-27 03:08:24 bird Exp $
    22 *
    33 * ModuleBase - Implementetation.
     
    1919#endif
    2020#define INCL_OS2KRNL_LDR
     21#define INCL_KKL_LOG
     22#define INCL_KKL_AVL
     23#define INCL_KKL_HEAP
     24#define INCL_KKL_PRINTF
    2125
    2226
     
    2529*******************************************************************************/
    2630#include <os2.h>                        /* OS/2 header file. */
     31#include <OS2Krnl.h>
     32#include <kKrnlLib.h>
    2733
    2834#include "devSegDf.h"                   /* Win32k segment definitions. */
    29 #include "malloc.h"                     /* Win32k malloc. Not C library! */
    3035
    3136#include <string.h>                     /* C library string.h. */
    32 #include <stdarg.h>                     /* C library stdarg.h. */
    33 
    34 #include "vprintf.h"                    /* win32k printf and vprintf. Not C library! */
     37
    3538#include "dev32.h"                      /* 32-Bit part of the device driver. (SSToDS) */
    36 #include "OS2Krnl.h"                    /* kernel structs.  (SFN) */
    3739#include "modulebase.h"                 /* ModuleBase class definitions, ++. */
    3840
  • branches/splittup/src/win32k/ldr/ldr.cpp

    r5086 r6841  
    1 /* $Id: ldr.cpp,v 1.10 2001-02-10 11:11:45 bird Exp $
     1/* $Id: ldr.cpp,v 1.10.2.1 2001-09-27 03:08:24 bird Exp $
    22 *
    33 * ldr.cpp - Loader helpers.
     
    1717#define INCL_OS2KRNL_PTDA
    1818#define INCL_OS2KRNL_LDR
     19#define INCL_KKL_LOG
     20#define INCL_KKL_AVL
     21#define INCL_KKL_HEAP
    1922
    2023/*******************************************************************************
     
    2225*******************************************************************************/
    2326#include <os2.h>
     27#include <peexe.h>
     28#include <exe386.h>
     29#include <OS2Krnl.h>
     30#include <kKrnlLib.h>
    2431
    2532#include "devSegDf.h"
    26 #include "malloc.h"
    27 #include "new.h"
    2833#include <memory.h>
    2934#include <stdlib.h>
     
    3136#include <string.h>
    3237
    33 #include "log.h"
    34 #include "avl.h"
    35 #include <peexe.h>
    36 #include <exe386.h>
    37 #include "OS2Krnl.h"
    3838#include "ldr.h"
    3939#include "ModuleBase.h"
     
    4545*   Global Variables                                                           *
    4646*******************************************************************************/
    47 static PAVLNODECORE    pSFNRoot = NULL;
    48 static PAVLNODECORE    pMTERoot = NULL;
     47static PAVLULNODECORE   pSFNRoot = NULL;
     48static PAVLULNODECORE   pMTERoot = NULL;
    4949
    5050
     
    8181 * @returns   Pointer to module node. If not found NULL.
    8282 * @param     hFile  File handle of the module to be found.
    83  * @sketch    return a AVLGet on the pSFNRoot-tree.
     83 * @sketch    return a AVLULGet on the pSFNRoot-tree.
    8484 * @status    completely implemented.
    8585 * @author    knut st. osmundsen
     
    8787PMODULE     getModuleBySFN(SFN hFile)
    8888{
    89     return (PMODULE)AVLGet(&pSFNRoot, (AVLKEY)hFile);
     89    return (PMODULE)AVLULGet(&pSFNRoot, (AVLULKEY)hFile);
    9090}
    9191
     
    115115    #if 0
    116116        /* Not 100% sure that this will work correctly! */
    117         PMODULE pMod = (PMODULE)AVLGet(&pMTERoot, (AVLKEY)pMTE);
     117        PMODULE pMod = (PMODULE)AVLULGet(&pMTERoot, (AVLULKEY)pMTE);
    118118        if (pMod == NULL)
    119119        {
     
    125125                }
    126126            #endif
    127             pMod = (PMODULE)AVLGet(&pSFNRoot, (AVLKEY)pMTE->mte_sfn);
     127            pMod = (PMODULE)AVLULGet(&pSFNRoot, (AVLULKEY)pMTE->mte_sfn);
    128128            if (pMod != NULL)
    129129            {
    130                 pMod->coreMTE.Key = (AVLKEY)pMTE;
     130                pMod->coreMTE.Key = (AVLULKEY)pMTE;
    131131                pMod->fFlags |= MOD_FLAGS_IN_MTETREE;
    132                 AVLInsert(&pMTERoot, (PAVLNODECORE)((unsigned)pMod + offsetof(MODULE, coreMTE)));
     132                AVLInsert(&pMTERoot, (PAVLULNODECORE)((unsigned)pMod + offsetof(MODULE, coreMTE)));
    133133            }
    134134        }
     
    146146        #endif
    147147        if (GetState(pMTE->mte_sfn) == HSTATE_OUR)
    148             return (PMODULE)AVLGet(&pSFNRoot, (AVLKEY)pMTE->mte_sfn);
     148            return (PMODULE)AVLULGet(&pSFNRoot, (AVLULKEY)pMTE->mte_sfn);
    149149
    150150        return NULL;
     
    209209    PMODULE pMod;
    210210    #ifdef DEBUG
    211         if (AVLGet(&pSFNRoot, (AVLKEY)hFile) != NULL)
     211        if (AVLULGet(&pSFNRoot, (AVLULKEY)hFile) != NULL)
    212212            kprintf(("addModule: Module allready present in the SFN-tree!\n"));
    213213        if (hFile == 0)
     
    232232
    233233    /* fill in the module node. */
    234     pMod->coreKey.Key = (AVLKEY)hFile;
     234    pMod->coreKey.Key = (AVLULKEY)hFile;
    235235    pMod->hFile = hFile;
    236236    pMod->pMTE = pMTE;
     
    239239
    240240    /* insert the module node into the tree(s) */
    241     AVLInsert(&pSFNRoot, (PAVLNODECORE)pMod);
     241    AVLULInsert(&pSFNRoot, (PAVLULNODECORE)pMod);
    242242    if (pMTE != NULL)
    243243    {
    244         pMod->coreMTE.Key = (AVLKEY)pMTE;
     244        pMod->coreMTE.Key = (AVLULKEY)pMTE;
    245245        pMod->fFlags |= MOD_FLAGS_IN_MTETREE;
    246         AVLInsert(&pMTERoot, (PAVLNODECORE)((unsigned)pMod + offsetof(MODULE, coreMTE)));
     246        AVLULInsert(&pMTERoot, (PAVLULNODECORE)((unsigned)pMod + offsetof(MODULE, coreMTE)));
    247247    }
    248248
     
    265265ULONG      removeModule(SFN hFile)
    266266{
    267     PMODULE pMod = (PMODULE)AVLRemove(&pSFNRoot, (AVLKEY)hFile);
     267    PMODULE pMod = (PMODULE)AVLULRemove(&pSFNRoot, (AVLULKEY)hFile);
    268268    if (pMod == NULL)
    269269    {
     
    275275    if (pMod->fFlags & MOD_FLAGS_IN_MTETREE)
    276276    {
    277         if (AVLRemove(&pMTERoot, (AVLKEY)pMod->pMTE) == NULL)
    278         {
    279             kprintf(("removeModule: MOD_FLAGS_IN_MTETREE set but AVLRemove returns NULL\n"));
     277        if (AVLULRemove(&pMTERoot, (AVLULKEY)pMod->pMTE) == NULL)
     278        {
     279            kprintf(("removeModule: MOD_FLAGS_IN_MTETREE set but AVLULRemove returns NULL\n"));
    280280        }
    281281    }
     
    333333         * Then get the pMTE, and access the smte_path to get a pointer to the executable path.
    334334         */
    335         PPTDA   pPTDACur;               /* Pointer to the current (system context) PTDA */
     335        PPTDA   pPTDA1;                 /* Pointer to the current (system context) PTDA */
    336336        PPTDA   pPTDA;                  /* PTDA in question. */
    337337        HMTE    hMTE = NULLHANDLE;      /* Modulehandle of the executable module. */
     
    343343         *  IF no pPTDAExecChild THEN  get hMte for the current PTDA.
    344344         */
    345         pPTDACur = ptdaGetCur();
    346         if (pPTDACur != NULL)
    347         {
    348             pPTDA = ptdaGet_pPTDAExecChild(pPTDACur);
     345        pPTDA1 = ptdaGetCur();
     346        if (pPTDA1 != NULL)
     347        {
     348            pPTDA = ptdaGet_pPTDAExecChild(pPTDA1);
    349349            if (pPTDA != NULL && fExecChild)
    350350                hMTE = ptdaGet_ptda_module(pPTDA);
    351351            if (hMTE == NULLHANDLE)
    352                 hMTE = ptdaGet_ptda_module(pPTDACur);
     352                hMTE = ptdaGet_ptda_module(pPTDA1);
    353353        }
    354354        else
  • branches/splittup/src/win32k/ldr/myLDRGetProcAddr.cpp

    r5086 r6841  
    1 /* $Id: myLDRGetProcAddr.cpp,v 1.2 2001-02-10 11:11:45 bird Exp $
     1/* $Id: myLDRGetProcAddr.cpp,v 1.2.2.1 2001-09-27 03:08:25 bird Exp $
    22 *
    33 * LDRGetProcAddr - Get an entry point to a module.
     
    1717#define INCL_OS2KRNL_PTDA
    1818#define INCL_OS2KRNL_LDR
     19#define INCL_KKL_LOG
     20#define INCL_KKL_AVL
    1921
    2022/*******************************************************************************
     
    2224*******************************************************************************/
    2325#include <os2.h>
     26#include <peexe.h>
     27#include <exe386.h>
     28#include <OS2Krnl.h>
     29#include <kKrnlLib.h>
    2430
    2531#include <memory.h>
     
    2834
    2935#include "devSegDf.h"                   /* Win32k segment definitions. */
    30 #include "log.h"
    31 #include "avl.h"
    32 #include <peexe.h>
    33 #include <exe386.h>
    34 #include "OS2Krnl.h"
    3536#include "dev32.h"
    3637#include "ldr.h"
  • branches/splittup/src/win32k/ldr/myLDRQAppType.cpp

    r5086 r6841  
    1 /* $Id: myLDRQAppType.cpp,v 1.5 2001-02-10 11:11:45 bird Exp $
     1/* $Id: myLDRQAppType.cpp,v 1.5.2.1 2001-09-27 03:08:25 bird Exp $
    22 *
    33 * _myLDRQAppType - _LDRQAppType overload.
     
    1818#define INCL_OS2KRNL_SEM
    1919#define INCL_OS2KRNL_LDR
     20#define INCL_KKL_LOG
     21#define INCL_KKL_AVL
    2022
    2123/*******************************************************************************
     
    2325*******************************************************************************/
    2426#include <os2.h>
     27#include <OS2Krnl.h>
     28#include <kKrnlLib.h>
    2529
    2630#include "devSegDf.h"                   /* Win32k segment definitions. */
    27 #include "OS2Krnl.h"
    28 #include "avl.h"
    2931#include "ldr.h"
    30 #include "log.h"
    3132
    3233
  • branches/splittup/src/win32k/ldr/myVMAllocMem.cpp

    r5086 r6841  
    1 /* $Id: myVMAllocMem.cpp,v 1.3 2001-02-10 11:11:45 bird Exp $
     1/* $Id: myVMAllocMem.cpp,v 1.3.2.1 2001-09-27 03:08:25 bird Exp $
    22 *
    33 * Debug module - overloads VMAllocMem to analyse input parameters....
     
    1515#define INCL_NOPMAPI
    1616#define INCL_OS2KRNL_LDR
     17#define INCL_OS2KRNL_VM
     18#define INCL_KKL_AVL
     19#define INCL_KKL_LOG
    1720
    1821/*******************************************************************************
     
    2023*******************************************************************************/
    2124#include <os2.h>
     25#include <OS2Krnl.h>
     26#include <kKrnlLib.h>
    2227
    23 #include "log.h"
    24 #include "OS2Krnl.h"
    25 #include "avl.h"
    2628#include "ldr.h"
    2729
     
    5153    APIRET rc;
    5254
    53     rc = VMAllocMem(p1,p2,p3,p4,p5,p6,p7,p8,p9);
     55    rc = VMAllocMem(p1,p2,p3,p4,p5,p6,p7,p8,(PVMAC)p9);
    5456
    5557    return rc;
  • branches/splittup/src/win32k/ldr/myldrCheckInternalName.cpp

    r6193 r6841  
    1 /* $Id: myldrCheckInternalName.cpp,v 1.5 2001-07-07 04:39:57 bird Exp $
     1/* $Id: myldrCheckInternalName.cpp,v 1.5.2.1 2001-09-27 03:08:25 bird Exp $
    22 *
    33 * ldrCheckInternalName - ldrCheckInternalName replacement with support for
    44 *                  long DLL names and no .DLL-extention dependency.
    55 *
    6  * Copyright (c) 1999-2000 knut st. osmundsen (knut.stange.osmundsen@mynd.no)
     6 * Copyright (c) 1999-2001 knut st. osmundsen (kosmunds@csc.com)
    77 *
    88 * Project Odin Software License can be found in LICENSE.TXT
     
    1717#define INCL_NOPMAPI
    1818#define INCL_OS2KRNL_LDR
     19#define INCL_KKL_LOG
     20#define INCL_KKL_AVL
    1921
    2022
     
    2325*******************************************************************************/
    2426#include <os2.h>
     27#include <peexe.h>
     28#include <exe386.h>
     29#include <OS2Krnl.h>
     30#include <kKrnlLib.h>
    2531
    2632#include <memory.h>
     
    2935
    3036#include "devSegDf.h"                   /* Win32k segment definitions. */
    31 #include "log.h"
    32 #include "avl.h"
    33 #include <peexe.h>
    34 #include <exe386.h>
    35 #include "OS2Krnl.h"
    3637#include "dev32.h"
    3738#include "ldr.h"
  • branches/splittup/src/win32k/ldr/myldrClose.cpp

    r5086 r6841  
    1 /* $Id: myldrClose.cpp,v 1.7 2001-02-10 11:11:46 bird Exp $
     1/* $Id: myldrClose.cpp,v 1.7.2.1 2001-09-27 03:08:26 bird Exp $
    22 *
    33 * myldrClose - ldrClose
    44 *
    5  * Copyright (c) 1998-1999 knut st. osmundsen
     5 * Copyright (c) 1998-2001 knut st. osmundsen (kosmunds@csc.com)
    66 *
    77 * Project Odin Software License can be found in LICENSE.TXT
     
    1515#define INCL_NOPMAPI
    1616#define INCL_OS2KRNL_LDR
     17#define INCL_KKL_LOG
     18#define INCL_KKL_AVL
    1719
    1820/*******************************************************************************
     
    2022*******************************************************************************/
    2123#include <os2.h>
     24#include <peexe.h>
     25#include <exe386.h>
     26#include <OS2Krnl.h>
     27#include <kKrnlLib.h>
    2228
    2329#include <memory.h>
     
    2531
    2632#include "devSegDf.h"                   /* Win32k segment definitions. */
    27 #include "log.h"
    28 #include "avl.h"
    29 #include <peexe.h>
    30 #include <exe386.h>
    31 #include "OS2Krnl.h"
    3233#include "ldr.h"
    3334#include "ModuleBase.h"
  • branches/splittup/src/win32k/ldr/myldrEnum32bitRelRecs.cpp

    r5086 r6841  
    1 /* $Id: myldrEnum32bitRelRecs.cpp,v 1.5 2001-02-10 11:11:46 bird Exp $
     1/* $Id: myldrEnum32bitRelRecs.cpp,v 1.5.2.1 2001-09-27 03:08:26 bird Exp $
    22 *
    33 * myldrEnum32bitRelRecs - ldrEnum32bitRelRecs
    44 *
    5  * Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@mynd.no)
     5 * Copyright (c) 2000-2001 knut st. osmundsen (kosmunds@csc.com)
    66 *
    77 * Project Odin Software License can be found in LICENSE.TXT
     
    1515#define INCL_NOPMAPI
    1616#define INCL_OS2KRNL_LDR
     17#define INCL_KKL_LOG
     18#define INCL_KKL_AVL
    1719
    1820
     
    2123*******************************************************************************/
    2224#include <os2.h>
     25#include <peexe.h>
     26#include <exe386.h>
     27#include <OS2Krnl.h>
     28#include <kKrnlLib.h>
    2329
    2430#include <memory.h>
     
    2632
    2733#include "devSegDf.h"                   /* Win32k segment definitions. */
    28 #include "avl.h"
    29 #include "log.h"
    30 #include <peexe.h>
    31 #include <exe386.h>
    32 #include "OS2Krnl.h"
    3334#include "ldr.h"
    3435#include "ModuleBase.h"
  • branches/splittup/src/win32k/ldr/myldrFindModule.cpp

    r6192 r6841  
    1 /* $Id: myldrFindModule.cpp,v 1.3 2001-07-07 04:39:11 bird Exp $
     1/* $Id: myldrFindModule.cpp,v 1.3.2.1 2001-09-27 03:08:26 bird Exp $
    22 *
    33 * ldrFindModule - ldrFindModule replacement with support for long DLL names
    44 *                  and .DLL-extention dependency.
    55 *
    6  * Copyright (c) 1999-2000 knut st. osmundsen (knut.stange.osmundsen@mynd.no)
     6 * Copyright (c) 1999-2001 knut st. osmundsen (kosmunds@csc.com)
    77 *
    88 * Project Odin Software License can be found in LICENSE.TXT
     
    1616#define INCL_NOPMAPI
    1717#define INCL_OS2KRNL_LDR
     18#define INCL_KKL_LOG
     19#define INCL_KKL_AVL
    1820
    1921/*******************************************************************************
     
    2123*******************************************************************************/
    2224#include <os2.h>
     25#include <peexe.h>
     26#include <exe386.h>
     27#include <OS2Krnl.h>
     28#include <kKrnlLib.h>
    2329
    2430#include <memory.h>
     
    2733
    2834#include "devSegDf.h"                   /* Win32k segment definitions. */
    29 #include "log.h"
    30 #include "avl.h"
    31 #include <peexe.h>
    32 #include <exe386.h>
    33 #include "OS2Krnl.h"
    3435#include "dev32.h"
    3536#include "ldr.h"
    3637#include "ModuleBase.h"
    3738#include "options.h"
    38 
    39 /*******************************************************************************
    40 *   Global Variables                                                           *
    41 *******************************************************************************/
    42 extern  PPMTE pmte_h;
    43 extern  PPMTE pprogram_h;
    44 extern  PPMTE pprogram_l;
    45 extern  PPMTE pglobal_h;
    46 extern  PPMTE pglobal_l;
    47 extern  PPMTE pspecific_h;
    48 extern  PPMTE pspecific_l;
    4939
    5040/*******************************************************************************
     
    10696    static PMTE  pmteNULL = NULL;
    10797    static PPMTE ppmteNULL = &pmteNULL;
    108     static PPMTE * apppmteHeadTail[] =
     98    static PMTE  apmteHeadTail[] =
    10999    {/* head           tail */
    110         &pmte_h,        &ppmteNULL,     /* CLASS_ALL        0x00000000 */
    111         &pprogram_h,    &pprogram_l,    /* CLASS_PROGRAM    0x00000040 */
    112         &pglobal_h,     &pglobal_l,     /* CLASS_GLOBAL     0x00000080 */
    113         &pspecific_h,   &pspecific_l,   /* CLASS_SPECIFIC   0x000000c0 */
     100        mte_h,        pmteNULL,         /* CLASS_ALL        0x00000000 */
     101        program_h,    program_l,        /* CLASS_PROGRAM    0x00000040 */
     102        global_h,     global_l,         /* CLASS_GLOBAL     0x00000080 */
     103        specific_h,   specific_l,       /* CLASS_SPECIFIC   0x000000c0 */
    114104    };
    115105
     
    157147     * Find start and end mte node
    158148     */
    159     pmte = **apppmteHeadTail[usClass >> 5];
    160     pmteEnd = **apppmteHeadTail[(usClass >> 5) + 1];
     149    pmte = apmteHeadTail[usClass >> 5];
     150    pmteEnd = apmteHeadTail[(usClass >> 5) + 1];
    161151    if (pmteEnd != NULL)                /* Advance one node - see loop condition. */
    162152        pmteEnd = pmteEnd->mte_link;
  • branches/splittup/src/win32k/ldr/myldrGetFileName.asm

    r5247 r6841  
    1 ; $Id: myldrGetFileName.asm,v 1.2 2001-02-23 02:57:54 bird Exp $
     1; $Id: myldrGetFileName.asm,v 1.2.2.1 2001-09-27 03:08:26 bird Exp $
    22;
    33; myldrGetFileName2 - assembly helper for ldrGetFileName.
     
    55;           doesn't have a path, and return correct *ppachExt.
    66;
    7 ; Copyright (c) 2000 knut st. osmundsen
     7; Copyright (c) 2000-2001 knut st. osmundsen (kosmunds@csc.com)
    88;
    99; Project Odin Software License can be found in LICENSE.TXT
  • branches/splittup/src/win32k/ldr/myldrOpen.cpp

    r6009 r6841  
    1 /* $Id: myldrOpen.cpp,v 1.16 2001-06-14 12:19:41 bird Exp $
     1/* $Id: myldrOpen.cpp,v 1.16.2.1 2001-09-27 03:08:27 bird Exp $
    22 *
    33 * myldrOpen - ldrOpen.
     
    2121#define INCL_OS2KRNL_SEC
    2222#define INCL_OS2KRNL_LDR
     23#define INCL_KKL_LOG
     24#define INCL_KKL_AVL
     25#define INCL_KKL_HEAP
    2326
    2427/*******************************************************************************
     
    2629*******************************************************************************/
    2730#include <os2.h>
     31#include <peexe.h>
     32#include <exe386.h>
     33#include <OS2Krnl.h>
     34#include <kKrnlLib.h>
    2835
    2936#include "devSegDf.h"                   /* Win32k segment definitions. */
    30 #include "rmalloc.h"
    31 #include "malloc.h"
    3237#include <memory.h>
    3338#include <stdlib.h>
     
    3540#include <stdarg.h>
    3641
    37 #include "log.h"
    38 #include "avl.h"
    3942#include "options.h"
    40 #include <peexe.h>
    41 #include <exe386.h>
    4243#include "elf.h"
    4344#include "OS2Krnl.h"
     
    4748#include "pe2lx.h"
    4849#include "myExecPgm.h"
    49 #include "env.h"
    50 #include "vprintf.h"                    /* Make 100% sure we have va_start.  */
     50#include "env.h"                        /* TODO */
    5151
    5252
  • branches/splittup/src/win32k/ldr/myldrOpenPath.cpp

    r5086 r6841  
    1 /* $Id: myldrOpenPath.cpp,v 1.5 2001-02-10 11:11:46 bird Exp $
     1/* $Id: myldrOpenPath.cpp,v 1.5.2.1 2001-09-27 03:08:27 bird Exp $
    22 *
    33 * myldrOpenPath - ldrOpenPath used to open executables we'll override
    44 * this to altern the search path for DLLs.
    55 *
    6  * Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@mynd.no)
     6 * Copyright (c) 2000-2001 knut st. osmundsen (kosmunds@csc.com)
    77 *
    88 * Project Odin Software License can be found in LICENSE.TXT
     
    1818#define INCL_OS2KRNL_PTDA
    1919#define INCL_OS2KRNL_LDR
     20#define INCL_KKL_LOG
     21#define INCL_KKL_AVL
    2022
    2123/*******************************************************************************
     
    2325*******************************************************************************/
    2426#include <os2.h>
     27#include <peexe.h>
     28#include <exe386.h>
     29#include <OS2Krnl.h>
     30#include <kKrnlLib.h>
    2531
    2632#include <memory.h>
     
    2834
    2935#include "devSegDf.h"                   /* Win32k segment definitions. */
    30 #include "log.h"
    3136#include "dev32.h"
    3237#include "dev32hlp.h"
    33 #include <peexe.h>
    34 #include <exe386.h>
    35 #include "OS2Krnl.h"
    36 #include "avl.h"
    3738#include "ldr.h"
    3839#include "ModuleBase.h"
  • branches/splittup/src/win32k/ldr/myldrOpenPatha.asm

    r5247 r6841  
    1 ; $Id: myldrOpenPatha.asm,v 1.5 2001-02-23 02:57:54 bird Exp $
     1; $Id: myldrOpenPatha.asm,v 1.5.2.1 2001-09-27 03:08:27 bird Exp $
    22;
    33; myldrOpenPatha - assembly helpers for myldrOpenPath.
    44;
    5 ; Copyright (c) 2000 knut st. osmundsen
     5; Copyright (c) 2000-2001 knut st. osmundsen (kosmunds@csc.com)
    66;
    77; Project Odin Software License can be found in LICENSE.TXT
     
    1313;
    1414    include devsegdf.inc
    15     include options.inc
    1615
    1716;
     
    2423;
    2524    extrn _ldrOpenPath_wrapped:PROC            ; calltab entry
    26     extrn _options:options
     25    extrn ulKernelBuild:ABS
    2726
    2827
     
    3736_ldrOpenPath@20 PROC NEAR
    3837    ASSUME ds:FLAT
    39     cmp     FLAT:DATA16:_options.ulBuild, 14053
    40     jge      new
     38    mov     eax, ulKernelBuild
     39    cmp     eax, 14053
     40    jge     new
    4141
    4242if 0
     
    7373    ;
    7474if 0
    75     extrn   pulTKSSBase32:DWORD
     75    extrn   _TKSSBase:DWORD
    7676    push    ecx
    7777    push    edi
     
    8080    pop     es
    8181
    82     mov     edi, pulTKSSBase32
    83     mov     edi, [edi]
     82    mov     edi, _TKSSBase
    8483    add     edi, esp
    8584    mov     ecx, esp
  • branches/splittup/src/win32k/ldr/myldrRead.cpp

    r5086 r6841  
    1 /* $Id: myldrRead.cpp,v 1.9 2001-02-10 11:11:47 bird Exp $
     1/* $Id: myldrRead.cpp,v 1.9.2.1 2001-09-27 03:08:28 bird Exp $
    22 *
    33 * myldrRead - ldrRead.
     
    1515#define INCL_NOPMAPI
    1616#define INCL_OS2KRNL_LDR
     17#define INCL_KKL_LOG
     18#define INCL_KKL_AVL
    1719
    1820/*******************************************************************************
     
    2022*******************************************************************************/
    2123#include <os2.h>
     24#include <peexe.h>
     25#include <exe386.h>
     26#include <OS2Krnl.h>
     27#include <kKrnlLib.h>
    2228
    2329#include <memory.h>
     
    2531
    2632#include "devSegDf.h"                   /* Win32k segment definitions. */
    27 #include "log.h"
    28 #include "avl.h"
    2933#include "dev32.h"
    30 #include <peexe.h>
    31 #include <exe386.h>
    32 #include "OS2Krnl.h"
    3334#include "ldr.h"
    3435#include "ModuleBase.h"
  • branches/splittup/src/win32k/ldr/myldrSetVMflags.cpp

    r5086 r6841  
    1 /* $Id: myldrSetVMflags.cpp,v 1.2 2001-02-10 11:11:47 bird Exp $
     1/* $Id: myldrSetVMflags.cpp,v 1.2.2.1 2001-09-27 03:08:28 bird Exp $
    22 *
    33 * myldrSetVMflags - ldrSetVMflags
    44 *
    5  * Copyright (c) 2000 knut st. osmundsen
     5 * Copyright (c) 2000-2001 knut st. osmundsen (kosmunds@csc.com)
    66 *
    77 * Project Odin Software License can be found in LICENSE.TXT
     
    1717#define INCL_OS2KRNL_VM
    1818#define INCL_OS2KRNL_LDR
     19#define INCL_KKL_LOG
     20#define INCL_KKL_AVL
     21
    1922
    2023/*******************************************************************************
     
    2225*******************************************************************************/
    2326#include <os2.h>
     27#include <peexe.h>
     28#include <exe386.h>
     29#include <OS2Krnl.h>
     30#include <kKrnlLib.h>
    2431
    2532#include <memory.h>
     
    2734
    2835#include "devSegDf.h"                   /* Win32k segment definitions. */
    29 #include "log.h"
    30 #include "avl.h"
    31 #include <peexe.h>
    32 #include <exe386.h>
    33 #include "OS2Krnl.h"
    3436#include "ldr.h"
    3537
  • branches/splittup/src/win32k/ldr/myldrWasLoadModuled.cpp

    r5086 r6841  
    1 /* $Id: myldrWasLoadModuled.cpp,v 1.2 2001-02-10 11:11:47 bird Exp $
     1/* $Id: myldrWasLoadModuled.cpp,v 1.2.2.1 2001-09-27 03:08:28 bird Exp $
    22 *
    33 * ldrWasLoadModuled - Tells OS/2 that the executable module was LoadModuled
     
    1818#define INCL_OS2KRNL_PTDA
    1919#define INCL_OS2KRNL_LDR
     20#define INCL_KKL_LOG
     21#define INCL_KKL_AVL
    2022
    2123/*******************************************************************************
     
    2325*******************************************************************************/
    2426#include <os2.h>
     27#include <peexe.h>
     28#include <exe386.h>
     29#include <OS2Krnl.h>
     30#include <kKrnlLib.h>
    2531
    2632#include <memory.h>
     
    2935
    3036#include "devSegDf.h"                   /* Win32k segment definitions. */
    31 #include "log.h"
    32 #include "avl.h"
    33 #include <peexe.h>
    34 #include <exe386.h>
    35 #include "OS2Krnl.h"
    3637#include "dev32.h"
    3738#include "ldr.h"
  • branches/splittup/src/win32k/ldr/mytkExecPgm.asm

    r5247 r6841  
    1 ; $Id: mytkExecPgm.asm,v 1.13 2001-02-23 02:57:55 bird Exp $
     1; $Id: mytkExecPgm.asm,v 1.13.2.1 2001-09-27 03:08:28 bird Exp $
    22;
    33; mytkExecPgm - tkExecPgm overload
    44;
    5 ; Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     5; Copyright (c) 2000-2001 knut st. osmundsen (kosmunds@csc.no)
    66;
    77; Project Odin Software License can be found in LICENSE.TXT
     
    5757    ; LDR semaphore
    5858    ;
    59     extrn pLdrSem:DWORD
     59    extrn _LdrSem:DWORD
    6060    extrn _LDRClearSem@0:PROC
    6161    extrn _KSEMRequestMutex@8:PROC
     
    8080    ; TKSSBase (32-bit)
    8181    ;
    82     extrn pulTKSSBase32:DWORD
     82    extrn _TKSSBase:DWORD
    8383
    8484;
     
    222222    ASSUME  DS:FLAT, ES:FLAT
    223223
    224     mov     eax, pLdrSem                ; Get pointer to the loader semaphore.
     224    mov     eax, offset _LdrSem         ; Get pointer to the loader semaphore.
    225225    or      eax, eax                    ; Check if null. (paranoia)
    226226    jz      tkepgm_backout              ; Fail if null.
     
    332332    ;
    333333    push    0                           ; Usage count variable.
    334     mov     eax, pulTKSSBase32          ; Get TKSSBase
    335     mov     eax, [eax]
     334    mov     eax, _TKSSBase              ; Get TKSSBase
    336335    add     eax, esp                    ; Added TKSSBase to the usage count pointer
    337336    push    eax                         ; Push address of usage count pointer.
    338     push    pLdrSem                     ; Push pointer to loader semaphore ( = handle).
     337    push    offset _LdrSem              ; Push pointer to loader semaphore ( = handle).
    339338    call    _KSEMQueryMutex@8
    340339    or      eax, eax                    ; Check return code. (1 = our / free; 0 = not our but take)
  • branches/splittup/src/win32k/ldr/mytkStartProcess.asm

    r5247 r6841  
    1 ; $Id: mytkStartProcess.asm,v 1.4 2001-02-23 02:57:55 bird Exp $
     1; $Id: mytkStartProcess.asm,v 1.4.2.1 2001-09-27 03:08:29 bird Exp $
    22;
    33; tkStartProcess overloader. Needed to clear the loader semaphore
    44; when a process is being started syncronously.
    55;
    6 ; Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@mynd.no)
     6; Copyright (c) 2000-2001 knut st. osmundsen (kosmunds@csc.no)
    77;
    88; Project Odin Software License can be found in LICENSE.TXT
     
    2424    ; LDR semaphore
    2525    ;
    26     extrn pLdrSem:DWORD
     26    extrn _LdrSem:DWORD
    2727    extrn _LDRClearSem@0:PROC
    2828    extrn _KSEMQueryMutex@8:PROC
     
    4646    ; TKSSBase (32-bit)
    4747    ;
    48     extrn pulTKSSBase32:DWORD
     48    extrn _TKSSBase:DWORD
    4949
    5050    ;
     
    8383
    8484    push    0                           ; Usage count variable.
    85     mov     eax, pulTKSSBase32          ; Get TKSSBase
    86     mov     eax, [eax]
     85    mov     eax, _TKSSBase              ; Get TKSSBase
    8786    add     eax, esp                    ; Added TKSSBase to the usage count pointer
    8887    push    eax                         ; Push address of usage count pointer.
    89     push    pLdrSem                     ; Push pointer to loader semaphore ( = handle).
     88    push    offset _LdrSem              ; Push pointer to loader semaphore ( = handle).
    9089    call    _KSEMQueryMutex@8
    9190    or      eax, eax                    ; Check return code. (1 = our / free; 0 = not our but take)
  • branches/splittup/src/win32k/ldr/xx2lxmain.cpp

    r5293 r6841  
    1 /* $Id: xx2lxmain.cpp,v 1.1 2001-03-11 16:37:17 bird Exp $
     1/* $Id: xx2lxmain.cpp,v 1.1.2.1 2001-09-27 03:08:29 bird Exp $
    22 *
    33 * Xx2Lx main program. (Ring 3 only!)
     
    4646*******************************************************************************/
    4747char            szBackupXxFilename[CCHMAXPATH];        /* too save stack/heap */
    48 struct options  options = DEFAULT_OPTION_ASSIGMENTS;
     48struct Win32kOptions  options = DEFAULT_OPTION_ASSIGMENTS;
    4949
    5050/*******************************************************************************
  • branches/splittup/src/win32k/misc/PerTaskW32kData.c

    r6296 r6841  
    1 /* $Id: PerTaskW32kData.c,v 1.2 2001-07-10 16:39:19 bird Exp $
     1/* $Id: PerTaskW32kData.c,v 1.2.2.1 2001-09-27 03:08:30 bird Exp $
    22 *
    33 * Per Task (Win32k) Data.
     
    1818#define INCL_OS2KRNL_TK                 /* OS2KRNL: Task Stuff */
    1919#define INCL_OS2KRNL_PTDA
     20#define INCL_KKL_AVL
     21#define INCL_KKL_LOG
     22#define INCL_KKL_HEAP
    2023
    2124/*******************************************************************************
     
    2326*******************************************************************************/
    2427#include <os2.h>
     28#include <OS2Krnl.h>
     29#include <kKrnlLib.h>
    2530
    2631#include "devSegDf.h"                   /* Win32k segment definitions. */
    2732#include "dev32.h"
    2833#include "dev32hlp.h"
    29 #include "log.h"
    30 #include "OS2Krnl.h"
    3134#include <string.h>
    32 #include "macros.h"
    33 #include "avl.h"
    3435#include "PerTaskW32kData.h"
    35 #include "rmalloc.h"
    3636
    3737
     
    3939*   Global Variables                                                           *
    4040*******************************************************************************/
    41 /*static*/ PAVLNODECORE pPTDTree;       /* Pointer to PTD tree */
     41/*static*/ PAVLPVNODECORE pPTDTree;     /* Pointer to PTD tree */
    4242                                        /* Currently assumed protected by ldrSem. */
    4343
     
    6565    if (pPTDA == 0)
    6666        pPTDA = ptdaGetCur();
    67     pptd = (PPTD)(void*)AVLGet(&pPTDTree, (AVLKEY)pPTDA);
     67    pptd = (PPTD)(void*)AVLPVGet(&pPTDTree, pPTDA);
    6868    if (!pptd && fCreate)
    6969    {
     
    7575        }
    7676        memset(pptd, 0, sizeof(*pptd));
    77         pptd->core.Key = (AVLKEY)pPTDA;
    78         AVLInsert(&pPTDTree, &pptd->core);
     77        pptd->core.Key = pPTDA;
     78        AVLPVInsert(&pPTDTree, &pptd->core);
    7979    }
    8080    return pptd;
     
    9393    if (pPTDA == 0)
    9494        pPTDA = ptdaGetCur();
    95     pptd = (PPTD)(void*)AVLRemove(&pPTDTree, (AVLKEY)pPTDA);
     95    pptd = (PPTD)(void*)AVLPVRemove(&pPTDTree, pPTDA);
    9696    if (pptd)
    9797    {
  • branches/splittup/src/win32k/pe2lx/pe2lx.cpp

    r6493 r6841  
    1 /* $Id: pe2lx.cpp,v 1.32 2001-08-08 17:24:45 bird Exp $
     1/* $Id: pe2lx.cpp,v 1.32.2.1 2001-09-27 03:08:34 bird Exp $
    22 *
    33 * Pe2Lx class implementation. Ring 0 and Ring 3
     
    1919#define INCL_OS2KRNL_LDR                /* Loader definitions. */
    2020#define INCL_OS2KRNL_PTDA               /* PTDA definitions. */
     21#define INCL_KKL_LOG
     22#define INCL_KKL_AVL
     23#define INCL_KKL_HEAP
    2124#ifdef RING0
    2225    #define INCL_NOAPI                  /* RING0: No apis. */
     26    #define Yield() D32Hlp_Yield()
    2327#else /*RING3*/
    2428    #define INCL_DOSPROCESS             /* RING3: DosSleep. */
    2529    #define INCL_OS2KRNL_LDR_NOAPIS     /* No apis */
     30    #define Yield() DosSleep(0)
    2631#endif
    2732
     
    8388#include <newexe.h>                     /* OS/2 NE structs and definitions. */
    8489#include <exe386.h>                     /* OS/2 LX structs and definitions. */
     90#include <OS2Krnl.h>                    /* kernel structs.  (SFN) */
     91#include <kKrnlLib.h>
    8592
    8693#include "devSegDf.h"                   /* Win32k segment definitions. */
    87 
    88 #include "malloc.h"                     /* win32k malloc (resident). Not C library! */
    89 #include "smalloc.h"                    /* win32k swappable heap. */
    90 #include "rmalloc.h"                    /* win32k resident heap. */
    9194
    9295#include <string.h>                     /* C library string.h. */
     
    9598#include <stdarg.h>                     /* C library stdarg.h. */
    9699
    97 #include "vprintf.h"                    /* win32k printf and vprintf. Not C library! */
    98100#include "dev32.h"                      /* 32-Bit part of the device driver. (SSToDS) */
    99 #include "OS2Krnl.h"                    /* kernel structs.  (SFN) */
    100101#ifdef RING0
    101     #include "avl.h"                    /* AVL tree. (ldr.h need it) */
    102102    #include "ldr.h"                    /* ldr helpers. (ldrGetExePath) */
    103103    #include "env.h"                    /* Environment helpers. */
     
    108108#include "pe2lx.h"                      /* Pe2Lx class definitions, ++. */
    109109#include <versionos2.h>                 /* Pe2Lx version. */
    110 #include "yield.h"                      /* Yield CPU. */
    111110#include "options.h"                    /* Win32k options. */
    112111
     
    17911790
    17921791            case FINDDLL_LIBPATH:
    1793                 pszPath = *pLdrLibPath;
     1792                pszPath = LdrLibPath;
    17941793                break;
    17951794
  • branches/splittup/src/win32k/test/fake.c

    r6288 r6841  
    1 /* $Id: fake.c,v 1.9 2001-07-10 05:26:51 bird Exp $
     1/* $Id: fake.c,v 1.9.4.1 2001-09-27 03:08:35 bird Exp $
    22 *
    33 * Fake stubs for the ldr and kernel functions we imports or overloads.
     
    21012101
    21022102/**
     2103 *
     2104 * @returns     OS/2 return code.
     2105 * @param       pid     Process Identifier.
     2106 * @param       ppPTDA  Pointer to the PTDA-pointer variabel which is to receive
     2107 *                      the PTDA pointer on successful return.
     2108 */
     2109ULONG KRNLCALL   fakeTKScanTasks(ULONG flFlags, ULONG id, PTKSCANTASKWORKER pfnWorker, ULONG ulArg);
     2110{
     2111    DUMMY();
     2112    printf("fakeTKScanTasks:                       - not implemented\n");
     2113    return ERROR_NOT_SUPPORTED;
     2114}
     2115
     2116/**
    21032117 * Force a thread to be made ready.
    21042118 * @param   flFlag  Which flag(s?) to set.
  • branches/splittup/src/win32k/win32k.def

    r5247 r6841  
    11;******************************************************************************
    2 ; Copyright 1998-2000 knut st. osmundsen
     2; Copyright 1998-2001 knut st. osmundsen
    33; Definition file for Win32k
    44; Project Odin Software License can be found in LICENSE.TXT
    55;******************************************************************************
    6 PHYSICAL DEVICE Grace
    7 DESCRIPTION "Odin32 Ring-0 support driver - copyright (c) 1998-2000 knut st. osmundsen"
     6PHYSICAL DEVICE Win32k
     7DESCRIPTION "Odin32 Ring-0 support driver - copyright (c) 1998-2001 knut st. osmundsen"
    88
    99CODE PRELOAD EXECUTEREAD
  • branches/splittup/src/win32k/win32k.mak

    r6429 r6841  
    1 # $Id: win32k.mak,v 1.13 2001-07-31 21:34:08 bird Exp $
     1# $Id: win32k.mak,v 1.13.2.1 2001-09-27 03:08:08 bird Exp $
    22
    33#
    44# Win32k.sys makefile.
    55#
    6 # Copyright 1998-2001 knut st. osmundsen (knut.stange.osmundsen@mynd.no)
     6# Copyright 1998-2001 knut st. osmundsen (kosmunds@csc.com)
    77#
    88# Project Odin Software License can be found in LICENSE.TXT
     
    3939    $(WIN32KOBJ)\d16strat.obj \
    4040    $(WIN32KOBJ)\d32CallGate.obj \
    41     $(WIN32KOBJ)\d32hlp.obj \
    4241    $(WIN32KOBJ)\d32globals.obj \
    4342    $(WIN32KOBJ)\d16globl.obj \
    44     $(WIN32KOBJ)\abort.obj \
    45     $(WIN32KOBJ)\asmutils.obj \
    46     $(WIN32KOBJ)\calltaba.obj \
    47     $(WIN32KOBJ)\locks.obj \
    48     $(WIN32KOBJ)\malloc.obj \
    49     $(WIN32KOBJ)\smalloc_avl.obj \
    50     $(WIN32KOBJ)\avl.obj \
    51     $(WIN32KOBJ)\rmalloc_avl.obj \
    52     $(WIN32KOBJ)\new.obj \
    53     $(WIN32KOBJ)\env.obj \
    5443    $(WIN32KOBJ)\PerTaskW32kData.obj \
    55     $(WIN32KOBJ)\stricmp.obj \
    56     $(WIN32KOBJ)\yield.obj \
    57     $(WIN32KOBJ)\vsprintf.obj \
    58     $(WIN32KOBJ)\vprintf.obj \
    5944    $(WIN32KOBJ)\ldr.obj \
    6045    $(WIN32KOBJ)\myldrClose.obj \
     
    6954    $(WIN32KOBJ)\myldrGetFileName.obj \
    7055    $(WIN32KOBJ)\d32Events.obj \
    71     $(WIN32KOBJ)\OS2KTCB.obj \
    72     $(WIN32KOBJ)\OS2KPTDA.obj \
    7356    $(WIN32KOBJ)\pe2lx.obj \
    7457    $(WIN32KOBJ)\ModuleBase.obj \
    75     $(WIN32KOBJ)\d32ElfIOCtl.obj \
    7658    $(WIN32KOBJ)\d32Win32kIOCtl.obj \
    7759    $(WIN32KOBJ)\d32Win32kOpenClose.obj \
     
    9072    $(WIN32KOBJ)\vprntf16.obj \
    9173    $(WIN32KOBJ)\d32init.obj \
    92     $(WIN32KOBJ)\d16init.obj_init \
    93     $(WIN32KOBJ)\ProbKrnl.obj_init \
    94     $(WIN32KOBJ)\SymDB.obj
     74    $(WIN32KOBJ)\d16init.obj_init
    9575
    9676LASTOBJ =\
     
    10181    $(DDKPATH)\lib\os2386.lib \
    10282    $(WIN32KOBJ)\devhelp.lib \
    103     $(WIN32KOBJ)\clib.lib
     83    $(WIN32KOBJ)\clib.lib \
     84    $(ODIN32_LIB)\kKrnlLib.lib
    10485
    10586
     
    10990$(NAME).sys: $(WIN32KBIN)\$(NAME).sys
    11091
    111 $(WIN32KBIN)\$(NAME).sys:   clfix.exe \
     92$(WIN32KBIN)\$(NAME).sys:   $(WIN32KBIN)\clfix.exe \
    11293                            $(WIN32KINCLUDE)\options.inc \
    11394                            $(WIN32KINCLUDE)\api.inc \
     
    152133
    153134# Add bldlevel signature to win32k.def - creates temporary win32kbldlevel.def.
    154 $(WIN32KOBJ)\$(NAME)bldlevel.def: $(NAME).def win32k.mak MakeDesc.cmd
     135$(WIN32KOBJ)\$(NAME)bldlevel.def: $(NAME).def win32k.mak
    155136    -$(ECHO) Creates $@ with bldlevel signature string.
    156137    $(BLDLEVELINF) $(NAME).def $@ -R"$(NAME).def" \
     
    166147TSTOBJS =\
    167148    $(WIN32KOBJ)\devfirst.obj \
    168     $(WIN32KOBJ)\$(NAME)tst.obj \
    169     $(WIN32KOBJ)\dh.obj \
    170     $(WIN32KOBJ)\dos.obj \
    171     $(WIN32KOBJ)\dosa.obj \
    172     $(WIN32KOBJ)\init.obj \
    173     $(WIN32KOBJ)\fake.obj \
    174     $(WIN32KOBJ)\fakea.obj \
    175     $(WIN32KOBJ)\TstFakers.obj \
    176149    $(WIN32KOBJ)\d16strat.obj \
    177150    $(WIN32KOBJ)\d32CallGate.obj \
     
    179152    $(WIN32KOBJ)\d32globals.obj \
    180153    $(WIN32KOBJ)\d16globl.obj \
    181     $(WIN32KOBJ)\abort.obj \
    182154    $(WIN32KOBJ)\asmutils.obj \
    183     $(WIN32KOBJ)\calltaba.obj \
    184155    $(WIN32KOBJ)\locks.obj \
    185     $(WIN32KOBJ)\malloc.obj_tst. \
    186     $(WIN32KOBJ)\smalloc_avl.obj \
    187     $(WIN32KOBJ)\avl.obj \
    188     $(WIN32KOBJ)\rmalloc_avl.obj \
    189     $(WIN32KOBJ)\new.obj \
    190     $(WIN32KOBJ)\env.obj \
    191156    $(WIN32KOBJ)\PerTaskW32kData.obj \
    192     $(WIN32KOBJ)\stricmp.obj \
    193     $(WIN32KOBJ)\yield.obj \
    194     $(WIN32KOBJ)\vsprintf.obj \
    195     $(WIN32KOBJ)\vprintf.obj_tst. \
    196157    $(WIN32KOBJ)\ldr.obj \
    197158    $(WIN32KOBJ)\myldrClose.obj \
     
    210171    $(WIN32KOBJ)\pe2lx.obj \
    211172    $(WIN32KOBJ)\ModuleBase.obj \
    212     $(WIN32KOBJ)\d32ElfIOCtl.obj \
    213173    $(WIN32KOBJ)\d32Win32kIOCtl.obj \
    214174    $(WIN32KOBJ)\d32Win32kOpenClose.obj \
     
    228188    $(WIN32KOBJ)\d32init.obj_tst. \
    229189    $(WIN32KOBJ)\d16init.obj_tst_init. \
    230     $(WIN32KOBJ)\ProbKrnl.obj_tst_init. \
    231     $(WIN32KOBJ)\SymDB.obj
     190    $(WIN32KOBJ)\$(NAME)tst.obj \
     191    $(WIN32KOBJ)\dh.obj \
     192    $(WIN32KOBJ)\dos.obj \
     193    $(WIN32KOBJ)\dosa.obj \
     194    $(WIN32KOBJ)\init.obj \
     195    $(WIN32KOBJ)\fake.obj \
     196    $(WIN32KOBJ)\fakea.obj \
    232197
    233198TSTLASTOBJ = $(LASTOBJ)
     
    348313
    349314#
    350 # Generate calltaba.asm
    351 #
    352 ldr\calltaba.asm \
    353 $(WIN32KBASE)\ldr\calltaba.asm : dev16\probkrnl.c $(WIN32KBIN)\mkcalltab.exe
    354     $(WIN32KBIN)\mkcalltab.exe calltab > $@
    355 
    356 
    357 #
    358 # Generate TstFakers.c
    359 #
    360 test\TstFakers.c \
    361 $(WIN32KBASE)\test\TstFakers.c: dev16\probkrnl.c include\probkrnl.h $(WIN32KBIN)\mkcalltab.exe
    362     $(WIN32KBIN)\mkcalltab.exe tstfakers > $@
    363 
    364 
    365 #
    366315# Make assembly version of options.h; options.inc
    367316#
     
    395344# Make the convert tool.
    396345#
    397 $(WIN32KBIN)\libconv.exe: libconv.c
    398     icc -Q+ -Ti+ -Fe$@ -Fo$(WIN32KOBJ)\$(*B).obj libconv.c
    399 
    400 
    401 #
    402 # Make the MkCallTab.exe utillity.
    403 #
    404 
    405 # MkCallTab objects.
    406 MKCALLTABOBJS = \
    407     $(WIN32KOBJ)\mkcalltab.obj_c \
    408     $(WIN32KOBJ)\probkrnl.obj_c \
    409     $(WIN32KOBJ)\d16globl.obj_c \
    410     $(WIN32KOBJ)\vprntf16.obj_c
    411 
    412 # Rule to build MkCallTab.exe
    413 mkcalltab.exe mkcalltab: $(WIN32KBIN)\mkcalltab.exe
    414 $(WIN32KBIN)\mkcalltab.exe: clfix.exe $(MKCALLTABOBJS)
    415     $(LD) $(LFLAGS) /pmtype:vio @<<$(WIN32KOBJ)\$(@B).lnk
    416         /OUT:$@
    417         /MAP:$(WIN32KBIN)\$(@B).map
    418         $(MKCALLTABOBJS)
    419         $(TOOLKIT)\lib\os2286.lib
    420         $(MSCPATH)\lib\clibcep.lib
    421 <<keep
    422 
    423 # Interference rule to make the MkCallTab objects.
    424 {dev16}.c.obj_c:
    425     @$(ECHO) compiling 16bit (mkcalltab): $<
    426     @$(CC16) -c -W3 -Asfw -G2s -Zp -Zl -nologo -Fa -Zi -Od -Lp -DDEBUG -DEXTRACT \
    427         -Fa$(WIN32KLIST)\$(*B)_c.s -Fo$(WIN32KOBJ)\$(@B).obj_c $(CINCLUDES16) $<
     346$(WIN32KBIN)\libconv.exe: kKrnlLib\tools\libconv.c
     347    icc -Q+ -Ti+ -Fe$@ -Fo$(WIN32KOBJ)\$(*B).obj $**
    428348
    429349
     
    433353#   MSC v6.0a compiler (cl.exe) (16-bit).
    434354#
    435 clfix.exe: clfix.c
    436     $(CC) $(@B).c
    437 
    438 
    439 #
    440 # Make the symbol extract utillity - Extract.exe
    441 #
    442 
    443 # Extract object files.
    444 EXTRACTOBJS = \
    445     $(WIN32KOBJ)\extract.obj_e \
    446     $(WIN32KOBJ)\probkrnl.obj_e \
    447     $(WIN32KOBJ)\d16globl.obj_e \
    448     $(WIN32KOBJ)\vprntf16.obj_e
    449 
    450 # Rules to build Extract.exe.
    451 $(WIN32KBIN)\extract.exe: clfix.exe $(EXTRACTOBJS)
    452     $(LD) $(LFLAGS) /pmtype:vio @<<$(WIN32KOBJ)\$(@B).lnk
    453         /OUT:$@
    454         /MAP:$(WIN32KBIN)\$(@B).map
    455         $(EXTRACTOBJS)
    456         $(TOOLKIT)\lib\os2286.lib
    457         $(MSCPATH)\lib\clibcep.lib
    458 <<keep
    459 
    460 # Copy rule.
    461 extract.exe: $(WIN32KBIN)\extract.exe
    462     $(CP) $** $@
    463 
    464 # Interference rule to make the Extract objects.
    465 {dev16}.c.obj_e:
    466     @$(ECHO) compiling 16bit (extract): $<
    467     @$(CC16) -c -W3 -Asfw -G2s -Zp -Zl -nologo -Fa -Zi -Od -Lp -DDEBUG -DEXTRACT \
    468         -Fa$(WIN32KLIST)\$(*B)_e.s -Fo$(WIN32KOBJ)\$(@B).obj_e $(CINCLUDES16) $<
    469 
    470 
     355$(WIN32KBIN)\clfix.exe: kKrnlLib\tools\clfix.c
     356    icc -Q+ -Ti+ -Fe$@ -Fo$(WIN32KOBJ)\$(*B).obj $**
    471357
    472358
  • branches/splittup/src/win32k/win32k.tools.mk

    r5944 r6841  
    1 # $Id: win32k.tools.mk,v 1.10 2001-06-10 01:38:09 bird Exp $
     1# $Id: win32k.tools.mk,v 1.10.2.1 2001-09-27 03:08:08 bird Exp $
    22
    33#
     
    3030# IBM VisualAge for C++ v3.08 or IBM C/C++ Tools v3.6.5
    3131#
    32 CC16        = clfix.exe $(MSCPATH)\binp\cl.exe
     32CC16        = $(WIN32KBIN)\clfix.exe $(MSCPATH)\binp\cl.exe
    3333CC          = icc
    3434CCPP        = icc
     
    8989#
    9090!ifdef DEBUG
    91 CDEFINES    = -DWIN32K -DRING0 -D__WIN32OS2__ -D__WINE__ -DDEBUG
    92 CDEFINES16  = -DRING0    -DDEBUG
    93 ADEFINES    = -D:WIN32K -D:DEBUG
    94 !else
    95 CDEFINES    = -DWIN32K -DRING0 -D__WIN32OS2__ -D__WINE__ -DRELEASE
    96 CDEFINES16  = -DRING0    -DRELEASE
    97 ADEFINES    = -D:WIN32K -D:RELEASE
     91CDEFINES    = -DWIN32K -DRING0 -D__WIN32OS2__ -D__WINE__ -DDEBUG $(CDEFINESEXTRA)
     92CDEFINES16  = -DRING0    -DDEBUG $(CDEFINESEXTRA16)
     93ADEFINES    = -D:WIN32K -D:DEBUG $(ADEFINESEXTRA)
     94!else
     95CDEFINES    = -DWIN32K -DRING0 -D__WIN32OS2__ -D__WINE__ -DRELEASE $(CDEFINESEXTRA)
     96CDEFINES16  = -DRING0    -DRELEASE $(CDEFINESEXTRA16)
     97ADEFINES    = -D:WIN32K -D:RELEASE $(ADEFINESEXTRA)
    9898!endif
    9999
     
    106106#
    107107CINCLUDES  = -I$(WIN32KINCLUDE) \
     108             -I$(KKRNLLIBINCLUDE) \
    108109             -I$(TOOLKIT)\h \
    109110             -I$(VACPATH)\include \
     
    115116
    116117CINCLUDES16= -I$(WIN32KINCLUDE) \
     118             -I$(KKRNLLIBINCLUDE) \
    117119             -I. \
    118120             -I$(DDKPATH)\h \
     
    122124
    123125AINCLUDES  = -Fdi:$(WIN32KINCLUDE) \
     126             -Fdi:$(KKRNLLIBINCLUDE) \
    124127             -Fdi:$(DDKPATH)\inc
    125128
     
    321324
    322325
     326{Krnl}.asm{$(WIN32KOBJ)}.obj:
     327    @$(ECHO) assembling Krnl:       $(SOURCEFILE)
     328    @$(ASMCOMPILE)
     329{Krnl}.asm.obj:
     330    @$(ECHO) assembling Krnl:       $(SOURCEFILE)
     331    @$(ASMCOMPILE)
     332
     333{Krnl}.c{$(WIN32KOBJ)}.obj:
     334    @$(ECHO) compiling 32bit Krnl:  $(SOURCEFILE)
     335    @$(CCOMPILE)
     336{Krnl}.c.obj:
     337    @$(ECHO) compiling 32bit Krnl:  $(SOURCEFILE)
     338    @$(CCOMPILE)
     339
     340{Krnl}.c{$(WIN32KOBJ)}.obj_tst:
     341    @$(ECHO) compiling 32bit Krnl tst: $(SOURCEFILE)
     342    @$(CCOMPILE_TST)
     343    @$(CP) $@ $@.obj
     344{Krnl}.c.obj_tst:
     345    @$(ECHO) compiling 32bit Krnl tst: $(SOURCEFILE)
     346    @$(CCOMPILE_TST)
     347    @$(CP) $@ $@.obj
     348
     349{Krnl}.cpp{$(WIN32KOBJ)}.obj:
     350    @$(ECHO) compiling 32bit Krnl:  $(SOURCEFILE)
     351    @$(CCOMPILE)
     352{Krnl}.cpp.obj:
     353    @$(ECHO) compiling 32bit Krnl:  $(SOURCEFILE)
     354    @$(CCOMPILE)
     355
     356
     357{clib}.asm{$(WIN32KOBJ)}.obj:
     358    @$(ECHO) assembling Krnl:       $(SOURCEFILE)
     359    @$(ASMCOMPILE)
     360{clib}.asm.obj:
     361    @$(ECHO) assembling Krnl:       $(SOURCEFILE)
     362    @$(ASMCOMPILE)
     363
     364{clib}.c{$(WIN32KOBJ)}.obj:
     365    @$(ECHO) compiling 32bit Krnl:  $(SOURCEFILE)
     366    @$(CCOMPILE)
     367{clib}.c.obj:
     368    @$(ECHO) compiling 32bit Krnl:  $(SOURCEFILE)
     369    @$(CCOMPILE)
     370
     371{clib}.c{$(WIN32KOBJ)}.obj_tst:
     372    @$(ECHO) compiling 32bit Krnl tst: $(SOURCEFILE)
     373    @$(CCOMPILE_TST)
     374    @$(CP) $@ $@.obj
     375{clib}.c.obj_tst:
     376    @$(ECHO) compiling 32bit Krnl tst: $(SOURCEFILE)
     377    @$(CCOMPILE_TST)
     378    @$(CP) $@ $@.obj
     379
     380{clib}.cpp{$(WIN32KOBJ)}.obj:
     381    @$(ECHO) compiling 32bit Krnl:  $(SOURCEFILE)
     382    @$(CCOMPILE)
     383{clib}.cpp.obj:
     384    @$(ECHO) compiling 32bit Krnl:  $(SOURCEFILE)
     385    @$(CCOMPILE)
     386
     387
     388
     389
    323390{pe2lx}.c{$(WIN32KOBJ)}.obj:
    324391    @$(ECHO) compiling 32bit pe2lx:  $(SOURCEFILE)
     
    358425
    359426
     427
     428{testcase}.asm{$(WIN32KOBJ)}.obj:
     429    @$(ECHO) assembling testcase:    $(SOURCEFILE)
     430    @$(ASMCOMPILE_TST)
     431{testcase}.asm.obj:
     432    @$(ECHO) assembling testcase:    $(SOURCEFILE)
     433    @$(ASMCOMPILE_TST)
     434
     435{testcase}.c{$(WIN32KOBJ)}.obj:
     436    @$(ECHO) compiling 32bit testcase: $(SOURCEFILE)
     437    @$(CCOMPILE_TST_TEST)
     438{testcase}.c.obj:
     439    @$(ECHO) compiling 32bit testcase: $(SOURCEFILE)
     440    @$(CCOMPILE_TST_TEST)
     441
     442{testcase}.cpp{$(WIN32KOBJ)}.obj:
     443    @$(ECHO) compiling 32bit testcase: $(SOURCEFILE)
     444    @$(CPPCOMPILE_TST_TEST)
     445{testcase}.cpp.obj:
     446    @$(ECHO) compiling 32bit testcase: $(SOURCEFILE)
     447    @$(CPPCOMPILE_TST_TEST)
     448
  • branches/splittup/src/win32k/win32k.vpj

    r5247 r6841  
    11[COMPILER]
    22MACRO=odin32_setcurrentdir();\nodin32_maketagfile();\n
    3 FILTEREXPANSION=0 1 0 0 0 0 0 0 0 0 0 1 1 0
    4 compile=concur|capture|clear|:Compile:&Compile,nmake -f win32k.mak .\bin\debug\%n.obj
     3FILTEREXPANSION=1 1 0 0 1
     4compile=concur|capture|clear|:Compile:&Compile,nmake .\bin\debug\%n.obj
    55make=concur|capture|clear|:Build:&Build,nmake
    66rebuild=concur|capture|clear|:Rebuild:&Rebuild,nmake -a
     
    1010user2=hide|:User 2:User 2,
    1111usertool_resource_editor=hide|:Resource Editor:Resource Editor,dlgedit
    12 workingdir=..\..\src\win32k
    13 includedirs=include;..\..\include;..\..\include\win;%(INCLUDE)
     12workingdir=G:\ODIN32\TREE\src\win32k
     13includedirs=G:\ODIN32\TREE\src\win32k\include;G:\ODIN32\TREE\src\win32k\kKrnlLib\include;F:\toolkit\h;f:\ibmcpp\include;F:\ddk\base\h;F:\ddk\base\src\dev\dasd\diskh;.;G:\ODIN32\TREE\include;G:\ODIN32\TREE\include\win;%(INCLUDE)
    1414tagfiles=
    1515reffile=
    16 FILTERNAME=Dev16\nDev32\nLoader\nPe2Lx\nElf2Lx\nRexx\nMisc\nKernelStuff\nTest\nDef Files\nMakefiles\nLibrary\nk32\nOther Files\n
    17 FILTERPATTERN=d16*;prob*;symdb*;vprintf16*;dev16*;omf*;sym*\nd32*;dev*;calltab*\nldr*;my*;ModuleBase*\npe*;ModuleBas*\nElf*;ModuleBase*\nkRx*;ModuleBase*\nmalloc*;smallo*;rmall*;heap*;new*;vpr*;spr*;vspr*;yield*;str*;macros*;cout*;buffer*;avl*;asmutil*;log*;env*;option*;type*\nOS2K*;calltab*;probe*;d32ini*\ndh.asm;dos*;fake*;init.asm;win32ktst*;test*\n*.def\nmakefile*;*.mak;Check*;configure*\nlib*;win32k.h\nk32*\n*.*\n
    18 FILTERAPPCOMMAND=\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    19 FILTERASSOCIATEFILETYPES=0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2016[FILES]
    2117calltrees.txt
    2218Check.cmd
    2319Check.mk
    24 clfix.c
    2520configure.cmd
    26 dump
    27 fastdep.c
    2821history.txt
    29 libconv.c
    3022makedesc.cmd
    31 Makefile
     23makefile
    3224Makefile.inc
    3325win32k.def
     
    3527win32k.tools.mk
    3628win32k.txt
    37 Win32knew.def
    3829win32ktst.def
    39 ..\..\include\win32k.h
     30Xx2Lx.def
     31Xx2Lx.mak
    4032api\api.cpp
    4133api\myVR32AllocMem.asm
     
    4335dev16\d16init.c
    4436dev16\d16strat.c
    45 dev16\extract.c
    46 dev16\mkcalltab.c
    47 dev16\probkrnl.c
    48 dev16\SymDB.c
    4937dev16\vprntf16.c
     38dev32\d32CallGate.asm
    5039dev32\d32ElfIOCtl.c
     40dev32\d32Events.asm
    5141dev32\d32globals.c
    5242dev32\d32hlp.asm
    5343dev32\d32init.c
    5444dev32\d32Win32kIOCtl.c
     45dev32\d32Win32kOpenClose.c
    5546dev32\devfirst.asm
    5647dev32\devlast.asm
    5748elf2lx\elf2lx.cpp
     49elf2lx\elf2lx.def
    5850elf2lx\elf2lxmain.cpp
    5951elf2lx\elfdumper.cpp
    6052elf2lx\makefile
    61 k32\k32QuerySystemMemInfo.cpp
    62 test\AllocMem.c
    63 test\AllocMem.def
    64 test\AllocMem.mak
    65 test\invokelongexename.c
    66 test\longexecutablename..c
    67 test\longexecutablename..def
    68 test\longexecutablename.c
    69 test\longexecutablename.def
    70 test\longexecutablename.drv.c
    71 test\longexecutablename.drv.def
    72 test\makefile
    73 test\MemInfoTest.c
    74 test\MemInfoTest.def
    75 test\MemInfoTest.mak
    7653include\api.h
     54include\api.inc
    7755include\asmutils.h
    78 include\avl.h
    79 include\cout.h
    8056include\dev16.h
    8157include\dev1632.h
     
    8359include\dev32hlp.h
    8460include\devSegDf.h
    85 include\devsegdf.inc
     61include\devSegDf.inc
    8662include\elf.h
    8763include\elf2lx.h
    88 include\env.h
    89 include\errors.h
    9064include\k32.h
    9165include\ldr.h
    9266include\locks.h
    93 include\log.h
    94 include\macros.h
    95 include\malloc.h
    9667include\ModuleBase.h
    9768include\myExecPgm.h
    98 include\new.h
    9969include\omf.h
    10070include\options.h
    10171include\options.inc
    102 include\OS2KIO.h
    103 include\OS2KLDR.h
    104 include\OS2KPG.h
    105 include\OS2KPTDA.h
    106 include\OS2Krnl.h
    107 include\OS2Krnl.inc
    108 include\OS2KSEC.h
    109 include\OS2KSEM.h
    110 include\OS2KSM.h
    111 include\OS2KTCB.h
    112 include\OS2KTK.h
    113 include\OS2KVM.h
    11472include\pe2lx.h
    115 include\probkrnl.h
    116 include\ptda.h
    117 include\rmalloc.h
    118 include\smalloc.h
    119 include\sprintf.h
    120 include\sym.h
     73include\PerTaskW32kData.h
    12174include\test.h
    122 include\types.h
    123 include\vprintf.h
    12475include\vprntf16.h
    125 include\yield.h
     76include\win32k.inc
    12677k32\k32AllocMemEx.cpp
     78k32\k32HandleSystemEvent.cpp
     79k32\k32KillProcessEx.cpp
    12780k32\k32ProcessReadWrite.cpp
     81k32\k32QueryCallGate.cpp
    12882k32\k32QueryOptionsStatus.cpp
    12983k32\k32QueryOTEs.cpp
     84k32\k32QuerySystemMemInfo.cpp
     85k32\k32SendSystemEvent.cpp
     86k32\k32SetEnvironment.cpp
    13087k32\k32SetOptions.cpp
     88kKrnlLib\clib\abort.c
     89kKrnlLib\clib\asmutils.asm
     90kKrnlLib\clib\kAssert.c
     91kKrnlLib\clib\kAVLBase.c.h
     92kKrnlLib\clib\kAVLDoWithAll.c.h
     93kKrnlLib\clib\kAVLEnum.c.h
     94kKrnlLib\clib\kAVLGet.c.h
     95kKrnlLib\clib\kAVLGet2.c.h
     96kKrnlLib\clib\kAVLGetBestFit.c.h
     97kKrnlLib\clib\kAVLGetWithAdjacentNodes.c.h
     98kKrnlLib\clib\kAVLGetWithParent.c.h
     99kKrnlLib\clib\kAVLPV.c
     100kKrnlLib\clib\kAVLRemove2.c.h
     101kKrnlLib\clib\kAVLRemoveBestFit.c.h
     102kKrnlLib\clib\kAVLStr.c
     103kKrnlLib\clib\kAVLStrI.c
     104kKrnlLib\clib\kAVLULM.c
     105kKrnlLib\clib\malloc.c
     106kKrnlLib\clib\new.cpp
     107kKrnlLib\clib\rmalloc.c
     108kKrnlLib\clib\smalloc.c
     109kKrnlLib\clib\stricmp.c
     110kKrnlLib\clib\vprintf.c
     111kKrnlLib\clib\vsprintf.c
     112kKrnlLib\dev32\Extract32.c
     113kKrnlLib\include\dev16.h
     114kKrnlLib\include\dev1632.h
     115kKrnlLib\include\dev32.h
     116kKrnlLib\include\dev32hlp.h
     117kKrnlLib\include\devSegDf.h
     118kKrnlLib\include\devSegDf.inc
     119kKrnlLib\include\env.h
     120kKrnlLib\include\kAssert.h
     121kKrnlLib\include\kAVL.h
     122kKrnlLib\include\kKLasmutils.h
     123kKrnlLib\include\kKLavl.h
     124kKrnlLib\include\kKLFunc.h
     125kKrnlLib\include\kKLInitHlp.h
     126kKrnlLib\include\kKLlog.h
     127kKrnlLib\include\kKLmalloc.h
     128kKrnlLib\include\kKLnew.h
     129kKrnlLib\include\kKLprintf.h
     130kKrnlLib\include\kKLrmalloc.h
     131kKrnlLib\include\kKLsmalloc.h
     132kKrnlLib\include\kKLsprintf.h
     133kKrnlLib\include\kKrnlLib.h
     134kKrnlLib\include\krnlPrivate.h
     135kKrnlLib\include\kTypes.h
     136kKrnlLib\include\omf.h
     137kKrnlLib\include\options.h
     138kKrnlLib\include\options.inc
     139kKrnlLib\include\OS2KIO.h
     140kKrnlLib\include\OS2KLDR.h
     141kKrnlLib\include\OS2KOwn.h
     142kKrnlLib\include\OS2KPG.h
     143kKrnlLib\include\OS2KPTDA.h
     144kKrnlLib\include\OS2Krnl.h
     145kKrnlLib\include\OS2KSEC.h
     146kKrnlLib\include\OS2KSEL.h
     147kKrnlLib\include\OS2KSEM.h
     148kKrnlLib\include\OS2KSM.h
     149kKrnlLib\include\OS2KTCB.h
     150kKrnlLib\include\OS2KTK.h
     151kKrnlLib\include\OS2KVM.h
     152kKrnlLib\include\ProbKrnl.h
     153kKrnlLib\include\ProbKrnlErrors.h
     154kKrnlLib\include\sym.h
     155kKrnlLib\include\testcase.h
     156kKrnlLib\include\vprntf16.h
     157kKrnlLib\krnl\env.c
     158kKrnlLib\krnl\krnlInit.c
     159kKrnlLib\krnl\krnlLockedWrite.asm
     160kKrnlLib\krnl\krnlOverloading.c
     161kKrnlLib\krnl\krnlPrologs.c
     162kKrnlLib\krnl\krnlStubs.c
     163kKrnlLib\krnl\OS2KPTDA.c
     164kKrnlLib\krnl\OS2KTCB.c
     165kKrnlLib\testcase\DH.asm
     166kKrnlLib\testcase\Dos.c
     167kKrnlLib\testcase\DosA.asm
     168kKrnlLib\testcase\Fake.c
     169kKrnlLib\testcase\FakeA.asm
     170kKrnlLib\testcase\Init.asm
     171kKrnlLib\testcase\kKrnlLibTst.c
     172kKrnlLib\testcase\TstFakers.c
     173kKrnlLib\tools\clfix.c
     174kKrnlLib\tools\libconv.c
     175ldr\calltaba.asm
    131176ldr\ldr.cpp
    132177ldr\ModuleBase.cpp
     
    136181ldr\myldrFindModule.cpp
    137182ldr\myldrGetFileName.asm
     183ldr\myLDRGetProcAddr.cpp
    138184ldr\myldrOpen.cpp
    139185ldr\myldrOpenPath.cpp
     
    142188ldr\myldrRead.cpp
    143189ldr\myldrSetVMflags.cpp
     190ldr\myldrWasLoadModuled.cpp
    144191ldr\mytkExecPgm.asm
    145192ldr\mytkStartProcess.asm
    146193ldr\myVMAllocMem.cpp
     194ldr\xx2lxmain.cpp
     195lib\libCallThruCallGate.asm
    147196lib\libDosAllocMemEx.c
     197lib\libDosKillProcessEx.c
    148198lib\libGetCS.asm
    149199lib\libInit.c
     200lib\libPrivate.h
    150201lib\libTerm.c
    151202lib\libTest.c
     203lib\libW32kHandleSystemEvent.c
    152204lib\libW32kProcessReadWrite.c
    153205lib\libW32kQueryOTEs.c
     206lib\libW32kQuerySystemMemInfo.c
    154207lib\libWin32kInstalled.c
    155208lib\libWin32kQueryOptionsStatus.c
     209lib\libWin32kSetEnvironment.c
    156210lib\libWin32kSetOptions.c
    157211lib\makefile
     
    171225misc\OS2KPTDA.c
    172226misc\OS2KTCB.c
     227misc\PerTaskW32kData.c
    173228misc\ptda.c
    174229misc\rmalloc.c
     
    180235misc\yield.c
    181236mmf\mmf.cpp
     237mmf\stderr
     238mmf\stdout
    182239pe2lx\makefile
    183240pe2lx\pe2lx.cpp
     241pe2lx\pe2lx.def
    184242pe2lx\pe2lxmain.cpp
    185243rexx\kRx.c
     
    187245rexx\kRxa.asm
    188246rexx\makefile
     247rexx\tst.asm
    189248rexx\tst.cmd
     249test\AllocMem.c
     250test\AllocMem.def
     251test\AllocMem.mak
    190252test\dh.asm
    191253test\dos.c
    192254test\dosa.asm
     255test\DosAllocMemEx.c
     256test\DosAllocMemEx.def
     257test\DosAllocMemEx.mak
    193258test\fake.c
    194259test\fakea.asm
    195260test\init.asm
     261test\invokelongexename.c
     262test\longexecutablename
     263test\longexecutablename..c
     264test\longexecutablename..def
     265test\longexecutablename.c
     266test\longexecutablename.def
     267test\longexecutablename.drv.c
     268test\longexecutablename.drv.def
     269test\makefile
     270test\MemInfoTest.c
     271test\MemInfoTest.def
     272test\MemInfoTest.mak
     273test\ole
     274test\PrfTstProcess.c
     275test\PrfTstProcess.def
     276test\PrfTstProcess.mak
    196277test\TestKernels.cmd
     278test\tst3
    197279test\TstProcessReadWrite.c
    198280test\win32ktst.c
     281test\Zombie.c
     282test\Zombie.def
     283test\Zombie.mak
     284test\test\64alloc.c
     285utils\Dialog.h
    199286utils\makefile
    200287utils\Win32kCC.c
     288utils\Win32kCC.def
    201289utils\Win32kCC.dlg
    202290utils\Win32kCC.h
    203291utils\Win32kCC.rc
     292utils\test\Dialog.h
     293utils\test\Win32kCC.c
     294utils\test\WIN32KCC.dlg
    204295[ASSOCIATION]
    205296[STATE]
    206 SCREEN: 1600 1200 -250 255 1244 800 0 0 M 0 0 0 0 1247 855
    207 CWD: G:\odin32\tree\src\win32k
     297SCREEN: 1792 1344 5 2 1194 1330 0 0 N 0 0 0 0 927 950
     298CWD: G:\odin32\tree\src\win32k\kKrnlLib
    208299BUFFER: BN="F:\VSLICK40\OS2\vrestore.slk"
    209300BI: MA=1 254 1  TABS=1 9  WWS=3 IWT=0 ST=0 IN=0 BW=0 US=0 RO=0 SE=0 SN=0 BIN=0 MN=Fundamental   HM=0 MF=1
     301VIEW: LN=.0 CL=1 LE=0 CX=0 CY=1 WI=5 BI=21 HT=0 HN=0 HF=0 HC=4
     302BUFFER: BN="G:\ODIN32\TREE\src\win32k\dev32\d32ElfIOCtl.c"
     303BI: MA=1 74 1  TABS=1 9  WWS=1 IWT=0 ST=0 IN=2 BW=0 US=32000 RO=0 SE=1 SN=0 BIN=0 MN=C  HM=0 MF=0
     304VIEW: LN=.0 CL=1 LE=0 CX=0 CY=1 WI=5 BI=26 HT=0 HN=0 HF=0 HC=4
     305BUFFER: BN="G:\ODIN32\TREE\src\win32k\dev32\d32Events.asm"
     306BI: MA=1 74 1  TABS=1 5  WWS=1 IWT=0 ST=0 IN=1 BW=0 US=32000 RO=0 SE=1 SN=0 BIN=0 MN=Assembly   HM=0 MF=0
     307VIEW: LN=.0 CL=1 LE=0 CX=0 CY=1 WI=5 BI=25 HT=0 HN=0 HF=0 HC=4
     308BUFFER: BN="G:\ODIN32\TREE\src\win32k\dev32\d32globals.c"
     309BI: MA=1 74 1  TABS=1 9  WWS=1 IWT=0 ST=0 IN=2 BW=0 US=32000 RO=0 SE=1 SN=0 BIN=0 MN=C  HM=0 MF=0
    210310VIEW: LN=.0 CL=1 LE=0 CX=0 CY=1 WI=5 BI=24 HT=0 HN=0 HF=0 HC=4
    211 BUFFER: BN="G:\odin32\tree\src\win32k\dev32\d32Events.asm"
    212 BI: MA=1 74 1  TABS=1 5  WWS=1 IWT=0 ST=0 IN=1 BW=0 US=32000 RO=0 SE=1 SN=0 BIN=0 MN=Assembly   HM=0 MF=864
    213 VIEW: LN=.4055 CL=36 LE=0 CX=35 CY=21 WI=5 BI=17 HT=0 HN=0 HF=0 HC=4
    214 BUFFER: BN="G:\odin32\tree\src\win32k\win32k.mak"
    215 BI: MA=1 74 1  TABS=1 5  WWS=1 IWT=0 ST=0 IN=2 BW=0 US=32000 RO=0 SE=1 SN=0 BIN=0 MN=   HM=0 MF=512
    216 VIEW: LN=.3660 CL=5 LE=0 CX=4 CY=21 WI=5 BI=23 HT=0 HN=0 HF=0 HC=4
    217 WINDOW: 52 54 841 577 -1 -1 M  WF=0 WT=2 "System Monospaced,10,0,1"
    218 BUFFER: BN="G:\odin32\tree\src\win32k\dev32\d32Events.asm"
    219 VIEW: LN=.4055 CL=36 LE=0 CX=35 CY=21 WI=83 BI=17 HT=0 HN=0 HF=0 HC=4
    220 WINDOW: 0 0 841 577 -1 -1 M  WF=0 WT=1 "System Monospaced,10,0,1"
    221 BUFFER: BN="G:\odin32\tree\src\win32k\win32k.mak"
    222 VIEW: LN=.3659 CL=4 LE=0 CX=3 CY=21 WI=85 BI=23 HT=0 HN=0 HF=0 HC=4
     311BUFFER: BN="G:\ODIN32\TREE\src\win32k\dev32\d32hlp.asm"
     312BI: MA=1 74 1  TABS=1 5  WWS=1 IWT=0 ST=0 IN=1 BW=0 US=32000 RO=0 SE=1 SN=0 BIN=0 MN=Assembly   HM=0 MF=0
     313VIEW: LN=.0 CL=1 LE=0 CX=0 CY=1 WI=5 BI=4 HT=0 HN=0 HF=0 HC=4
     314BUFFER: BN="G:\ODIN32\TREE\src\win32k\dev32\d32init.c"
     315BI: MA=1 74 1  TABS=1 9  WWS=1 IWT=0 ST=0 IN=2 BW=0 US=32000 RO=0 SE=1 SN=0 BIN=0 MN=C  HM=0 MF=608
     316VIEW: LN=.934 CL=21 LE=0 CX=20 CY=27 WI=5 BI=27 HT=0 HN=0 HF=0 HC=4
     317WINDOW: 260 270 625 641 -1 -1 M  WF=0 WT=1 "System Monospaced,10,0,1"
     318BUFFER: BN="G:\ODIN32\TREE\src\win32k\dev32\d32ElfIOCtl.c"
     319VIEW: LN=.0 CL=1 LE=0 CX=0 CY=1 WI=84 BI=26 HT=0 HN=0 HF=0 HC=4
     320WINDOW: 286 297 625 641 -1 -1 M  WF=0 WT=3 "System Monospaced,10,0,1"
     321BUFFER: BN="G:\ODIN32\TREE\src\win32k\dev32\d32Events.asm"
     322VIEW: LN=.0 CL=1 LE=0 CX=0 CY=1 WI=83 BI=25 HT=0 HN=0 HF=0 HC=4
     323WINDOW: 0 0 625 641 -1 -1 M  WF=0 WT=4 "System Monospaced,10,0,1"
     324BUFFER: BN="G:\ODIN32\TREE\src\win32k\dev32\d32globals.c"
     325VIEW: LN=.0 CL=1 LE=0 CX=0 CY=1 WI=134 BI=24 HT=0 HN=0 HF=0 HC=4
     326WINDOW: 26 27 625 641 -1 -1 M  WF=0 WT=5 "System Monospaced,10,0,1"
     327BUFFER: BN="G:\ODIN32\TREE\src\win32k\dev32\d32hlp.asm"
     328VIEW: LN=.0 CL=1 LE=0 CX=0 CY=1 WI=102 BI=4 HT=0 HN=0 HF=0 HC=4
     329WINDOW: 52 54 625 641 -1 -1 M  WF=0 WT=6 "System Monospaced,10,0,1"
     330BUFFER: BN="G:\ODIN32\TREE\src\win32k\dev32\d32init.c"
     331VIEW: LN=.934 CL=21 LE=0 CX=20 CY=27 WI=96 BI=27 HT=0 HN=0 HF=0 HC=4
    223332FILEHIST: 9
    224 G:\odin32\tree\src\win32k\dev32\d32CallGate.asm
    225 G:\odin32\tree\src\win32k\include\k32.h
    226 G:\odin32\tree\src\win32k\k32\k32HandleSystemEvent.cpp
    227 G:\odin32\tree\src\win32k\ldr\myldrGetFileName.asm
    228 G:\odin32\tree\src\win32k\ldr\myldrOpenPatha.asm
    229 G:\odin32\tree\src\win32k\ldr\mytkExecPgm.asm
    230 G:\odin32\tree\src\win32k\ldr\mytkStartProcess.asm
    231 G:\odin32\tree\src\win32k\ldr\calltaba.asm
    232 G:\odin32\tree\src\win32k\win32k.mak
     333G:\ODIN32\TREE\src\win32k\dev32\d32Events.asm
     334G:\ODIN32\TREE\src\win32k\dev32\d32globals.c
     335G:\ODIN32\TREE\src\win32k\dev32\d32hlp.asm
     336G:\ODIN32\TREE\src\win32k\dev32\d32init.c
     337G:\ODIN32\TREE\src\win32k\dev32\d32Win32kIOCtl.c
     338G:\ODIN32\TREE\src\win32k\dev32\d32Win32kOpenClose.c
     339G:\ODIN32\TREE\src\win32k\dev32\devfirst.asm
     340G:\ODIN32\TREE\src\win32k\dev32\devlast.asm
     341G:\odin32\tree\src\win32k\kKrnlLib\dev32\d32init.c
    233342PRINTER: 2
    234 PRINTER: 2
    235 Printer1,
     343
     344,
Note: See TracChangeset for help on using the changeset viewer.