Editja

WHvAcceptPartitionMigration

Accepts a migrating partition on the destination host.

Syntax

HRESULT
WINAPI
WHvAcceptPartitionMigration(
    _In_ HANDLE MigrationHandle,
    _Out_ WHV_PARTITION_HANDLE* Partition
    );

Parameters

MigrationHandle

Specifies the migration handle that the source process obtained from WHvStartPartitionMigration and transferred to the destination process.

Partition

Receives the handle to the newly created partition object that represents the migrated partition on the destination.

Return Value

If the function succeeds, the return value is S_OK.

The function returns E_INVALIDARG if the serialized partition data cannot be parsed. If the transferred handles are missing or invalid, the function returns HRESULT_FROM_WIN32(ERROR_INVALID_DATA). If the serialized partition uses a migration version that this version of the platform does not support, the function returns HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED).

Remarks

The WHvAcceptPartitionMigration function receives the serialized partition state and handles that the source sent with WHvStartPartitionMigration, and reconstructs the partition as a new partition object on the destination host. The new partition is created in a migrating state in which only WHvSetupPartition and WHvDeletePartition are permitted until the migration completes.

On success, the function closes MigrationHandle. The caller should not close the handle again.

After this call, the source finalizes the migration with WHvCompletePartitionMigration. Once the source has completed, the destination calls WHvSetupPartition on the partition returned in Partition to finish the migration and resume normal operation. Calling WHvSetupPartition before the source completes returns HRESULT_FROM_WIN32(ERROR_INVALID_STATE).

Requirements

Requirement Value
Minimum supported Windows Windows 10, version 20H2 (x64); Windows 11, version 24H2, build 26100.3915 (Arm64)
Header WinHvPlatform.h
Library WinHvPlatform.lib
DLL WinHvPlatform.dll
Architecture x64, Arm64

See also