MirrorVirtualDisk function

Initiates a mirror operation for a virtual disk. Once the mirroring operation is initiated it will not complete until either CancelIo or CancelIoEx is called to cancel all I/O on the VirtualDiskHandle, leaving the original file as the current or BreakMirrorVirtualDisk is called to stop using the original file and only use the mirror. GetVirtualDiskOperationProgress can be used to determine if the disks are fully mirrored and writes go to both virtual disks.

Syntax


DWORD WINAPI MirrorVirtualDisk(
  _In_  HANDLE VirtualDiskHandle,
  _In_  MIRROR_VIRTUAL_DISK_FLAG Flags,
  _In_  PMIRROR_VIRTUAL_DISK_PARAMETERS Parameters,
  _In_  LPOVERLAPPED Overlapped
);

Parameters

VirtualDiskHandle [in]

A handle to the open virtual disk. For information on how to open a virtual disk, see the OpenVirtualDisk function.

Flags [in]

A valid combination of values from the MIRROR_VIRTUAL_DISK_FLAG enumeration.

ValueMeaning
MIRROR_VIRTUAL_DISK_FLAG_NONE
0x00000000

The mirror virtual disk file does not exist, and needs to be created.

MIRROR_VIRTUAL_DISK_FLAG_EXISTING_FILE
0x00000001

Create the mirror using an existing file.

 

Parameters [in]

Address of a MIRROR_VIRTUAL_DISK_PARAMETERS structure containing mirror parameter data.

Overlapped [in]

Address of an OVERLAPPEDstructure. This parameter is required.

Return value

Status of the request.

If the function succeeds, the return value is ERROR_SUCCESS.

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

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Header

VirtDisk.h (include Windows.h)

Library

VirtDisk.lib

DLL

VirtDisk.dll

See also

VHD Functions
MIRROR_VIRTUAL_DISK_FLAG
MIRROR_VIRTUAL_DISK_PARAMETERS

 

 

Build date: 10/26/2012

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.