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

Win32k/kKrnlLib splittup: done the major stuff.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.