Changeset 6841 for branches/splittup/src/win32k/ldr/ldr.cpp
- Timestamp:
- Sep 27, 2001, 5:08:35 AM (24 years ago)
- File:
-
- 1 edited
-
branches/splittup/src/win32k/ldr/ldr.cpp (modified) (17 diffs)
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:45bird Exp $1 /* $Id: ldr.cpp,v 1.10.2.1 2001-09-27 03:08:24 bird Exp $ 2 2 * 3 3 * ldr.cpp - Loader helpers. … … 17 17 #define INCL_OS2KRNL_PTDA 18 18 #define INCL_OS2KRNL_LDR 19 #define INCL_KKL_LOG 20 #define INCL_KKL_AVL 21 #define INCL_KKL_HEAP 19 22 20 23 /******************************************************************************* … … 22 25 *******************************************************************************/ 23 26 #include <os2.h> 27 #include <peexe.h> 28 #include <exe386.h> 29 #include <OS2Krnl.h> 30 #include <kKrnlLib.h> 24 31 25 32 #include "devSegDf.h" 26 #include "malloc.h"27 #include "new.h"28 33 #include <memory.h> 29 34 #include <stdlib.h> … … 31 36 #include <string.h> 32 37 33 #include "log.h"34 #include "avl.h"35 #include <peexe.h>36 #include <exe386.h>37 #include "OS2Krnl.h"38 38 #include "ldr.h" 39 39 #include "ModuleBase.h" … … 45 45 * Global Variables * 46 46 *******************************************************************************/ 47 static PAVL NODECOREpSFNRoot = NULL;48 static PAVL NODECOREpMTERoot = NULL;47 static PAVLULNODECORE pSFNRoot = NULL; 48 static PAVLULNODECORE pMTERoot = NULL; 49 49 50 50 … … 81 81 * @returns Pointer to module node. If not found NULL. 82 82 * @param hFile File handle of the module to be found. 83 * @sketch return a AVL Get on the pSFNRoot-tree.83 * @sketch return a AVLULGet on the pSFNRoot-tree. 84 84 * @status completely implemented. 85 85 * @author knut st. osmundsen … … 87 87 PMODULE getModuleBySFN(SFN hFile) 88 88 { 89 return (PMODULE)AVL Get(&pSFNRoot, (AVLKEY)hFile);89 return (PMODULE)AVLULGet(&pSFNRoot, (AVLULKEY)hFile); 90 90 } 91 91 … … 115 115 #if 0 116 116 /* Not 100% sure that this will work correctly! */ 117 PMODULE pMod = (PMODULE)AVL Get(&pMTERoot, (AVLKEY)pMTE);117 PMODULE pMod = (PMODULE)AVLULGet(&pMTERoot, (AVLULKEY)pMTE); 118 118 if (pMod == NULL) 119 119 { … … 125 125 } 126 126 #endif 127 pMod = (PMODULE)AVL Get(&pSFNRoot, (AVLKEY)pMTE->mte_sfn);127 pMod = (PMODULE)AVLULGet(&pSFNRoot, (AVLULKEY)pMTE->mte_sfn); 128 128 if (pMod != NULL) 129 129 { 130 pMod->coreMTE.Key = (AVL KEY)pMTE;130 pMod->coreMTE.Key = (AVLULKEY)pMTE; 131 131 pMod->fFlags |= MOD_FLAGS_IN_MTETREE; 132 AVLInsert(&pMTERoot, (PAVL NODECORE)((unsigned)pMod + offsetof(MODULE, coreMTE)));132 AVLInsert(&pMTERoot, (PAVLULNODECORE)((unsigned)pMod + offsetof(MODULE, coreMTE))); 133 133 } 134 134 } … … 146 146 #endif 147 147 if (GetState(pMTE->mte_sfn) == HSTATE_OUR) 148 return (PMODULE)AVL Get(&pSFNRoot, (AVLKEY)pMTE->mte_sfn);148 return (PMODULE)AVLULGet(&pSFNRoot, (AVLULKEY)pMTE->mte_sfn); 149 149 150 150 return NULL; … … 209 209 PMODULE pMod; 210 210 #ifdef DEBUG 211 if (AVL Get(&pSFNRoot, (AVLKEY)hFile) != NULL)211 if (AVLULGet(&pSFNRoot, (AVLULKEY)hFile) != NULL) 212 212 kprintf(("addModule: Module allready present in the SFN-tree!\n")); 213 213 if (hFile == 0) … … 232 232 233 233 /* fill in the module node. */ 234 pMod->coreKey.Key = (AVL KEY)hFile;234 pMod->coreKey.Key = (AVLULKEY)hFile; 235 235 pMod->hFile = hFile; 236 236 pMod->pMTE = pMTE; … … 239 239 240 240 /* insert the module node into the tree(s) */ 241 AVL Insert(&pSFNRoot, (PAVLNODECORE)pMod);241 AVLULInsert(&pSFNRoot, (PAVLULNODECORE)pMod); 242 242 if (pMTE != NULL) 243 243 { 244 pMod->coreMTE.Key = (AVL KEY)pMTE;244 pMod->coreMTE.Key = (AVLULKEY)pMTE; 245 245 pMod->fFlags |= MOD_FLAGS_IN_MTETREE; 246 AVL Insert(&pMTERoot, (PAVLNODECORE)((unsigned)pMod + offsetof(MODULE, coreMTE)));246 AVLULInsert(&pMTERoot, (PAVLULNODECORE)((unsigned)pMod + offsetof(MODULE, coreMTE))); 247 247 } 248 248 … … 265 265 ULONG removeModule(SFN hFile) 266 266 { 267 PMODULE pMod = (PMODULE)AVL Remove(&pSFNRoot, (AVLKEY)hFile);267 PMODULE pMod = (PMODULE)AVLULRemove(&pSFNRoot, (AVLULKEY)hFile); 268 268 if (pMod == NULL) 269 269 { … … 275 275 if (pMod->fFlags & MOD_FLAGS_IN_MTETREE) 276 276 { 277 if (AVL Remove(&pMTERoot, (AVLKEY)pMod->pMTE) == NULL)278 { 279 kprintf(("removeModule: MOD_FLAGS_IN_MTETREE set but AVL Remove 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")); 280 280 } 281 281 } … … 333 333 * Then get the pMTE, and access the smte_path to get a pointer to the executable path. 334 334 */ 335 PPTDA pPTDA Cur;/* Pointer to the current (system context) PTDA */335 PPTDA pPTDA1; /* Pointer to the current (system context) PTDA */ 336 336 PPTDA pPTDA; /* PTDA in question. */ 337 337 HMTE hMTE = NULLHANDLE; /* Modulehandle of the executable module. */ … … 343 343 * IF no pPTDAExecChild THEN get hMte for the current PTDA. 344 344 */ 345 pPTDA Cur= ptdaGetCur();346 if (pPTDA Cur!= NULL)347 { 348 pPTDA = ptdaGet_pPTDAExecChild(pPTDA Cur);345 pPTDA1 = ptdaGetCur(); 346 if (pPTDA1 != NULL) 347 { 348 pPTDA = ptdaGet_pPTDAExecChild(pPTDA1); 349 349 if (pPTDA != NULL && fExecChild) 350 350 hMTE = ptdaGet_ptda_module(pPTDA); 351 351 if (hMTE == NULLHANDLE) 352 hMTE = ptdaGet_ptda_module(pPTDA Cur);352 hMTE = ptdaGet_ptda_module(pPTDA1); 353 353 } 354 354 else
Note:
See TracChangeset
for help on using the changeset viewer.
