diff options
Diffstat (limited to 'src/VBox/Main/glue/ErrorInfo.cpp')
-rw-r--r-- | src/VBox/Main/glue/ErrorInfo.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/VBox/Main/glue/ErrorInfo.cpp b/src/VBox/Main/glue/ErrorInfo.cpp index 13cdee83..149708f5 100644 --- a/src/VBox/Main/glue/ErrorInfo.cpp +++ b/src/VBox/Main/glue/ErrorInfo.cpp @@ -6,7 +6,7 @@ */ /* - * Copyright (C) 2006-2010 Oracle Corporation + * Copyright (C) 2006-2013 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; @@ -43,12 +43,23 @@ namespace com // //////////////////////////////////////////////////////////////////////////////// +HRESULT ErrorInfo::getVirtualBoxErrorInfo(ComPtr<IVirtualBoxErrorInfo> &pVirtualBoxErrorInfo) +{ + HRESULT rc = S_OK; + if (mErrorInfo) + rc = mErrorInfo.queryInterfaceTo(pVirtualBoxErrorInfo.asOutParam()); + else + pVirtualBoxErrorInfo.setNull(); + return rc; +} + void ErrorInfo::copyFrom(const ErrorInfo &x) { mIsBasicAvailable = x.mIsBasicAvailable; mIsFullAvailable = x.mIsFullAvailable; mResultCode = x.mResultCode; + mResultDetail = x.mResultDetail; mInterfaceID = x.mInterfaceID; mComponent = x.mComponent; mText = x.mText; @@ -77,6 +88,7 @@ void ErrorInfo::cleanup() } mResultCode = S_OK; + mResultDetail = 0; mInterfaceID.clear(); mComponent.setNull(); mText.setNull(); @@ -224,12 +236,16 @@ void ErrorInfo::init(IVirtualBoxErrorInfo *info) HRESULT rc = E_FAIL; bool gotSomething = false; bool gotAll = true; - LONG lrc; + LONG lrc, lrd; rc = info->COMGETTER(ResultCode)(&lrc); mResultCode = lrc; gotSomething |= SUCCEEDED(rc); gotAll &= SUCCEEDED(rc); + rc = info->COMGETTER(ResultDetail)(&lrd); mResultDetail = lrd; + gotSomething |= SUCCEEDED(rc); + gotAll &= SUCCEEDED(rc); + Bstr iid; rc = info->COMGETTER(InterfaceID)(iid.asOutParam()); gotSomething |= SUCCEEDED(rc); @@ -266,6 +282,8 @@ void ErrorInfo::init(IVirtualBoxErrorInfo *info) mIsBasicAvailable = gotSomething; mIsFullAvailable = gotAll; + mErrorInfo = info; + AssertMsg(gotSomething, ("Nothing to fetch!\n")); } |