Documentation
¶
Overview ¶
Package virtdisk reads the size and type of virtual hard disks (VHD, VHDX, VHD Set) through virtdisk.dll, the API behind Get-VHD. https://learn.microsoft.com/en-us/windows/win32/api/virtdisk/
Index ¶
Constants ¶
const ( ProviderSubtypeFixed uint32 = 2 ProviderSubtypeDynamic uint32 = 3 ProviderSubtypeDifferencing uint32 = 4 )
Provider subtypes of GET_VIRTUAL_DISK_INFO_PROVIDER_SUBTYPE.
Variables ¶
This section is empty.
Functions ¶
func Available ¶
func Available() error
Available reports whether virtdisk.dll and the functions used by GetInfo can be loaded. LazyProc.Call panics if they can't, so check this first.
func ParentLocations ¶
ParentLocations returns the paths at which the parent of the differencing disk at path is stored, as recorded in the disk. Disks without a parent return none.
Types ¶
type Info ¶
type Info struct {
// VirtualSize is the maximum size the virtual machine sees, in bytes.
VirtualSize uint64
// PhysicalSize is the size of the file on storage, in bytes.
PhysicalSize uint64
// ProviderSubtype is ProviderSubtypeFixed, ProviderSubtypeDynamic or ProviderSubtypeDifferencing.
ProviderSubtype uint32
}
Info is the size and type of a virtual hard disk.