VirtualBox

Changeset 107057 in vbox


Ignore:
Timestamp:
Nov 20, 2024 11:37:10 AM (2 months ago)
Author:
vboxsync
Message:

Windows driver installation: Improved VBoxWinDrvInstErrorFromWin32(): All we can do here is to return VERR_INSTALLATION_FAILED if the above calls returned something, as we don't have IPRT equivalents for all those (Windows- / SetupAPI-)specific error codes. bugref:10762

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/installation/VBoxWinDrvCommon.cpp

    r107051 r107057  
    661661 * @returns VBox status code.
    662662 * @retval  VERR_UNRESOLVED_ERROR if no translation was possible.
     663 * @retval  VERR_INSTALLATION_FAILED if a Setup API or a specific Windows error code occurred not handled
     664 *          within IPRT's error resolving function.
    663665 * @param   uNativeCode         Native Windows error code to translate.
    664666 */
    665667int VBoxWinDrvInstErrorFromWin32(unsigned uNativeCode)
    666668{
    667 #ifdef DEBUG_andy
    668     bool const fAssertMayPanic = RTAssertMayPanic();
    669     RTAssertSetMayPanic(false);
    670 #endif
    671 
    672669    const char *pszErr = VBoxWinDrvSetupApiErrToStr(uNativeCode);
    673670    if (!pszErr)
    674         VBoxWinDrvWinErrToStr(uNativeCode);
    675 
    676     int const rc = RTErrConvertFromWin32(uNativeCode);
    677     if (rc == VERR_UNRESOLVED_ERROR)
    678         AssertMsgFailed(("Unhandled error %u (%#x): %s\n", uNativeCode, uNativeCode, pszErr ? pszErr : "<Unknown>"));
    679 
    680 #ifdef DEBUG_andy
    681     RTAssertSetMayPanic(fAssertMayPanic);
    682 #endif
     671        pszErr = VBoxWinDrvWinErrToStr(uNativeCode);
     672
     673    /* All we can do here is to return VERR_INSTALLATION_FAILED if the above calls returned something,
     674     * as we don't have IPRT equivalents for all those (Windows- / SetupAPI-)specific error codes.
     675     *
     676     * For anything else not (yet) handled we want to get a debug assertion, however. */
     677    int rc = VERR_INSTALLATION_FAILED;
     678    if (!pszErr)
     679    {
     680        rc = RTErrConvertFromWin32(uNativeCode);
     681        if (rc == VERR_UNRESOLVED_ERROR)
     682            AssertMsgFailed(("Unhandled error %u (%#x): %s\n", uNativeCode, uNativeCode, pszErr ? pszErr : "<Unknown>"));
     683    }
     684
    683685    return rc;
    684686}
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