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

WHvCancelPartitionMigration

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

シグネチャ

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

HRESULT WHvCancelPartitionMigration(
    WHV_PARTITION_HANDLE Partition
);

パラメーター

名前方向
PartitionWHV_PARTITION_HANDLEin

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT WHvCancelPartitionMigration(
    WHV_PARTITION_HANDLE Partition
);
[DllImport("WinHvPlatform.dll", ExactSpelling = true)]
static extern int WHvCancelPartitionMigration(
    IntPtr Partition   // WHV_PARTITION_HANDLE
);
<DllImport("WinHvPlatform.dll", ExactSpelling:=True)>
Public Shared Function WHvCancelPartitionMigration(
    Partition As IntPtr   ' WHV_PARTITION_HANDLE
) As Integer
End Function
' Partition : WHV_PARTITION_HANDLE
Declare PtrSafe Function WHvCancelPartitionMigration 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

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

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

var (
	winhvplatform = windows.NewLazySystemDLL("WinHvPlatform.dll")
	procWHvCancelPartitionMigration = winhvplatform.NewProc("WHvCancelPartitionMigration")
)

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