Ignore:
Timestamp:
Jan 22, 2000, 7:21:03 PM (26 years ago)
Author:
bird
Message:

Temporary backup checkin.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/win32k/ldr/ldr.cpp

    r1678 r2501  
    1 /* $Id: ldr.cpp,v 1.6 1999-11-10 01:45:36 bird Exp $
     1/* $Id: ldr.cpp,v 1.7 2000-01-22 18:21:01 bird Exp $
    22 *
    33 * ldr.cpp - Loader helpers.
     
    8383PMODULE     getModuleByMTE(PMTE pMTE)
    8484{
    85     PMODULE pMod = (PMODULE)AVLGet(&pMTERoot, (AVLKEY)pMTE);
    86     if (pMod == NULL)
    87     {
     85    #if 0
     86        /* Not 100% sure that this will work correctly! */
     87        PMODULE pMod = (PMODULE)AVLGet(&pMTERoot, (AVLKEY)pMTE);
     88        if (pMod == NULL)
     89        {
     90            #ifdef DEBUG
     91                if (pMTE <= (PMTE)0x10000)
     92                {
     93                    kprintf(("getModuleByMTE: invalid pMTE pointer - %#8x\n", pMTE));
     94                    return NULL;
     95                }
     96            #endif
     97            pMod = (PMODULE)AVLGet(&pSFNRoot, (AVLKEY)pMTE->mte_sfn);
     98            if (pMod != NULL)
     99            {
     100                pMod->coreMTE.Key = (AVLKEY)pMTE;
     101                pMod->fFlags |= MOD_FLAGS_IN_MTETREE;
     102                AVLInsert(&pMTERoot, (PAVLNODECORE)((unsigned)pMod + offsetof(MODULE, coreMTE)));
     103            }
     104        }
     105        else
     106            pMod = (PMODULE)((unsigned)pMod - offsetof(MODULE, coreMTE));
     107        return pMod;
     108    #else
     109        /* Use this for the time being. */
    88110        #ifdef DEBUG
    89         if (pMTE <= (PMTE)0x10000)
    90         {
    91             kprintf(("getModuleByMTE: invalid pMTE pointer - %#8x\n", pMTE));
    92             return NULL;
    93         }
     111            if (pMTE <= (PMTE)0x10000)
     112            {
     113                kprintf(("getModuleByMTE: invalid pMTE pointer - %#8x\n", pMTE));
     114                return NULL;
     115            }
    94116        #endif
    95         pMod = (PMODULE)AVLGet(&pSFNRoot, (AVLKEY)pMTE->mte_sfn);
    96         if (pMod != NULL)
    97         {
    98             pMod->coreMTE.Key = (AVLKEY)pMTE;
    99             pMod->fFlags |= MOD_FLAGS_IN_MTETREE;
    100             AVLInsert(&pMTERoot, (PAVLNODECORE)((unsigned)pMod + offsetof(MODULE, coreMTE)));
    101         }
    102     }
    103     else
    104         pMod = (PMODULE)((unsigned)pMod - offsetof(MODULE, coreMTE));
    105     return pMod;
     117        if (GetState(pMTE->mte_sfn) == HSTATE_OUR)
     118            return (PMODULE)AVLGet(&pSFNRoot, (AVLKEY)pMTE->mte_sfn);
     119
     120        return NULL;
     121    #endif
    106122}
    107123
     
    149165            return ERROR_INVALID_PARAMETER;
    150166        }
    151         if ((fFlags & MOD_TYPE_MASK) == 0 || (fFlags  & ~MOD_TYPE_MASK) != 0)
     167        if ((fFlags & MOD_TYPE_MASK) == 0 || (fFlags  & ~MOD_TYPE_MASK) != 0UL)
    152168        {
    153169            kprintf(("addModule: invalid parameter: fFlags = 0x%#8x\n", fFlags));
     
    242258{
    243259    int rc = NO_ERROR;
    244     int i;
    245260
    246261    /* init state table */
Note: See TracChangeset for help on using the changeset viewer.