Changeset 85277 in vbox for trunk/src/VBox/Main/src-server
- Timestamp:
- Jul 12, 2020 1:58:25 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/UnattendedImpl.cpp
r84993 r85277 56 56 StorageBus_T enmBus; 57 57 Utf8Str strControllerName; 58 ULONG uPort;59 ULONG uDevice;58 LONG iPort; 59 LONG iDevice; 60 60 bool fFree; 61 61 62 ControllerSlot(StorageBus_T a_enmBus, const Utf8Str &a_rName, ULONG a_uPort, ULONG a_uDevice, bool a_fFree)63 : enmBus(a_enmBus), strControllerName(a_rName), uPort(a_uPort), uDevice(a_uDevice), fFree(a_fFree)62 ControllerSlot(StorageBus_T a_enmBus, const Utf8Str &a_rName, LONG a_iPort, LONG a_iDevice, bool a_fFree) 63 : enmBus(a_enmBus), strControllerName(a_rName), iPort(a_iPort), iDevice(a_iDevice), fFree(a_fFree) 64 64 {} 65 65 … … 70 70 if (strControllerName == rThat.strControllerName) 71 71 { 72 if ( uPort == rThat.uPort)73 return uDevice < rThat.uDevice;74 return uPort < rThat.uPort;72 if (iPort == rThat.iPort) 73 return iDevice < rThat.iDevice; 74 return iPort < rThat.iPort; 75 75 } 76 76 return strControllerName < rThat.strControllerName; … … 103 103 return enmBus == rThat.enmBus 104 104 && strControllerName == rThat.strControllerName 105 && uPort == rThat.uPort106 && uDevice == rThat.uDevice;105 && iPort == rThat.iPort 106 && iDevice == rThat.iDevice; 107 107 } 108 108 }; … … 119 119 DeviceType_T enmDeviceType; 120 120 AccessMode_T enmAccessType; 121 ULONG uPort;122 ULONG uDevice;121 LONG iPort; 122 LONG iDevice; 123 123 bool fMountOnly; 124 124 Utf8Str strImagePath; 125 125 126 126 UnattendedInstallationDisk(StorageBus_T a_enmBusType, Utf8Str const &a_rBusName, DeviceType_T a_enmDeviceType, 127 AccessMode_T a_enmAccessType, ULONG a_uPort, ULONG a_uDevice, bool a_fMountOnly,127 AccessMode_T a_enmAccessType, LONG a_iPort, LONG a_iDevice, bool a_fMountOnly, 128 128 Utf8Str const &a_rImagePath) 129 129 : enmBusType(a_enmBusType), strControllerName(a_rBusName), enmDeviceType(a_enmDeviceType), enmAccessType(a_enmAccessType) 130 , uPort(a_uPort), uDevice(a_uDevice), fMountOnly(a_fMountOnly), strImagePath(a_rImagePath)130 , iPort(a_iPort), iDevice(a_iDevice), fMountOnly(a_fMountOnly), strImagePath(a_rImagePath) 131 131 { 132 132 Assert(strControllerName.length() > 0); … … 135 135 UnattendedInstallationDisk(std::list<ControllerSlot>::const_iterator const &itDvdSlot, Utf8Str const &a_rImagePath) 136 136 : enmBusType(itDvdSlot->enmBus), strControllerName(itDvdSlot->strControllerName), enmDeviceType(DeviceType_DVD) 137 , enmAccessType(AccessMode_ReadOnly), uPort(itDvdSlot->uPort), uDevice(itDvdSlot->uDevice)137 , enmAccessType(AccessMode_ReadOnly), iPort(itDvdSlot->iPort), iDevice(itDvdSlot->iDevice) 138 138 , fMountOnly(!itDvdSlot->fFree), strImagePath(a_rImagePath) 139 139 { … … 1105 1105 psz++; 1106 1106 while (RT_C_IS_ALNUM(*psz) || *psz == '_'); 1107 size_t cchIdentifier = psz - pszIdentifier;1107 size_t cchIdentifier = (size_t)(psz - pszIdentifier); 1108 1108 1109 1109 /* Skip to the value. */ … … 1940 1940 * Iterate thru all possible slots, adding those not found in arrayOfUsedSlots. 1941 1941 */ 1942 for ( uint32_t iPort = 0; iPort <cPorts; iPort++)1943 for ( uint32_t iDevice = 0; iDevice <cMaxDevicesPerPort; iDevice++)1942 for (int32_t iPort = 0; iPort < (int32_t)cPorts; iPort++) 1943 for (int32_t iDevice = 0; iDevice < (int32_t)cMaxDevicesPerPort; iDevice++) 1944 1944 { 1945 1945 bool fFound = false; 1946 1946 for (size_t i = 0; i < arrayOfUsedSlots.size(); i++) 1947 if ( arrayOfUsedSlots[i]. uPort == iPort1948 && arrayOfUsedSlots[i]. uDevice == iDevice)1947 if ( arrayOfUsedSlots[i].iPort == iPort 1948 && arrayOfUsedSlots[i].iDevice == iDevice) 1949 1949 { 1950 1950 fFound = true; … … 1977 1977 hrc = pController->COMSETTER(PortCount)(cPorts + (ULONG)cNewPortsNeeded); 1978 1978 AssertComRCReturn(hrc, hrc); 1979 for (uint32_t iPort = cPorts; iPort < cPorts + cNewPortsNeeded; iPort++) 1980 for (uint32_t iDevice = 0; iDevice < cMaxDevicesPerPort; iDevice++) 1979 int32_t const cPortsNew = (int32_t)(cPorts + cNewPortsNeeded); 1980 for (int32_t iPort = (int32_t)cPorts; iPort < cPortsNew; iPort++) 1981 for (int32_t iDevice = 0; iDevice < (int32_t)cMaxDevicesPerPort; iDevice++) 1981 1982 { 1982 1983 rDvdSlots.push_back(ControllerSlot(enmStorageBus, rStrControllerName, iPort, iDevice, true /*fFree*/)); … … 2702 2703 { 2703 2704 // mount the opened disk image 2704 rc = rPtrSessionMachine->MountMedium(Bstr(pImage->strControllerName).raw(), pImage-> uPort,2705 pImage-> uDevice, ptrMedium, TRUE /*fForce*/);2705 rc = rPtrSessionMachine->MountMedium(Bstr(pImage->strControllerName).raw(), pImage->iPort, 2706 pImage->iDevice, ptrMedium, TRUE /*fForce*/); 2706 2707 LogRelFlowFunc(("Machine::MountMedium -> %Rhrc\n", rc)); 2707 2708 } … … 2709 2710 { 2710 2711 //attach the opened disk image to the controller 2711 rc = rPtrSessionMachine->AttachDevice(Bstr(pImage->strControllerName).raw(), pImage-> uPort,2712 pImage-> uDevice, pImage->enmDeviceType, ptrMedium);2712 rc = rPtrSessionMachine->AttachDevice(Bstr(pImage->strControllerName).raw(), pImage->iPort, 2713 pImage->iDevice, pImage->enmDeviceType, ptrMedium); 2713 2714 LogRelFlowFunc(("Machine::AttachDevice -> %Rhrc\n", rc)); 2714 2715 }
Note:
See TracChangeset
for help on using the changeset viewer.