GetVirtualDiskInformation function

Retrieves information about a virtual hard disk (VHD).

Syntax


DWORD GetVirtualDiskInformation(
  _In_         HANDLE VirtualDiskHandle,
  _Inout_      PULONG VirtualDiskInfoSize,
  _Inout_      PGET_VIRTUAL_DISK_INFO VirtualDiskInfo,
  _Inout_opt_  PULONG SizeUsed
);

Parameters

VirtualDiskHandle [in]

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.

VirtualDiskInfoSize [in, out]

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

VirtualDiskInfo [in, out]

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.

SizeUsed [in, out, optional]

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

Minimum supported client

Windows 7

Minimum supported server

Windows Server 2008 R2

Header

VirtDisk.h (include Windows.h)

Library

VirtDisk.lib

DLL

VirtDisk.dll

See also

About VHD
GET_VIRTUAL_DISK_INFO
VHD Reference

 

 

Build date: 10/26/2012

Community Additions

ADD
Show:
© 2014 Microsoft