- Timestamp:
- Jan 25, 2023 1:59:25 AM (21 months ago)
- Location:
- trunk
- Files:
-
- 18 edited
-
include/VBox/com/NativeEventQueue.h (modified) (1 diff)
-
include/VBox/com/errorprint.h (modified) (1 diff)
-
src/VBox/Main/.scm-settings (modified) (3 diffs)
-
src/VBox/Main/cbinding/VBoxCAPI.cpp (modified) (17 diffs)
-
src/VBox/Main/cbinding/tstCAPIGlue.c (modified) (26 diffs)
-
src/VBox/Main/glue/ErrorInfo.cpp (modified) (16 diffs)
-
src/VBox/Main/glue/EventQueue.cpp (modified) (9 diffs)
-
src/VBox/Main/glue/NativeEventQueue.cpp (modified) (14 diffs)
-
src/VBox/Main/glue/com.cpp (modified) (3 diffs)
-
src/VBox/Main/glue/errorprint.cpp (modified) (10 diffs)
-
src/VBox/Main/glue/initterm.cpp (modified) (19 diffs)
-
src/VBox/Main/glue/string.cpp (modified) (7 diffs)
-
src/VBox/Main/src-all/win/VBoxProxyStub.c (modified) (83 diffs)
-
src/VBox/Main/webservice/split-soapC.cpp (modified) (1 diff)
-
src/VBox/Main/webservice/vboxweb.cpp (modified) (40 diffs)
-
src/VBox/Main/webservice/vboxweb.h (modified) (4 diffs)
-
src/VBox/Main/webservice/webtest.cpp (modified) (1 diff)
-
src/VBox/Main/xml/Settings.cpp (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/com/NativeEventQueue.h
r98103 r98297 123 123 } 124 124 #else 125 static int dispatchMessageOnWindows(MSG const *pMsg, int rc);125 static int dispatchMessageOnWindows(MSG const *pMsg, int vrc); 126 126 #endif 127 127 -
trunk/include/VBox/com/errorprint.h
r98103 r98297 59 59 void GluePrintErrorInfo(const com::ErrorInfo &info); 60 60 void GluePrintErrorContext(const char *pcszContext, const char *pcszSourceFile, uint32_t uLine, bool fWarning = false); 61 void GluePrintRCMessage(HRESULT rc);62 void GlueHandleComError(ComPtr<IUnknown> iface, const char *pcszContext, HRESULT rc, const char *pcszSourceFile, uint32_t uLine);63 void GlueHandleComErrorNoCtx(ComPtr<IUnknown> iface, HRESULT rc);64 void GlueHandleComErrorProgress(ComPtr<IProgress> progress, const char *pcszContext, HRESULT rc,61 void GluePrintRCMessage(HRESULT hrc); 62 void GlueHandleComError(ComPtr<IUnknown> iface, const char *pcszContext, HRESULT hrc, const char *pcszSourceFile, uint32_t uLine); 63 void GlueHandleComErrorNoCtx(ComPtr<IUnknown> iface, HRESULT hrc); 64 void GlueHandleComErrorProgress(ComPtr<IProgress> progress, const char *pcszContext, HRESULT hrc, 65 65 const char *pcszSourceFile, uint32_t uLine); 66 66 -
trunk/src/VBox/Main/.scm-settings
r98296 r98297 25 25 # SPDX-License-Identifier: GPL-3.0-only 26 26 # 27 28 /*: --no-rc-use 27 29 28 30 # cbindings have different licences. … … 53 55 /cbinding/VBoxCAPI*.h: --guard-relative-to-dir '' 54 56 /cbinding/VBoxCAPIGlue.h.in: --guard-relative-to-dir '' 55 56 /src-all/*cpp: --no-rc-use57 /src-client/*cpp: --no-rc-use58 /src-global/*cpp: --no-rc-use59 /src-helper-apps/*cpp: --no-rc-use60 /src-server/*cpp: --no-rc-use61 /include/*: --no-rc-use62 57 63 58 # IDL and XML … … 98 93 --filter-out-files /testcase/VBoxVBTest/TestForm.frx 99 94 --filter-out-files /testcase/VBoxVBTest/VBoxVBTest.vbp 95 # for now: 96 /testcase/*: --unrestricted-rc-use 100 97 101 98 /testcase/tstUnattendedScript-1.expected: --treat-as plaintext --external-copyright -
trunk/src/VBox/Main/cbinding/VBoxCAPI.cpp
r98103 r98297 229 229 #else /* !VBOX_WITH_XPCOM */ 230 230 VARTYPE vt = VT_UNKNOWN; 231 HRESULT rc = SafeArrayGetVartype(psa, &vt);232 if (FAILED( rc))233 return rc;231 HRESULT hrc = SafeArrayGetVartype(psa, &vt); 232 if (FAILED(hrc)) 233 return hrc; 234 234 if (vt == VT_BSTR) 235 235 { … … 238 238 * behavior between COM and XPCOM without this kind of trickery. */ 239 239 void *pData; 240 rc = SafeArrayAccessData(psa, &pData);241 if (FAILED( rc))242 return rc;240 hrc = SafeArrayAccessData(psa, &pData); 241 if (FAILED(hrc)) 242 return hrc; 243 243 ULONG cbElement = VBoxVTElemSize(vt); 244 244 if (!cbElement) … … 265 265 pData = psa->pv; 266 266 #else /* !VBOX_WITH_XPCOM */ 267 HRESULT rc = SafeArrayAccessData(psa, &pData);268 if (FAILED( rc))269 return rc;267 HRESULT hrc = SafeArrayAccessData(psa, &pData); 268 if (FAILED(hrc)) 269 return hrc; 270 270 #endif /* !VBOX_WITH_XPCOM */ 271 271 memcpy(pData, pv, cb); … … 305 305 cElements = psa->c; 306 306 #else /* !VBOX_WITH_XPCOM */ 307 HRESULT rc = SafeArrayAccessData(psa, &pData);308 if (FAILED( rc))307 HRESULT hrc = SafeArrayAccessData(psa, &pData); 308 if (FAILED(hrc)) 309 309 { 310 310 *ppv = NULL; 311 311 if (pcb) 312 312 *pcb = 0; 313 return rc;313 return hrc; 314 314 } 315 315 cElements = psa->rgsabound[0].cElements; … … 343 343 { 344 344 ULONG mypcb; 345 HRESULT rc = VBoxSafeArrayCopyOutParamHelper((void **)ppaObj, &mypcb, VT_UNKNOWN, psa);346 if (FAILED( rc))345 HRESULT hrc = VBoxSafeArrayCopyOutParamHelper((void **)ppaObj, &mypcb, VT_UNKNOWN, psa); 346 if (FAILED(hrc)) 347 347 { 348 348 if (pcObj) 349 349 *pcObj = 0; 350 return rc;350 return hrc; 351 351 } 352 352 ULONG cElements = mypcb / sizeof(void *); … … 404 404 sessionIID = IID_ISession; 405 405 406 HRESULT rc = com::Initialize(VBOX_COM_INIT_F_DEFAULT | VBOX_COM_INIT_F_NO_COM_PATCHING);407 if (FAILED( rc))408 { 409 Log(("Cbinding: COM/XPCOM could not be initialized! rc=%Rhrc\n",rc));406 HRESULT hrc = com::Initialize(VBOX_COM_INIT_F_DEFAULT | VBOX_COM_INIT_F_NO_COM_PATCHING); 407 if (FAILED(hrc)) 408 { 409 Log(("Cbinding: COM/XPCOM could not be initialized! hrc=%Rhrc\n", hrc)); 410 410 VBoxComUninitialize(); 411 411 return; … … 413 413 414 414 #ifdef VBOX_WITH_XPCOM 415 rc = NS_GetMainEventQ(&g_EventQueue);416 if (FAILED( rc))417 { 418 Log(("Cbinding: Could not get XPCOM event queue! rc=%Rhrc\n",rc));415 hrc = NS_GetMainEventQ(&g_EventQueue); 416 if (FAILED(hrc)) 417 { 418 Log(("Cbinding: Could not get XPCOM event queue! hrc=%Rhrc\n", hrc)); 419 419 VBoxComUninitialize(); 420 420 return; … … 424 424 #ifdef VBOX_WITH_XPCOM 425 425 nsIComponentManager *pManager; 426 rc = NS_GetComponentManager(&pManager);427 if (FAILED( rc))428 { 429 Log(("Cbinding: Could not get component manager! rc=%Rhrc\n",rc));426 hrc = NS_GetComponentManager(&pManager); 427 if (FAILED(hrc)) 428 { 429 Log(("Cbinding: Could not get component manager! hrc=%Rhrc\n", hrc)); 430 430 VBoxComUninitialize(); 431 431 return; 432 432 } 433 433 434 rc = pManager->CreateInstanceByContractID(NS_VIRTUALBOX_CONTRACTID,435 nsnull,436 virtualBoxIID,437 (void **)&g_VirtualBox);434 hrc = pManager->CreateInstanceByContractID(NS_VIRTUALBOX_CONTRACTID, 435 nsnull, 436 virtualBoxIID, 437 (void **)&g_VirtualBox); 438 438 #else /* !VBOX_WITH_XPCOM */ 439 439 IVirtualBoxClient *pVirtualBoxClient; 440 rc = CoCreateInstance(CLSID_VirtualBoxClient, NULL, CLSCTX_INPROC_SERVER, IID_IVirtualBoxClient, (void **)&pVirtualBoxClient);441 if (SUCCEEDED( rc))440 hrc = CoCreateInstance(CLSID_VirtualBoxClient, NULL, CLSCTX_INPROC_SERVER, IID_IVirtualBoxClient, (void **)&pVirtualBoxClient); 441 if (SUCCEEDED(hrc)) 442 442 { 443 443 IVirtualBox *pVirtualBox; 444 rc = pVirtualBoxClient->get_VirtualBox(&pVirtualBox);445 if (SUCCEEDED( rc))444 hrc = pVirtualBoxClient->get_VirtualBox(&pVirtualBox); 445 if (SUCCEEDED(hrc)) 446 446 { 447 rc = pVirtualBox->QueryInterface(virtualBoxIID, (void **)&g_VirtualBox);447 hrc = pVirtualBox->QueryInterface(virtualBoxIID, (void **)&g_VirtualBox); 448 448 pVirtualBox->Release(); 449 449 } … … 451 451 } 452 452 #endif /* !VBOX_WITH_XPCOM */ 453 if (FAILED( rc))454 { 455 Log(("Cbinding: Could not instantiate VirtualBox object! rc=%Rhrc\n",rc));453 if (FAILED(hrc)) 454 { 455 Log(("Cbinding: Could not instantiate VirtualBox object! hrc=%Rhrc\n",hrc)); 456 456 #ifdef VBOX_WITH_XPCOM 457 457 pManager->Release(); … … 465 465 466 466 #ifdef VBOX_WITH_XPCOM 467 rc = pManager->CreateInstanceByContractID(NS_SESSION_CONTRACTID, 468 nsnull, 469 sessionIID, 470 (void **)&g_Session); 467 hrc = pManager->CreateInstanceByContractID(NS_SESSION_CONTRACTID, nsnull, sessionIID, (void **)&g_Session); 471 468 #else /* !VBOX_WITH_XPCOM */ 472 rc = CoCreateInstance(CLSID_Session, NULL, CLSCTX_INPROC_SERVER, sessionIID, (void **)&g_Session);473 #endif /* !VBOX_WITH_XPCOM */ 474 if (FAILED( rc))475 { 476 Log(("Cbinding: Could not instantiate Session object! rc=%Rhrc\n",rc));469 hrc = CoCreateInstance(CLSID_Session, NULL, CLSCTX_INPROC_SERVER, sessionIID, (void **)&g_Session); 470 #endif /* !VBOX_WITH_XPCOM */ 471 if (FAILED(hrc)) 472 { 473 Log(("Cbinding: Could not instantiate Session object! hrc=%Rhrc\n",hrc)); 477 474 #ifdef VBOX_WITH_XPCOM 478 475 pManager->Release(); … … 568 565 VBoxGetException(IErrorInfo **ppException) 569 566 { 570 HRESULT rc;567 HRESULT hrc; 571 568 572 569 *ppException = NULL; … … 574 571 #ifdef VBOX_WITH_XPCOM 575 572 nsIServiceManager *mgr = NULL; 576 rc = NS_GetServiceManager(&mgr);577 if (FAILED( rc) || !mgr)578 return rc;573 hrc = NS_GetServiceManager(&mgr); 574 if (FAILED(hrc) || !mgr) 575 return hrc; 579 576 580 577 IID esid = NS_IEXCEPTIONSERVICE_IID; 581 578 nsIExceptionService *es = NULL; 582 rc = mgr->GetServiceByContractID(NS_EXCEPTIONSERVICE_CONTRACTID, esid, (void **)&es);583 if (FAILED( rc) || !es)579 hrc = mgr->GetServiceByContractID(NS_EXCEPTIONSERVICE_CONTRACTID, esid, (void **)&es); 580 if (FAILED(hrc) || !es) 584 581 { 585 582 mgr->Release(); 586 return rc;583 return hrc; 587 584 } 588 585 589 586 nsIExceptionManager *em; 590 rc = es->GetCurrentExceptionManager(&em);591 if (FAILED( rc) || !em)587 hrc = es->GetCurrentExceptionManager(&em); 588 if (FAILED(hrc) || !em) 592 589 { 593 590 es->Release(); 594 591 mgr->Release(); 595 return rc;592 return hrc; 596 593 } 597 594 598 595 nsIException *ex; 599 rc = em->GetCurrentException(&ex);600 if (FAILED( rc))596 hrc = em->GetCurrentException(&ex); 597 if (FAILED(hrc)) 601 598 { 602 599 em->Release(); 603 600 es->Release(); 604 601 mgr->Release(); 605 return rc;602 return hrc; 606 603 } 607 604 … … 612 609 #else /* !VBOX_WITH_XPCOM */ 613 610 IErrorInfo *ex; 614 rc = ::GetErrorInfo(0, &ex);615 if (FAILED( rc))616 return rc;611 hrc = ::GetErrorInfo(0, &ex); 612 if (FAILED(hrc)) 613 return hrc; 617 614 618 615 *ppException = ex; 619 616 #endif /* !VBOX_WITH_XPCOM */ 620 617 621 return rc;618 return hrc; 622 619 } 623 620 … … 625 622 VBoxClearException(void) 626 623 { 627 HRESULT rc;624 HRESULT hrc; 628 625 629 626 #ifdef VBOX_WITH_XPCOM 630 627 nsIServiceManager *mgr = NULL; 631 rc = NS_GetServiceManager(&mgr);632 if (FAILED( rc) || !mgr)633 return rc;628 hrc = NS_GetServiceManager(&mgr); 629 if (FAILED(hrc) || !mgr) 630 return hrc; 634 631 635 632 IID esid = NS_IEXCEPTIONSERVICE_IID; 636 633 nsIExceptionService *es = NULL; 637 rc = mgr->GetServiceByContractID(NS_EXCEPTIONSERVICE_CONTRACTID, esid, (void **)&es);638 if (FAILED( rc) || !es)634 hrc = mgr->GetServiceByContractID(NS_EXCEPTIONSERVICE_CONTRACTID, esid, (void **)&es); 635 if (FAILED(hrc) || !es) 639 636 { 640 637 mgr->Release(); 641 return rc;638 return hrc; 642 639 } 643 640 644 641 nsIExceptionManager *em; 645 rc = es->GetCurrentExceptionManager(&em);646 if (FAILED( rc) || !em)642 hrc = es->GetCurrentExceptionManager(&em); 643 if (FAILED(hrc) || !em) 647 644 { 648 645 es->Release(); 649 646 mgr->Release(); 650 return rc;651 } 652 653 rc = em->SetCurrentException(NULL);647 return hrc; 648 } 649 650 hrc = em->SetCurrentException(NULL); 654 651 em->Release(); 655 652 es->Release(); 656 653 mgr->Release(); 657 654 #else /* !VBOX_WITH_XPCOM */ 658 rc = ::SetErrorInfo(0, NULL);659 #endif /* !VBOX_WITH_XPCOM */ 660 661 return rc;655 hrc = ::SetErrorInfo(0, NULL); 656 #endif /* !VBOX_WITH_XPCOM */ 657 658 return hrc; 662 659 } 663 660 … … 679 676 virtualBoxClientIID = IID_IVirtualBoxClient; 680 677 681 HRESULT rc = com::Initialize(VBOX_COM_INIT_F_DEFAULT | VBOX_COM_INIT_F_NO_COM_PATCHING);682 if (FAILED( rc))683 { 684 Log(("Cbinding: COM/XPCOM could not be initialized! rc=%Rhrc\n",rc));678 HRESULT hrc = com::Initialize(VBOX_COM_INIT_F_DEFAULT | VBOX_COM_INIT_F_NO_COM_PATCHING); 679 if (FAILED(hrc)) 680 { 681 Log(("Cbinding: COM/XPCOM could not be initialized! hrc=%Rhrc\n", hrc)); 685 682 VBoxClientUninitialize(); 686 return rc;687 } 688 689 #ifdef VBOX_WITH_XPCOM 690 rc = NS_GetMainEventQ(&g_EventQueue);691 if (NS_FAILED( rc))692 { 693 Log(("Cbinding: Could not get XPCOM event queue! rc=%Rhrc\n",rc));683 return hrc; 684 } 685 686 #ifdef VBOX_WITH_XPCOM 687 hrc = NS_GetMainEventQ(&g_EventQueue); 688 if (NS_FAILED(hrc)) 689 { 690 Log(("Cbinding: Could not get XPCOM event queue! hrc=%Rhrc\n", hrc)); 694 691 VBoxClientUninitialize(); 695 return rc;692 return hrc; 696 693 } 697 694 #endif /* VBOX_WITH_XPCOM */ … … 699 696 #ifdef VBOX_WITH_XPCOM 700 697 nsIComponentManager *pManager; 701 rc = NS_GetComponentManager(&pManager);702 if (FAILED( rc))703 { 704 Log(("Cbinding: Could not get component manager! rc=%Rhrc\n",rc));698 hrc = NS_GetComponentManager(&pManager); 699 if (FAILED(hrc)) 700 { 701 Log(("Cbinding: Could not get component manager! hrc=%Rhrc\n", hrc)); 705 702 VBoxClientUninitialize(); 706 return rc;707 } 708 709 rc = pManager->CreateInstanceByContractID(NS_VIRTUALBOXCLIENT_CONTRACTID,710 nsnull,711 virtualBoxClientIID,712 (void **)ppVirtualBoxClient);703 return hrc; 704 } 705 706 hrc = pManager->CreateInstanceByContractID(NS_VIRTUALBOXCLIENT_CONTRACTID, 707 nsnull, 708 virtualBoxClientIID, 709 (void **)ppVirtualBoxClient); 713 710 #else /* !VBOX_WITH_XPCOM */ 714 rc = CoCreateInstance(CLSID_VirtualBoxClient, NULL, CLSCTX_INPROC_SERVER, virtualBoxClientIID, (void **)ppVirtualBoxClient);715 #endif /* !VBOX_WITH_XPCOM */ 716 if (FAILED( rc))717 { 718 Log(("Cbinding: Could not instantiate VirtualBoxClient object! rc=%Rhrc\n",rc));711 hrc = CoCreateInstance(CLSID_VirtualBoxClient, NULL, CLSCTX_INPROC_SERVER, virtualBoxClientIID, (void **)ppVirtualBoxClient); 712 #endif /* !VBOX_WITH_XPCOM */ 713 if (FAILED(hrc)) 714 { 715 Log(("Cbinding: Could not instantiate VirtualBoxClient object! hrc=%Rhrc\n",hrc)); 719 716 #ifdef VBOX_WITH_XPCOM 720 717 pManager->Release(); … … 722 719 #endif /* VBOX_WITH_XPCOM */ 723 720 VBoxClientUninitialize(); 724 return rc;721 return hrc; 725 722 } 726 723 -
trunk/src/VBox/Main/cbinding/tstCAPIGlue.c
r98103 r98297 136 136 { 137 137 VBoxEventType_T evType; 138 HRESULT rc;138 HRESULT hrc; 139 139 140 140 if (!event) … … 145 145 146 146 evType = VBoxEventType_Invalid; 147 rc = IEvent_get_Type(event, &evType);148 if (FAILED( rc))149 { 150 printf("cannot get event type, rc=%#x\n", (unsigned)rc);147 hrc = IEvent_get_Type(event, &evType); 148 if (FAILED(hrc)) 149 { 150 printf("cannot get event type, hrc=%#x\n", (unsigned)hrc); 151 151 return S_OK; 152 152 } … … 170 170 IStateChangedEvent *ev = NULL; 171 171 enum MachineState state; 172 rc = IEvent_QueryInterface(event, &IID_IStateChangedEvent, (void **)&ev);173 if (FAILED( rc))172 hrc = IEvent_QueryInterface(event, &IID_IStateChangedEvent, (void **)&ev); 173 if (FAILED(hrc)) 174 174 { 175 printf("cannot get StateChangedEvent interface, rc=%#x\n", (unsigned)rc);175 printf("cannot get StateChangedEvent interface, hrc=%#x\n", (unsigned)hrc); 176 176 return S_OK; 177 177 } … … 181 181 return S_OK; 182 182 } 183 rc = IStateChangedEvent_get_State(ev, &state);184 if (FAILED( rc))185 printf("warning: cannot get state, rc=%#x\n", (unsigned)rc);183 hrc = IStateChangedEvent_get_State(ev, &state); 184 if (FAILED(hrc)) 185 printf("warning: cannot get state, hrc=%#x\n", (unsigned)hrc); 186 186 IStateChangedEvent_Release(ev); 187 187 printf("OnStateChanged: %s\n", GetStateName(state)); … … 392 392 static HRESULT LoadTypeInfo(REFIID riid, ITypeInfo **pTInfo) 393 393 { 394 HRESULT rc;394 HRESULT hrc; 395 395 ITypeLib *pTypeLib; 396 rc = LoadRegTypeLib(&LIBID_VirtualBox, 1 /* major */, 0 /* minor */, 0 /* lcid */, &pTypeLib);397 if (FAILED( rc))398 return rc;399 rc = ITypeLib_GetTypeInfoOfGuid(pTypeLib, riid, pTInfo);396 hrc = LoadRegTypeLib(&LIBID_VirtualBox, 1 /* major */, 0 /* minor */, 0 /* lcid */, &pTypeLib); 397 if (FAILED(hrc)) 398 return hrc; 399 hrc = ITypeLib_GetTypeInfoOfGuid(pTypeLib, riid, pTInfo); 400 400 401 401 /* No longer need access to the type lib, release it. */ 402 402 ITypeLib_Release(pTypeLib); 403 403 404 return rc;404 return hrc; 405 405 } 406 406 #endif … … 465 465 { 466 466 IConsole *console = NULL; 467 HRESULT rc;468 469 rc = ISession_get_Console(session, &console);470 if ( (SUCCEEDED(rc)) && console)467 HRESULT hrc; 468 469 hrc = ISession_get_Console(session, &console); 470 if (SUCCEEDED(hrc) && console) 471 471 { 472 472 IEventSource *es = NULL; 473 rc = IConsole_get_EventSource(console, &es);474 if (SUCCEEDED( rc) && es)473 hrc = IConsole_get_EventSource(console, &es); 474 if (SUCCEEDED(hrc) && es) 475 475 { 476 476 static const ULONG s_auInterestingEvents[] = … … 514 514 IEventListenerDemo_AddRef(consoleListener); 515 515 516 rc = IEventSource_RegisterListener(es, (IEventListener *)consoleListener,517 ComSafeArrayAsInParam(interestingEventsSA),518 1 /* active */);519 if (SUCCEEDED( rc))516 hrc = IEventSource_RegisterListener(es, (IEventListener *)consoleListener, 517 ComSafeArrayAsInParam(interestingEventsSA), 518 1 /* active */); 519 if (SUCCEEDED(hrc)) 520 520 { 521 521 /* Just wait here for events, no easy way to do this better … … 569 569 { 570 570 IConsole *console = NULL; 571 HRESULT rc;572 573 rc = ISession_get_Console(session, &console);574 if (SUCCEEDED( rc) && console)571 HRESULT hrc; 572 573 hrc = ISession_get_Console(session, &console); 574 if (SUCCEEDED(hrc) && console) 575 575 { 576 576 IEventSource *es = NULL; 577 rc = IConsole_get_EventSource(console, &es);578 if (SUCCEEDED( rc) && es)577 hrc = IConsole_get_EventSource(console, &es); 578 if (SUCCEEDED(hrc) && es) 579 579 { 580 580 static const ULONG s_auInterestingEvents[] = … … 609 609 sizeof(s_auInterestingEvents)); 610 610 611 rc = IEventSource_CreateListener(es, &consoleListener);612 if (SUCCEEDED( rc) && consoleListener)611 hrc = IEventSource_CreateListener(es, &consoleListener); 612 if (SUCCEEDED(hrc) && consoleListener) 613 613 { 614 rc = IEventSource_RegisterListener(es, consoleListener,615 ComSafeArrayAsInParam(interestingEventsSA),616 0 /* passive */);617 if (SUCCEEDED( rc))614 hrc = IEventSource_RegisterListener(es, consoleListener, 615 ComSafeArrayAsInParam(interestingEventsSA), 616 0 /* passive */); 617 if (SUCCEEDED(hrc)) 618 618 { 619 619 /* Just wait here for events, no easy way to do this better … … 630 630 { 631 631 IEvent *ev = NULL; 632 rc = IEventSource_GetEvent(es, consoleListener, 250, &ev);633 if (FAILED( rc))632 hrc = IEventSource_GetEvent(es, consoleListener, 250, &ev); 633 if (FAILED(hrc)) 634 634 { 635 printf("Failed getting event: %#x\n", (unsigned) rc);635 printf("Failed getting event: %#x\n", (unsigned)hrc); 636 636 g_fStop = 1; 637 637 continue; … … 640 640 if (!ev) 641 641 continue; 642 rc = EventListenerDemoProcessEvent(ev);643 if (FAILED( rc))642 hrc = EventListenerDemoProcessEvent(ev); 643 if (FAILED(hrc)) 644 644 { 645 printf("Failed processing event: %#x\n", (unsigned) rc);645 printf("Failed processing event: %#x\n", (unsigned)hrc); 646 646 g_fStop = 1; 647 647 /* finish processing the event */ 648 648 } 649 rc = IEventSource_EventProcessed(es, consoleListener, ev);650 if (FAILED( rc))649 hrc = IEventSource_EventProcessed(es, consoleListener, ev); 650 if (FAILED(hrc)) 651 651 { 652 printf("Failed to mark event as processed: %#x\n", (unsigned) rc);652 printf("Failed to mark event as processed: %#x\n", (unsigned)hrc); 653 653 g_fStop = 1; 654 654 /* continue with event release */ … … 689 689 * @param pszExecutable string with the executable name 690 690 * @param pszErrorMsg string containing the code location specific error message 691 * @param rcCOM/XPCOM result code691 * @param hrc COM/XPCOM result code 692 692 */ 693 static void PrintErrorInfo(const char *pszExecutable, const char *pszErrorMsg, HRESULT rc)693 static void PrintErrorInfo(const char *pszExecutable, const char *pszErrorMsg, HRESULT hrc) 694 694 { 695 695 IErrorInfo *ex; 696 HRESULT rc2;697 fprintf(stderr, "%s: %s ( rc=%#010x)\n", pszExecutable, pszErrorMsg, (unsigned)rc);698 rc2 = g_pVBoxFuncs->pfnGetException(&ex);699 if (SUCCEEDED( rc2) && ex)696 HRESULT hrc2; 697 fprintf(stderr, "%s: %s (hrc=%#010x)\n", pszExecutable, pszErrorMsg, (unsigned)hrc); 698 hrc2 = g_pVBoxFuncs->pfnGetException(&ex); 699 if (SUCCEEDED(hrc2) && ex) 700 700 { 701 701 IVirtualBoxErrorInfo *ei; 702 rc2 = IErrorInfo_QueryInterface(ex, &IID_IVirtualBoxErrorInfo, (void **)&ei);703 if (SUCCEEDED( rc2) && ei != NULL)702 hrc2 = IErrorInfo_QueryInterface(ex, &IID_IVirtualBoxErrorInfo, (void **)&ei); 703 if (SUCCEEDED(hrc2) && ei != NULL) 704 704 { 705 705 /* got extended error info, maybe multiple infos */ … … 729 729 g_pVBoxFuncs->pfnUtf8Free(text); 730 730 731 rc2 = IVirtualBoxErrorInfo_get_Next(ei, &ei_next);732 if (FAILED( rc2))731 hrc2 = IVirtualBoxErrorInfo_get_Next(ei, &ei_next); 732 if (FAILED(hrc2)) 733 733 ei_next = NULL; 734 734 IVirtualBoxErrorInfo_Release(ei); … … 752 752 static void startVM(const char *argv0, IVirtualBox *virtualBox, ISession *session, BSTR id) 753 753 { 754 HRESULT rc;754 HRESULT hrc; 755 755 IMachine *machine = NULL; 756 756 IProgress *progress = NULL; … … 759 759 SAFEARRAY *groupsSA = g_pVBoxFuncs->pfnSafeArrayOutParamAlloc(); 760 760 761 rc = IVirtualBox_FindMachine(virtualBox, id, &machine);762 if (FAILED( rc) || !machine)763 { 764 PrintErrorInfo(argv0, "Error: Couldn't get the Machine reference", rc);761 hrc = IVirtualBox_FindMachine(virtualBox, id, &machine); 762 if (FAILED(hrc) || !machine) 763 { 764 PrintErrorInfo(argv0, "Error: Couldn't get the Machine reference", hrc); 765 765 return; 766 766 } 767 767 768 rc = IMachine_get_Groups(machine, ComSafeArrayAsOutTypeParam(groupsSA, BSTR));769 if (SUCCEEDED( rc))768 hrc = IMachine_get_Groups(machine, ComSafeArrayAsOutTypeParam(groupsSA, BSTR)); 769 if (SUCCEEDED(hrc)) 770 770 { 771 771 BSTR *groups = NULL; … … 792 792 793 793 g_pVBoxFuncs->pfnUtf8ToUtf16("gui", &sessionType); 794 rc = IMachine_LaunchVMProcess(machine, session, sessionType, ComSafeArrayAsInParam(env), &progress);794 hrc = IMachine_LaunchVMProcess(machine, session, sessionType, ComSafeArrayAsInParam(env), &progress); 795 795 g_pVBoxFuncs->pfnUtf16Free(sessionType); 796 if (SUCCEEDED( rc))796 if (SUCCEEDED(hrc)) 797 797 { 798 798 BOOL completed; … … 802 802 IProgress_WaitForCompletion(progress, -1); 803 803 804 rc = IProgress_get_Completed(progress, &completed);805 if (FAILED( rc))804 hrc = IProgress_get_Completed(progress, &completed); 805 if (FAILED(hrc)) 806 806 fprintf(stderr, "Error: GetCompleted status failed\n"); 807 807 … … 837 837 } 838 838 else 839 PrintErrorInfo(argv0, "Error: LaunchVMProcess failed", rc);839 PrintErrorInfo(argv0, "Error: LaunchVMProcess failed", hrc); 840 840 841 841 /* It's important to always release resources. */ … … 852 852 static void listVMs(const char *argv0, IVirtualBox *virtualBox, ISession *session) 853 853 { 854 HRESULT rc;854 HRESULT hrc; 855 855 SAFEARRAY *machinesSA = g_pVBoxFuncs->pfnSafeArrayOutParamAlloc(); 856 856 IMachine **machines = NULL; … … 862 862 * Get the list of all registered VMs. 863 863 */ 864 rc = IVirtualBox_get_Machines(virtualBox, ComSafeArrayAsOutIfaceParam(machinesSA, IMachine *));865 if (FAILED( rc))866 { 867 PrintErrorInfo(argv0, "could not get list of machines", rc);864 hrc = IVirtualBox_get_Machines(virtualBox, ComSafeArrayAsOutIfaceParam(machinesSA, IMachine *)); 865 if (FAILED(hrc)) 866 { 867 PrintErrorInfo(argv0, "could not get list of machines", hrc); 868 868 return; 869 869 } … … 1012 1012 BSTR versionUtf16 = NULL; 1013 1013 BSTR homefolderUtf16 = NULL; 1014 HRESULT rc; /* Result code of various function (method) calls. */1014 HRESULT hrc; /* Result code of various function (method) calls. */ 1015 1015 (void)argc; 1016 1016 … … 1040 1040 printf("----------------------------------------------------\n"); 1041 1041 1042 rc = IVirtualBoxClient_get_VirtualBox(vboxclient, &vbox);1043 if (FAILED( rc) || !vbox)1044 { 1045 PrintErrorInfo(argv[0], "FATAL: could not get VirtualBox reference", rc);1042 hrc = IVirtualBoxClient_get_VirtualBox(vboxclient, &vbox); 1043 if (FAILED(hrc) || !vbox) 1044 { 1045 PrintErrorInfo(argv[0], "FATAL: could not get VirtualBox reference", hrc); 1046 1046 return EXIT_FAILURE; 1047 1047 } 1048 rc = IVirtualBoxClient_get_Session(vboxclient, &session);1049 if (FAILED( rc) || !session)1050 { 1051 PrintErrorInfo(argv[0], "FATAL: could not get Session reference", rc);1048 hrc = IVirtualBoxClient_get_Session(vboxclient, &session); 1049 if (FAILED(hrc) || !session) 1050 { 1051 PrintErrorInfo(argv[0], "FATAL: could not get Session reference", hrc); 1052 1052 return EXIT_FAILURE; 1053 1053 } … … 1055 1055 #ifdef USE_ACTIVE_EVENT_LISTENER 1056 1056 # ifdef WIN32 1057 rc = LoadTypeInfo(&IID_IEventListener, &g_pTInfoIEventListener);1058 if (FAILED( rc) || !g_pTInfoIEventListener)1059 { 1060 PrintErrorInfo(argv[0], "FATAL: could not get type information for IEventListener", rc);1057 hrc = LoadTypeInfo(&IID_IEventListener, &g_pTInfoIEventListener); 1058 if (FAILED(hrc) || !g_pTInfoIEventListener) 1059 { 1060 PrintErrorInfo(argv[0], "FATAL: could not get type information for IEventListener", hrc); 1061 1061 return EXIT_FAILURE; 1062 1062 } … … 1071 1071 1072 1072 /* 1. Revision */ 1073 rc = IVirtualBox_get_Revision(vbox, &revision);1074 if (SUCCEEDED( rc))1073 hrc = IVirtualBox_get_Revision(vbox, &revision); 1074 if (SUCCEEDED(hrc)) 1075 1075 printf("\tRevision: %u\n", (unsigned)revision); 1076 1076 else 1077 PrintErrorInfo(argv[0], "GetRevision() failed", rc);1077 PrintErrorInfo(argv[0], "GetRevision() failed", hrc); 1078 1078 1079 1079 /* 2. Version */ 1080 rc = IVirtualBox_get_Version(vbox, &versionUtf16);1081 if (SUCCEEDED( rc))1080 hrc = IVirtualBox_get_Version(vbox, &versionUtf16); 1081 if (SUCCEEDED(hrc)) 1082 1082 { 1083 1083 char *version = NULL; … … 1088 1088 } 1089 1089 else 1090 PrintErrorInfo(argv[0], "GetVersion() failed", rc);1090 PrintErrorInfo(argv[0], "GetVersion() failed", hrc); 1091 1091 1092 1092 /* 3. Home Folder */ 1093 rc = IVirtualBox_get_HomeFolder(vbox, &homefolderUtf16);1094 if (SUCCEEDED( rc))1093 hrc = IVirtualBox_get_HomeFolder(vbox, &homefolderUtf16); 1094 if (SUCCEEDED(hrc)) 1095 1095 { 1096 1096 char *homefolder = NULL; … … 1101 1101 } 1102 1102 else 1103 PrintErrorInfo(argv[0], "GetHomeFolder() failed", rc);1103 PrintErrorInfo(argv[0], "GetHomeFolder() failed", hrc); 1104 1104 1105 1105 listVMs(argv[0], vbox, session); -
trunk/src/VBox/Main/glue/ErrorInfo.cpp
r98103 r98297 56 56 HRESULT ErrorInfo::getVirtualBoxErrorInfo(ComPtr<IVirtualBoxErrorInfo> &pVirtualBoxErrorInfo) 57 57 { 58 HRESULT rc = S_OK;58 HRESULT hrc = S_OK; 59 59 if (mErrorInfo) 60 rc = mErrorInfo.queryInterfaceTo(pVirtualBoxErrorInfo.asOutParam());60 hrc = mErrorInfo.queryInterfaceTo(pVirtualBoxErrorInfo.asOutParam()); 61 61 else 62 62 pVirtualBoxErrorInfo.setNull(); 63 return rc;63 return hrc; 64 64 } 65 65 … … 111 111 void ErrorInfo::init(bool aKeepObj /* = false */) 112 112 { 113 HRESULT rc = E_FAIL;113 HRESULT hrc = E_FAIL; 114 114 115 115 #if !defined(VBOX_WITH_XPCOM) 116 116 117 117 ComPtr<IErrorInfo> err; 118 rc = ::GetErrorInfo(0, err.asOutParam());119 if ( rc == S_OK && err)118 hrc = ::GetErrorInfo(0, err.asOutParam()); 119 if (hrc == S_OK && err) 120 120 { 121 121 if (aKeepObj) … … 123 123 124 124 ComPtr<IVirtualBoxErrorInfo> info; 125 rc = err.queryInterfaceTo(info.asOutParam());126 if (SUCCEEDED( rc) && info)125 hrc = err.queryInterfaceTo(info.asOutParam()); 126 if (SUCCEEDED(hrc) && info) 127 127 init(info); 128 128 … … 131 131 bool gotSomething = false; 132 132 133 rc = err->GetGUID(mInterfaceID.asOutParam());134 gotSomething |= SUCCEEDED( rc);135 if (SUCCEEDED( rc))133 hrc = err->GetGUID(mInterfaceID.asOutParam()); 134 gotSomething |= SUCCEEDED(hrc); 135 if (SUCCEEDED(hrc)) 136 136 GetInterfaceNameByIID(mInterfaceID.ref(), mInterfaceName.asOutParam()); 137 137 138 rc = err->GetSource(mComponent.asOutParam());139 gotSomething |= SUCCEEDED( rc);140 141 rc = err->GetDescription(mText.asOutParam());142 gotSomething |= SUCCEEDED( rc);138 hrc = err->GetSource(mComponent.asOutParam()); 139 gotSomething |= SUCCEEDED(hrc); 140 141 hrc = err->GetDescription(mText.asOutParam()); 142 gotSomething |= SUCCEEDED(hrc); 143 143 144 144 if (gotSomething) … … 152 152 153 153 nsCOMPtr<nsIExceptionService> es; 154 es = do_GetService(NS_EXCEPTIONSERVICE_CONTRACTID, & rc);155 if (NS_SUCCEEDED( rc))154 es = do_GetService(NS_EXCEPTIONSERVICE_CONTRACTID, &hrc); 155 if (NS_SUCCEEDED(hrc)) 156 156 { 157 157 nsCOMPtr<nsIExceptionManager> em; 158 rc = es->GetCurrentExceptionManager(getter_AddRefs(em));159 if (NS_SUCCEEDED( rc))158 hrc = es->GetCurrentExceptionManager(getter_AddRefs(em)); 159 if (NS_SUCCEEDED(hrc)) 160 160 { 161 161 ComPtr<nsIException> ex; 162 rc = em->GetCurrentException(ex.asOutParam());163 if (NS_SUCCEEDED( rc) && ex)162 hrc = em->GetCurrentException(ex.asOutParam()); 163 if (NS_SUCCEEDED(hrc) && ex) 164 164 { 165 165 if (aKeepObj) … … 167 167 168 168 ComPtr<IVirtualBoxErrorInfo> info; 169 rc = ex.queryInterfaceTo(info.asOutParam());170 if (NS_SUCCEEDED( rc) && info)169 hrc = ex.queryInterfaceTo(info.asOutParam()); 170 if (NS_SUCCEEDED(hrc) && info) 171 171 init(info); 172 172 … … 175 175 bool gotSomething = false; 176 176 177 rc = ex->GetResult(&mResultCode);178 gotSomething |= NS_SUCCEEDED( rc);177 hrc = ex->GetResult(&mResultCode); 178 gotSomething |= NS_SUCCEEDED(hrc); 179 179 180 180 char *pszMsg; 181 rc = ex->GetMessage(&pszMsg);182 gotSomething |= NS_SUCCEEDED( rc);183 if (NS_SUCCEEDED( rc))181 hrc = ex->GetMessage(&pszMsg); 182 gotSomething |= NS_SUCCEEDED(hrc); 183 if (NS_SUCCEEDED(hrc)) 184 184 { 185 185 mText = Bstr(pszMsg); … … 196 196 em->SetCurrentException(NULL); 197 197 198 rc = NS_OK;198 hrc = NS_OK; 199 199 } 200 200 } 201 201 } 202 202 /* Ignore failure when called after nsComponentManagerImpl::Shutdown(). */ 203 else if ( rc == NS_ERROR_UNEXPECTED)204 rc = NS_OK;205 206 AssertComRC( rc);203 else if (hrc == NS_ERROR_UNEXPECTED) 204 hrc = NS_OK; 205 206 AssertComRC(hrc); 207 207 208 208 #endif // defined(VBOX_WITH_XPCOM) … … 219 219 ComPtr<IUnknown> iface = aI; 220 220 ComPtr<ISupportErrorInfo> serr; 221 HRESULT rc = iface.queryInterfaceTo(serr.asOutParam());222 if (SUCCEEDED( rc))223 { 224 rc = serr->InterfaceSupportsErrorInfo(aIID);225 if (SUCCEEDED( rc))221 HRESULT hrc = iface.queryInterfaceTo(serr.asOutParam()); 222 if (SUCCEEDED(hrc)) 223 { 224 hrc = serr->InterfaceSupportsErrorInfo(aIID); 225 if (SUCCEEDED(hrc)) 226 226 init(aKeepObj); 227 227 } … … 244 244 AssertReturnVoid(info); 245 245 246 HRESULT rc = E_FAIL;246 HRESULT hrc = E_FAIL; 247 247 bool gotSomething = false; 248 248 bool gotAll = true; 249 249 LONG lrc, lrd; 250 250 251 rc = info->COMGETTER(ResultCode)(&lrc); mResultCode = lrc;252 gotSomething |= SUCCEEDED( rc);253 gotAll &= SUCCEEDED( rc);254 255 rc = info->COMGETTER(ResultDetail)(&lrd); mResultDetail = lrd;256 gotSomething |= SUCCEEDED( rc);257 gotAll &= SUCCEEDED( rc);251 hrc = info->COMGETTER(ResultCode)(&lrc); mResultCode = lrc; 252 gotSomething |= SUCCEEDED(hrc); 253 gotAll &= SUCCEEDED(hrc); 254 255 hrc = info->COMGETTER(ResultDetail)(&lrd); mResultDetail = lrd; 256 gotSomething |= SUCCEEDED(hrc); 257 gotAll &= SUCCEEDED(hrc); 258 258 259 259 Bstr iid; 260 rc = info->COMGETTER(InterfaceID)(iid.asOutParam());261 gotSomething |= SUCCEEDED( rc);262 gotAll &= SUCCEEDED( rc);263 if (SUCCEEDED( rc))260 hrc = info->COMGETTER(InterfaceID)(iid.asOutParam()); 261 gotSomething |= SUCCEEDED(hrc); 262 gotAll &= SUCCEEDED(hrc); 263 if (SUCCEEDED(hrc)) 264 264 { 265 265 mInterfaceID = iid; … … 267 267 } 268 268 269 rc = info->COMGETTER(Component)(mComponent.asOutParam());270 gotSomething |= SUCCEEDED( rc);271 gotAll &= SUCCEEDED( rc);272 273 rc = info->COMGETTER(Text)(mText.asOutParam());274 gotSomething |= SUCCEEDED( rc);275 gotAll &= SUCCEEDED( rc);269 hrc = info->COMGETTER(Component)(mComponent.asOutParam()); 270 gotSomething |= SUCCEEDED(hrc); 271 gotAll &= SUCCEEDED(hrc); 272 273 hrc = info->COMGETTER(Text)(mText.asOutParam()); 274 gotSomething |= SUCCEEDED(hrc); 275 gotAll &= SUCCEEDED(hrc); 276 276 277 277 m_pNext = NULL; 278 278 279 279 ComPtr<IVirtualBoxErrorInfo> next; 280 rc = info->COMGETTER(Next)(next.asOutParam());281 if (SUCCEEDED( rc) && !next.isNull())280 hrc = info->COMGETTER(Next)(next.asOutParam()); 281 if (SUCCEEDED(hrc) && !next.isNull()) 282 282 { 283 283 m_pNext = new ErrorInfo(next); 284 284 Assert(m_pNext != NULL); 285 285 if (!m_pNext) 286 rc = E_OUTOFMEMORY;287 } 288 289 gotSomething |= SUCCEEDED( rc);290 gotAll &= SUCCEEDED( rc);286 hrc = E_OUTOFMEMORY; 287 } 288 289 gotSomething |= SUCCEEDED(hrc); 290 gotAll &= SUCCEEDED(hrc); 291 291 292 292 mIsBasicAvailable = gotSomething; … … 312 312 313 313 ComPtr<IVirtualBoxErrorInfo> info; 314 HRESULT rc = progress->COMGETTER(ErrorInfo)(info.asOutParam());315 if (SUCCEEDED( rc) && info)314 HRESULT hrc = progress->COMGETTER(ErrorInfo)(info.asOutParam()); 315 if (SUCCEEDED(hrc) && info) 316 316 init(info); 317 317 } … … 328 328 return S_OK; 329 329 330 HRESULT rc = S_OK;330 HRESULT hrc = S_OK; 331 331 332 332 #if !defined(VBOX_WITH_XPCOM) … … 335 335 if (!mErrorInfo.isNull()) 336 336 { 337 rc = mErrorInfo.queryInterfaceTo(err.asOutParam());338 AssertComRC( rc);339 } 340 rc = ::SetErrorInfo(0, err);337 hrc = mErrorInfo.queryInterfaceTo(err.asOutParam()); 338 AssertComRC(hrc); 339 } 340 hrc = ::SetErrorInfo(0, err); 341 341 342 342 #else // defined(VBOX_WITH_XPCOM) 343 343 344 344 nsCOMPtr <nsIExceptionService> es; 345 es = do_GetService(NS_EXCEPTIONSERVICE_CONTRACTID, & rc);346 if (NS_SUCCEEDED( rc))345 es = do_GetService(NS_EXCEPTIONSERVICE_CONTRACTID, &hrc); 346 if (NS_SUCCEEDED(hrc)) 347 347 { 348 348 nsCOMPtr <nsIExceptionManager> em; 349 rc = es->GetCurrentExceptionManager(getter_AddRefs(em));350 if (NS_SUCCEEDED( rc))349 hrc = es->GetCurrentExceptionManager(getter_AddRefs(em)); 350 if (NS_SUCCEEDED(hrc)) 351 351 { 352 352 ComPtr<nsIException> ex; 353 353 if (!mErrorInfo.isNull()) 354 354 { 355 rc = mErrorInfo.queryInterfaceTo(ex.asOutParam());356 AssertComRC( rc);355 hrc = mErrorInfo.queryInterfaceTo(ex.asOutParam()); 356 AssertComRC(hrc); 357 357 } 358 rc = em->SetCurrentException(ex);358 hrc = em->SetCurrentException(ex); 359 359 } 360 360 } … … 362 362 #endif // defined(VBOX_WITH_XPCOM) 363 363 364 if (SUCCEEDED( rc))364 if (SUCCEEDED(hrc)) 365 365 { 366 366 mErrorInfo.setNull(); … … 368 368 } 369 369 370 return rc;370 return hrc; 371 371 } 372 372 -
trunk/src/VBox/Main/glue/EventQueue.cpp
r98103 r98297 49 49 mShutdown(false) 50 50 { 51 int rc = RTCritSectInit(&mCritSect);52 AssertRC( rc);53 54 rc = RTSemEventCreate(&mSemEvent);55 AssertRC( rc);51 int vrc = RTCritSectInit(&mCritSect); 52 AssertRC(vrc); 53 54 vrc = RTSemEventCreate(&mSemEvent); 55 AssertRC(vrc); 56 56 } 57 57 58 58 EventQueue::~EventQueue(void) 59 59 { 60 int rc = RTCritSectDelete(&mCritSect);61 AssertRC( rc);62 63 rc = RTSemEventDestroy(mSemEvent);64 AssertRC( rc);60 int vrc = RTCritSectDelete(&mCritSect); 61 AssertRC(vrc); 62 63 vrc = RTSemEventDestroy(mSemEvent); 64 AssertRC(vrc); 65 65 66 66 EventQueueListIterator it = mEvents.begin(); … … 98 98 { 99 99 size_t cNumEvents; 100 int rc = RTCritSectEnter(&mCritSect);101 if (RT_SUCCESS( rc))100 int vrc = RTCritSectEnter(&mCritSect); 101 if (RT_SUCCESS(vrc)) 102 102 { 103 103 if (mUserCnt == 0) /* No concurrent access allowed. */ … … 108 108 if (!cNumEvents) 109 109 { 110 int rc2 = RTCritSectLeave(&mCritSect);111 AssertRC( rc2);112 113 rc = RTSemEventWaitNoResume(mSemEvent, cMsTimeout);114 115 rc2 = RTCritSectEnter(&mCritSect);116 AssertRC( rc2);117 118 if (RT_SUCCESS( rc))110 int vrc2 = RTCritSectLeave(&mCritSect); 111 AssertRC(vrc2); 112 113 vrc = RTSemEventWaitNoResume(mSemEvent, cMsTimeout); 114 115 vrc2 = RTCritSectEnter(&mCritSect); 116 AssertRC(vrc2); 117 118 if (RT_SUCCESS(vrc)) 119 119 { 120 120 if (mShutdown) 121 rc = VERR_INTERRUPTED;121 vrc = VERR_INTERRUPTED; 122 122 cNumEvents = mEvents.size(); 123 123 } 124 124 } 125 125 126 if (RT_SUCCESS( rc))127 rc = processPendingEvents(cNumEvents);126 if (RT_SUCCESS(vrc)) 127 vrc = processPendingEvents(cNumEvents); 128 128 129 129 Assert(mUserCnt); … … 131 131 } 132 132 else 133 rc = VERR_WRONG_ORDER;134 135 int rc2 = RTCritSectLeave(&mCritSect);136 if (RT_SUCCESS( rc))137 rc =rc2;138 } 139 140 Assert( rc != VERR_TIMEOUT || cMsTimeout != RT_INDEFINITE_WAIT);141 return rc;133 vrc = VERR_WRONG_ORDER; 134 135 int vrc2 = RTCritSectLeave(&mCritSect); 136 if (RT_SUCCESS(vrc)) 137 vrc = vrc2; 138 } 139 140 Assert(vrc != VERR_TIMEOUT || cMsTimeout != RT_INDEFINITE_WAIT); 141 return vrc; 142 142 } 143 143 … … 154 154 return VINF_SUCCESS; 155 155 156 int rc = VINF_SUCCESS;156 int vrc = VINF_SUCCESS; 157 157 158 158 EventQueueListIterator it = mEvents.begin(); … … 166 166 mEvents.erase(it); 167 167 168 int rc2 = RTCritSectLeave(&mCritSect);169 AssertRC( rc2);168 int vrc2 = RTCritSectLeave(&mCritSect); 169 AssertRC(vrc2); 170 170 171 171 pEvent->handler(); 172 172 pEvent->Release(); 173 173 174 rc2 = RTCritSectEnter(&mCritSect);175 AssertRC( rc2);174 vrc2 = RTCritSectEnter(&mCritSect); 175 AssertRC(vrc2); 176 176 177 177 it = mEvents.begin(); 178 178 if (mShutdown) 179 179 { 180 rc = VERR_INTERRUPTED;180 vrc = VERR_INTERRUPTED; 181 181 break; 182 182 } 183 183 } 184 184 185 return rc;185 return vrc; 186 186 } 187 187 … … 208 208 BOOL EventQueue::postEvent(Event *pEvent) 209 209 { 210 int rc = RTCritSectEnter(&mCritSect);211 if (RT_SUCCESS( rc))210 int vrc = RTCritSectEnter(&mCritSect); 211 if (RT_SUCCESS(vrc)) 212 212 { 213 213 try … … 231 231 232 232 /* Leave critical section before signalling event. */ 233 rc = RTCritSectLeave(&mCritSect);234 if (RT_SUCCESS( rc))235 { 236 int rc2 = RTSemEventSignal(mSemEvent);237 AssertRC( rc2);233 vrc = RTCritSectLeave(&mCritSect); 234 if (RT_SUCCESS(vrc)) 235 { 236 int vrc2 = RTSemEventSignal(mSemEvent); 237 AssertRC(vrc2); 238 238 } 239 239 } … … 241 241 { 242 242 NOREF(ba); 243 rc = VERR_NO_MEMORY;244 } 245 246 if (RT_FAILURE( rc))247 { 248 int rc2 = RTCritSectLeave(&mCritSect);249 AssertRC( rc2);250 } 251 } 252 253 return RT_SUCCESS( rc) ? TRUE : FALSE;243 vrc = VERR_NO_MEMORY; 244 } 245 246 if (RT_FAILURE(vrc)) 247 { 248 int vrc2 = RTCritSectLeave(&mCritSect); 249 AssertRC(vrc2); 250 } 251 } 252 253 return RT_SUCCESS(vrc) ? TRUE : FALSE; 254 254 } 255 255 -
trunk/src/VBox/Main/glue/NativeEventQueue.cpp
r98103 r98297 163 163 // NULL to the event thread (because it stopped accepting events). 164 164 165 nsresult rc = NS_GetEventQueueService(getter_AddRefs(mEventQService)); 166 167 if (NS_SUCCEEDED(rc)) 168 { 169 rc = mEventQService->GetThreadEventQueue(NS_CURRENT_THREAD, 170 getter_AddRefs(mEventQ)); 171 if (rc == NS_ERROR_NOT_AVAILABLE) 165 nsresult hrc = NS_GetEventQueueService(getter_AddRefs(mEventQService)); 166 167 if (NS_SUCCEEDED(hrc)) 168 { 169 hrc = mEventQService->GetThreadEventQueue(NS_CURRENT_THREAD, getter_AddRefs(mEventQ)); 170 if (hrc == NS_ERROR_NOT_AVAILABLE) 172 171 { 173 rc = mEventQService->CreateThreadEventQueue();174 if (NS_SUCCEEDED( rc))172 hrc = mEventQService->CreateThreadEventQueue(); 173 if (NS_SUCCEEDED(hrc)) 175 174 { 176 175 mEQCreated = true; 177 rc = mEventQService->GetThreadEventQueue(NS_CURRENT_THREAD, 178 getter_AddRefs(mEventQ)); 176 hrc = mEventQService->GetThreadEventQueue(NS_CURRENT_THREAD, getter_AddRefs(mEventQ)); 179 177 } 180 178 } 181 179 } 182 AssertComRC( rc);180 AssertComRC(hrc); 183 181 184 182 #endif // VBOX_WITH_XPCOM … … 356 354 } 357 355 358 int rc = select(fd + 1, &fdsetR, NULL, &fdsetE, ptv); 359 if (rc > 0) 360 rc = VINF_SUCCESS; 361 else if (rc == 0) 362 rc = VERR_TIMEOUT; 356 int iRc = select(fd + 1, &fdsetR, NULL, &fdsetE, ptv); 357 int vrc; 358 if (iRc > 0) 359 vrc = VINF_SUCCESS; 360 else if (iRc == 0) 361 vrc = VERR_TIMEOUT; 363 362 else if (errno == EINTR) 364 rc = VINF_INTERRUPTED;363 vrc = VINF_INTERRUPTED; 365 364 else 366 365 { … … 368 367 if (s_ErrorCount < 500) 369 368 { 370 LogRel(("waitForEventsOnXPCOM rc=%d errno=%d\n", rc, errno));369 LogRel(("waitForEventsOnXPCOM iRc=%d errno=%d\n", iRc, errno)); 371 370 ++s_ErrorCount; 372 371 } 373 372 374 AssertMsgFailed((" rc=%d errno=%d\n", rc, errno));375 rc = VERR_INTERNAL_ERROR_4;376 } 377 return rc;373 AssertMsgFailed(("iRc=%d errno=%d\n", iRc, errno)); 374 vrc = VERR_INTERNAL_ERROR_4; 375 } 376 return vrc; 378 377 } 379 378 … … 388 387 * This will pick out our events and handle them specially. 389 388 * 390 * @returns @a rc or VERR_INTERRUPTED (WM_QUIT or NULL msg).389 * @returns @a vrc or VERR_INTERRUPTED (WM_QUIT or NULL msg). 391 390 * @param pMsg The message to dispatch. 392 * @param rcThe current status code.391 * @param vrc The current status code. 393 392 */ 394 393 /*static*/ 395 int NativeEventQueue::dispatchMessageOnWindows(MSG const *pMsg, int rc)394 int NativeEventQueue::dispatchMessageOnWindows(MSG const *pMsg, int vrc) 396 395 { 397 396 /* … … 410 409 } 411 410 else 412 rc = VERR_INTERRUPTED;413 return rc;411 vrc = VERR_INTERRUPTED; 412 return vrc; 414 413 } 415 414 AssertMsgFailed(("lParam=%p wParam=%p\n", pMsg->lParam, pMsg->wParam)); … … 420 419 */ 421 420 if (pMsg->message == WM_QUIT) 422 rc = VERR_INTERRUPTED;421 vrc = VERR_INTERRUPTED; 423 422 TranslateMessage(pMsg); 424 423 DispatchMessage(pMsg); 425 424 426 return rc;425 return vrc; 427 426 } 428 427 … … 437 436 static int processPendingEvents(void) 438 437 { 439 int rc = VERR_TIMEOUT;438 int vrc = VERR_TIMEOUT; 440 439 MSG Msg; 441 440 if (PeekMessage(&Msg, NULL /*hWnd*/, 0 /*wMsgFilterMin*/, 0 /*wMsgFilterMax*/, PM_REMOVE)) 442 441 { 443 rc = VINF_SUCCESS;442 vrc = VINF_SUCCESS; 444 443 do 445 rc = NativeEventQueue::dispatchMessageOnWindows(&Msg,rc);444 vrc = NativeEventQueue::dispatchMessageOnWindows(&Msg, vrc); 446 445 while (PeekMessage(&Msg, NULL /*hWnd*/, 0 /*wMsgFilterMin*/, 0 /*wMsgFilterMax*/, PM_REMOVE)); 447 446 } 448 return rc;447 return vrc; 449 448 } 450 449 … … 463 462 /* ProcessPendingEvents doesn't report back what it did, so check here. */ 464 463 PRBool fHasEvents = PR_FALSE; 465 nsresult hr = pQueue->PendingEvents(&fHasEvents);466 if (NS_FAILED(hr ))464 nsresult hrc = pQueue->PendingEvents(&fHasEvents); 465 if (NS_FAILED(hrc)) 467 466 return VERR_INTERNAL_ERROR_2; 468 467 469 468 /* Process pending events. */ 470 int rc = VINF_SUCCESS;469 int vrc = VINF_SUCCESS; 471 470 if (fHasEvents) 472 471 pQueue->ProcessPendingEvents(); 473 472 else 474 rc = VERR_TIMEOUT;473 vrc = VERR_TIMEOUT; 475 474 476 475 # ifdef RT_OS_DARWIN 477 476 /* Process pending native events. */ 478 int rc2 = waitForEventsOnDarwin(0);479 if ( rc == VERR_TIMEOUT ||rc2 == VERR_INTERRUPTED)480 rc =rc2;477 int vrc2 = waitForEventsOnDarwin(0); 478 if (vrc == VERR_TIMEOUT || vrc2 == VERR_INTERRUPTED) 479 vrc = vrc2; 481 480 # endif 482 481 483 return rc;482 return vrc; 484 483 } 485 484 … … 514 513 int NativeEventQueue::processEventQueue(RTMSINTERVAL cMsTimeout) 515 514 { 516 int rc;515 int vrc; 517 516 CHECK_THREAD_RET(VERR_INVALID_CONTEXT); 518 517 … … 527 526 * while select() is. So we cannot use it for indefinite waits. 528 527 */ 529 rc = processPendingEvents(mEventQ);530 if ( rc == VERR_TIMEOUT528 vrc = processPendingEvents(mEventQ); 529 if ( vrc == VERR_TIMEOUT 531 530 && cMsTimeout > 0) 532 531 { … … 538 537 * Ctrl-C handling is important, signal needs to be handled on 539 538 * a different thread or something. */ 540 rc = waitForEventsOnDarwin(cMsTimeout);539 vrc = waitForEventsOnDarwin(cMsTimeout); 541 540 # else // !RT_OS_DARWIN 542 rc = waitForEventsOnXPCOM(mEventQ, cMsTimeout);541 vrc = waitForEventsOnXPCOM(mEventQ, cMsTimeout); 543 542 # endif // !RT_OS_DARWIN 544 if ( RT_SUCCESS( rc)545 || rc == VERR_TIMEOUT)543 if ( RT_SUCCESS(vrc) 544 || vrc == VERR_TIMEOUT) 546 545 { 547 int rc2 = processPendingEvents(mEventQ);546 int vrc2 = processPendingEvents(mEventQ); 548 547 /* If the wait was successful don't fail the whole operation. */ 549 if (RT_FAILURE( rc) && RT_FAILURE(rc2))550 rc =rc2;548 if (RT_FAILURE(vrc) && RT_FAILURE(vrc2)) 549 vrc = vrc2; 551 550 } 552 551 } 553 552 554 if ( ( RT_SUCCESS( rc)555 || rc == VERR_INTERRUPTED556 || rc == VERR_TIMEOUT)553 if ( ( RT_SUCCESS(vrc) 554 || vrc == VERR_INTERRUPTED 555 || vrc == VERR_TIMEOUT) 557 556 && mInterrupted) 558 557 { 559 558 mInterrupted = false; 560 rc = VERR_INTERRUPTED;559 vrc = VERR_INTERRUPTED; 561 560 } 562 561 … … 566 565 BOOL fRet = 0; /* Shut up MSC */ 567 566 MSG Msg; 568 rc = VINF_SUCCESS;569 while ( rc != VERR_INTERRUPTED567 vrc = VINF_SUCCESS; 568 while ( vrc != VERR_INTERRUPTED 570 569 && (fRet = GetMessage(&Msg, NULL /*hWnd*/, WM_USER, WM_USER)) 571 570 && fRet != -1) 572 rc = NativeEventQueue::dispatchMessageOnWindows(&Msg,rc);571 vrc = NativeEventQueue::dispatchMessageOnWindows(&Msg, vrc); 573 572 if (fRet == 0) 574 rc = VERR_INTERRUPTED;573 vrc = VERR_INTERRUPTED; 575 574 else if (fRet == -1) 576 rc = RTErrConvertFromWin32(GetLastError());575 vrc = RTErrConvertFromWin32(GetLastError()); 577 576 } 578 577 else 579 578 { 580 rc = processPendingEvents();581 if ( rc == VERR_TIMEOUT579 vrc = processPendingEvents(); 580 if ( vrc == VERR_TIMEOUT 582 581 && cMsTimeout != 0) 583 582 { … … 590 589 ("%d\n", rcW), 591 590 VERR_INTERNAL_ERROR_4); 592 rc = processPendingEvents();591 vrc = processPendingEvents(); 593 592 } 594 593 } 595 594 #endif // !VBOX_WITH_XPCOM 596 595 597 Assert( rc != VERR_TIMEOUT || cMsTimeout != RT_INDEFINITE_WAIT);598 return rc;596 Assert(vrc != VERR_TIMEOUT || cMsTimeout != RT_INDEFINITE_WAIT); 597 return vrc; 599 598 } 600 599 … … 646 645 mEventQ->InitEvent(pMyEvent, this, com::NativeEventQueue::plEventHandler, 647 646 com::NativeEventQueue::plEventDestructor); 648 HRESULT rc = mEventQ->PostEvent(pMyEvent);649 return NS_SUCCEEDED( rc);647 HRESULT hrc = mEventQ->PostEvent(pMyEvent); 648 return NS_SUCCEEDED(hrc); 650 649 } 651 650 catch (std::bad_alloc &ba) -
trunk/src/VBox/Main/glue/com.cpp
r98103 r98297 78 78 #if !defined(VBOX_WITH_XPCOM) 79 79 80 LONG rc;81 80 LPOLESTR iidStr = NULL; 82 81 if (StringFromIID(aIID, &iidStr) == S_OK) 83 82 { 84 83 HKEY ifaceKey; 85 rc = RegOpenKeyExW(HKEY_CLASSES_ROOT, L"Interface", 86 0, KEY_QUERY_VALUE, &ifaceKey); 87 if (rc == ERROR_SUCCESS) 84 LSTATUS lrc = RegOpenKeyExW(HKEY_CLASSES_ROOT, L"Interface", 0, KEY_QUERY_VALUE, &ifaceKey); 85 if (lrc == ERROR_SUCCESS) 88 86 { 89 87 HKEY iidKey; 90 rc = RegOpenKeyExW(ifaceKey, iidStr, 0, KEY_QUERY_VALUE, &iidKey);91 if ( rc == ERROR_SUCCESS)88 lrc = RegOpenKeyExW(ifaceKey, iidStr, 0, KEY_QUERY_VALUE, &iidKey); 89 if (lrc == ERROR_SUCCESS) 92 90 { 93 91 /* determine the size and type */ 94 92 DWORD sz, type; 95 rc = RegQueryValueExW(iidKey, NULL, NULL, &type, NULL, &sz);96 if ( rc == ERROR_SUCCESS && type == REG_SZ)93 lrc = RegQueryValueExW(iidKey, NULL, NULL, &type, NULL, &sz); 94 if (lrc == ERROR_SUCCESS && type == REG_SZ) 97 95 { 98 96 /* query the value to BSTR */ 99 97 *aName = SysAllocStringLen(NULL, (sz + 1) / sizeof(TCHAR) + 1); 100 rc = RegQueryValueExW(iidKey, NULL, NULL, NULL, (LPBYTE) *aName, &sz);101 if ( rc != ERROR_SUCCESS)98 lrc = RegQueryValueExW(iidKey, NULL, NULL, NULL, (LPBYTE) *aName, &sz); 99 if (lrc != ERROR_SUCCESS) 102 100 { 103 101 SysFreeString(*aName); … … 149 147 void** ppobj) 150 148 { 151 HRESULT rc;152 nsCOMPtr<ipcIService> ipcServ = do_GetService(IPC_SERVICE_CONTRACTID, & rc);153 if (SUCCEEDED( rc))149 HRESULT hrc = E_UNEXPECTED; 150 nsCOMPtr<ipcIService> ipcServ = do_GetService(IPC_SERVICE_CONTRACTID, &hrc); 151 if (SUCCEEDED(hrc)) 154 152 { 155 153 PRUint32 serverID = 0; 156 rc = ipcServ->ResolveClientName(serverName, &serverID);157 if (SUCCEEDED ( rc))154 hrc = ipcServ->ResolveClientName(serverName, &serverID); 155 if (SUCCEEDED (hrc)) 158 156 { 159 nsCOMPtr<ipcIDConnectService> dconServ = do_GetService(IPC_DCONNECTSERVICE_CONTRACTID, & rc);160 if (SUCCEEDED( rc))161 rc = dconServ->CreateInstance(serverID,162 clsid,163 id,164 ppobj);157 nsCOMPtr<ipcIDConnectService> dconServ = do_GetService(IPC_DCONNECTSERVICE_CONTRACTID, &hrc); 158 if (SUCCEEDED(hrc)) 159 hrc = dconServ->CreateInstance(serverID, 160 clsid, 161 id, 162 ppobj); 165 163 } 166 164 } 167 return rc;165 return hrc; 168 166 } 169 167 … … 173 171 { 174 172 nsCOMPtr<nsIComponentManager> manager; 175 HRESULT rc = NS_GetComponentManager(getter_AddRefs(manager));176 if (SUCCEEDED( rc))177 rc = manager->CreateInstance(clsid,178 nsnull,179 id,180 ppobj);181 return rc;173 HRESULT hrc = NS_GetComponentManager(getter_AddRefs(manager)); 174 if (SUCCEEDED(hrc)) 175 hrc = manager->CreateInstance(clsid, 176 nsnull, 177 id, 178 ppobj); 179 return hrc; 182 180 } 183 181 -
trunk/src/VBox/Main/glue/errorprint.cpp
r98103 r98297 57 57 try 58 58 { 59 HRESULT rc = S_OK;59 HRESULT hrc = S_OK; 60 60 Utf8Str str; 61 61 RTCList<Utf8Str> comp; … … 67 67 if (haveResultCode) 68 68 { 69 rc = info.getResultCode();70 comp.append(Utf8StrFmt("code %Rhrc (0x%RX32)", rc,rc));69 hrc = info.getResultCode(); 70 comp.append(Utf8StrFmt("code %Rhrc (0x%RX32)", hrc, hrc)); 71 71 } 72 72 if (haveComponent) … … 90 90 91 91 // print and log 92 if (FAILED( rc))92 if (FAILED(hrc)) 93 93 { 94 94 RTMsgError("%s", str.c_str()); … … 126 126 } 127 127 128 void GluePrintRCMessage(HRESULT rc)128 void GluePrintRCMessage(HRESULT hrc) 129 129 { 130 130 // print and log 131 if (FAILED( rc))132 { 133 RTMsgError("Code %Rhra (extended info not available)\n", rc);134 Log(("ERROR: Code %Rhra (extended info not available)\n", rc));131 if (FAILED(hrc)) 132 { 133 RTMsgError("Code %Rhra (extended info not available)\n", hrc); 134 Log(("ERROR: Code %Rhra (extended info not available)\n", hrc)); 135 135 } 136 136 else 137 137 { 138 RTMsgWarning("Code %Rhra (extended info not available)\n", rc);139 Log(("WARNING: Code %Rhra (extended info not available)\n", rc));138 RTMsgWarning("Code %Rhra (extended info not available)\n", hrc); 139 Log(("WARNING: Code %Rhra (extended info not available)\n", hrc)); 140 140 } 141 141 } … … 143 143 static void glueHandleComErrorInternal(com::ErrorInfo &info, 144 144 const char *pcszContext, 145 HRESULT rc,145 HRESULT hrc, 146 146 const char *pcszSourceFile, 147 147 uint32_t ulLine) … … 154 154 GluePrintErrorInfo(*pInfo); 155 155 156 /* Use rc for figuring out if there were just warnings. */157 HRESULT rc2 = pInfo->getResultCode();158 if ( (SUCCEEDED_WARNING( rc) && FAILED(rc2))159 || (SUCCEEDED( rc) && (FAILED(rc2) || SUCCEEDED_WARNING(rc2))))160 rc =rc2;156 /* Use hrc for figuring out if there were just warnings. */ 157 HRESULT hrc2 = pInfo->getResultCode(); 158 if ( (SUCCEEDED_WARNING(hrc) && FAILED(hrc2)) 159 || (SUCCEEDED(hrc) && (FAILED(hrc2) || SUCCEEDED_WARNING(hrc2)))) 160 hrc = hrc2; 161 161 162 162 pInfo = pInfo->getNext(); … … 171 171 RTMsgError("--------\n"); 172 172 } 173 } 174 while (pInfo); 173 } while (pInfo); 175 174 } 176 175 else 177 GluePrintRCMessage( rc);176 GluePrintRCMessage(hrc); 178 177 179 178 if (pcszContext != NULL || pcszSourceFile != NULL) 180 GluePrintErrorContext(pcszContext, pcszSourceFile, ulLine, SUCCEEDED_WARNING( rc));179 GluePrintErrorContext(pcszContext, pcszSourceFile, ulLine, SUCCEEDED_WARNING(hrc)); 181 180 } 182 181 183 182 void GlueHandleComError(ComPtr<IUnknown> iface, 184 183 const char *pcszContext, 185 HRESULT rc,184 HRESULT hrc, 186 185 const char *pcszSourceFile, 187 186 uint32_t ulLine) … … 193 192 glueHandleComErrorInternal(info, 194 193 pcszContext, 195 rc,194 hrc, 196 195 pcszSourceFile, 197 196 ulLine); … … 199 198 } 200 199 201 void GlueHandleComErrorNoCtx(ComPtr<IUnknown> iface, HRESULT rc)202 { 203 GlueHandleComError(iface, NULL, rc, NULL, 0);200 void GlueHandleComErrorNoCtx(ComPtr<IUnknown> iface, HRESULT hrc) 201 { 202 GlueHandleComError(iface, NULL, hrc, NULL, 0); 204 203 } 205 204 206 205 void GlueHandleComErrorProgress(ComPtr<IProgress> progress, 207 206 const char *pcszContext, 208 HRESULT rc,207 HRESULT hrc, 209 208 const char *pcszSourceFile, 210 209 uint32_t ulLine) … … 215 214 glueHandleComErrorInternal(ei, 216 215 pcszContext, 217 rc,216 hrc, 218 217 pcszSourceFile, 219 218 ulLine); -
trunk/src/VBox/Main/glue/initterm.cpp
r98103 r98297 443 443 HRESULT Initialize(uint32_t fInitFlags /*=VBOX_COM_INIT_F_DEFAULT*/) 444 444 { 445 HRESULT rc = E_FAIL;445 HRESULT hrc = E_FAIL; 446 446 447 447 #if !defined(VBOX_WITH_XPCOM) … … 511 511 | COINIT_SPEED_OVER_MEMORY; 512 512 513 rc = CoInitializeEx(NULL, flags);513 hrc = CoInitializeEx(NULL, flags); 514 514 515 515 /* the overall result must be either S_OK or S_FALSE (S_FALSE means 516 516 * "already initialized using the same apartment model") */ 517 AssertMsg( rc == S_OK || rc == S_FALSE, ("rc=%08X\n",rc));517 AssertMsg(hrc == S_OK || hrc == S_FALSE, ("hrc=%08X\n", hrc)); 518 518 519 519 #if defined(VBOX_WITH_SDS) 520 520 // Setup COM Security to enable impersonation 521 HRESULT hr GUICoInitializeSecurity = CoInitializeSecurity(NULL,522 -1,523 NULL,524 NULL,525 RPC_C_AUTHN_LEVEL_DEFAULT,526 RPC_C_IMP_LEVEL_IMPERSONATE,527 NULL,528 EOAC_NONE,529 NULL);530 NOREF(hr GUICoInitializeSecurity);531 Assert(SUCCEEDED(hr GUICoInitializeSecurity) || hrGUICoInitializeSecurity == RPC_E_TOO_LATE);521 HRESULT hrcGUICoInitializeSecurity = CoInitializeSecurity(NULL, 522 -1, 523 NULL, 524 NULL, 525 RPC_C_AUTHN_LEVEL_DEFAULT, 526 RPC_C_IMP_LEVEL_IMPERSONATE, 527 NULL, 528 EOAC_NONE, 529 NULL); 530 NOREF(hrcGUICoInitializeSecurity); 531 Assert(SUCCEEDED(hrcGUICoInitializeSecurity) || hrcGUICoInitializeSecurity == RPC_E_TOO_LATE); 532 532 #endif 533 533 … … 556 556 { 557 557 if ( gCOMMainThread == hSelf 558 && SUCCEEDED( rc))558 && SUCCEEDED(hrc)) 559 559 gCOMMainInitCount++; 560 560 561 AssertComRC( rc);562 return rc;561 AssertComRC(hrc); 562 return hrc; 563 563 } 564 564 Assert(RTThreadIsMain(hSelf)); … … 566 566 /* this is the first main thread initialization */ 567 567 Assert(gCOMMainInitCount == 0); 568 if (SUCCEEDED( rc))568 if (SUCCEEDED(hrc)) 569 569 gCOMMainInitCount = 1; 570 570 … … 583 583 584 584 nsCOMPtr<nsIEventQueue> eventQ; 585 rc = NS_GetMainEventQ(getter_AddRefs(eventQ));586 587 if (NS_SUCCEEDED( rc))585 hrc = NS_GetMainEventQ(getter_AddRefs(eventQ)); 586 587 if (NS_SUCCEEDED(hrc)) 588 588 { 589 589 PRBool isOnMainThread = PR_FALSE; 590 rc = eventQ->IsOnCurrentThread(&isOnMainThread);591 if (NS_SUCCEEDED( rc) && isOnMainThread)590 hrc = eventQ->IsOnCurrentThread(&isOnMainThread); 591 if (NS_SUCCEEDED(hrc) && isOnMainThread) 592 592 ++gXPCOMInitCount; 593 593 } 594 594 595 AssertComRC( rc);596 return rc;595 AssertComRC(hrc); 596 return hrc; 597 597 } 598 598 Assert(RTThreadIsMain(RTThreadSelf())); … … 682 682 if (RT_FAILURE(vrc)) 683 683 { 684 rc = NS_ERROR_FAILURE;684 hrc = NS_ERROR_FAILURE; 685 685 continue; 686 686 } … … 689 689 if (RT_FAILURE(vrc)) 690 690 { 691 rc = NS_ERROR_FAILURE;691 hrc = NS_ERROR_FAILURE; 692 692 continue; 693 693 } … … 695 695 if (RT_FAILURE(vrc)) 696 696 { 697 rc = NS_ERROR_FAILURE;697 hrc = NS_ERROR_FAILURE; 698 698 continue; 699 699 } … … 703 703 dsProv = new DirectoryServiceProvider(); 704 704 if (dsProv) 705 rc = dsProv->init(szCompReg, szXptiDat, szCompDir, szAppHomeDir);705 hrc = dsProv->init(szCompReg, szXptiDat, szCompDir, szAppHomeDir); 706 706 else 707 rc = NS_ERROR_OUT_OF_MEMORY;708 if (NS_FAILED( rc))707 hrc = NS_ERROR_OUT_OF_MEMORY; 708 if (NS_FAILED(hrc)) 709 709 break; 710 710 … … 721 721 { 722 722 nsCOMPtr<nsILocalFile> file; 723 rc = NS_NewNativeLocalFile(nsEmbedCString(appDirCP), 724 PR_FALSE, getter_AddRefs(file)); 725 if (NS_SUCCEEDED(rc)) 726 appDir = do_QueryInterface(file, &rc); 723 hrc = NS_NewNativeLocalFile(nsEmbedCString(appDirCP), PR_FALSE, getter_AddRefs(file)); 724 if (NS_SUCCEEDED(hrc)) 725 appDir = do_QueryInterface(file, &hrc); 727 726 728 727 RTStrFree(appDirCP); 729 728 } 730 729 else 731 rc = NS_ERROR_FAILURE;732 } 733 if (NS_FAILED( rc))730 hrc = NS_ERROR_FAILURE; 731 } 732 if (NS_FAILED(hrc)) 734 733 break; 735 734 … … 742 741 { 743 742 nsCOMPtr<nsIServiceManager> serviceManager; 744 rc = NS_InitXPCOM2(getter_AddRefs(serviceManager), appDir, dsProv);745 if (NS_SUCCEEDED( rc))743 hrc = NS_InitXPCOM2(getter_AddRefs(serviceManager), appDir, dsProv); 744 if (NS_SUCCEEDED(hrc)) 746 745 { 747 nsCOMPtr<nsIComponentRegistrar> registrar = 748 do_QueryInterface(serviceManager, &rc); 749 if (NS_SUCCEEDED(rc)) 746 nsCOMPtr<nsIComponentRegistrar> registrar = do_QueryInterface(serviceManager, &hrc); 747 if (NS_SUCCEEDED(hrc)) 750 748 { 751 rc = registrar->AutoRegister(nsnull);752 if (NS_SUCCEEDED( rc))749 hrc = registrar->AutoRegister(nsnull); 750 if (NS_SUCCEEDED(hrc)) 753 751 { 754 752 /* We succeeded, stop probing paths */ … … 761 759 762 760 /* clean up before the new try */ 763 HRESULT rc2 = NS_ShutdownXPCOM(nsnull);764 if (SUCCEEDED( rc))765 rc =rc2;761 HRESULT hrc2 = NS_ShutdownXPCOM(nsnull); 762 if (SUCCEEDED(hrc)) 763 hrc = hrc2; 766 764 767 765 if (i == 0) … … 774 772 #endif /* !defined(VBOX_WITH_XPCOM) */ 775 773 776 AssertComRCReturnRC( rc);774 AssertComRCReturnRC(hrc); 777 775 778 776 // for both COM and XPCOM, we only get here if this is the main thread; … … 784 782 * Init the main event queue (ASSUMES it cannot fail). 785 783 */ 786 if (SUCCEEDED( rc))784 if (SUCCEEDED(hrc)) 787 785 NativeEventQueue::init(); 788 786 789 return rc;787 return hrc; 790 788 } 791 789 792 790 HRESULT Shutdown() 793 791 { 794 HRESULT rc = S_OK;792 HRESULT hrc = S_OK; 795 793 796 794 #if !defined(VBOX_WITH_XPCOM) … … 813 811 814 812 nsCOMPtr<nsIEventQueue> eventQ; 815 rc = NS_GetMainEventQ(getter_AddRefs(eventQ));816 817 if (NS_SUCCEEDED( rc) ||rc == NS_ERROR_NOT_AVAILABLE)813 hrc = NS_GetMainEventQ(getter_AddRefs(eventQ)); 814 815 if (NS_SUCCEEDED(hrc) || hrc == NS_ERROR_NOT_AVAILABLE) 818 816 { 819 817 /* NS_ERROR_NOT_AVAILABLE seems to mean that … … 825 823 826 824 PRBool isOnMainThread = PR_FALSE; 827 if (NS_SUCCEEDED( rc))828 { 829 rc = eventQ->IsOnCurrentThread(&isOnMainThread);825 if (NS_SUCCEEDED(hrc)) 826 { 827 hrc = eventQ->IsOnCurrentThread(&isOnMainThread); 830 828 eventQ = nsnull; /* early release before shutdown */ 831 829 } … … 833 831 { 834 832 isOnMainThread = RTThreadIsMain(RTThreadSelf()); 835 rc = NS_OK;836 } 837 838 if (NS_SUCCEEDED( rc) && isOnMainThread)833 hrc = NS_OK; 834 } 835 836 if (NS_SUCCEEDED(hrc) && isOnMainThread) 839 837 { 840 838 /* only the main thread needs to uninitialize XPCOM and only if … … 843 841 { 844 842 NativeEventQueue::uninit(); 845 rc = NS_ShutdownXPCOM(nsnull);843 hrc = NS_ShutdownXPCOM(nsnull); 846 844 847 845 /* This is a thread initialized XPCOM and set gIsXPCOMInitialized to … … 856 854 #endif /* !defined(VBOX_WITH_XPCOM) */ 857 855 858 AssertComRC( rc);859 860 return rc;856 AssertComRC(hrc); 857 858 return hrc; 861 859 } 862 860 -
trunk/src/VBox/Main/glue/string.cpp
r98103 r98297 112 112 { 113 113 size_t cwcAppend; 114 int rc = ::RTStrCalcUtf16LenEx(pachChars, cbChars, &cwcAppend);115 AssertRCReturnStmt( rc, pArgs->hrc = E_UNEXPECTED, 0);114 int vrc = ::RTStrCalcUtf16LenEx(pachChars, cbChars, &cwcAppend); 115 AssertRCReturnStmt(vrc, pArgs->hrc = E_UNEXPECTED, 0); 116 116 117 117 /* … … 143 143 PRTUTF16 pwszDst = pThis->m_bstr + pArgs->offDst; 144 144 Assert(pArgs->cwcAlloc > pArgs->offDst); 145 rc = ::RTStrToUtf16Ex(pachChars, cbChars, &pwszDst, pArgs->cwcAlloc - pArgs->offDst, &cwcAppend);146 AssertRCReturnStmt( rc, pArgs->hrc = E_UNEXPECTED, 0);145 vrc = ::RTStrToUtf16Ex(pachChars, cbChars, &pwszDst, pArgs->cwcAlloc - pArgs->offDst, &cwcAppend); 146 AssertRCReturnStmt(vrc, pArgs->hrc = E_UNEXPECTED, 0); 147 147 pArgs->offDst += cwcAppend; 148 148 } … … 269 269 { 270 270 RTUNICP ucLeft; 271 int rc = RTUtf16GetCpEx(&pwszLeft, &ucLeft);272 AssertRCReturn( rc, 1);271 int vrc = RTUtf16GetCpEx(&pwszLeft, &ucLeft); 272 AssertRCReturn(vrc, 1); 273 273 274 274 RTUNICP ucRight; 275 rc = RTStrGetCpEx(&a_pszRight, &ucRight);276 AssertRCReturn( rc, -1);275 vrc = RTStrGetCpEx(&a_pszRight, &ucRight); 276 AssertRCReturn(vrc, -1); 277 277 if (ucLeft == ucRight) 278 278 { … … 577 577 { 578 578 size_t cwcSrc; 579 int rc = RTStrCalcUtf16LenEx(pszSrc, cchSrc, &cwcSrc);579 int vrc = RTStrCalcUtf16LenEx(pszSrc, cchSrc, &cwcSrc); 580 580 #ifdef RT_EXCEPTIONS_ENABLED 581 AssertRCStmt( rc, throw std::bad_alloc());581 AssertRCStmt(vrc, throw std::bad_alloc()); 582 582 #else 583 AssertRCReturn( rc, *this);583 AssertRCReturn(vrc, *this); 584 584 #endif 585 585 … … 590 590 { 591 591 PRTUTF16 pwszDst = &m_bstr[cwcOld]; 592 rc = RTStrToUtf16Ex(pszSrc, cchSrc, &pwszDst, cwcSrc + 1, NULL);592 vrc = RTStrToUtf16Ex(pszSrc, cchSrc, &pwszDst, cwcSrc + 1, NULL); 593 593 #ifdef RT_EXCEPTIONS_ENABLED 594 AssertRCStmt( rc, throw std::bad_alloc());594 AssertRCStmt(vrc, throw std::bad_alloc()); 595 595 #else 596 AssertRC( rc);596 AssertRC(vrc); 597 597 #endif 598 598 } … … 605 605 { 606 606 size_t cwcSrc; 607 int rc = RTStrCalcUtf16LenEx(pszSrc, cchSrc, &cwcSrc);608 AssertRCStmt( rc, E_INVALIDARG);607 int vrc = RTStrCalcUtf16LenEx(pszSrc, cchSrc, &cwcSrc); 608 AssertRCStmt(vrc, E_INVALIDARG); 609 609 610 610 size_t cwcOld = length(); … … 615 615 { 616 616 PRTUTF16 pwszDst = &m_bstr[cwcOld]; 617 rc = RTStrToUtf16Ex(pszSrc, cchSrc, &pwszDst, cwcSrc + 1, NULL);618 AssertRCStmt( rc, E_INVALIDARG);617 vrc = RTStrToUtf16Ex(pszSrc, cchSrc, &pwszDst, cwcSrc + 1, NULL); 618 AssertRCStmt(vrc, E_INVALIDARG); 619 619 } 620 620 m_bstr[cwcTotal] = '\0'; -
trunk/src/VBox/Main/src-all/win/VBoxProxyStub.c
r98103 r98297 360 360 361 361 /** The current total result. */ 362 LSTATUS rc;362 LSTATUS lrc; 363 363 364 364 /** KEY_WOW64_32KEY, KEY_WOW64_64KEY or 0 (for default). Allows doing all … … 395 395 static LSTATUS vbpsRegInit(VBPSREGSTATE *pState, HKEY hkeyRoot, const char *pszSubRoot, bool fDelete, bool fUpdate, DWORD fSamWow) 396 396 { 397 LSTATUS rc;397 LSTATUS lrc; 398 398 unsigned i = 0; 399 399 … … 411 411 } 412 412 pState->cAltDeletes = 0; 413 pState-> rc= ERROR_SUCCESS;413 pState->lrc = ERROR_SUCCESS; 414 414 pState->fDelete = fDelete; 415 415 pState->fUpdate = fUpdate; … … 428 428 * Open the root keys. 429 429 */ 430 rc = RegOpenKeyExA(hkeyRoot, pszSubRoot, 0 /*fOptions*/, pState->fSamBoth, &pState->hkeyClassesRootDst);431 if ( rc == ERROR_SUCCESS)432 { 433 rc = RegCreateKeyExW(pState->hkeyClassesRootDst, L"CLSID", 0 /*Reserved*/, NULL /*pszClass*/, 0 /*fOptions*/,434 pState->fSamBoth, NULL /*pSecAttr*/, &pState->hkeyClsidRootDst, NULL /*pdwDisposition*/);435 if ( rc == ERROR_SUCCESS)430 lrc = RegOpenKeyExA(hkeyRoot, pszSubRoot, 0 /*fOptions*/, pState->fSamBoth, &pState->hkeyClassesRootDst); 431 if (lrc == ERROR_SUCCESS) 432 { 433 lrc = RegCreateKeyExW(pState->hkeyClassesRootDst, L"CLSID", 0 /*Reserved*/, NULL /*pszClass*/, 0 /*fOptions*/, 434 pState->fSamBoth, NULL /*pSecAttr*/, &pState->hkeyClsidRootDst, NULL /*pdwDisposition*/); 435 if (lrc == ERROR_SUCCESS) 436 436 return ERROR_SUCCESS; 437 437 438 438 /* Ignore access denied errors as these may easily happen for 439 439 non-admin users. Just give up when this happens */ 440 AssertLogRelMsgReturn( rc == ERROR_ACCESS_DENIED, ("%u\n", rc), pState->rc =rc);440 AssertLogRelMsgReturn(lrc == ERROR_ACCESS_DENIED, ("%u\n", lrc), pState->lrc = lrc); 441 441 } 442 442 else 443 AssertLogRelMsgReturn( rc == ERROR_ACCESS_DENIED, ("%u\n", rc), pState->rc =rc);444 return pState-> rc =rc;443 AssertLogRelMsgReturn(lrc == ERROR_ACCESS_DENIED, ("%u\n", lrc), pState->lrc = lrc); 444 return pState->lrc = lrc; 445 445 } 446 446 … … 453 453 static void vbpsRegTerm(VBPSREGSTATE *pState) 454 454 { 455 LSTATUS rc;455 LSTATUS lrc; 456 456 if (pState->hkeyClassesRootDst) 457 457 { 458 rc = RegCloseKey(pState->hkeyClassesRootDst);459 Assert( rc == ERROR_SUCCESS);458 lrc = RegCloseKey(pState->hkeyClassesRootDst); 459 Assert(lrc == ERROR_SUCCESS); 460 460 pState->hkeyClassesRootDst = NULL; 461 461 } 462 462 if (pState->hkeyClsidRootDst) 463 463 { 464 rc = RegCloseKey(pState->hkeyClsidRootDst);465 Assert( rc == ERROR_SUCCESS);464 lrc = RegCloseKey(pState->hkeyClsidRootDst); 465 Assert(lrc == ERROR_SUCCESS); 466 466 pState->hkeyClsidRootDst = NULL; 467 467 } 468 468 if (pState->hkeyInterfaceRootDst) 469 469 { 470 rc = RegCloseKey(pState->hkeyInterfaceRootDst);471 Assert( rc == ERROR_SUCCESS);470 lrc = RegCloseKey(pState->hkeyInterfaceRootDst); 471 Assert(lrc == ERROR_SUCCESS); 472 472 pState->hkeyInterfaceRootDst = NULL; 473 473 } … … 478 478 if (pState->aAltDeletes[i].hkeyClasses) 479 479 { 480 rc = RegCloseKey(pState->aAltDeletes[i].hkeyClasses);481 Assert( rc == ERROR_SUCCESS);480 lrc = RegCloseKey(pState->aAltDeletes[i].hkeyClasses); 481 Assert(lrc == ERROR_SUCCESS); 482 482 pState->aAltDeletes[i].hkeyClasses = NULL; 483 483 } 484 484 if (pState->aAltDeletes[i].hkeyClsid) 485 485 { 486 rc = RegCloseKey(pState->aAltDeletes[i].hkeyClsid);487 Assert( rc == ERROR_SUCCESS);486 lrc = RegCloseKey(pState->aAltDeletes[i].hkeyClsid); 487 Assert(lrc == ERROR_SUCCESS); 488 488 pState->aAltDeletes[i].hkeyClsid = NULL; 489 489 } 490 490 if (pState->aAltDeletes[i].hkeyInterface) 491 491 { 492 rc = RegCloseKey(pState->aAltDeletes[i].hkeyInterface);493 Assert( rc == ERROR_SUCCESS);492 lrc = RegCloseKey(pState->aAltDeletes[i].hkeyInterface); 493 Assert(lrc == ERROR_SUCCESS); 494 494 pState->aAltDeletes[i].hkeyInterface = NULL; 495 495 } … … 512 512 { 513 513 unsigned i; 514 LSTATUS rc;514 LSTATUS lrc; 515 515 516 516 /* Ignore call if not in delete mode. */ … … 520 520 /* Check that there is space in the state. */ 521 521 i = pState->cAltDeletes; 522 AssertReturn(i < RT_ELEMENTS(pState->aAltDeletes), pState-> rc = ERROR_TOO_MANY_NAMES);522 AssertReturn(i < RT_ELEMENTS(pState->aAltDeletes), pState->lrc = ERROR_TOO_MANY_NAMES); 523 523 524 524 525 525 /* Open the root. */ 526 rc = RegOpenKeyExA(hkeyAltRoot, pszAltSubRoot, 0 /*fOptions*/, pState->fSamDelete,526 lrc = RegOpenKeyExA(hkeyAltRoot, pszAltSubRoot, 0 /*fOptions*/, pState->fSamDelete, 527 527 &pState->aAltDeletes[i].hkeyClasses); 528 if ( rc == ERROR_SUCCESS)528 if (lrc == ERROR_SUCCESS) 529 529 { 530 530 /* Try open the CLSID subkey, it's fine if it doesn't exists. */ 531 rc = RegOpenKeyExW(pState->aAltDeletes[i].hkeyClasses, L"CLSID", 0 /*fOptions*/, pState->fSamDelete,532 &pState->aAltDeletes[i].hkeyClsid);533 if ( rc == ERROR_SUCCESS ||rc == ERROR_FILE_NOT_FOUND)531 lrc = RegOpenKeyExW(pState->aAltDeletes[i].hkeyClasses, L"CLSID", 0 /*fOptions*/, pState->fSamDelete, 532 &pState->aAltDeletes[i].hkeyClsid); 533 if (lrc == ERROR_SUCCESS || lrc == ERROR_FILE_NOT_FOUND) 534 534 { 535 if ( rc == ERROR_FILE_NOT_FOUND)535 if (lrc == ERROR_FILE_NOT_FOUND) 536 536 pState->aAltDeletes[i].hkeyClsid = NULL; 537 537 pState->cAltDeletes = i + 1; 538 538 return ERROR_SUCCESS; 539 539 } 540 AssertLogRelMsgFailed(("%u\n", rc));540 AssertLogRelMsgFailed(("%u\n", lrc)); 541 541 RegCloseKey(pState->aAltDeletes[i].hkeyClasses); 542 542 } 543 543 /* No need to add non-existing alternative roots, nothing to delete in the void. */ 544 else if ( rc == ERROR_FILE_NOT_FOUND)545 rc = ERROR_SUCCESS;544 else if (lrc == ERROR_FILE_NOT_FOUND) 545 lrc = ERROR_SUCCESS; 546 546 else 547 547 { 548 AssertLogRelMsgFailed(("%u (%#x %s)\n", rc));549 pState-> rc =rc;548 AssertLogRelMsgFailed(("%u (%#x %s)\n", lrc)); 549 pState->lrc = lrc; 550 550 } 551 551 552 552 pState->aAltDeletes[i].hkeyClasses = NULL; 553 553 pState->aAltDeletes[i].hkeyClsid = NULL; 554 return rc;554 return lrc; 555 555 } 556 556 … … 568 568 { 569 569 unsigned i; 570 LSTATUS rc;570 LSTATUS lrc; 571 571 572 572 /* … … 576 576 { 577 577 if (pState->fSamUpdate) 578 rc = RegCreateKeyExW(pState->hkeyClassesRootDst, L"Interface", 0 /*Reserved*/, NULL /*pszClass*/, 0 /*fOptions*/,579 pState->fSamBoth, NULL /*pSecAttr*/, &pState->hkeyInterfaceRootDst, NULL /*pdwDisposition*/);578 lrc = RegCreateKeyExW(pState->hkeyClassesRootDst, L"Interface", 0 /*Reserved*/, NULL /*pszClass*/, 0 /*fOptions*/, 579 pState->fSamBoth, NULL /*pSecAttr*/, &pState->hkeyInterfaceRootDst, NULL /*pdwDisposition*/); 580 580 else 581 rc = RegOpenKeyExW(pState->hkeyClassesRootDst, L"Interface", 0 /*fOptions*/, pState->fSamBoth,582 &pState->hkeyClsidRootDst);583 if ( rc == ERROR_ACCESS_DENIED)581 lrc = RegOpenKeyExW(pState->hkeyClassesRootDst, L"Interface", 0 /*fOptions*/, pState->fSamBoth, 582 &pState->hkeyClsidRootDst); 583 if (lrc == ERROR_ACCESS_DENIED) 584 584 { 585 585 pState->hkeyInterfaceRootDst = NULL; 586 return pState-> rc =rc;586 return pState->lrc = lrc; 587 587 } 588 AssertLogRelMsgReturnStmt( rc == ERROR_SUCCESS, ("%u\n", rc), pState->hkeyInterfaceRootDst = NULL, pState->rc =rc);588 AssertLogRelMsgReturnStmt(lrc == ERROR_SUCCESS, ("%u\n", lrc), pState->hkeyInterfaceRootDst = NULL, pState->lrc = lrc); 589 589 } 590 590 … … 596 596 if (pState->aAltDeletes[i].hkeyInterface == NULL) 597 597 { 598 rc = RegOpenKeyExW(pState->aAltDeletes[i].hkeyClasses, L"Interface", 0 /*fOptions*/, pState->fSamDelete,599 &pState->aAltDeletes[i].hkeyInterface);600 if ( rc != ERROR_SUCCESS)598 lrc = RegOpenKeyExW(pState->aAltDeletes[i].hkeyClasses, L"Interface", 0 /*fOptions*/, pState->fSamDelete, 599 &pState->aAltDeletes[i].hkeyInterface); 600 if (lrc != ERROR_SUCCESS) 601 601 { 602 AssertMsgStmt( rc == ERROR_FILE_NOT_FOUND || rc == ERROR_ACCESS_DENIED, ("%u\n", rc), pState->rc =rc);602 AssertMsgStmt(lrc == ERROR_FILE_NOT_FOUND || lrc == ERROR_ACCESS_DENIED, ("%u\n", lrc), pState->lrc = lrc); 603 603 pState->aAltDeletes[i].hkeyInterface = NULL; 604 604 } … … 687 687 { 688 688 DWORD const cbValue = (DWORD)((RTUtf16Len(pwszValue) + 1) * sizeof(RTUTF16)); 689 LSTATUS rc;689 LSTATUS lrc; 690 690 Assert(pState->fUpdate); 691 691 … … 699 699 PRTUTF16 pwszExistingData = (PRTUTF16)alloca(cbExistingData); 700 700 DWORD dwExistingType; 701 rc = RegQueryValueExW(hkey, pwszValueNm, 0 /*Reserved*/, &dwExistingType, (BYTE *)pwszExistingData, &cbExistingData);702 if ( rc == ERROR_SUCCESS)701 lrc = RegQueryValueExW(hkey, pwszValueNm, 0 /*Reserved*/, &dwExistingType, (BYTE *)pwszExistingData, &cbExistingData); 702 if (lrc == ERROR_SUCCESS) 703 703 { 704 704 if ( dwExistingType == REG_SZ … … 718 718 } 719 719 else 720 Assert( rc == ERROR_FILE_NOT_FOUND ||rc == ERROR_MORE_DATA);720 Assert(lrc == ERROR_FILE_NOT_FOUND || lrc == ERROR_MORE_DATA); 721 721 } 722 722 … … 724 724 * Set the value. 725 725 */ 726 rc = RegSetValueExW(hkey, pwszValueNm, 0 /*Reserved*/, REG_SZ, (const BYTE *)pwszValue, cbValue);727 if ( rc == ERROR_SUCCESS)726 lrc = RegSetValueExW(hkey, pwszValueNm, 0 /*Reserved*/, REG_SZ, (const BYTE *)pwszValue, cbValue); 727 if (lrc == ERROR_SUCCESS) 728 728 { 729 729 VBSP_LOG_SET_VALUE(("vbpsSetRegValueWW: %ls/%ls=%ls (at %d)\n", … … 732 732 } 733 733 734 AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT( rc == ERROR_ACCESS_DENIED),735 ("%d: '%ls'='%ls' -> %u\n", uLine, pwszValueNm, pwszValue, rc));736 pState-> rc =rc;737 return rc;734 AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT(lrc == ERROR_ACCESS_DENIED), 735 ("%d: '%ls'='%ls' -> %u\n", uLine, pwszValueNm, pwszValue, lrc)); 736 pState->lrc = lrc; 737 return lrc; 738 738 } 739 739 … … 752 752 { 753 753 DWORD const cbValue = (DWORD)strlen(pszValue) + 1; 754 LSTATUS rc;754 LSTATUS lrc; 755 755 Assert(pState->fUpdate); 756 756 … … 764 764 char *pszExistingData = alloca(cbExistingData); 765 765 DWORD dwExistingType; 766 rc = RegQueryValueExA(hkey, pszValueNm, 0 /*Reserved*/, &dwExistingType, (PBYTE)pszExistingData, &cbExistingData);767 if ( rc == ERROR_SUCCESS)766 lrc = RegQueryValueExA(hkey, pszValueNm, 0 /*Reserved*/, &dwExistingType, (PBYTE)pszExistingData, &cbExistingData); 767 if (lrc == ERROR_SUCCESS) 768 768 { 769 769 if ( dwExistingType == REG_SZ … … 785 785 } 786 786 else 787 Assert( rc == ERROR_FILE_NOT_FOUND ||rc == ERROR_MORE_DATA);787 Assert(lrc == ERROR_FILE_NOT_FOUND || lrc == ERROR_MORE_DATA); 788 788 } 789 789 … … 791 791 * Set the value. 792 792 */ 793 rc = RegSetValueExA(hkey, pszValueNm, 0 /*Reserved*/, REG_SZ, (PBYTE)pszValue, cbValue);794 if ( rc == ERROR_SUCCESS)793 lrc = RegSetValueExA(hkey, pszValueNm, 0 /*Reserved*/, REG_SZ, (PBYTE)pszValue, cbValue); 794 if (lrc == ERROR_SUCCESS) 795 795 { 796 796 VBSP_LOG_SET_VALUE(("vbpsSetRegValueAA: %ls/%s=%s (at %d)\n", … … 799 799 } 800 800 801 AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT( rc == ERROR_ACCESS_DENIED),802 ("%d: '%s'='%s' -> %u\n", uLine, pszValueNm, pszValue, rc));803 pState-> rc =rc;804 return rc;801 AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT(lrc == ERROR_ACCESS_DENIED), 802 ("%d: '%s'='%s' -> %u\n", uLine, pszValueNm, pszValue, lrc)); 803 pState->lrc = lrc; 804 return lrc; 805 805 } 806 806 … … 816 816 static LSTATUS vbpsCloseKey(VBPSREGSTATE *pState, HKEY hkey, unsigned uLine) 817 817 { 818 LSTATUS rc = RegCloseKey(hkey);819 if ( rc == ERROR_SUCCESS)818 LSTATUS lrc = RegCloseKey(hkey); 819 if (lrc == ERROR_SUCCESS) 820 820 return ERROR_SUCCESS; 821 821 822 AssertLogRelMsgFailed(("%d: close key -> %u\n", uLine, rc));823 pState-> rc =rc;824 return rc;822 AssertLogRelMsgFailed(("%d: close key -> %u\n", uLine, lrc)); 823 pState->lrc = lrc; 824 return lrc; 825 825 } 826 826 … … 844 844 HKEY hNewKey; 845 845 DWORD dwDisposition = 0; 846 LSTATUS rc = RegCreateKeyExA(hkeyParent, pszKey, 0 /*Reserved*/, NULL /*pszClass*/, 0 /*fOptions*/,847 pState->fSamBoth, NULL /*pSecAttr*/, &hNewKey, &dwDisposition);848 if ( rc == ERROR_SUCCESS)846 LSTATUS lrc = RegCreateKeyExA(hkeyParent, pszKey, 0 /*Reserved*/, NULL /*pszClass*/, 0 /*fOptions*/, 847 pState->fSamBoth, NULL /*pSecAttr*/, &hNewKey, &dwDisposition); 848 if (lrc == ERROR_SUCCESS) 849 849 { 850 850 *phkey = hNewKey; … … 854 854 else 855 855 { 856 AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT( rc == ERROR_ACCESS_DENIED),857 ("%d: create key '%s' -> %u\n", uLine, pszKey, rc));858 pState-> rc =rc;856 AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT(lrc == ERROR_ACCESS_DENIED), 857 ("%d: create key '%s' -> %u\n", uLine, pszKey, lrc)); 858 pState->lrc = lrc; 859 859 *phkey = NULL; 860 860 } 861 return rc;861 return lrc; 862 862 } 863 863 … … 878 878 { 879 879 HKEY hNewKey; 880 LSTATUS rc = vbpsCreateRegKeyA(pState, hkeyParent, pszKey, &hNewKey, uLine);881 if ( rc == ERROR_SUCCESS)882 { 883 rc = vbpsSetRegValueAA(pState, hNewKey, NULL /*pszValueNm*/, pszValue, uLine);880 LSTATUS lrc = vbpsCreateRegKeyA(pState, hkeyParent, pszKey, &hNewKey, uLine); 881 if (lrc == ERROR_SUCCESS) 882 { 883 lrc = vbpsSetRegValueAA(pState, hNewKey, NULL /*pszValueNm*/, pszValue, uLine); 884 884 vbpsCloseKey(pState, hNewKey, uLine); 885 885 } 886 886 else 887 887 { 888 AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT( rc == ERROR_ACCESS_DENIED),889 ("%d: create key '%s'(/Default='%s') -> %u\n", uLine, pszKey, pszValue, rc));890 pState-> rc =rc;891 } 892 return rc;888 AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT(lrc == ERROR_ACCESS_DENIED), 889 ("%d: create key '%s'(/Default='%s') -> %u\n", uLine, pszKey, pszValue, lrc)); 890 pState->lrc = lrc; 891 } 892 return lrc; 893 893 } 894 894 … … 909 909 { 910 910 HKEY hNewKey; 911 LSTATUS rc = vbpsCreateRegKeyA(pState, hkeyParent, pszKey, &hNewKey, uLine);912 if ( rc == ERROR_SUCCESS)913 { 914 rc = vbpsSetRegValueWW(pState, hNewKey, NULL /*pwszValueNm*/, pwszValue, uLine);911 LSTATUS lrc = vbpsCreateRegKeyA(pState, hkeyParent, pszKey, &hNewKey, uLine); 912 if (lrc == ERROR_SUCCESS) 913 { 914 lrc = vbpsSetRegValueWW(pState, hNewKey, NULL /*pwszValueNm*/, pwszValue, uLine); 915 915 vbpsCloseKey(pState, hNewKey, uLine); 916 916 } 917 917 else 918 918 { 919 AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT( rc == ERROR_ACCESS_DENIED),920 ("%d: create key '%s'(/Default='%ls') -> %u\n", uLine, pszKey, pwszValue, rc));921 pState-> rc =rc;922 } 923 return rc;919 AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT(lrc == ERROR_ACCESS_DENIED), 920 ("%d: create key '%s'(/Default='%ls') -> %u\n", uLine, pszKey, pwszValue, lrc)); 921 pState->lrc = lrc; 922 } 923 return lrc; 924 924 } 925 925 … … 941 941 { 942 942 HKEY hNewKey; 943 LSTATUS rc = vbpsCreateRegKeyA(pState, hkeyParent, pszKey, &hNewKey, uLine);944 if ( rc == ERROR_SUCCESS)945 { 946 rc = vbpsSetRegValueAA(pState, hNewKey, NULL /*pszValueNm*/, pszValue, uLine);943 LSTATUS lrc = vbpsCreateRegKeyA(pState, hkeyParent, pszKey, &hNewKey, uLine); 944 if (lrc == ERROR_SUCCESS) 945 { 946 lrc = vbpsSetRegValueAA(pState, hNewKey, NULL /*pszValueNm*/, pszValue, uLine); 947 947 *phkey = hNewKey; 948 948 } 949 949 else 950 950 { 951 AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT( rc == ERROR_ACCESS_DENIED),952 ("%d: create key '%s'(/Default='%s') -> %u\n", uLine, pszKey, pszValue, rc));953 pState-> rc =rc;951 AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT(lrc == ERROR_ACCESS_DENIED), 952 ("%d: create key '%s'(/Default='%s') -> %u\n", uLine, pszKey, pszValue, lrc)); 953 pState->lrc = lrc; 954 954 *phkey = NULL; 955 955 } 956 return rc;956 return lrc; 957 957 } 958 958 … … 970 970 static LSTATUS vbpsDeleteKeyRecursiveA(VBPSREGSTATE *pState, HKEY hkeyParent, const char *pszKey, unsigned uLine) 971 971 { 972 LSTATUS rc;972 LSTATUS lrc; 973 973 974 974 Assert(pState->fDelete); 975 975 Assert(pszKey); 976 AssertReturn(*pszKey != '\0', pState-> rc = ERROR_INVALID_PARAMETER);976 AssertReturn(*pszKey != '\0', pState->lrc = ERROR_INVALID_PARAMETER); 977 977 978 978 #ifdef VBSP_LOG_ENABLED 979 979 { 980 980 HKEY hkeyLog; 981 rc = RegOpenKeyExA(hkeyParent, pszKey, 0 /*fOptions*/, pState->fSamDelete, &hkeyLog);982 if ( rc != ERROR_FILE_NOT_FOUND)981 lrc = RegOpenKeyExA(hkeyParent, pszKey, 0 /*fOptions*/, pState->fSamDelete, &hkeyLog); 982 if (lrc != ERROR_FILE_NOT_FOUND) 983 983 VBSP_LOG_DEL_KEY(("vbpsDeleteKeyRecursiveA: %ls/%s (at %d)\n", vbpsDebugKeyToWSZ(hkeyParent), pszKey, uLine)); 984 if ( rc == ERROR_SUCCESS)984 if (lrc == ERROR_SUCCESS) 985 985 RegCloseKey(hkeyLog); 986 986 } 987 987 #endif 988 988 989 rc = SHDeleteKeyA(hkeyParent, pszKey);990 if ( rc == ERROR_SUCCESS ||rc == ERROR_FILE_NOT_FOUND)989 lrc = SHDeleteKeyA(hkeyParent, pszKey); 990 if (lrc == ERROR_SUCCESS || lrc == ERROR_FILE_NOT_FOUND) 991 991 return ERROR_SUCCESS; 992 992 993 AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT( rc == ERROR_ACCESS_DENIED),994 ("%d: delete key '%s' -> %u\n", uLine, pszKey, rc));995 pState-> rc =rc;996 return rc;993 AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT(lrc == ERROR_ACCESS_DENIED), 994 ("%d: delete key '%s' -> %u\n", uLine, pszKey, lrc)); 995 pState->lrc = lrc; 996 return lrc; 997 997 } 998 998 … … 1010 1010 static LSTATUS vbpsDeleteKeyRecursiveW(VBPSREGSTATE *pState, HKEY hkeyParent, PCRTUTF16 pwszKey, unsigned uLine) 1011 1011 { 1012 LSTATUS rc;1012 LSTATUS lrc; 1013 1013 1014 1014 Assert(pState->fDelete); 1015 1015 Assert(pwszKey); 1016 AssertReturn(*pwszKey != '\0', pState-> rc = ERROR_INVALID_PARAMETER);1016 AssertReturn(*pwszKey != '\0', pState->lrc = ERROR_INVALID_PARAMETER); 1017 1017 1018 1018 #ifdef VBSP_LOG_ENABLED 1019 1019 { 1020 1020 HKEY hkeyLog; 1021 rc = RegOpenKeyExW(hkeyParent, pwszKey, 0 /*fOptions*/, pState->fSamDelete, &hkeyLog);1022 if ( rc != ERROR_FILE_NOT_FOUND)1021 lrc = RegOpenKeyExW(hkeyParent, pwszKey, 0 /*fOptions*/, pState->fSamDelete, &hkeyLog); 1022 if (lrc != ERROR_FILE_NOT_FOUND) 1023 1023 VBSP_LOG_DEL_KEY(("vbpsDeleteKeyRecursiveW: %ls/%ls (at %d)\n", vbpsDebugKeyToWSZ(hkeyParent), pwszKey, uLine)); 1024 if ( rc == ERROR_SUCCESS)1024 if (lrc == ERROR_SUCCESS) 1025 1025 RegCloseKey(hkeyLog); 1026 1026 } 1027 1027 #endif 1028 1028 1029 rc = SHDeleteKeyW(hkeyParent, pwszKey);1030 if ( rc == ERROR_SUCCESS ||rc == ERROR_FILE_NOT_FOUND)1029 lrc = SHDeleteKeyW(hkeyParent, pwszKey); 1030 if (lrc == ERROR_SUCCESS || lrc == ERROR_FILE_NOT_FOUND) 1031 1031 return ERROR_SUCCESS; 1032 1032 1033 AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT( rc == ERROR_ACCESS_DENIED),1034 ("%d: delete key '%ls' -> %u\n", uLine, pwszKey, rc));1035 pState-> rc =rc;1036 return rc;1033 AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT(lrc == ERROR_ACCESS_DENIED), 1034 ("%d: delete key '%ls' -> %u\n", uLine, pwszKey, lrc)); 1035 pState->lrc = lrc; 1036 return lrc; 1037 1037 } 1038 1038 … … 1052 1052 const char *pszDescription, const char *pszServiceName) 1053 1053 { 1054 LSTATUS rc;1054 LSTATUS lrc; 1055 1055 HKEY hkeyAppIds; 1056 1056 Assert(*pszAppId == '{'); … … 1064 1064 while (i-- > 0) 1065 1065 { 1066 rc = RegOpenKeyExW(pState->aAltDeletes[i].hkeyClasses, L"AppID", 0 /*fOptions*/, pState->fSamDelete, &hkeyAppIds);1067 AssertLogRelMsgStmt( rc == ERROR_SUCCESS || rc == ERROR_FILE_NOT_FOUND, ("%u\n", rc), pState->rc =rc);1068 if ( rc == ERROR_SUCCESS)1066 lrc = RegOpenKeyExW(pState->aAltDeletes[i].hkeyClasses, L"AppID", 0 /*fOptions*/, pState->fSamDelete, &hkeyAppIds); 1067 AssertLogRelMsgStmt(lrc == ERROR_SUCCESS || lrc == ERROR_FILE_NOT_FOUND, ("%u\n", lrc), pState->lrc = lrc); 1068 if (lrc == ERROR_SUCCESS) 1069 1069 { 1070 1070 vbpsDeleteKeyRecursiveA(pState, hkeyAppIds, pszAppId, __LINE__); … … 1076 1076 if (pState->fUpdate) 1077 1077 { 1078 rc = RegCreateKeyExW(pState->hkeyClassesRootDst, L"AppID", 0 /*Reserved*/, NULL /*pszClass*/, 0 /*fOptions*/,1079 pState->fSamBoth, NULL /*pSecAttr*/, &hkeyAppIds, NULL /*pdwDisposition*/);1080 if ( rc == ERROR_ACCESS_DENIED)1078 lrc = RegCreateKeyExW(pState->hkeyClassesRootDst, L"AppID", 0 /*Reserved*/, NULL /*pszClass*/, 0 /*fOptions*/, 1079 pState->fSamBoth, NULL /*pSecAttr*/, &hkeyAppIds, NULL /*pdwDisposition*/); 1080 if (lrc == ERROR_ACCESS_DENIED) 1081 1081 return ERROR_SUCCESS; 1082 1082 } 1083 1083 else 1084 1084 { 1085 rc = RegOpenKeyExW(pState->hkeyClassesRootDst, L"AppID", 0 /*fOptions*/, pState->fSamBoth, &hkeyAppIds);1086 if ( rc == ERROR_FILE_NOT_FOUND ||rc == ERROR_ACCESS_DENIED)1085 lrc = RegOpenKeyExW(pState->hkeyClassesRootDst, L"AppID", 0 /*fOptions*/, pState->fSamBoth, &hkeyAppIds); 1086 if (lrc == ERROR_FILE_NOT_FOUND || lrc == ERROR_ACCESS_DENIED) 1087 1087 return ERROR_SUCCESS; 1088 1088 } 1089 if ( rc == ERROR_ACCESS_DENIED)1090 return pState-> rc =rc;1091 AssertLogRelMsgReturn( rc == ERROR_SUCCESS, ("%u\n", rc), pState->rc =rc);1089 if (lrc == ERROR_ACCESS_DENIED) 1090 return pState->lrc = lrc; 1091 AssertLogRelMsgReturn(lrc == ERROR_SUCCESS, ("%u\n", lrc), pState->lrc = lrc); 1092 1092 1093 1093 if (pState->fDelete) … … 1103 1103 { 1104 1104 HKEY hkey; 1105 rc = vbpsCreateRegKeyA(pState, hkeyAppIds, pszAppId, &hkey, __LINE__);1106 if ( rc == ERROR_SUCCESS)1105 lrc = vbpsCreateRegKeyA(pState, hkeyAppIds, pszAppId, &hkey, __LINE__); 1106 if (lrc == ERROR_SUCCESS) 1107 1107 { 1108 1108 vbpsSetRegValueAA(pState, hkey, NULL /*pszValueNm*/, pszDescription, __LINE__); … … 1112 1112 } 1113 1113 1114 rc = vbpsCreateRegKeyA(pState, hkeyAppIds, pszModuleName, &hkey, __LINE__);1115 if ( rc == ERROR_SUCCESS)1114 lrc = vbpsCreateRegKeyA(pState, hkeyAppIds, pszModuleName, &hkey, __LINE__); 1115 if (lrc == ERROR_SUCCESS) 1116 1116 { 1117 1117 vbpsSetRegValueAA(pState, hkey, NULL /*pszValueNm*/, "", __LINE__); … … 1123 1123 vbpsCloseKey(pState, hkeyAppIds, __LINE__); 1124 1124 1125 return pState-> rc;1125 return pState->lrc; 1126 1126 } 1127 1127 … … 1142 1142 const CLSID *pClsId, const char *pszCurVerSuffIfRootName) 1143 1143 { 1144 LSTATUS rc;1144 LSTATUS lrc; 1145 1145 1146 1146 /* … … 1162 1162 /* pszClassName/Default = description. */ 1163 1163 HKEY hkeyClass; 1164 rc = vbpsCreateRegKeyWithDefaultValueAAEx(pState, pState->hkeyClassesRootDst, pszClassName, pszDescription,1165 &hkeyClass, __LINE__);1166 if ( rc == ERROR_SUCCESS)1164 lrc = vbpsCreateRegKeyWithDefaultValueAAEx(pState, pState->hkeyClassesRootDst, pszClassName, pszDescription, 1165 &hkeyClass, __LINE__); 1166 if (lrc == ERROR_SUCCESS) 1167 1167 { 1168 1168 char szClsId[CURLY_UUID_STR_BUF_SIZE]; … … 1175 1175 { 1176 1176 char szCurClassNameVer[128]; 1177 rc = RTStrCopy(szCurClassNameVer, sizeof(szCurClassNameVer), pszClassName);1178 if (RT_SUCCESS( rc))1179 rc = RTStrCat(szCurClassNameVer, sizeof(szCurClassNameVer), pszCurVerSuffIfRootName);1180 AssertStmt(RT_SUCCESS( rc), pState->rc =rc = ERROR_INVALID_DATA);1181 if ( rc == ERROR_SUCCESS)1177 lrc = RTStrCopy(szCurClassNameVer, sizeof(szCurClassNameVer), pszClassName); 1178 if (RT_SUCCESS(lrc)) 1179 lrc = RTStrCat(szCurClassNameVer, sizeof(szCurClassNameVer), pszCurVerSuffIfRootName); 1180 AssertStmt(RT_SUCCESS(lrc), pState->lrc = lrc = ERROR_INVALID_DATA); 1181 if (lrc == ERROR_SUCCESS) 1182 1182 vbpsCreateRegKeyWithDefaultValueAA(pState, hkeyClass, "CurVer", szCurClassNameVer, __LINE__); 1183 1183 } … … 1187 1187 } 1188 1188 1189 return pState-> rc;1189 return pState->lrc; 1190 1190 } 1191 1191 … … 1218 1218 const char *pszThreadingModel) 1219 1219 { 1220 LSTATUS rc;1220 LSTATUS lrc; 1221 1221 char szClsId[CURLY_UUID_STR_BUF_SIZE]; 1222 1222 RT_NOREF(pszAppId); … … 1248 1248 { 1249 1249 HKEY hkeyClass; 1250 rc = vbpsCreateRegKeyWithDefaultValueAAEx(pState, pState->hkeyClsidRootDst, szClsId, pszDescription,1251 &hkeyClass, __LINE__);1252 if ( rc == ERROR_SUCCESS)1250 lrc = vbpsCreateRegKeyWithDefaultValueAAEx(pState, pState->hkeyClsidRootDst, szClsId, pszDescription, 1251 &hkeyClass, __LINE__); 1252 if (lrc == ERROR_SUCCESS) 1253 1253 { 1254 1254 bool const fIsLocalServer32 = strcmp(pszServerType, "LocalServer32") == 0; … … 1257 1257 1258 1258 /* pszServerType/Default = module. */ 1259 rc = vbpsCreateRegKeyA(pState, hkeyClass, pszServerType, &hkeyServerType, __LINE__);1260 if ( rc == ERROR_SUCCESS)1259 lrc = vbpsCreateRegKeyA(pState, hkeyClass, pszServerType, &hkeyServerType, __LINE__); 1260 if (lrc == ERROR_SUCCESS) 1261 1261 { 1262 1262 RTUTF16 wszModule[MAX_PATH * 2]; … … 1265 1265 *pwszCur++ = '"'; 1266 1266 1267 rc = RTUtf16Copy(pwszCur, MAX_PATH, pwszVBoxDir); AssertRC(rc);1267 int vrc = RTUtf16Copy(pwszCur, MAX_PATH, pwszVBoxDir); AssertRC(vrc); 1268 1268 pwszCur += RTUtf16Len(pwszCur); 1269 rc = RTUtf16CopyAscii(pwszCur, MAX_PATH - 3, pszServerSubPath); AssertRC(rc);1269 vrc = RTUtf16CopyAscii(pwszCur, MAX_PATH - 3, pszServerSubPath); AssertRC(vrc); 1270 1270 pwszCur += RTUtf16Len(pwszCur); 1271 1271 … … 1286 1286 if (pszClassName) 1287 1287 { 1288 rc = RTStrCopy(szCurClassNameVer, sizeof(szCurClassNameVer), pszClassName);1289 if (RT_SUCCESS( rc))1290 rc = RTStrCat(szCurClassNameVer, sizeof(szCurClassNameVer), pszCurClassNameVerSuffix);1291 AssertStmt(RT_SUCCESS( rc), pState->rc =rc = ERROR_INVALID_DATA);1292 if ( rc == ERROR_SUCCESS)1288 int vrc = RTStrCopy(szCurClassNameVer, sizeof(szCurClassNameVer), pszClassName); 1289 if (RT_SUCCESS(vrc)) 1290 vrc = RTStrCat(szCurClassNameVer, sizeof(szCurClassNameVer), pszCurClassNameVerSuffix); 1291 AssertStmt(RT_SUCCESS(vrc), pState->lrc = lrc = ERROR_INVALID_DATA); 1292 if (lrc == ERROR_SUCCESS) 1293 1293 vbpsCreateRegKeyWithDefaultValueAA(pState, hkeyClass, "ProgId", szCurClassNameVer, __LINE__); 1294 1294 … … 1313 1313 } 1314 1314 1315 return pState-> rc;1315 return pState->lrc; 1316 1316 } 1317 1317 … … 1393 1393 HKEY hkeyTypeLibs; 1394 1394 HKEY hkeyTypeLibId; 1395 LSTATUS rc;1395 LSTATUS lrc; 1396 1396 RT_NOREF(fIs32On64); 1397 1397 … … 1403 1403 1404 1404 /* Open Classes/TypeLib/. */ 1405 rc = vbpsCreateRegKeyA(pState, pState->hkeyClassesRootDst, "TypeLib", &hkeyTypeLibs, __LINE__);1406 if ( rc != ERROR_SUCCESS)1405 lrc = vbpsCreateRegKeyA(pState, pState->hkeyClassesRootDst, "TypeLib", &hkeyTypeLibs, __LINE__); 1406 if (lrc != ERROR_SUCCESS) 1407 1407 return; 1408 1408 1409 1409 /* Create TypeLib/{UUID}. */ 1410 rc = vbpsCreateRegKeyA(pState, hkeyTypeLibs, vbpsFormatUuidInCurly(szTypeLibId, &LIBID_VirtualBox), &hkeyTypeLibId, __LINE__);1411 if ( rc == ERROR_SUCCESS)1410 lrc = vbpsCreateRegKeyA(pState, hkeyTypeLibs, vbpsFormatUuidInCurly(szTypeLibId, &LIBID_VirtualBox), &hkeyTypeLibId, __LINE__); 1411 if (lrc == ERROR_SUCCESS) 1412 1412 { 1413 1413 /* {UUID}/Major.Minor/Default = pszDescription. */ … … 1415 1415 char szMajMin[64]; 1416 1416 sprintf(szMajMin, "%u.%u", kTypeLibraryMajorVersion, kTypeLibraryMinorVersion); 1417 rc = vbpsCreateRegKeyWithDefaultValueAAEx(pState, hkeyTypeLibId, szMajMin, pszDescription, &hkeyMajMin, __LINE__);1418 if ( rc == ERROR_SUCCESS)1417 lrc = vbpsCreateRegKeyWithDefaultValueAAEx(pState, hkeyTypeLibId, szMajMin, pszDescription, &hkeyMajMin, __LINE__); 1418 if (lrc == ERROR_SUCCESS) 1419 1419 { 1420 1420 RTUTF16 wszBuf[MAX_PATH * 2]; … … 1422 1422 /* {UUID}/Major.Minor/0. */ 1423 1423 HKEY hkey0; 1424 rc = vbpsCreateRegKeyA(pState, hkeyMajMin, "0", &hkey0, __LINE__);1425 if ( rc == ERROR_SUCCESS)1424 lrc = vbpsCreateRegKeyA(pState, hkeyMajMin, "0", &hkey0, __LINE__); 1425 if (lrc == ERROR_SUCCESS) 1426 1426 { 1427 1427 /* {UUID}/Major.Minor/0/winXX/Default = VBoxProxyStub. */ 1428 rc = RTUtf16Copy(wszBuf, MAX_PATH, pwszVBoxDir); AssertRC(rc);1429 rc = RTUtf16CatAscii(wszBuf, MAX_PATH * 2, pszTypeLibDll); AssertRC(rc);1428 int vrc = RTUtf16Copy(wszBuf, MAX_PATH, pwszVBoxDir); AssertRC(vrc); 1429 vrc = RTUtf16CatAscii(wszBuf, MAX_PATH * 2, pszTypeLibDll); AssertRC(vrc); 1430 1430 1431 1431 vbpsCreateRegKeyWithDefaultValueAW(pState, hkey0, pszWinXx, wszBuf, __LINE__); … … 1437 1437 1438 1438 /* {UUID}/Major.Minor/HELPDIR */ 1439 rc = RTUtf16Copy(wszBuf, MAX_PATH, pwszVBoxDir); AssertRC(rc);1439 int vrc = RTUtf16Copy(wszBuf, MAX_PATH, pwszVBoxDir); AssertRC(vrc); 1440 1440 #if 0 /* MSI: trailing slash; regsvr32/comregister: strip unnecessary trailing slash. Go with MSI to avoid user issues. */ 1441 1441 { … … 1497 1497 const ProxyFileInfo **ppProxyFile = &g_apProxyFiles[0]; 1498 1498 const ProxyFileInfo *pProxyFile; 1499 LSTATUS rc;1499 LSTATUS lrc; 1500 1500 char szProxyClsId[CURLY_UUID_STR_BUF_SIZE]; 1501 1501 char szTypeLibId[CURLY_UUID_STR_BUF_SIZE]; … … 1507 1507 1508 1508 Assert(pState->fUpdate && !pState->fDelete); 1509 rc = vbpsRegOpenInterfaceKeys(pState);1510 if ( rc != ERROR_SUCCESS)1509 lrc = vbpsRegOpenInterfaceKeys(pState); 1510 if (lrc != ERROR_SUCCESS) 1511 1511 return; 1512 1512 … … 1534 1534 HKEY hkeyIfId; 1535 1535 1536 AssertReturnVoidStmt(cchIfNm >= 3 && cchIfNm <= 72, pState-> rc = ERROR_INVALID_DATA);1537 1538 AssertReturnVoidStmt(cMethods >= 3 && cMethods < 1024, pState-> rc = ERROR_INVALID_DATA);1536 AssertReturnVoidStmt(cchIfNm >= 3 && cchIfNm <= 72, pState->lrc = ERROR_INVALID_DATA); 1537 1538 AssertReturnVoidStmt(cMethods >= 3 && cMethods < 1024, pState->lrc = ERROR_INVALID_DATA); 1539 1539 sprintf(szMethods, "%u", cMethods); 1540 1540 1541 rc = vbpsCreateRegKeyWithDefaultValueAAEx(pState, pState->hkeyInterfaceRootDst,1542 vbpsFormatUuidInCurly(szIfId, papStubVtbls[iIf]->header.piid),1543 pszIfNm, &hkeyIfId, __LINE__);1544 if ( rc == ERROR_SUCCESS)1541 lrc = vbpsCreateRegKeyWithDefaultValueAAEx(pState, pState->hkeyInterfaceRootDst, 1542 vbpsFormatUuidInCurly(szIfId, papStubVtbls[iIf]->header.piid), 1543 pszIfNm, &hkeyIfId, __LINE__); 1544 if (lrc == ERROR_SUCCESS) 1545 1545 { 1546 1546 HKEY hkeyTypeLib; … … 1549 1549 1550 1550 /* The MSI seems to still be putting TypeLib keys here. So, let's do that too. */ 1551 rc = vbpsCreateRegKeyWithDefaultValueAAEx(pState, hkeyIfId, "TypeLib", szTypeLibId, &hkeyTypeLib, __LINE__);1552 if ( rc == ERROR_SUCCESS)1551 lrc = vbpsCreateRegKeyWithDefaultValueAAEx(pState, hkeyIfId, "TypeLib", szTypeLibId, &hkeyTypeLib, __LINE__); 1552 if (lrc == ERROR_SUCCESS) 1553 1553 { 1554 1554 vbpsSetRegValueAA(pState, hkeyTypeLib, "Version", szTypeLibVersion, __LINE__); … … 1629 1629 #endif 1630 1630 VBPSREGSTATE State; 1631 LSTATUS rc;1631 LSTATUS lrc; 1632 1632 1633 1633 /* 1634 1634 * Do registration for the current execution mode of the DLL. 1635 1635 */ 1636 rc = vbpsRegInit(&State, HKEY_CLASSES_ROOT, NULL /* Alt: HKEY_LOCAL_MACHINE, "Software\\Classes", */, fDelete, fUpdate, 0);1637 if ( rc == ERROR_SUCCESS)1636 lrc = vbpsRegInit(&State, HKEY_CLASSES_ROOT, NULL /* Alt: HKEY_LOCAL_MACHINE, "Software\\Classes", */, fDelete, fUpdate, 0); 1637 if (lrc == ERROR_SUCCESS) 1638 1638 { 1639 1639 if (!fUpdate) … … 1646 1646 1647 1647 RegisterXidlModulesAndClassesGenerated(&State, pwszVBoxDir, fIs32On64); 1648 rc = State.rc;1648 lrc = State.lrc; 1649 1649 } 1650 1650 vbpsRegTerm(&State); … … 1653 1653 * Translate error code? Return. 1654 1654 */ 1655 if ( rc == ERROR_SUCCESS)1655 if (lrc == ERROR_SUCCESS) 1656 1656 return S_OK; 1657 1657 return E_FAIL; … … 1880 1880 */ 1881 1881 HKEY hkeyInterfaces; 1882 LRESULT rc = RegOpenKeyExW(pState->aAltDeletes[iAlt].hkeyClasses, L"Interface",1883 0 /*fOptions*/, pState->fSamDelete, &hkeyInterfaces);1884 if ( rc == ERROR_SUCCESS)1882 LRESULT lrc = RegOpenKeyExW(pState->aAltDeletes[iAlt].hkeyClasses, L"Interface", 1883 0 /*fOptions*/, pState->fSamDelete, &hkeyInterfaces); 1884 if (lrc == ERROR_SUCCESS) 1885 1885 { 1886 1886 /* … … 1893 1893 RTUTF16 wszCurNm[128 + 48]; 1894 1894 DWORD cwcCurNm = 128; 1895 rc = RegEnumKeyExW(hkeyInterfaces, idxKey, wszCurNm, &cwcCurNm,1896 NULL /*pdwReserved*/, NULL /*pwszClass*/, NULL /*pcwcClass*/, NULL /*pLastWriteTime*/);1897 if ( rc == ERROR_SUCCESS)1895 lrc = RegEnumKeyExW(hkeyInterfaces, idxKey, wszCurNm, &cwcCurNm, 1896 NULL /*pdwReserved*/, NULL /*pwszClass*/, NULL /*pcwcClass*/, NULL /*pLastWriteTime*/); 1897 if (lrc == ERROR_SUCCESS) 1898 1898 { 1899 1899 /* … … 1918 1918 /* Try the TypeLib sub-key. */ 1919 1919 memcpy(&wszCurNm[cwcCurNm], s_wszTypeLib, sizeof(s_wszTypeLib)); 1920 rc = RegOpenKeyExW(hkeyInterfaces, wszCurNm, 0 /*fOptions*/, KEY_QUERY_VALUE, &hkeySub);1921 if ( rc == ERROR_SUCCESS)1920 lrc = RegOpenKeyExW(hkeyInterfaces, wszCurNm, 0 /*fOptions*/, KEY_QUERY_VALUE, &hkeySub); 1921 if (lrc == ERROR_SUCCESS) 1922 1922 { 1923 1923 cbValue = sizeof(wszValue) - sizeof(RTUTF16); 1924 rc = RegQueryValueExW(hkeySub, NULL /*pszValueNm*/, NULL /*pdwReserved*/,1925 &dwType, (PBYTE)&wszValue[0], &cbValue);1926 if ( rc != ERROR_SUCCESS || dwType != REG_SZ)1924 lrc = RegQueryValueExW(hkeySub, NULL /*pszValueNm*/, NULL /*pdwReserved*/, 1925 &dwType, (PBYTE)&wszValue[0], &cbValue); 1926 if (lrc != ERROR_SUCCESS || dwType != REG_SZ) 1927 1927 cbValue = 0; 1928 1928 wszValue[cbValue / sizeof(RTUTF16)] = '\0'; 1929 1929 1930 if ( rc == ERROR_SUCCESS1930 if ( lrc == ERROR_SUCCESS 1931 1931 && vbpsIsTypeLibIdToRemove(wszValue)) 1932 1932 { 1933 1933 /* Check the TypeLib/Version value to make sure. */ 1934 1934 cbValue = sizeof(wszValue) - sizeof(RTUTF16); 1935 rc = RegQueryValueExW(hkeySub, L"Version", 0 /*pdwReserved*/, &dwType, (PBYTE)&wszValue[0], &cbValue);1936 if ( rc != ERROR_SUCCESS)1935 lrc = RegQueryValueExW(hkeySub, L"Version", 0 /*pdwReserved*/, &dwType, (PBYTE)&wszValue[0], &cbValue); 1936 if (lrc != ERROR_SUCCESS) 1937 1937 cbValue = 0; 1938 1938 wszValue[cbValue] = '\0'; 1939 1939 1940 if ( rc == ERROR_SUCCESS1940 if ( lrc == ERROR_SUCCESS 1941 1941 && vbpsIsTypeLibVersionToRemove(wszValue)) 1942 1942 fDeleteMe = true; … … 1944 1944 vbpsCloseKey(pState, hkeySub, __LINE__); 1945 1945 } 1946 else if ( rc == ERROR_FILE_NOT_FOUND)1946 else if (lrc == ERROR_FILE_NOT_FOUND) 1947 1947 { 1948 1948 /* No TypeLib, try the ProxyStubClsid32 sub-key next. */ 1949 1949 static RTUTF16 const s_wszProxyStubClsid32[] = L"\\ProxyStubClsid32"; 1950 1950 memcpy(&wszCurNm[cwcCurNm], s_wszProxyStubClsid32, sizeof(s_wszProxyStubClsid32)); 1951 rc = RegOpenKeyExW(hkeyInterfaces, wszCurNm, 0 /*fOptions*/, KEY_QUERY_VALUE, &hkeySub);1952 if ( rc == ERROR_SUCCESS)1951 lrc = RegOpenKeyExW(hkeyInterfaces, wszCurNm, 0 /*fOptions*/, KEY_QUERY_VALUE, &hkeySub); 1952 if (lrc == ERROR_SUCCESS) 1953 1953 { 1954 1954 cbValue = sizeof(wszValue) - sizeof(RTUTF16); 1955 rc = RegQueryValueExW(hkeySub, NULL /*pszValueNm*/, NULL /*pdwReserved*/,1956 &dwType, (PBYTE)&wszValue[0], &cbValue);1957 if ( rc != ERROR_SUCCESS || dwType != REG_SZ)1955 lrc = RegQueryValueExW(hkeySub, NULL /*pszValueNm*/, NULL /*pdwReserved*/, 1956 &dwType, (PBYTE)&wszValue[0], &cbValue); 1957 if (lrc != ERROR_SUCCESS || dwType != REG_SZ) 1958 1958 cbValue = 0; 1959 1959 wszValue[cbValue / sizeof(RTUTF16)] = '\0'; 1960 1960 1961 if ( rc == ERROR_SUCCESS1961 if ( lrc == ERROR_SUCCESS 1962 1962 && vbpsIsProxyStubClsIdToRemove(wszValue)) 1963 1963 fDeleteMe = true; … … 1978 1978 else 1979 1979 { 1980 Assert( rc == ERROR_NO_MORE_ITEMS);1980 Assert(lrc == ERROR_NO_MORE_ITEMS); 1981 1981 break; 1982 1982 } … … 2004 2004 */ 2005 2005 HKEY hkeyClsIds; 2006 LRESULT rc;2007 rc = RegOpenKeyExW(pState->aAltDeletes[iAlt].hkeyClasses, L"CLSID", 0 /*fOptions*/, pState->fSamDelete, &hkeyClsIds);2008 if ( rc == ERROR_SUCCESS)2006 LRESULT lrc; 2007 lrc = RegOpenKeyExW(pState->aAltDeletes[iAlt].hkeyClasses, L"CLSID", 0 /*fOptions*/, pState->fSamDelete, &hkeyClsIds); 2008 if (lrc == ERROR_SUCCESS) 2009 2009 { 2010 2010 /* … … 2017 2017 RTUTF16 wszCurNm[128 + 48]; 2018 2018 DWORD cwcCurNm = 128; 2019 rc = RegEnumKeyExW(hkeyClsIds, idxKey, wszCurNm, &cwcCurNm,2020 NULL /*pdwReserved*/, NULL /*pwszClass*/, NULL /*pcwcClass*/, NULL /*pLastWriteTime*/);2021 if ( rc == ERROR_SUCCESS)2019 lrc = RegEnumKeyExW(hkeyClsIds, idxKey, wszCurNm, &cwcCurNm, 2020 NULL /*pdwReserved*/, NULL /*pwszClass*/, NULL /*pcwcClass*/, NULL /*pLastWriteTime*/); 2021 if (lrc == ERROR_SUCCESS) 2022 2022 { 2023 2023 /* … … 2039 2039 /* The TypeLib sub-key. */ 2040 2040 memcpy(&wszCurNm[cwcCurNm], s_wszTypeLib, sizeof(s_wszTypeLib)); 2041 rc = RegOpenKeyExW(hkeyClsIds, wszCurNm, 0 /*fOptions*/, KEY_QUERY_VALUE, &hkeySub);2042 if ( rc == ERROR_SUCCESS)2041 lrc = RegOpenKeyExW(hkeyClsIds, wszCurNm, 0 /*fOptions*/, KEY_QUERY_VALUE, &hkeySub); 2042 if (lrc == ERROR_SUCCESS) 2043 2043 { 2044 2044 bool fDeleteMe = false; 2045 2045 2046 2046 cbValue = sizeof(wszValue) - sizeof(RTUTF16); 2047 rc = RegQueryValueExW(hkeySub, NULL /*pszValueNm*/, NULL /*pdwReserved*/,2048 &dwType, (PBYTE)&wszValue[0], &cbValue);2049 if ( rc != ERROR_SUCCESS || dwType != REG_SZ)2047 lrc = RegQueryValueExW(hkeySub, NULL /*pszValueNm*/, NULL /*pdwReserved*/, 2048 &dwType, (PBYTE)&wszValue[0], &cbValue); 2049 if (lrc != ERROR_SUCCESS || dwType != REG_SZ) 2050 2050 cbValue = 0; 2051 2051 wszValue[cbValue / sizeof(RTUTF16)] = '\0'; 2052 2052 2053 if ( rc == ERROR_SUCCESS2053 if ( lrc == ERROR_SUCCESS 2054 2054 && vbpsIsTypeLibIdToRemove(wszValue)) 2055 2055 fDeleteMe = true; … … 2062 2062 static RTUTF16 const s_wszProgId[] = L"\\ProgId"; 2063 2063 memcpy(&wszCurNm[cwcCurNm], s_wszProgId, sizeof(s_wszProgId)); 2064 rc = RegOpenKeyExW(hkeyClsIds, wszCurNm, 0 /*fOptions*/, KEY_QUERY_VALUE, &hkeySub);2065 if ( rc == ERROR_SUCCESS)2064 lrc = RegOpenKeyExW(hkeyClsIds, wszCurNm, 0 /*fOptions*/, KEY_QUERY_VALUE, &hkeySub); 2065 if (lrc == ERROR_SUCCESS) 2066 2066 { 2067 2067 static RTUTF16 const s_wszProgIdPrefix[] = L"VirtualBox."; 2068 2068 2069 2069 cbValue = sizeof(wszValue) - sizeof(RTUTF16); 2070 rc = RegQueryValueExW(hkeySub, NULL /*pszValueNm*/, NULL /*pdwReserved*/,2071 &dwType, (PBYTE)&wszValue[0], &cbValue);2072 if ( rc != ERROR_SUCCESS || dwType != REG_SZ)2070 lrc = RegQueryValueExW(hkeySub, NULL /*pszValueNm*/, NULL /*pdwReserved*/, 2071 &dwType, (PBYTE)&wszValue[0], &cbValue); 2072 if (lrc != ERROR_SUCCESS || dwType != REG_SZ) 2073 2073 cbValue = 0; 2074 2074 wszValue[cbValue / sizeof(RTUTF16)] = '\0'; … … 2081 2081 } 2082 2082 else 2083 AssertStmt( rc == ERROR_FILE_NOT_FOUND, fDeleteMe = false);2083 AssertStmt(lrc == ERROR_FILE_NOT_FOUND, fDeleteMe = false); 2084 2084 2085 2085 if (fDeleteMe) … … 2094 2094 } 2095 2095 else 2096 Assert( rc == ERROR_FILE_NOT_FOUND);2096 Assert(lrc == ERROR_FILE_NOT_FOUND); 2097 2097 } 2098 2098 else 2099 2099 { 2100 Assert( rc == ERROR_NO_MORE_ITEMS);2100 Assert(lrc == ERROR_NO_MORE_ITEMS); 2101 2101 break; 2102 2102 } … … 2106 2106 } 2107 2107 else 2108 Assert( rc == ERROR_FILE_NOT_FOUND);2108 Assert(lrc == ERROR_FILE_NOT_FOUND); 2109 2109 } 2110 2110 } … … 2123 2123 */ 2124 2124 HKEY hkeyTypeLibs; 2125 LSTATUS rc;2126 rc = RegOpenKeyExW(pState->aAltDeletes[iAlt].hkeyClasses, L"TypeLib", 0 /*fOptions*/, pState->fSamDelete, &hkeyTypeLibs);2127 if ( rc == ERROR_SUCCESS)2125 LSTATUS lrc; 2126 lrc = RegOpenKeyExW(pState->aAltDeletes[iAlt].hkeyClasses, L"TypeLib", 0 /*fOptions*/, pState->fSamDelete, &hkeyTypeLibs); 2127 if (lrc == ERROR_SUCCESS) 2128 2128 { 2129 2129 /* … … 2134 2134 { 2135 2135 HKEY hkeyTypeLibId; 2136 rc = RegOpenKeyExW(hkeyTypeLibs, g_apwszTypeLibIds[iTlb], 0 /*fOptions*/, pState->fSamDelete, &hkeyTypeLibId);2137 if ( rc == ERROR_SUCCESS)2136 lrc = RegOpenKeyExW(hkeyTypeLibs, g_apwszTypeLibIds[iTlb], 0 /*fOptions*/, pState->fSamDelete, &hkeyTypeLibId); 2137 if (lrc == ERROR_SUCCESS) 2138 2138 { 2139 2139 unsigned iVer = RT_ELEMENTS(g_apwszTypelibVersions); … … 2141 2141 { 2142 2142 HKEY hkeyVer; 2143 rc = RegOpenKeyExW(hkeyTypeLibId, g_apwszTypelibVersions[iVer], 0, KEY_READ, &hkeyVer);2144 if ( rc == ERROR_SUCCESS)2143 lrc = RegOpenKeyExW(hkeyTypeLibId, g_apwszTypelibVersions[iVer], 0, KEY_READ, &hkeyVer); 2144 if (lrc == ERROR_SUCCESS) 2145 2145 { 2146 2146 char szValue[128]; 2147 2147 DWORD cbValue = sizeof(szValue) - 1; 2148 rc = RegQueryValueExA(hkeyVer, NULL, NULL, NULL, (PBYTE)&szValue[0], &cbValue);2148 lrc = RegQueryValueExA(hkeyVer, NULL, NULL, NULL, (PBYTE)&szValue[0], &cbValue); 2149 2149 vbpsCloseKey(pState, hkeyVer, __LINE__); 2150 if ( rc == ERROR_SUCCESS)2150 if (lrc == ERROR_SUCCESS) 2151 2151 { 2152 2152 szValue[cbValue] = '\0'; … … 2167 2167 * The type library ID key should be empty now, so we can try remove it (non-recursively). 2168 2168 */ 2169 rc = RegDeleteKeyW(hkeyTypeLibs, g_apwszTypeLibIds[iTlb]);2170 Assert( rc == ERROR_SUCCESS);2169 lrc = RegDeleteKeyW(hkeyTypeLibs, g_apwszTypeLibIds[iTlb]); 2170 Assert(lrc == ERROR_SUCCESS); 2171 2171 } 2172 2172 } 2173 2173 } 2174 2174 else 2175 Assert( rc == ERROR_FILE_NOT_FOUND);2175 Assert(lrc == ERROR_FILE_NOT_FOUND); 2176 2176 } 2177 2177 } … … 2188 2188 */ 2189 2189 VBPSREGSTATE State; 2190 LRESULT rc = vbpsRegInit(&State, HKEY_CLASSES_ROOT, NULL, true /*fDelete*/, false /*fUpdate*/, fSamWow);2191 if ( rc == ERROR_SUCCESS)2190 LRESULT lrc = vbpsRegInit(&State, HKEY_CLASSES_ROOT, NULL, true /*fDelete*/, false /*fUpdate*/, fSamWow); 2191 if (lrc == ERROR_SUCCESS) 2192 2192 { 2193 2193 vbpsRegAddAltDelete(&State, HKEY_CURRENT_USER, "Software\\Classes"); … … 2342 2342 */ 2343 2343 WCHAR wszFilePath[MAX_PATH + 2]; 2344 int rc = RTUtf16CopyAscii(wszFilePath, RT_ELEMENTS(wszFilePath), "\"");2345 if (RT_SUCCESS( rc))2346 rc = RTUtf16Cat(wszFilePath, RT_ELEMENTS(wszFilePath), pwszVBoxDir);2347 if (RT_SUCCESS( rc))2348 rc = RTUtf16Cat(wszFilePath, RT_ELEMENTS(wszFilePath), pwszModule);2349 if (RT_SUCCESS( rc))2350 rc = RTUtf16CatAscii(wszFilePath, RT_ELEMENTS(wszFilePath), "\"");2351 AssertLogRelRCReturnVoid( rc);2344 int vrc = RTUtf16CopyAscii(wszFilePath, RT_ELEMENTS(wszFilePath), "\""); 2345 if (RT_SUCCESS(vrc)) 2346 vrc = RTUtf16Cat(wszFilePath, RT_ELEMENTS(wszFilePath), pwszVBoxDir); 2347 if (RT_SUCCESS(vrc)) 2348 vrc = RTUtf16Cat(wszFilePath, RT_ELEMENTS(wszFilePath), pwszModule); 2349 if (RT_SUCCESS(vrc)) 2350 vrc = RTUtf16CatAscii(wszFilePath, RT_ELEMENTS(wszFilePath), "\""); 2351 AssertLogRelRCReturnVoid(vrc); 2352 2352 2353 2353 /* … … 2463 2463 else 2464 2464 { 2465 pState-> rc = GetLastError();2466 LogRel(("Failed to not open service %ls for stop+delete: %u\n", pwszServiceName, pState-> rc));2465 pState->lrc = GetLastError(); 2466 LogRel(("Failed to not open service %ls for stop+delete: %u\n", pwszServiceName, pState->lrc)); 2467 2467 hService = OpenServiceW(hSCM, pwszServiceName, SERVICE_CHANGE_CONFIG); 2468 2468 } … … 2506 2506 else 2507 2507 { 2508 pState-> rc = GetLastError();2509 AssertMsgFailed(("Failed to create service '%ls': %u\n", pwszServiceName, pState-> rc));2508 pState->lrc = GetLastError(); 2509 AssertMsgFailed(("Failed to create service '%ls': %u\n", pwszServiceName, pState->lrc)); 2510 2510 } 2511 2511 CloseServiceHandle(hSCM); … … 2513 2513 else 2514 2514 { 2515 pState-> rc = GetLastError();2516 LogRel(("Failed to open service manager with create service access: %u\n", pState-> rc));2515 pState->lrc = GetLastError(); 2516 LogRel(("Failed to open service manager with create service access: %u\n", pState->lrc)); 2517 2517 } 2518 2518 } … … 2535 2535 DECLEXPORT(uint32_t) VbpsUpdateRegistrations(void) 2536 2536 { 2537 LSTATUS rc;2537 LSTATUS lrc; 2538 2538 VBPSREGSTATE State; 2539 2539 #ifdef VBOX_IN_32_ON_64_MAIN_API … … 2557 2557 * Update registry entries for the current CPU bitness. 2558 2558 */ 2559 rc = vbpsRegInit(&State, HKEY_CLASSES_ROOT, NULL, false /*fDelete*/, true /*fUpdate*/, 0);2560 if ( rc == ERROR_SUCCESS && !vbpsIsUpToDate(&State))2559 lrc = vbpsRegInit(&State, HKEY_CLASSES_ROOT, NULL, false /*fDelete*/, true /*fUpdate*/, 0); 2560 if (lrc == ERROR_SUCCESS && !vbpsIsUpToDate(&State)) 2561 2561 { 2562 2562 … … 2570 2570 RegisterXidlModulesAndClassesGenerated(&State, wszVBoxDir, fIs32On64); 2571 2571 vbpsMarkUpToDate(&State); 2572 rc = State.rc;2572 lrc = State.lrc; 2573 2573 } 2574 2574 vbpsRegTerm(&State); … … 2579 2579 * Update registry entries for the other CPU bitness. 2580 2580 */ 2581 if ( rc == ERROR_SUCCESS)2582 { 2583 rc = vbpsRegInit(&State, HKEY_CLASSES_ROOT, NULL, false /*fDelete*/, true /*fUpdate*/,2584 !fIs32On64 ? KEY_WOW64_32KEY : KEY_WOW64_64KEY);2585 if ( rc == ERROR_SUCCESS && !vbpsIsUpToDate(&State))2581 if (lrc == ERROR_SUCCESS) 2582 { 2583 lrc = vbpsRegInit(&State, HKEY_CLASSES_ROOT, NULL, false /*fDelete*/, true /*fUpdate*/, 2584 !fIs32On64 ? KEY_WOW64_32KEY : KEY_WOW64_64KEY); 2585 if (lrc == ERROR_SUCCESS && !vbpsIsUpToDate(&State)) 2586 2586 { 2587 2587 vbpsUpdateTypeLibRegistration(&State, wszVBoxDir, !fIs32On64); … … 2590 2590 RegisterXidlModulesAndClassesGenerated(&State, wszVBoxDir, !fIs32On64); 2591 2591 vbpsMarkUpToDate(&State); 2592 rc = State.rc;2592 lrc = State.lrc; 2593 2593 } 2594 2594 vbpsRegTerm(&State); -
trunk/src/VBox/Main/webservice/split-soapC.cpp
r98103 r98297 44 44 if (pFileIn) 45 45 { 46 int rc2 = fseek(pFileIn, 0, SEEK_END);46 int iRc2 = fseek(pFileIn, 0, SEEK_END); 47 47 long cbFileIn = ftell(pFileIn); 48 int rc3 = fseek(pFileIn, 0, SEEK_SET);49 if ( rc3 != -1 && rc2 != -1 && cbFileIn >= 0)48 int iRc3 = fseek(pFileIn, 0, SEEK_SET); 49 if (iRc3 != -1 && iRc2 != -1 && cbFileIn >= 0) 50 50 { 51 51 char *pBuffer = (char *)malloc(cbFileIn + 1); -
trunk/src/VBox/Main/webservice/vboxweb.cpp
r98103 r98297 386 386 m_soap->max_keep_alive = g_cMaxKeepAlive; 387 387 388 int rc = RTThreadCreate(&m_pThread,389 fntWrapper,390 this, // pvUser391 0, // cbStack392 RTTHREADTYPE_MAIN_HEAVY_WORKER,393 0,394 m_strThread.c_str());395 if (RT_FAILURE( rc))396 { 397 RTMsgError("Cannot start worker thread %d: %Rrc\n", u, rc);388 int vrc = RTThreadCreate(&m_pThread, 389 fntWrapper, 390 this, // pvUser 391 0, // cbStack 392 RTTHREADTYPE_MAIN_HEAVY_WORKER, 393 0, 394 m_strThread.c_str()); 395 if (RT_FAILURE(vrc)) 396 { 397 RTMsgError("Cannot start worker thread %d: %Rrc\n", u, vrc); 398 398 exit(1); 399 399 } … … 837 837 for (int i = 0; i < num_locks; i++) 838 838 { 839 int rc = RTCritSectInitEx(&g_pSSLMutexes[i], RTCRITSECT_FLAGS_NO_LOCK_VAL,840 NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_NONE,841 "openssl-%d", i);842 if (RT_FAILURE( rc))839 int vrc = RTCritSectInitEx(&g_pSSLMutexes[i], RTCRITSECT_FLAGS_NO_LOCK_VAL, 840 NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_NONE, 841 "openssl-%d", i); 842 if (RT_FAILURE(vrc)) 843 843 { 844 844 for ( ; i >= 0; i--) … … 1076 1076 { 1077 1077 // initialize runtime 1078 int rc = RTR3InitExe(argc, &argv, 0);1079 if (RT_FAILURE( rc))1080 return RTMsgInitFailure( rc);1078 int vrc = RTR3InitExe(argc, &argv, 0); 1079 if (RT_FAILURE(vrc)) 1080 return RTMsgInitFailure(vrc); 1081 1081 #ifdef RT_OS_WINDOWS 1082 1082 ATL::CComModule _Module; /* Required internally by ATL (constructor records instance in global variable). */ … … 1133 1133 else 1134 1134 { 1135 intvrc = RTStrmOpen(ValueUnion.psz, "r", &StrmIn);1135 vrc = RTStrmOpen(ValueUnion.psz, "r", &StrmIn); 1136 1136 if (RT_FAILURE(vrc)) 1137 1137 return RTMsgErrorExit(RTEXITCODE_FAILURE, "failed to open password file (%s, %Rrc)", ValueUnion.psz, vrc); 1138 1138 } 1139 1139 char szPasswd[512]; 1140 intvrc = RTStrmGetLine(StrmIn, szPasswd, sizeof(szPasswd));1140 vrc = RTStrmGetLine(StrmIn, szPasswd, sizeof(szPasswd)); 1141 1141 if (RT_FAILURE(vrc)) 1142 1142 return RTMsgErrorExit(RTEXITCODE_FAILURE, "failed to read password (%s, %Rrc)", ValueUnion.psz, vrc); … … 1223 1223 1224 1224 default: 1225 rc = RTGetOptPrintError(c, &ValueUnion); 1226 return rc; 1225 return RTGetOptPrintError(c, &ValueUnion); 1227 1226 } 1228 1227 } … … 1230 1229 /* create release logger, to stdout */ 1231 1230 RTERRINFOSTATIC ErrInfo; 1232 rc = com::VBoxLogRelCreate("web service", g_fDaemonize ? NULL : pszLogFile,1233 RTLOGFLAGS_PREFIX_THREAD | RTLOGFLAGS_PREFIX_TIME_PROG,1234 "all", "VBOXWEBSRV_RELEASE_LOG",1235 RTLOGDEST_STDOUT, UINT32_MAX /* cMaxEntriesPerGroup */,1236 g_cHistory, g_uHistoryFileTime, g_uHistoryFileSize,1237 RTErrInfoInitStatic(&ErrInfo));1238 if (RT_FAILURE( rc))1239 return RTMsgErrorExit(RTEXITCODE_FAILURE, "failed to open release log (%s, %Rrc)", ErrInfo.Core.pszMsg, rc);1231 vrc = com::VBoxLogRelCreate("web service", g_fDaemonize ? NULL : pszLogFile, 1232 RTLOGFLAGS_PREFIX_THREAD | RTLOGFLAGS_PREFIX_TIME_PROG, 1233 "all", "VBOXWEBSRV_RELEASE_LOG", 1234 RTLOGDEST_STDOUT, UINT32_MAX /* cMaxEntriesPerGroup */, 1235 g_cHistory, g_uHistoryFileTime, g_uHistoryFileSize, 1236 RTErrInfoInitStatic(&ErrInfo)); 1237 if (RT_FAILURE(vrc)) 1238 return RTMsgErrorExit(RTEXITCODE_FAILURE, "failed to open release log (%s, %Rrc)", ErrInfo.Core.pszMsg, vrc); 1240 1239 1241 1240 #if defined(RT_OS_DARWIN) || defined(RT_OS_LINUX) || defined (RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) … … 1247 1246 if (!pszLogFile || !*pszLogFile) 1248 1247 { 1249 rc = com::GetVBoxUserHomeDirectory(szLogFile, sizeof(szLogFile));1250 if (RT_FAILURE( rc))1251 return RTMsgErrorExit(RTEXITCODE_FAILURE, "could not get base directory for logging: %Rrc", rc);1252 rc = RTPathAppend(szLogFile, sizeof(szLogFile), "vboxwebsrv.log");1253 if (RT_FAILURE( rc))1254 return RTMsgErrorExit(RTEXITCODE_FAILURE, "could not construct logging path: %Rrc", rc);1248 vrc = com::GetVBoxUserHomeDirectory(szLogFile, sizeof(szLogFile)); 1249 if (RT_FAILURE(vrc)) 1250 return RTMsgErrorExit(RTEXITCODE_FAILURE, "could not get base directory for logging: %Rrc", vrc); 1251 vrc = RTPathAppend(szLogFile, sizeof(szLogFile), "vboxwebsrv.log"); 1252 if (RT_FAILURE(vrc)) 1253 return RTMsgErrorExit(RTEXITCODE_FAILURE, "could not construct logging path: %Rrc", vrc); 1255 1254 pszLogFile = szLogFile; 1256 1255 } 1257 1256 1258 rc = RTProcDaemonizeUsingFork(false /* fNoChDir */, false /* fNoClose */, pszPidFile);1259 if (RT_FAILURE( rc))1260 return RTMsgErrorExit(RTEXITCODE_FAILURE, "failed to daemonize, rc=%Rrc. exiting.",rc);1257 vrc = RTProcDaemonizeUsingFork(false /* fNoChDir */, false /* fNoClose */, pszPidFile); 1258 if (RT_FAILURE(vrc)) 1259 return RTMsgErrorExit(RTEXITCODE_FAILURE, "failed to daemonize, vrc=%Rrc. exiting.", vrc); 1261 1260 1262 1261 /* create release logger, to file */ 1263 rc = com::VBoxLogRelCreate("web service", pszLogFile,1264 RTLOGFLAGS_PREFIX_THREAD | RTLOGFLAGS_PREFIX_TIME_PROG,1265 "all", "VBOXWEBSRV_RELEASE_LOG",1266 RTLOGDEST_FILE, UINT32_MAX /* cMaxEntriesPerGroup */,1267 g_cHistory, g_uHistoryFileTime, g_uHistoryFileSize,1268 RTErrInfoInitStatic(&ErrInfo));1269 if (RT_FAILURE( rc))1270 return RTMsgErrorExit(RTEXITCODE_FAILURE, "failed to open release log (%s, %Rrc)", ErrInfo.Core.pszMsg, rc);1262 vrc = com::VBoxLogRelCreate("web service", pszLogFile, 1263 RTLOGFLAGS_PREFIX_THREAD | RTLOGFLAGS_PREFIX_TIME_PROG, 1264 "all", "VBOXWEBSRV_RELEASE_LOG", 1265 RTLOGDEST_FILE, UINT32_MAX /* cMaxEntriesPerGroup */, 1266 g_cHistory, g_uHistoryFileTime, g_uHistoryFileSize, 1267 RTErrInfoInitStatic(&ErrInfo)); 1268 if (RT_FAILURE(vrc)) 1269 return RTMsgErrorExit(RTEXITCODE_FAILURE, "failed to open release log (%s, %Rrc)", ErrInfo.Core.pszMsg, vrc); 1271 1270 } 1272 1271 #endif … … 1310 1309 if (FAILED(hrc)) 1311 1310 { 1312 RTMsgError("Failed to get VirtualBox object ( rc=%Rhrc)!", hrc);1311 RTMsgError("Failed to get VirtualBox object (hrc=%Rhrc)!", hrc); 1313 1312 return RTEXITCODE_FAILURE; 1314 1313 } … … 1345 1344 // SOAP queue pumper thread 1346 1345 RTTHREAD threadQPumper; 1347 rc = RTThreadCreate(&threadQPumper,1348 fntQPumper,1349 NULL, // pvUser1350 0, // cbStack (default)1351 RTTHREADTYPE_MAIN_WORKER,1352 RTTHREADFLAGS_WAITABLE,1353 "SQPmp");1354 if (RT_FAILURE( rc))1355 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Cannot start SOAP queue pumper thread: %Rrc", rc);1346 vrc = RTThreadCreate(&threadQPumper, 1347 fntQPumper, 1348 NULL, // pvUser 1349 0, // cbStack (default) 1350 RTTHREADTYPE_MAIN_WORKER, 1351 RTTHREADFLAGS_WAITABLE, 1352 "SQPmp"); 1353 if (RT_FAILURE(vrc)) 1354 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Cannot start SOAP queue pumper thread: %Rrc", vrc); 1356 1355 1357 1356 // watchdog thread … … 1360 1359 { 1361 1360 // start our watchdog thread 1362 rc = RTThreadCreate(&threadWatchdog,1363 fntWatchdog,1364 NULL,1365 0,1366 RTTHREADTYPE_MAIN_WORKER,1367 RTTHREADFLAGS_WAITABLE,1368 "Watchdog");1369 if (RT_FAILURE( rc))1370 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Cannot start watchdog thread: %Rrc", rc);1361 vrc = RTThreadCreate(&threadWatchdog, 1362 fntWatchdog, 1363 NULL, 1364 0, 1365 RTTHREADTYPE_MAIN_WORKER, 1366 RTTHREADFLAGS_WAITABLE, 1367 "Watchdog"); 1368 if (RT_FAILURE(vrc)) 1369 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Cannot start watchdog thread: %Rrc", vrc); 1371 1370 } 1372 1371 … … 1374 1373 if (!SetConsoleCtrlHandler((PHANDLER_ROUTINE)websrvSignalHandler, TRUE /* Add handler */)) 1375 1374 { 1376 rc = RTErrConvertFromWin32(GetLastError());1377 RTMsgError("Unable to install console control handler, rc=%Rrc\n",rc);1375 vrc = RTErrConvertFromWin32(GetLastError()); 1376 RTMsgError("Unable to install console control handler, vrc=%Rrc\n", vrc); 1378 1377 } 1379 1378 #else … … 1390 1389 // we have to process main event queue 1391 1390 WEBDEBUG(("Pumping COM event queue\n")); 1392 rc = pQ->processEventQueue(RT_INDEFINITE_WAIT);1393 if (RT_FAILURE( rc))1394 RTMsgError("processEventQueue -> %Rrc", rc);1391 vrc = pQ->processEventQueue(RT_INDEFINITE_WAIT); 1392 if (RT_FAILURE(vrc)) 1393 RTMsgError("processEventQueue -> %Rrc", vrc); 1395 1394 } 1396 1395 … … 1400 1399 if (!SetConsoleCtrlHandler((PHANDLER_ROUTINE)websrvSignalHandler, FALSE /* Remove handler */)) 1401 1400 { 1402 rc = RTErrConvertFromWin32(GetLastError());1403 RTMsgError("Unable to remove console control handler, rc=%Rrc\n",rc);1401 vrc = RTErrConvertFromWin32(GetLastError()); 1402 RTMsgError("Unable to remove console control handler, vrc=%Rrc\n", vrc); 1404 1403 } 1405 1404 #else … … 1654 1653 1655 1654 aStr.reserve(cchOut+1); 1656 int rc = RTBase64Encode(sfaData.raw(), cbData, 1657 aStr.mutableRaw(), aStr.capacity(), 1658 NULL); 1659 AssertRC(rc); 1655 int vrc = RTBase64Encode(sfaData.raw(), cbData, aStr.mutableRaw(), aStr.capacity(), NULL); 1656 AssertRC(vrc); 1660 1657 aStr.jolt(); 1661 1658 … … 1676 1673 1677 1674 com::SafeArray<BYTE> result(cbOut); 1678 int rc = RTBase64Decode(pszStr, result.raw(), cbOut, NULL, NULL);1679 if (FAILED( rc))1680 { 1681 LogRel(("String Decoding Failed. Error code: %Rrc\n", rc));1675 int vrc = RTBase64Decode(pszStr, result.raw(), cbOut, NULL, NULL); 1676 if (FAILED(vrc)) 1677 { 1678 LogRel(("String Decoding Failed. Error code: %Rrc\n", vrc)); 1682 1679 RaiseSoapRuntimeFault(soap, idThis, pszMethodName, E_INVALIDARG, pObj, iid); 1683 1680 } … … 1723 1720 1724 1721 // compose descriptive message 1725 com::Utf8Str str = com::Utf8StrFmt("VirtualBox error:rc=%#lx", apirc);1722 com::Utf8StrFmt str("VirtualBox error: apirc=%#lx", apirc); 1726 1723 if (info.isFullAvailable() || info.isBasicAvailable()) 1727 1724 { … … 1875 1872 IVirtualBox **ppVirtualBox) 1876 1873 { 1877 int rc = VERR_WEB_NOT_AUTHENTICATED;1874 int vrc = VERR_WEB_NOT_AUTHENTICATED; 1878 1875 ComPtr<IVirtualBox> pVirtualBox; 1879 1876 { … … 1882 1879 } 1883 1880 if (pVirtualBox.isNull()) 1884 return rc;1881 return vrc; 1885 1882 pVirtualBox.queryInterfaceTo(ppVirtualBox); 1886 1883 … … 1913 1910 { 1914 1911 if (RTPathHavePath(filename.c_str())) 1915 rc = RTLdrLoad(filename.c_str(), &hlibAuth);1912 vrc = RTLdrLoad(filename.c_str(), &hlibAuth); 1916 1913 else 1917 rc = RTLdrLoadAppPriv(filename.c_str(), &hlibAuth); 1918 1919 if (RT_FAILURE(rc)) 1914 vrc = RTLdrLoadAppPriv(filename.c_str(), &hlibAuth); 1915 if (RT_FAILURE(vrc)) 1920 1916 { 1921 1917 WEBDEBUG(("%s() Failed to load external authentication library '%s'. Error code: %Rrc\n", 1922 __FUNCTION__, filename.c_str(), rc));1918 __FUNCTION__, filename.c_str(), vrc)); 1923 1919 break; 1924 1920 } 1925 1921 1926 if (RT_FAILURE( rc = RTLdrGetSymbol(hlibAuth, AUTHENTRY3_NAME, (void**)&pfnAuthEntry3)))1922 if (RT_FAILURE(vrc = RTLdrGetSymbol(hlibAuth, AUTHENTRY3_NAME, (void**)&pfnAuthEntry3))) 1927 1923 { 1928 1924 WEBDEBUG(("%s(): Could not resolve import '%s'. Error code: %Rrc\n", 1929 __FUNCTION__, AUTHENTRY3_NAME, rc));1930 1931 if (RT_FAILURE( rc = RTLdrGetSymbol(hlibAuth, AUTHENTRY2_NAME, (void**)&pfnAuthEntry2)))1925 __FUNCTION__, AUTHENTRY3_NAME, vrc)); 1926 1927 if (RT_FAILURE(vrc = RTLdrGetSymbol(hlibAuth, AUTHENTRY2_NAME, (void**)&pfnAuthEntry2))) 1932 1928 { 1933 1929 WEBDEBUG(("%s(): Could not resolve import '%s'. Error code: %Rrc\n", 1934 __FUNCTION__, AUTHENTRY2_NAME, rc));1935 1936 if (RT_FAILURE( rc = RTLdrGetSymbol(hlibAuth, AUTHENTRY_NAME, (void**)&pfnAuthEntry)))1930 __FUNCTION__, AUTHENTRY2_NAME, vrc)); 1931 1932 if (RT_FAILURE(vrc = RTLdrGetSymbol(hlibAuth, AUTHENTRY_NAME, (void**)&pfnAuthEntry))) 1937 1933 WEBDEBUG(("%s(): Could not resolve import '%s'. Error code: %Rrc\n", 1938 __FUNCTION__, AUTHENTRY_NAME, rc));1934 __FUNCTION__, AUTHENTRY_NAME, vrc)); 1939 1935 } 1940 1936 } … … 1950 1946 { 1951 1947 LogRel(("Access denied, excessive username length: %zu\n", strlen(pcszUsername))); 1952 rc = VERR_WEB_NOT_AUTHENTICATED;1948 vrc = VERR_WEB_NOT_AUTHENTICATED; 1953 1949 } 1954 1950 else if (strlen(pcszPassword) >= _1K) 1955 1951 { 1956 1952 LogRel(("Access denied, excessive password length: %zu\n", strlen(pcszPassword))); 1957 rc = VERR_WEB_NOT_AUTHENTICATED;1953 vrc = VERR_WEB_NOT_AUTHENTICATED; 1958 1954 } 1959 1955 else if (pfnAuthEntry3 || pfnAuthEntry2 || pfnAuthEntry) … … 1981 1977 { 1982 1978 LogRel(("Access for user '%s' granted\n", pcszUsername)); 1983 rc = VINF_SUCCESS;1979 vrc = VINF_SUCCESS; 1984 1980 } 1985 1981 else … … 1987 1983 if (result == AuthResultAccessDenied) 1988 1984 LogRel(("Access for user '%s' denied\n", pcszUsername)); 1989 rc = VERR_WEB_NOT_AUTHENTICATED;1985 vrc = VERR_WEB_NOT_AUTHENTICATED; 1990 1986 } 1991 1987 } … … 1994 1990 // fAuthLibLoaded = true but all pointers are NULL: 1995 1991 // The authlib was "null" and auth was disabled 1996 rc = VINF_SUCCESS;1992 vrc = VINF_SUCCESS; 1997 1993 } 1998 1994 else 1999 1995 { 2000 1996 WEBDEBUG(("Could not resolve AuthEntry, VRDPAuth2 or VRDPAuth entry point")); 2001 rc = VERR_WEB_NOT_AUTHENTICATED;1997 vrc = VERR_WEB_NOT_AUTHENTICATED; 2002 1998 } 2003 1999 2004 2000 lock.release(); 2005 2001 2006 return rc;2002 return vrc; 2007 2003 } 2008 2004 … … 2232 2228 bool fNullAllowed) 2233 2229 { 2234 int rc = 0;2230 int vrc = VINF_SUCCESS; 2235 2231 2236 2232 do … … 2250 2246 &objId)) 2251 2247 { 2252 rc = VERR_WEB_INVALID_MANAGED_OBJECT_REFERENCE;2248 vrc = VERR_WEB_INVALID_MANAGED_OBJECT_REFERENCE; 2253 2249 break; 2254 2250 } … … 2258 2254 { 2259 2255 WEBDEBUG((" %s: cannot find websession for objref %s\n", __FUNCTION__, id.c_str())); 2260 rc = VERR_WEB_INVALID_SESSION_ID;2256 vrc = VERR_WEB_INVALID_SESSION_ID; 2261 2257 break; 2262 2258 } … … 2270 2266 { 2271 2267 WEBDEBUG((" %s: cannot find comobj for objref %s\n", __FUNCTION__, id.c_str())); 2272 rc = VERR_WEB_INVALID_OBJECT_ID;2268 vrc = VERR_WEB_INVALID_OBJECT_ID; 2273 2269 break; 2274 2270 } … … 2278 2274 } while (0); 2279 2275 2280 return rc;2276 return vrc; 2281 2277 } 2282 2278 … … 2304 2300 { 2305 2301 RT_NOREF(soap); 2306 HRESULT rc = S_OK;2302 HRESULT hrc = S_OK; /** @todo r=bird: hrc is not set.... */ 2307 2303 WEBDEBUG(("-- entering %s\n", __FUNCTION__)); 2308 2304 … … 2318 2314 } while (0); 2319 2315 2320 WEBDEBUG(("-- leaving %s, rc: %#lx\n", __FUNCTION__,rc));2321 if (FAILED( rc))2316 WEBDEBUG(("-- leaving %s, hrc: %#lx\n", __FUNCTION__, hrc)); 2317 if (FAILED(hrc)) 2322 2318 return SOAP_FAULT; 2323 2319 return SOAP_OK; … … 2340 2336 { 2341 2337 RT_NOREF(resp); 2342 HRESULT rc;2338 HRESULT hrc; 2343 2339 WEBDEBUG(("-- entering %s\n", __FUNCTION__)); 2344 2340 … … 2348 2344 2349 2345 ManagedObjectRef *pRef; 2350 rc = ManagedObjectRef::findRefFromId(req->_USCOREthis, &pRef, false);2351 if ( rc == S_OK)2346 hrc = ManagedObjectRef::findRefFromId(req->_USCOREthis, &pRef, false); 2347 if (hrc == S_OK) 2352 2348 { 2353 2349 WEBDEBUG((" found reference; deleting!\n")); … … 2362 2358 } 2363 2359 2364 WEBDEBUG(("-- leaving %s, rc: %#lx\n", __FUNCTION__,rc));2365 if (FAILED( rc))2360 WEBDEBUG(("-- leaving %s, hrc: %#lx\n", __FUNCTION__, hrc)); 2361 if (FAILED(hrc)) 2366 2362 return SOAP_FAULT; 2367 2363 return SOAP_OK; … … 2405 2401 { 2406 2402 RT_NOREF(soap); 2407 HRESULT rc = S_OK;2403 HRESULT hrc = S_OK; 2408 2404 WEBDEBUG(("-- entering %s\n", __FUNCTION__)); 2409 2405 … … 2436 2432 } 2437 2433 else 2438 rc = E_FAIL;2434 hrc = E_FAIL; 2439 2435 } while (0); 2440 2436 2441 WEBDEBUG(("-- leaving %s, rc: %#lx\n", __FUNCTION__,rc));2442 if (FAILED( rc))2437 WEBDEBUG(("-- leaving %s, hrc: %#lx\n", __FUNCTION__, hrc)); 2438 if (FAILED(hrc)) 2443 2439 return SOAP_FAULT; 2444 2440 return SOAP_OK; … … 2456 2452 _vbox__IWebsessionManager_USCOREgetSessionObjectResponse *resp) 2457 2453 { 2458 HRESULT rc = S_OK;2454 HRESULT hrc = S_OK; 2459 2455 WEBDEBUG(("-- entering %s\n", __FUNCTION__)); 2460 2456 … … 2463 2459 // create a new ISession object 2464 2460 ComPtr<ISession> pSession; 2465 rc = g_pVirtualBoxClient->COMGETTER(Session)(pSession.asOutParam());2466 if (FAILED( rc))2461 hrc = g_pVirtualBoxClient->COMGETTER(Session)(pSession.asOutParam()); 2462 if (FAILED(hrc)) 2467 2463 { 2468 2464 WEBDEBUG(("ERROR: cannot create session object!")); … … 2475 2471 } while (0); 2476 2472 2477 WEBDEBUG(("-- leaving %s, rc: %#lx\n", __FUNCTION__,rc));2478 if (FAILED( rc))2473 WEBDEBUG(("-- leaving %s, hrc: %#lx\n", __FUNCTION__, hrc)); 2474 if (FAILED(hrc)) 2479 2475 return SOAP_FAULT; 2480 2476 return SOAP_OK; … … 2494 2490 { 2495 2491 RT_NOREF(resp); 2496 HRESULT rc = S_OK;2492 HRESULT hrc = S_OK; 2497 2493 WEBDEBUG(("-- entering %s\n", __FUNCTION__)); 2498 2494 … … 2512 2508 } 2513 2509 2514 WEBDEBUG(("-- leaving %s, rc: %#lx\n", __FUNCTION__,rc));2515 if (FAILED( rc))2510 WEBDEBUG(("-- leaving %s, hrc: %#lx\n", __FUNCTION__, hrc)); 2511 if (FAILED(hrc)) 2516 2512 return SOAP_FAULT; 2517 2513 return SOAP_OK; -
trunk/src/VBox/Main/webservice/vboxweb.h
r98103 r98297 275 275 util::AutoWriteLock lock(g_pWebsessionsLockHandle COMMA_LOCKVAL_SRC_POS); 276 276 277 int rc;278 277 ManagedObjectRef *pRef; 279 if ((rc = ManagedObjectRef::findRefFromId(id, &pRef, fNullAllowed))) 278 int vrc = ManagedObjectRef::findRefFromId(id, &pRef, fNullAllowed); 279 if (vrc != VINF_SUCCESS) 280 280 // error: 281 281 RaiseSoapInvalidObjectFault(soap, id); … … 286 286 WEBDEBUG((" %s(): returning NULL object as permitted\n", __FUNCTION__)); 287 287 pComPtr.setNull(); 288 return 0;288 return VINF_SUCCESS; 289 289 } 290 290 … … 301 301 WEBDEBUG((" %s(): returning original %s*=0x%lX (IUnknown*=0x%lX)\n", __FUNCTION__, pRef->getInterfaceName(), pobjInterface, pobjUnknown)); 302 302 pComPtr = (T*)pobjInterface; // this calls AddRef() once 303 return 0;303 return VINF_SUCCESS; 304 304 } 305 305 … … 312 312 WEBDEBUG((" %s(): returning pointer 0x%lX for queried interface %RTuuid (IUnknown*=0x%lX)\n", __FUNCTION__, pT, guidCaller.raw(), pobjUnknown)); 313 313 *(pComPtr.asOutParam()) = pT; 314 return 0;314 return VINF_SUCCESS; 315 315 } 316 316 317 317 WEBDEBUG((" Interface not supported for object reference %s, which is of class %s\n", id.c_str(), pRef->getInterfaceName())); 318 rc = VERR_WEB_UNSUPPORTED_INTERFACE;318 vrc = VERR_WEB_UNSUPPORTED_INTERFACE; 319 319 RaiseSoapInvalidObjectFault(soap, id); // @todo better message 320 320 } 321 321 322 return rc;322 return vrc; 323 323 } 324 324 -
trunk/src/VBox/Main/webservice/webtest.cpp
r98103 r98297 94 94 95 95 /* SSL callbacks drag in IPRT sem/thread use, so make sure it is ready. */ 96 int rc = RTR3InitExe(argc, &argv, 0);97 if (RT_FAILURE( rc))98 return RTMsgInitFailure( rc);96 int vrc = RTR3InitExe(argc, &argv, 0); 97 if (RT_FAILURE(vrc)) 98 return RTMsgInitFailure(vrc); 99 99 100 100 int ap; -
trunk/src/VBox/Main/xml/Settings.cpp
r98103 r98297 497 497 ) 498 498 { 499 int rc;500 if ( (RT_SUCCESS( rc = RTStrToInt32Ex(pcsz, NULL, 0, &yyyy)))499 int vrc; 500 if ( (RT_SUCCESS(vrc = RTStrToInt32Ex(pcsz, NULL, 0, &yyyy))) 501 501 // could theoretically be negative but let's assume that nobody 502 502 // created virtual machines before the Christian era 503 && (RT_SUCCESS( rc = RTStrToUInt32Ex(pcsz + 5, NULL, 0, &mm)))504 && (RT_SUCCESS( rc = RTStrToUInt32Ex(pcsz + 8, NULL, 0, &dd)))505 && (RT_SUCCESS( rc = RTStrToUInt32Ex(pcsz + 11, NULL, 0, &hh)))506 && (RT_SUCCESS( rc = RTStrToUInt32Ex(pcsz + 14, NULL, 0, &min)))507 && (RT_SUCCESS( rc = RTStrToUInt32Ex(pcsz + 17, NULL, 0, &secs)))503 && (RT_SUCCESS(vrc = RTStrToUInt32Ex(pcsz + 5, NULL, 0, &mm))) 504 && (RT_SUCCESS(vrc = RTStrToUInt32Ex(pcsz + 8, NULL, 0, &dd))) 505 && (RT_SUCCESS(vrc = RTStrToUInt32Ex(pcsz + 11, NULL, 0, &hh))) 506 && (RT_SUCCESS(vrc = RTStrToUInt32Ex(pcsz + 14, NULL, 0, &min))) 507 && (RT_SUCCESS(vrc = RTStrToUInt32Ex(pcsz + 17, NULL, 0, &secs))) 508 508 ) 509 509 { … … 527 527 } 528 528 529 throw ConfigFileError(this, pElm, N_("Cannot parse ISO timestamp '%s': runtime error, %Rra"), str.c_str(), rc);529 throw ConfigFileError(this, pElm, N_("Cannot parse ISO timestamp '%s': runtime error, %Rra"), str.c_str(), vrc); 530 530 } 531 531 … … 2274 2274 if (pszEnd) 2275 2275 { 2276 int rc = RTStrToUInt16Ex(RTStrStripL(pszEnd + 1), NULL, 10, &uPort);2277 if (RT_FAILURE( rc))2276 int vrc = RTStrToUInt16Ex(RTStrStripL(pszEnd + 1), NULL, 10, &uPort); 2277 if (RT_FAILURE(vrc)) 2278 2278 uPort = 1080; 2279 2279 } 2280 2280 RTURIPARSED Parsed; 2281 int rc = RTUriParse(systemProperties.strProxyUrl.c_str(), &Parsed);2282 if (RT_SUCCESS( rc))2281 int vrc = RTUriParse(systemProperties.strProxyUrl.c_str(), &Parsed); 2282 if (RT_SUCCESS(vrc)) 2283 2283 { 2284 2284 if (Parsed.uAuthorityPort == UINT32_MAX) … … 5010 5010 * placing it to local cache. */ 5011 5011 5012 int rc = GuestPropValidateName(prop.strName.c_str(), prop.strName.length() + 1 /* '\0' */);5013 if (RT_FAILURE( rc))5012 int vrc = GuestPropValidateName(prop.strName.c_str(), prop.strName.length() + 1 /* '\0' */); 5013 if (RT_FAILURE(vrc)) 5014 5014 { 5015 5015 LogRel(("WARNING: Guest property with invalid name (%s) present in VM configuration file. Guest property will be dropped.\n", … … 5018 5018 } 5019 5019 5020 rc = GuestPropValidateValue(prop.strValue.c_str(), prop.strValue.length() + 1 /* '\0' */);5021 if ( rc == VERR_TOO_MUCH_DATA)5020 vrc = GuestPropValidateValue(prop.strValue.c_str(), prop.strValue.length() + 1 /* '\0' */); 5021 if (vrc == VERR_TOO_MUCH_DATA) 5022 5022 { 5023 5023 LogRel(("WARNING: Guest property '%s' present in VM configuration file and has too long value. Guest property value will be truncated.\n", … … 5028 5028 prop.strValue.truncate(GUEST_PROP_MAX_VALUE_LEN - 1 /*terminator*/); 5029 5029 } 5030 else if (RT_FAILURE( rc))5030 else if (RT_FAILURE(vrc)) 5031 5031 { 5032 5032 LogRel(("WARNING: Guest property '%s' present in VM configuration file and has invalid value. Guest property will be dropped.\n", … … 6763 6763 6764 6764 VBOXCRYPTOCTX hCryptoCtx = NULL; 6765 int rc = pCryptoIf->pfnCryptoCtxLoad(strKeyStore.c_str(), pszPassword, &hCryptoCtx);6766 if (RT_SUCCESS( rc))6765 int vrc = pCryptoIf->pfnCryptoCtxLoad(strKeyStore.c_str(), pszPassword, &hCryptoCtx); 6766 if (RT_SUCCESS(vrc)) 6767 6767 { 6768 6768 com::Utf8Str str = elmMachine.getValue(); … … 6773 6773 parseBase64(abEncrypted, str, &elmMachine); 6774 6774 } 6775 catch (...)6776 { 6777 int rc2 = pCryptoIf->pfnCryptoCtxDestroy(hCryptoCtx);6778 AssertRC( rc2);6775 catch (...) 6776 { 6777 int vrc2 = pCryptoIf->pfnCryptoCtxDestroy(hCryptoCtx); 6778 AssertRC(vrc2); 6779 6779 throw; 6780 6780 } … … 6782 6782 IconBlob abDecrypted(abEncrypted.size()); 6783 6783 size_t cbDecrypted = 0; 6784 rc = pCryptoIf->pfnCryptoCtxDecrypt(hCryptoCtx, false /*fPartial*/,6785 &abEncrypted[0], abEncrypted.size(),6786 uuid.raw(), sizeof(RTUUID),6787 &abDecrypted[0], abDecrypted.size(), &cbDecrypted);6788 int rc2 = pCryptoIf->pfnCryptoCtxDestroy(hCryptoCtx);6789 AssertRC( rc2);6790 6791 if (RT_SUCCESS( rc))6784 vrc = pCryptoIf->pfnCryptoCtxDecrypt(hCryptoCtx, false /*fPartial*/, 6785 &abEncrypted[0], abEncrypted.size(), 6786 uuid.raw(), sizeof(RTUUID), 6787 &abDecrypted[0], abDecrypted.size(), &cbDecrypted); 6788 int vrc2 = pCryptoIf->pfnCryptoCtxDestroy(hCryptoCtx); 6789 AssertRC(vrc2); 6790 6791 if (RT_SUCCESS(vrc)) 6792 6792 { 6793 6793 abDecrypted.resize(cbDecrypted); … … 6803 6803 } 6804 6804 6805 if (RT_FAILURE( rc))6806 { 6807 if ( rc == VERR_ACCESS_DENIED)6805 if (RT_FAILURE(vrc)) 6806 { 6807 if (vrc == VERR_ACCESS_DENIED) 6808 6808 enmParseState = ParseState_PasswordError; 6809 6809 else 6810 throw ConfigFileError(this, &elmMachine, N_("Parsing config failed. (%Rrc)"), rc);6810 throw ConfigFileError(this, &elmMachine, N_("Parsing config failed. (%Rrc)"), vrc); 6811 6811 } 6812 6812 } … … 8804 8804 xml::XmlStringWriter writer; 8805 8805 com::Utf8Str strMachineXml; 8806 int rc = writer.write(*pDoc, &strMachineXml);8806 int vrc = writer.write(*pDoc, &strMachineXml); 8807 8807 delete pDoc; 8808 if (RT_SUCCESS( rc))8808 if (RT_SUCCESS(vrc)) 8809 8809 { 8810 8810 VBOXCRYPTOCTX hCryptoCtx; 8811 8811 if (strKeyStore.isEmpty()) 8812 8812 { 8813 rc = pCryptoIf->pfnCryptoCtxCreate("AES-GCM256", pszPassword, &hCryptoCtx);8814 if (RT_SUCCESS( rc))8813 vrc = pCryptoIf->pfnCryptoCtxCreate("AES-GCM256", pszPassword, &hCryptoCtx); 8814 if (RT_SUCCESS(vrc)) 8815 8815 { 8816 8816 char *pszNewKeyStore; 8817 rc = pCryptoIf->pfnCryptoCtxSave(hCryptoCtx, &pszNewKeyStore);8818 if (RT_SUCCESS( rc))8817 vrc = pCryptoIf->pfnCryptoCtxSave(hCryptoCtx, &pszNewKeyStore); 8818 if (RT_SUCCESS(vrc)) 8819 8819 { 8820 8820 strKeyStore = pszNewKeyStore; … … 8826 8826 } 8827 8827 else 8828 rc = pCryptoIf->pfnCryptoCtxLoad(strKeyStore.c_str(), pszPassword, &hCryptoCtx);8829 if (RT_SUCCESS( rc))8828 vrc = pCryptoIf->pfnCryptoCtxLoad(strKeyStore.c_str(), pszPassword, &hCryptoCtx); 8829 if (RT_SUCCESS(vrc)) 8830 8830 { 8831 8831 IconBlob abEncrypted; 8832 8832 size_t cbEncrypted = 0; 8833 rc = pCryptoIf->pfnCryptoCtxQueryEncryptedSize(hCryptoCtx, strMachineXml.length(), &cbEncrypted);8834 if (RT_SUCCESS( rc))8833 vrc = pCryptoIf->pfnCryptoCtxQueryEncryptedSize(hCryptoCtx, strMachineXml.length(), &cbEncrypted); 8834 if (RT_SUCCESS(vrc)) 8835 8835 { 8836 8836 abEncrypted.resize(cbEncrypted); 8837 rc = pCryptoIf->pfnCryptoCtxEncrypt(hCryptoCtx, false /*fPartial*/, NULL /*pvIV*/, 0 /*cbIV*/,8838 strMachineXml.c_str(), strMachineXml.length(),8839 uuid.raw(), sizeof(RTUUID),8840 &abEncrypted[0], abEncrypted.size(), &cbEncrypted);8841 int rc2 = pCryptoIf->pfnCryptoCtxDestroy(hCryptoCtx);8842 AssertRC( rc2);8843 if (RT_SUCCESS( rc))8837 vrc = pCryptoIf->pfnCryptoCtxEncrypt(hCryptoCtx, false /*fPartial*/, NULL /*pvIV*/, 0 /*cbIV*/, 8838 strMachineXml.c_str(), strMachineXml.length(), 8839 uuid.raw(), sizeof(RTUUID), 8840 &abEncrypted[0], abEncrypted.size(), &cbEncrypted); 8841 int vrc2 = pCryptoIf->pfnCryptoCtxDestroy(hCryptoCtx); 8842 AssertRC(vrc2); 8843 if (RT_SUCCESS(vrc)) 8844 8844 { 8845 8845 abEncrypted.resize(cbEncrypted); … … 8853 8853 } 8854 8854 8855 if (RT_FAILURE( rc))8856 throw ConfigFileError(this, &elmMachine, N_("Creating machine encrypted xml failed. (%Rrc)"), rc);8855 if (RT_FAILURE(vrc)) 8856 throw ConfigFileError(this, &elmMachine, N_("Creating machine encrypted xml failed. (%Rrc)"), vrc); 8857 8857 } 8858 8858 else 8859 throw ConfigFileError(this, &elmMachine, N_("Creating machine xml failed. (%Rrc)"), rc);8859 throw ConfigFileError(this, &elmMachine, N_("Creating machine xml failed. (%Rrc)"), vrc); 8860 8860 } 8861 8861
Note:
See TracChangeset
for help on using the changeset viewer.

