Changeset 45805 in vbox
- Timestamp:
- Apr 29, 2013 12:30:50 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/com/ErrorInfo.h
r45125 r45805 174 174 mIsFullAvailable(false), 175 175 mResultCode(S_OK), 176 mResultDetail(0), 176 177 m_pNext(NULL) 177 178 { … … 183 184 mIsFullAvailable(false), 184 185 mResultCode(S_OK), 186 mResultDetail(0), 185 187 m_pNext(NULL) 186 188 { … … 191 193 ErrorInfo (const ComPtr <IVirtualBoxErrorInfo> &aPtr) 192 194 : mIsBasicAvailable (false), mIsFullAvailable (false) 193 , mResultCode (S_OK) 195 , mResultCode (S_OK), mResultDetail(0) 194 196 { init (aPtr); } 195 197 … … 204 206 ErrorInfo (IVirtualBoxErrorInfo *aInfo) 205 207 : mIsBasicAvailable (false), mIsFullAvailable (false) 206 , mResultCode (S_OK) 208 , mResultCode (S_OK), mResultDetail(0) 207 209 { init (aInfo); } 208 210 … … 264 266 { 265 267 return mResultCode; 268 } 269 270 /** 271 * Returns the (optional) result detail code of the failed operation. 272 */ 273 LONG getResultDetail() const 274 { 275 return mResultDetail; 266 276 } 267 277 … … 359 369 360 370 HRESULT mResultCode; 371 LONG mResultDetail; 361 372 Guid mInterfaceID; 362 373 Bstr mComponent; -
trunk/src/VBox/Main/Makefile.kmk
r45731 r45805 641 641 src-client/GuestImpl.cpp \ 642 642 src-client/GuestDirectoryImpl.cpp \ 643 src-client/GuestErrorInfoImpl.cpp \644 643 src-client/GuestFileImpl.cpp \ 645 644 src-client/GuestFsObjInfoImpl.cpp \ -
trunk/src/VBox/Main/glue/ErrorInfo.cpp
r44970 r45805 50 50 51 51 mResultCode = x.mResultCode; 52 mResultDetail = x.mResultDetail; 52 53 mInterfaceID = x.mInterfaceID; 53 54 mComponent = x.mComponent; … … 78 79 79 80 mResultCode = S_OK; 81 mResultDetail = 0; 80 82 mInterfaceID.clear(); 81 83 mComponent.setNull(); … … 225 227 bool gotSomething = false; 226 228 bool gotAll = true; 227 LONG lrc ;229 LONG lrc, lrd; 228 230 229 231 rc = info->COMGETTER(ResultCode)(&lrc); mResultCode = lrc; 232 gotSomething |= SUCCEEDED(rc); 233 gotAll &= SUCCEEDED(rc); 234 235 rc = info->COMGETTER(ResultDetail)(&lrd); mResultDetail = lrd; 230 236 gotSomething |= SUCCEEDED(rc); 231 237 gotAll &= SUCCEEDED(rc); -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r45680 r45805 1261 1261 <interface 1262 1262 name="IVirtualBoxErrorInfo" extends="$errorinfo" 1263 uuid=" f91e6e91-49e1-4fd2-b21e-269003350d06"1263 uuid="c1bcc6d5-7966-481d-ab0b-d0ed73e28135" 1264 1264 supportsErrorInfo="no" 1265 1265 wsmap="managed" … … 1308 1308 In XPCOM, it is the same as nsIException::result. 1309 1309 </note> 1310 </desc> 1311 </attribute> 1312 1313 <attribute name="resultDetail" type="long" readonly="yes"> 1314 <desc> 1315 Optional result data of this error. This will vary depending on the 1316 actual error usage. By default this attribute is not being used. 1310 1317 </desc> 1311 1318 </attribute> … … 9724 9731 9725 9732 <interface 9726 name="IGuestErrorInfo" extends="$unknown"9727 uuid="ab576a37-dcfc-4d80-9a73-493d15e293c4"9728 wsmap="managed"9729 >9730 <desc>9731 The IGuestErrorInfo interface represents extended error information which9732 happened while performing an operation on the guest.9733 </desc>9734 9735 <attribute name="result" type="long" readonly="yes">9736 <desc>Runtime (IPRT) error code. See include/iprt/err.h and include/VBox/err.h9737 for details.</desc>9738 </attribute>9739 9740 <attribute name="text" type="wstring" readonly="yes">9741 <desc>Text description of the error.</desc>9742 </attribute>9743 9744 </interface>9745 9746 <interface9747 9733 name="IGuestSession" extends="$unknown" 9748 9734 uuid="c8e8607b-5e67-4073-8f14-146515d0c1ff" … … 19977 19963 </desc> 19978 19964 </attribute> 19979 <attribute name="error" type="IGuestErrorInfo" readonly="yes"> 19980 <desc> 19981 Extended guest error information in case of new session 19982 status is indicating an error. 19965 <attribute name="error" type="IVirtualBoxErrorInfo" readonly="yes"> 19966 <desc> 19967 Error information in case of new session status is indicating an error. 19968 19969 The attribute <link to="IVirtualBoxErrorInfo::resultDetail"/> will contain 19970 the runtime (IPRT) error code from the guest. See include/iprt/err.h and 19971 include/VBox/err.h for details. 19983 19972 </desc> 19984 19973 </attribute> … … 20056 20045 </desc> 20057 20046 </attribute> 20058 <attribute name="error" type="IGuestErrorInfo" readonly="yes"> 20059 <desc> 20060 Extended guest error information in case of new process 20061 status is indicating an error. 20047 <attribute name="error" type="IVirtualBoxErrorInfo" readonly="yes"> 20048 <desc> 20049 Error information in case of new session status is indicating an error. 20050 20051 The attribute <link to="IVirtualBoxErrorInfo::resultDetail"/> will contain 20052 the runtime (IPRT) error code from the guest. See include/iprt/err.h and 20053 include/VBox/err.h for details. 20062 20054 </desc> 20063 20055 </attribute> … … 20171 20163 </desc> 20172 20164 </attribute> 20173 <attribute name="error" type="IGuestErrorInfo" readonly="yes"> 20174 <desc> 20175 Extended guest error information in case of new file 20176 status is indicating an error. 20165 <attribute name="error" type="IVirtualBoxErrorInfo" readonly="yes"> 20166 <desc> 20167 Error information in case of new session status is indicating an error. 20168 20169 The attribute <link to="IVirtualBoxErrorInfo::resultDetail"/> will contain 20170 the runtime (IPRT) error code from the guest. See include/iprt/err.h and 20171 include/VBox/err.h for details. 20177 20172 </desc> 20178 20173 </attribute> -
trunk/src/VBox/Main/include/VirtualBoxErrorInfoImpl.h
r44528 r45805 94 94 IVirtualBoxErrorInfo *aNext = NULL); 95 95 96 HRESULT initEx(HRESULT aResultCode, 97 LONG aResultDetail, 98 const GUID &aIID, 99 const char *pcszComponent, 100 const Utf8Str &strText, 101 IVirtualBoxErrorInfo *aNext = NULL); 102 96 103 HRESULT init(const com::ErrorInfo &ei, 97 104 IVirtualBoxErrorInfo *aNext = NULL); … … 99 106 // IVirtualBoxErrorInfo properties 100 107 STDMETHOD(COMGETTER(ResultCode))(LONG *aResultCode); 108 STDMETHOD(COMGETTER(ResultDetail))(LONG *aResultDetail); 101 109 STDMETHOD(COMGETTER(InterfaceID))(BSTR *aIID); 102 110 STDMETHOD(COMGETTER(Component))(BSTR *aComponent); … … 114 122 115 123 HRESULT m_resultCode; 124 LONG m_resultDetail; 116 125 Utf8Str m_strText; 117 126 Guid m_IID; -
trunk/src/VBox/Main/src-all/VirtualBoxErrorInfoImpl.cpp
r42261 r45805 31 31 { 32 32 m_resultCode = aResultCode; 33 m_resultDetail = 0; /* Not being used. */ 33 34 m_IID = aIID; 34 35 m_strComponent = pcszComponent; … … 39 40 } 40 41 42 HRESULT VirtualBoxErrorInfo::initEx(HRESULT aResultCode, 43 LONG aResultDetail, 44 const GUID &aIID, 45 const char *pcszComponent, 46 const Utf8Str &strText, 47 IVirtualBoxErrorInfo *aNext) 48 { 49 HRESULT hr = init(aResultCode, aIID, pcszComponent, strText, aNext); 50 m_resultDetail = aResultDetail; 51 52 return hr; 53 } 54 41 55 HRESULT VirtualBoxErrorInfo::init(const com::ErrorInfo &info, 42 56 IVirtualBoxErrorInfo *aNext) 43 57 { 44 58 m_resultCode = info.getResultCode(); 59 m_resultDetail = info.getResultDetail(); 45 60 m_IID = info.getInterfaceID(); 46 61 m_strComponent = info.getComponent(); … … 75 90 } 76 91 92 STDMETHODIMP VirtualBoxErrorInfo::COMGETTER(ResultDetail)(LONG *aResultDetail) 93 { 94 CheckComArgOutPointerValid(aResultDetail); 95 96 *aResultDetail = m_resultDetail; 97 return S_OK; 98 } 99 77 100 STDMETHODIMP VirtualBoxErrorInfo::COMGETTER(InterfaceID)(BSTR *aIID) 78 101 { … … 124 147 125 148 m_resultCode = S_OK; 149 m_resultDetail = 0; 126 150 rc = aInfo->GetGUID(m_IID.asOutParam()); 127 151 AssertComRC(rc); … … 188 212 rc = aInfo->GetResult(&m_resultCode); 189 213 AssertComRC(rc); 214 m_resultDetail = 0; /* Not being used. */ 190 215 191 216 char *pszMsg; /* No Utf8Str.asOutParam, different allocator! */ -
trunk/src/VBox/Main/src-client/GuestFileImpl.cpp
r45780 r45805 21 21 * Header Files * 22 22 *******************************************************************************/ 23 #include "GuestErrorInfoImpl.h"24 23 #include "GuestFileImpl.h" 25 24 #include "GuestSessionImpl.h" 26 25 #include "GuestCtrlImplPrivate.h" 27 26 #include "ConsoleImpl.h" 27 #include "VirtualBoxErrorInfoImpl.h" 28 28 29 29 #include "Global.h" … … 919 919 mData.mStatus = fileStatus; 920 920 921 ComObjPtr< GuestErrorInfo> errorInfo;921 ComObjPtr<VirtualBoxErrorInfo> errorInfo; 922 922 HRESULT hr = errorInfo.createObject(); 923 923 ComAssertComRC(hr); 924 924 if (RT_FAILURE(fileRc)) 925 925 { 926 int rc2 = errorInfo->init(fileRc, guestErrorToString(fileRc)); 926 int rc2 = errorInfo->initEx(VBOX_E_IPRT_ERROR, fileRc, 927 COM_IIDOF(IGuestFile), getComponentName(), 928 guestErrorToString(fileRc)); 927 929 AssertRC(rc2); 928 930 } -
trunk/src/VBox/Main/src-client/GuestProcessImpl.cpp
r45780 r45805 29 29 * Header Files * 30 30 *******************************************************************************/ 31 #include "GuestErrorInfoImpl.h"32 31 #include "GuestProcessImpl.h" 33 32 #include "GuestSessionImpl.h" 34 33 #include "GuestCtrlImplPrivate.h" 35 34 #include "ConsoleImpl.h" 36 #include "V BoxEvents.h"35 #include "VirtualBoxErrorInfoImpl.h" 37 36 38 37 #include "Global.h" 39 38 #include "AutoCaller.h" 39 #include "VBoxEvents.h" 40 40 41 41 #include <memory> /* For auto_ptr. */ … … 938 938 mData.mRC = procRc; 939 939 940 ComObjPtr< GuestErrorInfo> errorInfo;940 ComObjPtr<VirtualBoxErrorInfo> errorInfo; 941 941 HRESULT hr = errorInfo.createObject(); 942 942 ComAssertComRC(hr); 943 943 if (RT_FAILURE(mData.mRC)) 944 944 { 945 int rc2 = errorInfo->init(mData.mRC, guestErrorToString(mData.mRC)); 945 int rc2 = errorInfo->initEx(VBOX_E_IPRT_ERROR, mData.mRC, 946 COM_IIDOF(IGuestProcess), getComponentName(), 947 guestErrorToString(mData.mRC)); 946 948 AssertRC(rc2); 947 949 } … … 1526 1528 } 1527 1529 1528 ComPtr<I GuestErrorInfo> errorInfo;1530 ComPtr<IVirtualBoxErrorInfo> errorInfo; 1529 1531 hr = pProcessEvent->COMGETTER(Error)(errorInfo.asOutParam()); 1530 1532 ComAssertComRC(hr); 1531 1533 1532 1534 LONG lGuestRc; 1533 hr = errorInfo->COMGETTER(Result )(&lGuestRc);1535 hr = errorInfo->COMGETTER(ResultDetail)(&lGuestRc); 1534 1536 ComAssertComRC(hr); 1535 1537 if (RT_FAILURE((int)lGuestRc)) -
trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp
r45783 r45805 22 22 *******************************************************************************/ 23 23 #include "GuestImpl.h" 24 #include "GuestErrorInfoImpl.h"25 24 #include "GuestSessionImpl.h" 26 25 #include "GuestCtrlImplPrivate.h" 26 #include "VirtualBoxErrorInfoImpl.h" 27 27 28 28 #include "Global.h" … … 1702 1702 mData.mRC = sessionRc; 1703 1703 1704 ComObjPtr< GuestErrorInfo> errorInfo;1704 ComObjPtr<VirtualBoxErrorInfo> errorInfo; 1705 1705 HRESULT hr = errorInfo.createObject(); 1706 1706 ComAssertComRC(hr); 1707 int rc2 = errorInfo->init(sessionRc, guestErrorToString(sessionRc)); 1707 int rc2 = errorInfo->initEx(VBOX_E_IPRT_ERROR, sessionRc, 1708 COM_IIDOF(IGuestSession), getComponentName(), 1709 guestErrorToString(sessionRc)); 1708 1710 AssertRC(rc2); 1709 1711 … … 1981 1983 *pSessionStatus = sessionStatus; 1982 1984 1983 ComPtr<I GuestErrorInfo> errorInfo;1985 ComPtr<IVirtualBoxErrorInfo> errorInfo; 1984 1986 HRESULT hr = pChangedEvent->COMGETTER(Error)(errorInfo.asOutParam()); 1985 1987 ComAssertComRC(hr); 1986 1988 1987 1989 LONG lGuestRc; 1988 hr = errorInfo->COMGETTER(Result )(&lGuestRc);1990 hr = errorInfo->COMGETTER(ResultDetail)(&lGuestRc); 1989 1991 ComAssertComRC(hr); 1990 1992 if (RT_FAILURE((int)lGuestRc))
Note:
See TracChangeset
for help on using the changeset viewer.