VirtualBox

Ignore:
Timestamp:
Nov 22, 2010 2:26:53 PM (14 years ago)
Author:
vboxsync
Message:

PDM: Added search paths to the device and driver DLL CFGM nodes so that VBoxEhciR0.r0/RC.rc can be found.

Location:
trunk/src/VBox/HostDrivers/Support
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/SUPLib.cpp

    r33878 r34241  
    15561556
    15571557
    1558 SUPR3DECL(int) SUPR3LoadModule(const char *pszFilename, const char *pszModule, void **ppvImageBase)
    1559 {
    1560     int rc = VINF_SUCCESS;
    1561 #ifdef VBOX_WITH_HARDENING
     1558SUPR3DECL(int) SUPR3LoadModule(const char *pszFilename, const char *pszModule, void **ppvImageBase, char *pszErr, size_t cbErr)
     1559{
    15621560    /*
    15631561     * Check that the module can be trusted.
    15641562     */
    1565     rc = supR3HardenedVerifyFixedFile(pszFilename, false /* fFatal */);
    1566 #endif
     1563    int rc = SUPR3HardenedVerifyPlugIn(pszFilename, pszErr, cbErr);
    15671564    if (RT_SUCCESS(rc))
     1565    {
    15681566        rc = supLoadModule(pszFilename, pszModule, NULL, ppvImageBase);
    1569     else
    1570         LogRel(("SUPR3LoadModule: Verification of \"%s\" failed, rc=%Rrc\n", rc));
     1567        if (RT_FAILURE(rc))
     1568            RTStrPrintf(pszErr, cbErr, "supLoadModule returned %Rrc", rc);
     1569    }
    15711570    return rc;
    15721571}
     
    20562055{
    20572056    void *pvImageBase;
    2058     return SUPR3LoadModule(pszFilename, "VMMR0.r0", &pvImageBase);
     2057    return SUPR3LoadModule(pszFilename, "VMMR0.r0", &pvImageBase, NULL, 0);
    20592058}
    20602059
     
    21892188
    21902189    LogFlow(("SUPR3HardenedLdrLoadAppPriv: returns %Rrc\n", rc));
     2190    return rc;
     2191}
     2192
     2193
     2194SUPR3DECL(int) SUPR3HardenedLdrLoadPlugIn(const char *pszFilename, PRTLDRMOD phLdrMod, char *pszErr, size_t cbErr)
     2195{
     2196    int rc;
     2197
     2198    /*
     2199     * Validate input.
     2200     */
     2201    AssertPtr(pszErr);
     2202    Assert(cbErr > 32);
     2203    AssertPtrReturn(phLdrMod, VERR_INVALID_PARAMETER);
     2204    *phLdrMod = NIL_RTLDRMOD;
     2205    AssertPtrReturn(pszFilename, VERR_INVALID_PARAMETER);
     2206    AssertReturn(RTPathStartsWithRoot(pszFilename), VERR_INVALID_PARAMETER);
     2207
     2208#ifdef VBOX_WITH_HARDENING
     2209    /*
     2210     * Verify the image file.
     2211     */
     2212    rc = supR3HardenedVerifyFile(pszFilename, RTHCUINTPTR_MAX, pszErr, cbErr);
     2213    if (RT_FAILURE(rc))
     2214    {
     2215        if (!pszErr || !cbErr)
     2216            LogRel(("supR3HardenedVerifyFile: Verification of \"%s\" failed, rc=%Rrc\n", pszFilename, rc));
     2217        return rc;
     2218    }
     2219#endif
     2220
     2221    /*
     2222     * Try load it.
     2223     */
     2224    rc = RTLdrLoad(pszFilename, phLdrMod);
     2225    if (RT_FAILURE(rc))
     2226        RTStrPrintf(pszErr, cbErr, "RTLdrLoad returned %Rrc", rc);
    21912227    return rc;
    21922228}
  • trunk/src/VBox/HostDrivers/Support/testcase/tstSupLoadModule.cpp

    r28800 r34241  
    7070            case VINF_GETOPT_NOT_OPTION:
    7171            {
     72                char szErr[4096+1024];
    7273                void *pvImageBase;
    73                 rc = SUPR3LoadModule(ValueUnion.psz, RTPathFilename(ValueUnion.psz), &pvImageBase);
     74                rc = SUPR3LoadModule(ValueUnion.psz, RTPathFilename(ValueUnion.psz), &pvImageBase, szErr, sizeof(szErr));
    7475                if (RT_FAILURE(rc))
    7576                {
    76                     RTMsgError("%Rrc when attempting to load '%s'\n", rc, ValueUnion.psz);
     77                    RTMsgError("%Rrc when attempting to load '%s': %s\n", rc, ValueUnion.psz, szErr);
    7778                    return 1;
    7879                }
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