Changeset 2501 for trunk/src/win32k/ldr/ldr.cpp
- Timestamp:
- Jan 22, 2000, 7:21:03 PM (26 years ago)
- 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:36bird Exp $1 /* $Id: ldr.cpp,v 1.7 2000-01-22 18:21:01 bird Exp $ 2 2 * 3 3 * ldr.cpp - Loader helpers. … … 83 83 PMODULE getModuleByMTE(PMTE pMTE) 84 84 { 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. */ 88 110 #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 } 94 116 #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 106 122 } 107 123 … … 149 165 return ERROR_INVALID_PARAMETER; 150 166 } 151 if ((fFlags & MOD_TYPE_MASK) == 0 || (fFlags & ~MOD_TYPE_MASK) != 0 )167 if ((fFlags & MOD_TYPE_MASK) == 0 || (fFlags & ~MOD_TYPE_MASK) != 0UL) 152 168 { 153 169 kprintf(("addModule: invalid parameter: fFlags = 0x%#8x\n", fFlags)); … … 242 258 { 243 259 int rc = NO_ERROR; 244 int i;245 260 246 261 /* init state table */
Note:
See TracChangeset
for help on using the changeset viewer.