儲存庫 vbox 的更動 55582
- 時間撮記:
- 2015-5-1 下午06:26:59 (10 年 以前)
- svn:sync-xref-src-repo-rev:
- 99955
- 位置:
- trunk/src/VBox/Main
- 檔案:
-
- 修改 2 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Main/include/VirtualBoxBase.h
r55401 r55582 758 758 Utf8Str aText, 759 759 bool aWarning, 760 bool aLogIt); 760 bool aLogIt, 761 LONG aResultDetail = 0); 761 762 static void clearError(void); 762 763 … … 764 765 HRESULT setError(HRESULT aResultCode, const char *pcsz, ...); 765 766 HRESULT setError(const ErrorInfo &ei); 767 HRESULT setErrorVrc(int vrc); 768 HRESULT setErrorVrc(int vrc, const char *pcszMsgFmt, ...); 769 HRESULT setErrorBoth(HRESULT hrc, int vrc); 770 HRESULT setErrorBoth(HRESULT hrc, int vrc, const char *pcszMsgFmt, ...); 766 771 HRESULT setWarning(HRESULT aResultCode, const char *pcsz, ...); 767 772 HRESULT setErrorNoLog(HRESULT aResultCode, const char *pcsz, ...); -
trunk/src/VBox/Main/src-all/VirtualBoxBase.cpp
r51903 r55582 37 37 #include "VirtualBoxErrorInfoImpl.h" 38 38 #include "Logging.h" 39 #include "Global.h" 39 40 40 41 #include "VBox/com/ErrorInfo.h" … … 168 169 Utf8Str aText, 169 170 bool aWarning, 170 bool aLogIt) 171 bool aLogIt, 172 LONG aResultDetail /* = 0*/) 171 173 { 172 174 /* whether multi-error mode is turned on */ … … 174 176 175 177 if (aLogIt) 176 LogRel(("%s [COM]: aRC=%Rhrc (%#08x) aIID={%RTuuid} aComponent={%s} aText={%s}, preserve=%RTbool \n",178 LogRel(("%s [COM]: aRC=%Rhrc (%#08x) aIID={%RTuuid} aComponent={%s} aText={%s}, preserve=%RTbool aResultDetail=%d\n", 177 179 aWarning ? "WARNING" : "ERROR", 178 180 aResultCode, … … 182 184 aText.c_str(), 183 185 aWarning, 184 preserve)); 186 preserve, 187 aResultDetail)); 185 188 186 189 /* these are mandatory, others -- not */ … … 259 262 260 263 /* set the current error info and preserve the previous one if any */ 261 rc = info->init (aResultCode, aIID, pcszComponent, aText, curInfo);264 rc = info->initEx(aResultCode, aResultDetail, aIID, pcszComponent, aText, curInfo); 262 265 if (FAILED(rc)) break; 263 266 … … 303 306 304 307 /* set the current error info and preserve the previous one if any */ 305 rc = info->init (aResultCode, aIID, pcszComponent, Bstr(aText), curInfo);308 rc = info->initEx(aResultCode, aResultDetail, aIID, pcszComponent, Bstr(aText), curInfo); 306 309 if (FAILED(rc)) break; 307 310 … … 504 507 505 508 /** 509 * Converts the VBox status code a COM one and sets the error info. 510 * 511 * The VBox status code is made available to the API user via 512 * IVirtualBoxErrorInfo::resultDetail attribute. 513 * 514 * @param vrc The VBox status code. 515 * @return COM status code appropriate for @a vrc. 516 * 517 * @sa VirtualBoxBase::setError(HRESULT) 518 */ 519 HRESULT VirtualBoxBase::setErrorVrc(int vrc) 520 { 521 return setErrorInternal(Global::vboxStatusCodeToCOM(vrc), 522 this->getClassIID(), 523 this->getComponentName(), 524 Utf8Str("%Rrc", vrc), 525 false /* aWarning */, 526 true /* aLogIt */, 527 vrc /* aResultDetail */); 528 } 529 530 /** 531 * Converts the VBox status code a COM one and sets the error info. 532 * 533 * @param vrc The VBox status code. 534 * @param pcszMsgFmt Error message format string. 535 * @param ... Argument specified in the @a pcszMsgFmt 536 * @return COM status code appropriate for @a vrc. 537 * 538 * @sa VirtualBoxBase::setError(HRESULT, const char *, ...) 539 */ 540 HRESULT VirtualBoxBase::setErrorVrc(int vrc, const char *pcszMsgFmt, ...) 541 { 542 va_list va; 543 va_start(va, pcszMsgFmt); 544 HRESULT hrc = setErrorInternal(Global::vboxStatusCodeToCOM(vrc), 545 this->getClassIID(), 546 this->getComponentName(), 547 Utf8Str(pcszMsgFmt, va), 548 false /* aWarning */, 549 true /* aLogIt */, 550 vrc /* aResultDetail */); 551 va_end(va); 552 return hrc; 553 } 554 555 /** 556 * Sets error info with both a COM status and an VBox status code. 557 * 558 * The VBox status code is made available to the API user via 559 * IVirtualBoxErrorInfo::resultDetail attribute. 560 * 561 * @param hrc The COM status code to return. 562 * @param vrc The VBox status code. 563 * @return Most likely @hrc, see setErrorInternal. 564 * 565 * @sa VirtualBoxBase::setError(HRESULT) 566 */ 567 HRESULT VirtualBoxBase::setErrorBoth(HRESULT hrc, int vrc) 568 { 569 return setErrorInternal(hrc, 570 this->getClassIID(), 571 this->getComponentName(), 572 Utf8Str("%Rrc", vrc), 573 false /* aWarning */, 574 true /* aLogIt */, 575 vrc /* aResultDetail */); 576 } 577 578 /** 579 * Sets error info with a message and both a COM status and an VBox status code. 580 * 581 * The VBox status code is made available to the API user via 582 * IVirtualBoxErrorInfo::resultDetail attribute. 583 * 584 * @param hrc The COM status code to return. 585 * @param vrc The VBox status code. 586 * @param pcszMsgFmt Error message format string. 587 * @param ... Argument specified in the @a pcszMsgFmt 588 * @return Most likely @hrc, see setErrorInternal. 589 * 590 * @sa VirtualBoxBase::setError(HRESULT, const char *, ...) 591 */ 592 HRESULT VirtualBoxBase::setErrorBoth(HRESULT hrc, int vrc, const char *pcszMsgFmt, ...) 593 { 594 va_list va; 595 va_start(va, pcszMsgFmt); 596 hrc = setErrorInternal(hrc, 597 this->getClassIID(), 598 this->getComponentName(), 599 Utf8Str(pcszMsgFmt, va), 600 false /* aWarning */, 601 true /* aLogIt */, 602 vrc /* aResultDetail */); 603 va_end(va); 604 return hrc; 605 } 606 607 /** 506 608 * Like setError(), but sets the "warning" bit in the call to setErrorInternal(). 507 609 * @param aResultCode
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器