GetVirtualDiskInformation function (virtdisk.h)

Retrieves information about a virtual hard disk (VHD).

Syntax

DWORD GetVirtualDiskInformation(
  [in]                HANDLE                 VirtualDiskHandle,
  [in, out]           PULONG                 VirtualDiskInfoSize,
  [in, out]           PGET_VIRTUAL_DISK_INFO VirtualDiskInfo,
  [in, out, optional] PULONG                 SizeUsed
);

Parameters

[in] VirtualDiskHandle

A handle to the open VHD, which must have been opened using the VIRTUAL_DISK_ACCESS_GET_INFO flag set in the VirtualDiskAccessMask parameter to the OpenVirtualDisk function. For information on how to open a VHD, see the OpenVirtualDisk function.

[in, out] VirtualDiskInfoSize

A pointer to a ULONG that contains the size of the VirtualDiskInfo parameter.

[in, out] VirtualDiskInfo

A pointer to a valid GET_VIRTUAL_DISK_INFO structure. The format of the data returned is dependent on the value passed in the Version member by the caller.

[in, out, optional] SizeUsed

A pointer to a ULONG that contains the size used.

Return value

Status of the request.

If the function succeeds, the return value is ERROR_SUCCESS and the VirtualDiskInfo parameter contains the requested information.

If the function fails, the return value is an error code and the VirtualDiskInfo parameter is undefined. For more information, see System Error Codes.

Remarks

The GetVirtualDiskInformation function can be called on any valid VirtualDiskHandle, provided the handle was opened using the VIRTUAL_DISK_ACCESS_GET_INFO flag. The VHD is not required to be an attached disk.

Requirements

Requirement Value
Minimum supported client Windows 7
Minimum supported server Windows Server 2008 R2
Target Platform Windows
Header virtdisk.h
Library VirtDisk.lib
DLL VirtDisk.dll

See also

About VHD

GET_VIRTUAL_DISK_INFO

VHD Reference