Changeset 49452 in vbox for trunk/src/VBox
- Timestamp:
- Nov 12, 2013 1:10:55 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/testcase/tstVBoxAPIXPCOM.cpp
r48164 r49452 167 167 machine->GetOSTypeId(getter_Copies(typeId)); 168 168 IGuestOSType *osType = nsnull; 169 virtualBox->GetGuestOSType 169 virtualBox->GetGuestOSType(typeId.get(), &osType); 170 170 nsXPIDLString osName; 171 171 osType->GetDescription(getter_Copies(osName)); … … 235 235 else 236 236 { 237 machine->SetOSTypeId 237 machine->SetOSTypeId(NS_LITERAL_STRING("Windows2000").get()); 238 238 } 239 239 … … 264 264 { 265 265 nsCOMPtr<nsIComponentManager> manager; 266 rc = NS_GetComponentManager (getter_AddRefs(manager));266 rc = NS_GetComponentManager(getter_AddRefs(manager)); 267 267 if (NS_FAILED(rc)) 268 268 { … … 270 270 return; 271 271 } 272 rc = manager->CreateInstanceByContractID 273 274 275 272 rc = manager->CreateInstanceByContractID(NS_SESSION_CONTRACTID, 273 nsnull, 274 NS_GET_IID(ISession), 275 getter_AddRefs(session)); 276 276 if (NS_FAILED(rc)) 277 277 { … … 318 318 * a dynamically expanding image. 319 319 */ 320 nsCOMPtr 320 nsCOMPtr<IProgress> progress; 321 321 com::SafeArray<MediumVariant_T> mediumVariant; 322 322 mediumVariant.push_back(MediumVariant_Standard); … … 396 396 * Last step: tell the VM to boot from the CD. 397 397 */ 398 rc = sessionMachine->SetBootOrder 398 rc = sessionMachine->SetBootOrder(1, DeviceType::DVD); 399 399 if (NS_FAILED(rc)) 400 400 { … … 505 505 */ 506 506 nsCOMPtr<nsIEventQueue> eventQ; 507 rc = NS_GetMainEventQ(getter_AddRefs 507 rc = NS_GetMainEventQ(getter_AddRefs(eventQ)); 508 508 if (NS_FAILED(rc)) 509 509 { … … 521 521 */ 522 522 nsCOMPtr<nsIComponentManager> manager; 523 rc = NS_GetComponentManager (getter_AddRefs(manager));523 rc = NS_GetComponentManager(getter_AddRefs(manager)); 524 524 if (NS_FAILED(rc)) 525 525 { … … 529 529 530 530 nsCOMPtr<IVirtualBox> virtualBox; 531 rc = manager->CreateInstanceByContractID 532 533 534 531 rc = manager->CreateInstanceByContractID(NS_VIRTUALBOX_CONTRACTID, 532 nsnull, 533 NS_GET_IID(IVirtualBox), 534 getter_AddRefs(virtualBox)); 535 535 if (NS_FAILED(rc)) 536 536 { … … 607 607 nsresult rc; 608 608 609 nsCOMPtr 610 es = do_GetService 609 nsCOMPtr<nsIExceptionService> es; 610 es = do_GetService(NS_EXCEPTIONSERVICE_CONTRACTID, &rc); 611 611 if (NS_SUCCEEDED(rc)) 612 612 { 613 nsCOMPtr 614 rc = es->GetCurrentExceptionManager (getter_AddRefs(em));613 nsCOMPtr<nsIExceptionManager> em; 614 rc = es->GetCurrentExceptionManager(getter_AddRefs(em)); 615 615 if (NS_SUCCEEDED(rc)) 616 616 { 617 617 nsCOMPtr<nsIException> ex; 618 rc = em->GetCurrentException (getter_AddRefs(ex));618 rc = em->GetCurrentException(getter_AddRefs(ex)); 619 619 if (NS_SUCCEEDED(rc) && ex) 620 620 { 621 nsCOMPtr 621 nsCOMPtr<IVirtualBoxErrorInfo> info; 622 622 info = do_QueryInterface(ex, &rc); 623 623 if (NS_SUCCEEDED(rc) && info) 624 624 { 625 625 /* got extended error info */ 626 RTPrintf 626 RTPrintf("Extended error info (IVirtualBoxErrorInfo):\n"); 627 627 PRInt32 resultCode = NS_OK; 628 info->GetResultCode 629 RTPrintf 628 info->GetResultCode(&resultCode); 629 RTPrintf(" resultCode=%08X\n", resultCode); 630 630 nsXPIDLString component; 631 info->GetComponent (getter_Copies(component));632 RTPrintf 631 info->GetComponent(getter_Copies(component)); 632 RTPrintf(" component=%s\n", NS_ConvertUTF16toUTF8(component).get()); 633 633 nsXPIDLString text; 634 info->GetText (getter_Copies(text));635 RTPrintf 634 info->GetText(getter_Copies(text)); 635 RTPrintf(" text=%s\n", NS_ConvertUTF16toUTF8(text).get()); 636 636 } 637 637 else 638 638 { 639 639 /* got basic error info */ 640 RTPrintf 640 RTPrintf("Basic error info (nsIException):\n"); 641 641 nsresult resultCode = NS_OK; 642 ex->GetResult 643 RTPrintf 642 ex->GetResult(&resultCode); 643 RTPrintf(" resultCode=%08X\n", resultCode); 644 644 nsXPIDLCString message; 645 ex->GetMessage (getter_Copies(message));646 RTPrintf 645 ex->GetMessage(getter_Copies(message)); 646 RTPrintf(" message=%s\n", message.get()); 647 647 } 648 648 649 649 /* reset the exception to NULL to indicate we've processed it */ 650 em->SetCurrentException 650 em->SetCurrentException(NULL); 651 651 652 652 rc = NS_OK;
Note:
See TracChangeset
for help on using the changeset viewer.