VirtualBox

Changeset 50239 in vbox


Ignore:
Timestamp:
Jan 27, 2014 2:34:23 AM (11 years ago)
Author:
vboxsync
Message:

TrustedMain: when com::Initialize() fails make error reporting more sane.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/NetworkServices/NAT/VBoxNetLwipNAT.cpp

    r50213 r50239  
    10791079
    10801080    HRESULT hrc = com::Initialize();
     1081    if (FAILED(hrc))
     1082    {
    10811083#ifdef VBOX_WITH_XPCOM
    1082     if (hrc == NS_ERROR_FILE_ACCESS_DENIED)
    1083     {
    1084         char szHome[RTPATH_MAX] = "";
    1085         com::GetVBoxUserHomeDirectory(szHome, sizeof(szHome));
     1084        if (hrc == NS_ERROR_FILE_ACCESS_DENIED)
     1085        {
     1086            char szHome[RTPATH_MAX] = "";
     1087            int vrc = com::GetVBoxUserHomeDirectory(szHome, sizeof(szHome), false);
     1088            if (RT_SUCCESS(vrc))
     1089            {
     1090                return RTMsgErrorExit(RTEXITCODE_FAILURE,
     1091                                      "Failed to initialize COM: %s: %Rhrf",
     1092                                      szHome, hrc);
     1093            }
     1094        }
     1095#endif  // VBOX_WITH_XPCOM
    10861096        return RTMsgErrorExit(RTEXITCODE_FAILURE,
    1087                "Failed to initialize COM because the global settings directory '%s' is not accessible!", szHome);
    1088     }
    1089 #endif
    1090     if (FAILED(hrc))
    1091         return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to initialize COM!");
     1097                              "Failed to initialize COM: %Rhrf", hrc);
     1098    }
    10921099
    10931100    g_pLwipNat = new VBoxNetLwipNAT(icmpsock4, icmpsock6);
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