Changeset 4052 for branches/GRACE/src/win32k/pe2lx/pe2lx.cpp
- Timestamp:
- Aug 20, 2000, 10:08:50 AM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GRACE/src/win32k/pe2lx/pe2lx.cpp
r4046 r4052 1 /* $Id: pe2lx.cpp,v 1.18.4. 3 2000-08-19 14:37:18bird Exp $1 /* $Id: pe2lx.cpp,v 1.18.4.4 2000-08-20 08:08:47 bird Exp $ 2 2 * 3 3 * Pe2Lx class implementation. Ring 0 and Ring 3 … … 4647 4647 4648 4648 4649 BOOL Pe2Lx::initOdin32Path() 4650 { 4651 APIRET rc; 4652 PMTE pMTE; 4653 4654 4655 if (sfnKernel32 != NULLHANDLE) 4656 return TRUE; 4657 4658 /* 4659 * Try find it using ldrFindModule. 4660 */ 4661 pMTE = NULL; 4662 rc = ldrFindModule("KERNEL32", 8, CLASS_GLOBAL, &pMTE); 4663 if (rc == NO_ERROR && pMTE != NULL) 4664 { 4665 char *psz = pMTE->mte_swapmte->smte_path; 4666 if (psz != NULL) 4667 { 4668 char * pszEnd = psz + strlen(psz) - 1; 4669 while (pszEnd > psz && *pszEnd != '\\' && *pszEnd != '/' && *pszEnd != ':') 4670 pszEnd--; 4671 pszEnd--; 4672 while (pszEnd > psz && *pszEnd != '\\' && *pszEnd != '/' && *pszEnd != ':') 4673 pszEnd--; 4674 if (pszEnd > psz) 4675 { 4676 char * pszPath = (char*)malloc(pszEnd - psz); 4677 memcpy(pszPath, psz, pszEnd - psz); 4678 pszPath[pszEnd - psz] = '\0'; 4679 4680 if (pszOdin32Path) 4681 free((void*)pszOdin32Path); 4682 pszOdin32Path = pszPath; 4683 sfnKernel32 = pMTE->mte_sfn; 4684 4685 return TRUE; 4686 } 4687 } 4688 } 4689 4690 /* 4691 * Try find it searching the LIBPATHs. 4692 * (Don't thing we should use ldrOpenPath since it 4693 * end's up calling ldrOpen - which is overloaded.) 4694 */ 4695 4696 return FALSE; 4697 } 4698 4699 4649 4700 /** 4650 4701 * Static method which dumps a set of nt headers.
Note:
See TracChangeset
for help on using the changeset viewer.