IVMHardDisk::Compact method
[Windows Virtual PC is no longer available for use as of Windows 8. Instead, use the Hyper-V WMI provider (V2).]
Compacts a dynamically expanding virtual hard disk image.
Syntax
HRESULT Compact(
[out, retval] IVMTask **compactTask
);
Parameters
-
compactTask [out, retval]
-
An IVMTask object that is used to track the completion the compaction process.
Return value
This method can return one of these values.
Return code/value | Description |
---|---|
|
The operation was successful. |
|
An unexpected error has occurred. |
|
The parameter is NULL. |
|
The virtual hard disk image referenced by this IVMHardDisk object is in use. |
|
The host volume does not have enough space to create a temporary file needed for the compaction of this virtual hard disk image. |
|
The virtual hard disk image cannot be compacted because the application is shutting down. |
|
The virtual hard disk image referenced by this IVMHardDisk object is marked as read only. |
|
The virtual hard disk image referenced by this IVMHardDisk object must be a vmDiskTypeDynamic image type. |
|
The virtual hard disk image referenced by this IVMHardDisk object does not seem to be a valid image. |
Remarks
To compact a dynamically expanding hard disk image, free space on the disk image should first be zeroed.
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_IVMHardDisk is defined as ffa14ae6-48f5-42a4-8a22-186f2e5c7db0 |