Changeset 5115 in vbox
- Timestamp:
- Oct 1, 2007 8:32:57 AM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 24970
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/HardDiskImpl.cpp
r5101 r5115 1064 1064 storageTypes[] = 1065 1065 { 1066 /* try the plugin format first if there is no extension match */ 1067 { HardDiskStorageType_CustomHardDisk, NULL }, 1068 /* then try the rest */ 1066 1069 { HardDiskStorageType_VMDKImage, ".vmdk" }, 1067 1070 { HardDiskStorageType_VirtualDiskImage, ".vdi" }, … … 1076 1079 for (size_t i = 0; i < ELEMENTS (storageTypes); ++ i) 1077 1080 { 1078 if (RTPathCompare (ext, storageTypes [i].ext) == 0) 1081 if (storageTypes [i].ext && 1082 RTPathCompare (ext, storageTypes [i].ext) == 0) 1079 1083 { 1080 1084 first = i; … … 1088 1092 HRESULT firstRC = S_OK; 1089 1093 com::ErrorInfoKeeper firstErr (true /* aIsNull */); 1090 1091 if (haveFirst == false)1092 {1093 /* Try if a plugin supports this format. */1094 ComObjPtr <HCustomHardDisk> obj;1095 obj.createObject();1096 rc = obj->init (aVirtualBox, NULL, aLocation,1097 FALSE /* aRegistered */);1098 if (SUCCEEDED (rc))1099 {1100 hardDisk = obj;1101 return rc;1102 }1103 }1104 1094 1105 1095 for (size_t i = 0; i < ELEMENTS (storageTypes); ++ i) … … 1134 1124 break; 1135 1125 } 1126 case HardDiskStorageType_CustomHardDisk: 1127 { 1128 ComObjPtr <HCustomHardDisk> obj; 1129 obj.createObject(); 1130 rc = obj->init (aVirtualBox, NULL, aLocation, 1131 FALSE /* aRegistered */); 1132 if (SUCCEEDED (rc)) 1133 { 1134 hardDisk = obj; 1135 return rc; 1136 } 1137 break; 1138 } 1136 1139 default: 1137 1140 { … … 1594 1597 CHECK_BUSY_AND_READERS(); 1595 1598 1596 / / append the default path if only a name is given1599 /* append the default path if only a name is given */ 1597 1600 Bstr path = aFilePath; 1598 1601 if (aFilePath && *aFilePath) … … 4347 4350 * image-less object. 4348 4351 * @param aRegistered Whether to mark this disk as registered or not 4349 * (ignored when @a a FilePathis @c NULL, assuming @c FALSE)4352 * (ignored when @a aLocation is @c NULL, assuming @c FALSE) 4350 4353 */ 4351 4354 HRESULT HCustomHardDisk::init (VirtualBox *aVirtualBox, HardDisk *aParent, … … 4507 4510 } 4508 4511 4509 // I VirtualDiskImageproperties4512 // ICustomHardDisk properties 4510 4513 //////////////////////////////////////////////////////////////////////////////// 4511 4514 … … 4687 4690 } 4688 4691 4689 aAccessError = Utf8StrFmt ("Hard disk location'%ls' is not yet created",4692 aAccessError = Utf8StrFmt ("Hard disk '%ls' is not yet created", 4690 4693 mLocation.raw()); 4691 4694 return S_OK; … … 4949 4952 else if (VBOX_FAILURE (vrc)) 4950 4953 *aAccessError = Utf8StrFmt ( 4951 tr ("Could not access hard disk image'%ls' (%Vrc)"),4954 tr ("Could not access hard disk '%ls' (%Vrc)"), 4952 4955 mLocation.raw(), vrc); 4953 4956 } -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r5101 r5115 4930 4930 <const name="CustomHardDisk" value="3"> 4931 4931 <desc> 4932 Disk formats supported through plugins (the access type ( 4933 wether regular file in the host OS or something else) is up to 4934 the plugin, see <link to="ICustomHardDisk"/>) 4932 Disk formats supported through plugins (see 4933 <link to="ICustomHardDisk"/>) 4935 4934 </desc> 4936 4935 </const> … … 5600 5599 newly created hard disk objects, this value is <tt>null</tt>. 5601 5600 5602 When assigning a new path, it can be absolute (full path) or 5603 relative to the <link to="IVirtualBox::homeFolder"> VirtualBox 5604 home directory</link>. If only a file name without any path is 5605 given, the <link to="ISystemProperties::defaultVDIFolder"> 5606 default VDI folder</link> will be used as a path to the image 5607 file. 5601 When assigning a new path, it can be absolute (full path) or relative 5602 to the <link to="IVirtualBox::homeFolder"> VirtualBox home 5603 directory</link>. If only a file name without any path is given, 5604 the <link to="ISystemProperties::defaultVDIFolder"> default VDI 5605 folder</link> will be used as a path to the image file. 5608 5606 5609 5607 When reading this propery, a full path is always returned. … … 5611 5609 <note> 5612 5610 This property cannot be changed when <link to="#created"/> 5613 returns <tt>true</tt>. In this case, the specified file name can be 5614 absolute (full path) or relative to 5615 the <link to="IVirtualBox::homeFolder"> VirtualBox home 5616 directory</link>. If only a file name without any path is given, 5617 the <link to="ISystemProperties::defaultVDIFolder"> default VDI 5618 folder</link> will be used as a path to the image file. 5611 returns <tt>true</tt>. 5619 5612 </note> 5620 5613 … … 5872 5865 <note> 5873 5866 This property cannot be changed when <link to="#created"/> 5874 returns <tt>true</tt>. In this case, the specified file name can be 5875 absolute (full path) or relative to 5876 the <link to="IVirtualBox::homeFolder"> VirtualBox home 5877 directory</link>. If only a file name without any path is given, 5878 the <link to="ISystemProperties::defaultVDIFolder"> default VDI 5879 folder</link> will be used as a path to the image file. 5867 returns <tt>true</tt>. 5880 5868 </note> 5881 5869 … … 5983 5971 5984 5972 The ICustomHardDisk interface represents <link to="IHardDisk">virtual hard 5985 disks</link> that are supported through third-par iteplugins.5986 5987 Hard disks using custom images can be opened using5973 disks</link> that are supported through third-party plugins. 5974 5975 Hard disks using custom hard disk images can be opened using 5988 5976 <link to="IVirtualBox::openHardDisk()"/>. 5989 5977 … … 6013 6001 <desc> 6014 6002 6015 Full location path of the custom image of this hard disk. 6016 6017 When assigning a new path, it must be absolute (full path). 6018 When reading this propery, a full path is always returned. 6003 Location of this custom hard disk. For 6004 newly created hard disk objects, this value is <tt>null</tt>. 6005 6006 The format of the location string is plugin-dependent. In case if the 6007 plugin uses a regular file in the local file system to store hard disk 6008 data, then the location is a file path and the following rules apply: 6009 <ul> 6010 <li> 6011 when assigning a new path, it must be absolute (full path) or 6012 relative to the <link to="IVirtualBox::homeFolder"> VirtualBox 6013 home directory</link>. If only a file name without any path is 6014 given, the <link to="ISystemProperties::defaultVDIFolder"> default 6015 VDI folder</link> will be used as a path to the image file. 6016 </li> 6017 <li> 6018 When reading this propery, a full path is always returned. 6019 </li> 6020 </ul> 6019 6021 6020 6022 <note> 6021 6023 This property cannot be changed when <link to="#created"/> 6022 returns <tt>true</tt>. In this case, the specified file name can be 6023 absolute (full path) or relative to 6024 the <link to="IVirtualBox::homeFolder"> VirtualBox home 6025 directory</link>. If only a file name without any path is given, 6026 the <link to="ISystemProperties::defaultVDIFolder"> default VDI 6027 folder</link> will be used as a path to the image file. 6024 returns <tt>true</tt>. 6028 6025 </note> 6029 6026
Note:
See TracChangeset
for help on using the changeset viewer.