Changeset 23591 in vbox
- Timestamp:
- Oct 7, 2009 7:57:15 AM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 53257
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/MediumImpl.cpp
r23451 r23591 95 95 accessibleInLock(false), 96 96 type(MediumType_Normal), 97 devType(DeviceType_HardDisk), 97 98 logicalSize(0), 98 99 hddOpenMode(OpenReadWrite), … … 128 129 129 130 MediumType_T type; 131 DeviceType_T devType; 130 132 uint64_t logicalSize; /*< In MBytes. */ 131 133 … … 1047 1049 * @param aVirtualBox VirtualBox object. 1048 1050 * @param aParent Parent medium disk or NULL for a root (base) medium. 1049 * @param a TypeDevice type of the medium.1051 * @param aDeviceType Device type of the medium. 1050 1052 * @param aNode Configuration settings. 1051 1053 * … … 1054 1056 HRESULT Medium::init(VirtualBox *aVirtualBox, 1055 1057 Medium *aParent, 1056 DeviceType_T a Type,1058 DeviceType_T aDeviceType, 1057 1059 const settings::Medium &data) 1058 1060 { … … 1098 1100 1099 1101 /* required */ 1100 if (a Type == DeviceType_HardDisk)1102 if (aDeviceType == DeviceType_HardDisk) 1101 1103 { 1102 1104 AssertReturn(!data.strFormat.isEmpty(), E_FAIL); … … 1137 1139 CheckComRCReturnRC(rc); 1138 1140 1139 if (a Type == DeviceType_HardDisk)1141 if (aDeviceType == DeviceType_HardDisk) 1140 1142 { 1141 1143 /* type is only for base hard disks */ … … 1145 1147 else 1146 1148 m->type = MediumType_Writethrough; 1149 1150 /* remember device type for correct unregistering later */ 1151 m->devType = aDeviceType; 1147 1152 1148 1153 LogFlowThisFunc(("m->locationFull='%ls', m->format=%ls, m->id={%RTuuid}\n", … … 1166 1171 rc = pHD->init(aVirtualBox, 1167 1172 this, // parent 1168 a Type,1173 aDeviceType, 1169 1174 m); // child data 1170 1175 CheckComRCBreakRC(rc); … … 1190 1195 * 1191 1196 * @param aVirtualBox VirtualBox object. 1192 * @param a TypeDevice type of the medium.1197 * @param aDeviceType Device type of the medium. 1193 1198 * @param aLocation Location of the host drive. 1194 1199 * @param aDescription Comment for this host drive. … … 1197 1202 */ 1198 1203 HRESULT Medium::init(VirtualBox *aVirtualBox, 1199 DeviceType_T a Type,1204 DeviceType_T aDeviceType, 1200 1205 CBSTR aLocation, 1201 1206 CBSTR aDescription) 1202 1207 { 1203 ComAssertRet(a Type == DeviceType_DVD || aType == DeviceType_Floppy, E_INVALIDARG);1208 ComAssertRet(aDeviceType == DeviceType_DVD || aDeviceType == DeviceType_Floppy, E_INVALIDARG); 1204 1209 ComAssertRet(aLocation, E_INVALIDARG); 1205 1210 … … 1215 1220 RTUUID uuid; 1216 1221 RTUuidClear(&uuid); 1217 if (a Type == DeviceType_DVD)1222 if (aDeviceType == DeviceType_DVD) 1218 1223 memcpy(&uuid.au8[0], "DVD", 3); 1219 1224 else … … 1229 1234 1230 1235 m->type = MediumType_Writethrough; 1236 m->devType = aDeviceType; 1231 1237 m->state = MediumState_Created; 1232 1238 m->hostDrive = true; … … 4690 4696 } 4691 4697 4692 HRESULT rc = mVirtualBox->unregisterHardDisk(this); 4698 HRESULT rc = E_FAIL; 4699 switch (m->devType) 4700 { 4701 case DeviceType_DVD: 4702 rc = mVirtualBox->unregisterDVDImage(this); 4703 break; 4704 case DeviceType_Floppy: 4705 rc = mVirtualBox->unregisterFloppyImage(this); 4706 break; 4707 case DeviceType_HardDisk: 4708 rc = mVirtualBox->unregisterHardDisk(this); 4709 break; 4710 default: 4711 break; 4712 } 4693 4713 4694 4714 if (FAILED(rc)) -
trunk/src/VBox/Main/include/MediumImpl.h
r23257 r23591 88 88 HRESULT init(VirtualBox *aVirtualBox, 89 89 Medium *aParent, 90 DeviceType_T a Type,90 DeviceType_T aDeviceType, 91 91 const settings::Medium &data); 92 92 // initializer for host floppy/DVD 93 93 HRESULT init(VirtualBox *aVirtualBox, 94 DeviceType_T a Type,94 DeviceType_T aDeviceType, 95 95 CBSTR aLocation, 96 96 CBSTR aDescription = NULL);
Note:
See TracChangeset
for help on using the changeset viewer.