VirtualBox

Changeset 46915 in vbox


Ignore:
Timestamp:
Jul 2, 2013 5:21:32 PM (12 years ago)
Author:
vboxsync
Message:

PDMLdrEnumModules: Replaced fRc with a enmCtx so we don't load ring-3 modules into the ring-0 address host space.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/pdmapi.h

    r45965 r46915  
    7676VMMR3_INT_DECL(void)    PDMR3TermUVM(PUVM pUVM);
    7777
     78/** PDM loader context indicator.  */
     79typedef enum  PDMLDRCTX
     80{
     81    /** Invalid zero value. */
     82    PDMLDRCTX_INVALID = 0,
     83    /** Ring-0 context. */
     84    PDMLDRCTX_RING_0,
     85    /** Ring-3 context. */
     86    PDMLDRCTX_RING_3,
     87    /** Raw-mode context. */
     88    PDMLDRCTX_RAW_MODE,
     89    /** End of valid context values. */
     90    PDMLDRCTX_END,
     91    /** 32-bit type hack. */
     92    PDMLDRCTX_32BIT_HACK = 0x7fffffff
     93} PDMLDRCTX;
     94
    7895/**
    7996 * Module enumeration callback function.
     
    87104 * @param   ImageBase       Address where to executable image is loaded.
    88105 * @param   cbImage         Size of the executable image.
    89  * @param   fRC             Set if raw-mode context, clear if host context.
     106 * @param   enmCtx          The context the module is loaded into.
    90107 * @param   pvArg           User argument.
    91108 */
    92109typedef DECLCALLBACK(int) FNPDMR3ENUM(PVM pVM, const char *pszFilename, const char *pszName,
    93                                       RTUINTPTR ImageBase, size_t cbImage, bool fRC, void *pvArg);
     110                                      RTUINTPTR ImageBase, size_t cbImage, PDMLDRCTX enmCtx, void *pvArg);
    94111/** Pointer to a FNPDMR3ENUM() function. */
    95112typedef FNPDMR3ENUM *PFNPDMR3ENUM;
  • trunk/src/VBox/VMM/VMMR3/DBGFAddrSpace.cpp

    r46167 r46915  
    542542 */
    543543static DECLCALLBACK(int) dbgfR3AsLazyPopulateR0Callback(PVM pVM, const char *pszFilename, const char *pszName,
    544                                                         RTUINTPTR ImageBase, size_t cbImage, bool fRC, void *pvArg)
     544                                                        RTUINTPTR ImageBase, size_t cbImage, PDMLDRCTX enmCtx, void *pvArg)
    545545{
    546546    NOREF(pVM); NOREF(cbImage);
    547547
    548548    /* Only ring-0 modules. */
    549     if (!fRC)
     549    if (enmCtx == PDMLDRCTX_RING_0)
    550550    {
    551551        RTDBGMOD hDbgMod;
     
    570570 */
    571571static DECLCALLBACK(int) dbgfR3AsLazyPopulateRCCallback(PVM pVM, const char *pszFilename, const char *pszName,
    572                                                         RTUINTPTR ImageBase, size_t cbImage, bool fRC, void *pvArg)
     572                                                        RTUINTPTR ImageBase, size_t cbImage, PDMLDRCTX enmCtx, void *pvArg)
    573573{
    574574    NOREF(pVM); NOREF(cbImage);
    575575
    576576    /* Only raw-mode modules. */
    577     if (fRC)
     577    if (enmCtx == PDMLDRCTX_RAW_MODE)
    578578    {
    579579        RTDBGMOD hDbgMod;
  • trunk/src/VBox/VMM/VMMR3/PDMLdr.cpp

    r46165 r46915  
    14491449                         pCur->ImageBase,
    14501450                         pCur->eType == PDMMOD_TYPE_RC ? RTLdrSize(pCur->hLdrMod) : 0,
    1451                          pCur->eType == PDMMOD_TYPE_RC,
     1451                           pCur->eType == PDMMOD_TYPE_RC ? PDMLDRCTX_RAW_MODE
     1452                         : pCur->eType == PDMMOD_TYPE_R0 ? PDMLDRCTX_RING_0
     1453                         : pCur->eType == PDMMOD_TYPE_R3 ? PDMLDRCTX_RING_3
     1454                         :                                 PDMLDRCTX_INVALID,
    14521455                         pvArg);
    14531456        if (RT_FAILURE(rc))
  • trunk/src/VBox/VMM/testcase/tstVMM.cpp

    r46299 r46915  
    140140/** PDMR3LdrEnumModules callback, see FNPDMR3ENUM. */
    141141static DECLCALLBACK(int)
    142 tstVMMLdrEnum(PVM pVM, const char *pszFilename, const char *pszName, RTUINTPTR ImageBase, size_t cbImage, bool fGC, void *pvUser)
    143 {
    144     NOREF(pVM); NOREF(pszFilename); NOREF(fGC); NOREF(pvUser); NOREF(cbImage);
     142tstVMMLdrEnum(PVM pVM, const char *pszFilename, const char *pszName, RTUINTPTR ImageBase, size_t cbImage,
     143              PDMLDRCTX enmCtx, void *pvUser)
     144{
     145    NOREF(pVM); NOREF(pszFilename); NOREF(enmCtx); NOREF(pvUser); NOREF(cbImage);
    145146    RTPrintf("tstVMM: %RTptr %s\n", ImageBase, pszName);
    146147    return VINF_SUCCESS;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette