Changeset 39248 in vbox for trunk/src/VBox/Main/src-client
- Timestamp:
- Nov 9, 2011 12:29:53 PM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 74778
- Location:
- trunk/src/VBox/Main/src-client
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r39242 r39248 69 69 #include "BusAssignmentManager.h" 70 70 71 // generated header72 #include "SchemaDefs.h"73 71 #include "VBoxEvents.h" 74 72 #include "AutoCaller.h" … … 379 377 , mMachineState(MachineState_PoweredOff) 380 378 { 381 for (ULONG slot = 0; slot < SchemaDefs::NetworkAdapterCount; ++slot)382 meAttachmentType[slot] = NetworkAttachmentType_Null;383 379 } 384 380 … … 395 391 memset(&mapSharedFolderLed, 0, sizeof(mapSharedFolderLed)); 396 392 397 for (unsigned i = 0; i < RT_ELEMENTS(maStorageDevType); ++ 393 for (unsigned i = 0; i < RT_ELEMENTS(maStorageDevType); ++i) 398 394 maStorageDevType[i] = DeviceType_Null; 399 395 … … 501 497 mcGuestCredentialsProvided = false; 502 498 499 /* Figure out size of meAttachmentType vector */ 500 ComPtr<IVirtualBox> pVirtualBox; 501 rc = aMachine->COMGETTER(Parent)(pVirtualBox.asOutParam()); 502 AssertComRC(rc); 503 ComPtr<ISystemProperties> pSystemProperties; 504 if (pVirtualBox) 505 pVirtualBox->COMGETTER(SystemProperties)(pSystemProperties.asOutParam()); 506 ChipsetType_T chipsetType = ChipsetType_PIIX3; 507 aMachine->COMGETTER(ChipsetType)(&chipsetType); 508 ULONG maxNetworkAdapters = 0; 509 if (pSystemProperties) 510 pSystemProperties->GetMaxNetworkAdapters(chipsetType, &maxNetworkAdapters); 511 meAttachmentType.resize(maxNetworkAdapters); 512 for (ULONG slot = 0; slot < SchemaDefs::NetworkAdapterCount; ++slot) 513 meAttachmentType[slot] = NetworkAttachmentType_Null; 514 515 503 516 // VirtualBox 4.0: We no longer initialize the VMMDev instance here, 504 517 // which starts the HGCM thread. Instead, this is now done in the … … 518 531 /* VirtualBox events registration. */ 519 532 { 520 ComPtr<IVirtualBox> pVirtualBox;521 rc = aMachine->COMGETTER(Parent)(pVirtualBox.asOutParam());522 AssertComRC(rc);523 524 533 ComPtr<IEventSource> pES; 525 534 rc = pVirtualBox->COMGETTER(EventSource)(pES.asOutParam()); … … 1329 1338 for (SharedFolderMap::const_iterator it = that->m_mapSharedFolders.begin(); 1330 1339 it != that->m_mapSharedFolders.end(); 1331 ++ 1340 ++it) 1332 1341 { 1333 1342 SharedFolder *pSF = (*it).second; … … 1409 1418 AssertRCReturn(vrc, vrc); 1410 1419 1411 for (uint32_t i = 0; i < size; ++ 1420 for (uint32_t i = 0; i < size; ++i) 1412 1421 { 1413 1422 Utf8Str strName; … … 2846 2855 break; 2847 2856 } 2848 ++ 2857 ++it; 2849 2858 } 2850 2859 … … 4469 4478 AssertReturn(pThis, VERR_INVALID_PARAMETER); 4470 4479 4480 AutoCaller autoCaller(pThis); 4481 AssertComRCReturn(autoCaller.rc(), VERR_ACCESS_DENIED); 4482 4483 ComPtr<IVirtualBox> pVirtualBox; 4484 pThis->mMachine->COMGETTER(Parent)(pVirtualBox.asOutParam()); 4485 ComPtr<ISystemProperties> pSystemProperties; 4486 if (pVirtualBox) 4487 pVirtualBox->COMGETTER(SystemProperties)(pSystemProperties.asOutParam()); 4488 ChipsetType_T chipsetType = ChipsetType_PIIX3; 4489 pThis->mMachine->COMGETTER(ChipsetType)(&chipsetType); 4490 ULONG maxNetworkAdapters = 0; 4491 if (pSystemProperties) 4492 pSystemProperties->GetMaxNetworkAdapters(chipsetType, &maxNetworkAdapters); 4471 4493 AssertMsg( ( !strcmp(pszDevice, "pcnet") 4472 4494 || !strcmp(pszDevice, "e1000") 4473 4495 || !strcmp(pszDevice, "virtio-net")) 4474 4496 && uLun == 0 4475 && uInstance < SchemaDefs::NetworkAdapterCount,4497 && uInstance < maxNetworkAdapters, 4476 4498 ("pszDevice=%s uLun=%d uInstance=%d\n", pszDevice, uLun, uInstance)); 4477 4499 Log(("pszDevice=%s uLun=%d uInstance=%d\n", pszDevice, uLun, uInstance)); 4478 4479 AutoCaller autoCaller(pThis);4480 AssertComRCReturn(autoCaller.rc(), VERR_ACCESS_DENIED);4481 4500 4482 4501 /* … … 4994 5013 break; 4995 5014 } 4996 ++ 5015 ++it; 4997 5016 } 4998 5017 … … 6004 6023 Utf8Str oldName, newName; 6005 6024 6006 for (unsigned int j = 0; j < RT_ELEMENTS(files); ++ 6025 for (unsigned int j = 0; j < RT_ELEMENTS(files); ++j) 6007 6026 { 6008 6027 if (i > 0) … … 6231 6250 /* the network cards will undergo a quick consistency check */ 6232 6251 for (ULONG slot = 0; 6233 slot < SchemaDefs::NetworkAdapterCount;6252 slot < maxNetworkAdapters; 6234 6253 ++slot) 6235 6254 { … … 6671 6690 /* advance percent count */ 6672 6691 if (aProgress) 6673 aProgress->SetCurrentOperationProgress(99 * (++ 6692 aProgress->SetCurrentOperationProgress(99 * (++step) / StepCount ); 6674 6693 6675 6694 … … 6701 6720 /* advance percent count */ 6702 6721 if (aProgress) 6703 aProgress->SetCurrentOperationProgress(99 * (++ 6722 aProgress->SetCurrentOperationProgress(99 * (++step) / StepCount ); 6704 6723 6705 6724 vrc = VINF_SUCCESS; … … 6726 6745 /* advance percent count */ 6727 6746 if (aProgress) 6728 aProgress->SetCurrentOperationProgress(99 * (++ 6747 aProgress->SetCurrentOperationProgress(99 * (++step) / StepCount ); 6729 6748 6730 6749 #ifdef VBOX_WITH_HGCM … … 6744 6763 /* advance percent count */ 6745 6764 if (aProgress) 6746 aProgress->SetCurrentOperationProgress(99 * (++ step) / StepCount);6765 aProgress->SetCurrentOperationProgress(99 * (++step) / StepCount); 6747 6766 6748 6767 #endif /* VBOX_WITH_HGCM */ … … 6790 6809 /* advance percent count */ 6791 6810 if (aProgress) 6792 aProgress->SetCurrentOperationProgress(99 * (++ step) / StepCount);6811 aProgress->SetCurrentOperationProgress(99 * (++step) / StepCount); 6793 6812 6794 6813 if (RT_SUCCESS(vrc)) … … 6820 6839 /* advance percent count */ 6821 6840 if (aProgress) 6822 aProgress->SetCurrentOperationProgress(99 * (++ step) / StepCount);6841 aProgress->SetCurrentOperationProgress(99 * (++step) / StepCount); 6823 6842 } 6824 6843 else … … 7047 7066 { 7048 7067 for (SharedFolderDataMap::const_iterator it = oldFolders.begin(); 7049 it != oldFolders.end(); ++ 7068 it != oldFolders.end(); ++it) 7050 7069 { 7051 7070 if (m_mapSharedFolders.find(it->first) != m_mapSharedFolders.end()) … … 8086 8105 * host interface termination handling 8087 8106 */ 8088 HRESULT rc; 8089 for (ULONG slot = 0; slot < SchemaDefs::NetworkAdapterCount; slot ++) 8107 HRESULT rc = S_OK; 8108 ComPtr<IVirtualBox> pVirtualBox; 8109 mMachine->COMGETTER(Parent)(pVirtualBox.asOutParam()); 8110 ComPtr<ISystemProperties> pSystemProperties; 8111 if (pVirtualBox) 8112 pVirtualBox->COMGETTER(SystemProperties)(pSystemProperties.asOutParam()); 8113 ChipsetType_T chipsetType = ChipsetType_PIIX3; 8114 mMachine->COMGETTER(ChipsetType)(&chipsetType); 8115 ULONG maxNetworkAdapters = 0; 8116 if (pSystemProperties) 8117 pSystemProperties->GetMaxNetworkAdapters(chipsetType, &maxNetworkAdapters); 8118 8119 for (ULONG slot = 0; slot < maxNetworkAdapters; slot++) 8090 8120 { 8091 8121 ComPtr<INetworkAdapter> pNetworkAdapter; … … 8393 8423 } 8394 8424 8395 ++ 8425 ++it; 8396 8426 } 8397 8427 … … 8498 8528 for (VMPowerUpTask::ProgressList::const_iterator 8499 8529 it = task->hardDiskProgresses.begin(); 8500 it != task->hardDiskProgresses.end(); ++ 8530 it != task->hardDiskProgresses.end(); ++it) 8501 8531 { 8502 8532 HRESULT rc2 = (*it)->WaitForCompletion(-1); -
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r38873 r39248 756 756 BOOL fOsXGuest = guestTypeFamilyId == Bstr("MacOS"); 757 757 758 ULONG maxNetworkAdapters; 759 hrc = systemProperties->GetMaxNetworkAdapters(chipsetType, &maxNetworkAdapters); H(); 758 760 /* 759 761 * Get root node first. … … 1710 1712 #endif /* VBOX_WITH_VIRTIO */ 1711 1713 std::list<BootNic> llBootNics; 1712 for (ULONG ulInstance = 0; ulInstance < SchemaDefs::NetworkAdapterCount; ++ulInstance)1714 for (ULONG ulInstance = 0; ulInstance < maxNetworkAdapters; ++ulInstance) 1713 1715 { 1714 1716 ComPtr<INetworkAdapter> networkAdapter; -
trunk/src/VBox/Main/src-client/GuestImpl.cpp
r37930 r39248 141 141 ///////////////////////////////////////////////////////////////////////////// 142 142 143 STDMETHODIMP Guest::COMGETTER(OSTypeId) 143 STDMETHODIMP Guest::COMGETTER(OSTypeId)(BSTR *aOSTypeId) 144 144 { 145 145 CheckComArgOutPointerValid(aOSTypeId); … … 602 602 * its real status when using new(er) Guest Additions. 603 603 */ 604 mData.mOSTypeId = Global::OSTypeId 604 mData.mOSTypeId = Global::OSTypeId(aOsType); 605 605 } 606 606
Note:
See TracChangeset
for help on using the changeset viewer.