IVMVirtualPC::CreateDynamicVirtualHardDisk method
[Windows Virtual PC is no longer available for use as of Windows 8. Instead, use the Hyper-V WMI provider (V2).]
Creates a dynamically resizing virtual hard disk.
Syntax
HRESULT CreateDynamicVirtualHardDisk(
[in] BSTR imagePath,
[in] long size,
[out, retval] IVMTask **diskTask
);
Parameters
-
imagePath [in]
-
The full path to the new disk image file. The containing folder will be created if it does not exist.
-
size [in]
-
The size of the image, in megabytes. This value can be at most 2,088,960 MB (2040GB).
-
diskTask [out, retval]
-
An IVMTask object that is used to track the creation of the image.
Return value
This method can return one of these values.
Return code/value | Description |
---|---|
|
The operation was successful. |
|
A parameter is NULL. |
|
The size parameter is less than or equal to 0. |
|
The system cannot find the path specified by the imagePath parameter. |
|
The file specified by the imagePath parameter is on a CD-ROM or DVD-ROM. |
|
The imagePath parameter contains an invalid character (one of "*?:<>/|""). |
|
Both the imagePath parameter specifies an empty or relative path. At least one of the parameters must be an absolute path. |
|
The path specified by the imagePath parameter is too long. The length of the path must be less than 260 characters. |
|
The file referenced by the imagePath parameter already exists. |
|
The dynamically expanding virtual hard disk image needs at least 8 MB free on the host volume. |
|
The parameter size must be less than 2,088,960 MB. If the format is FAT16, then size must be less than 2000 MB. |
|
Unformatted and FAT16 formatted virtual hard disk images must be at least 3 MB. FAT32 formatted virtual hard disk images must be at least 514 MB. |
|
The host volume cannot support a file this size if the dynamically expanding virtual hard disk image expands to its full limit. The maximum file size for a FAT32 volume is 4 GB. The maximum file size for a FAT16 volume is 2 GB. |
|
The virtual hard disk cannot be created after the application has started shutting down. |
|
The processor does not support Hardware Accelerated Virtualization (HAV) extensions. |
|
An unexpected error has occurred. |
Requirements
Requirement | Value |
---|---|
Minimum supported client |
Windows 7 [desktop apps only] |
Minimum supported server |
None supported |
End of client support |
Windows 7 |
Product |
Windows Virtual PC |
Header |
|
IID |
IID_IVMVirtualPC is defined as 236ba0d9-a24a-4292-a132-27c1421dfd01 |