Changeset 29980 in vbox
- Timestamp:
- Jun 2, 2010 11:44:51 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/GMMR0.cpp
r29741 r29980 3474 3474 } 3475 3475 3476 typedef struct 3477 { 3478 PAVLGCPTRNODECORE pNode; 3479 char *pszModuleName; 3480 char *pszVersion; 3481 VBOXOSFAMILY enmGuestOS; 3482 } GMMFINDMODULEBYNAME, *PGMMFINDMODULEBYNAME; 3483 3484 /** 3485 * Tree enumeration callback for finding identical modules by name and version 3486 */ 3487 DECLCALLBACK(int) gmmR0CheckForIdenticalModule(PAVLGCPTRNODECORE pNode, void *pvUser) 3488 { 3489 PGMMFINDMODULEBYNAME pInfo = (PGMMFINDMODULEBYNAME)pvUser; 3490 PGMMSHAREDMODULE pModule = (PGMMSHAREDMODULE)pNode; 3491 3492 if ( pInfo 3493 && pInfo->enmGuestOS == pModule->enmGuestOS 3494 /** todo replace with RTStrNCmp */ 3495 && !strcmp(pModule->szName, pInfo->pszModuleName) 3496 && !strcmp(pModule->szVersion, pInfo->pszVersion)) 3497 { 3498 pInfo->pNode = pNode; 3499 return 1; /* stop search */ 3500 } 3501 return 0; 3502 } 3503 3476 3504 3477 3505 /** … … 3538 3566 /* Check if this module is already globally registered. */ 3539 3567 PGMMSHAREDMODULE pGlobalModule = (PGMMSHAREDMODULE)RTAvlGCPtrGet(&pGMM->pGlobalSharedModuleTree, GCBaseAddr); 3568 if ( !pGlobalModule 3569 && enmGuestOS == VBOXOSFAMILY_Windows64) 3570 { 3571 /* Two identical copies of e.g. Win7 x64 will typically not have a similar virtual address space layout for dlls or kernel modules. 3572 * Try to find identical binaries based on name and version. 3573 */ 3574 GMMFINDMODULEBYNAME Info; 3575 3576 Info.pNode = NULL; 3577 Info.pszVersion = pszVersion; 3578 Info.pszModuleName = pszModuleName; 3579 Info.enmGuestOS = enmGuestOS; 3580 3581 int ret = RTAvlGCPtrDoWithAll(&pGMM->pGlobalSharedModuleTree, true /* fFromLeft */, gmmR0CheckForIdenticalModule, &Info); 3582 if (ret == 1) 3583 { 3584 Assert(Info.pNode); 3585 pGlobalModule = (PGMMSHAREDMODULE)Info.pNode; 3586 } 3587 } 3588 3540 3589 if (!pGlobalModule) 3541 3590 {
Note:
See TracChangeset
for help on using the changeset viewer.