Win32 API 日本語リファレンス
ホームSystem.Hypervisor › WHvCompletePartitionMigration

WHvCompletePartitionMigration

関数
パーティションのマイグレーションを完了する。
DLLWinHvPlatform.dll呼出規約winapi

シグネチャ

// WinHvPlatform.dll
#include <windows.h>

HRESULT WHvCompletePartitionMigration(
    WHV_PARTITION_HANDLE Partition
);

パラメーター

名前方向
PartitionWHV_PARTITION_HANDLEin

戻り値の型: HRESULT

各言語での呼び出し定義

// WinHvPlatform.dll
#include <windows.h>

HRESULT WHvCompletePartitionMigration(
    WHV_PARTITION_HANDLE Partition
);
[DllImport("WinHvPlatform.dll", ExactSpelling = true)]
static extern int WHvCompletePartitionMigration(
    IntPtr Partition   // WHV_PARTITION_HANDLE
);
<DllImport("WinHvPlatform.dll", ExactSpelling:=True)>
Public Shared Function WHvCompletePartitionMigration(
    Partition As IntPtr   ' WHV_PARTITION_HANDLE
) As Integer
End Function
' Partition : WHV_PARTITION_HANDLE
Declare PtrSafe Function WHvCompletePartitionMigration Lib "winhvplatform" ( _
    ByVal Partition As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

WHvCompletePartitionMigration = ctypes.windll.winhvplatform.WHvCompletePartitionMigration
WHvCompletePartitionMigration.restype = ctypes.c_int
WHvCompletePartitionMigration.argtypes = [
    ctypes.c_ssize_t,  # Partition : WHV_PARTITION_HANDLE
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('WinHvPlatform.dll')
WHvCompletePartitionMigration = Fiddle::Function.new(
  lib['WHvCompletePartitionMigration'],
  [
    Fiddle::TYPE_INTPTR_T,  # Partition : WHV_PARTITION_HANDLE
  ],
  Fiddle::TYPE_INT)
#[link(name = "winhvplatform")]
extern "system" {
    fn WHvCompletePartitionMigration(
        Partition: isize  // WHV_PARTITION_HANDLE
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("WinHvPlatform.dll")]
public static extern int WHvCompletePartitionMigration(IntPtr Partition);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WinHvPlatform_WHvCompletePartitionMigration' -Namespace Win32 -PassThru
# $api::WHvCompletePartitionMigration(Partition)
#uselib "WinHvPlatform.dll"
#func global WHvCompletePartitionMigration "WHvCompletePartitionMigration" sptr
; WHvCompletePartitionMigration Partition   ; 戻り値は stat
; Partition : WHV_PARTITION_HANDLE -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "WinHvPlatform.dll"
#cfunc global WHvCompletePartitionMigration "WHvCompletePartitionMigration" sptr
; res = WHvCompletePartitionMigration(Partition)
; Partition : WHV_PARTITION_HANDLE -> "sptr"
; HRESULT WHvCompletePartitionMigration(WHV_PARTITION_HANDLE Partition)
#uselib "WinHvPlatform.dll"
#cfunc global WHvCompletePartitionMigration "WHvCompletePartitionMigration" intptr
; res = WHvCompletePartitionMigration(Partition)
; Partition : WHV_PARTITION_HANDLE -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	winhvplatform = windows.NewLazySystemDLL("WinHvPlatform.dll")
	procWHvCompletePartitionMigration = winhvplatform.NewProc("WHvCompletePartitionMigration")
)

// Partition (WHV_PARTITION_HANDLE)
r1, _, err := procWHvCompletePartitionMigration.Call(
	uintptr(Partition),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function WHvCompletePartitionMigration(
  Partition: NativeInt   // WHV_PARTITION_HANDLE
): Integer; stdcall;
  external 'WinHvPlatform.dll' name 'WHvCompletePartitionMigration';
result := DllCall("WinHvPlatform\WHvCompletePartitionMigration"
    , "Ptr", Partition   ; WHV_PARTITION_HANDLE
    , "Int")   ; return: HRESULT
●WHvCompletePartitionMigration(Partition) = DLL("WinHvPlatform.dll", "int WHvCompletePartitionMigration(int)")
# 呼び出し: WHvCompletePartitionMigration(Partition)
# Partition : WHV_PARTITION_HANDLE -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。