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

HcsFinalizeLiveMigration

関数
ライブマイグレーションを完了させる。
DLLcomputecore.dll呼出規約winapi

シグネチャ

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

HRESULT HcsFinalizeLiveMigration(
    HCS_SYSTEM computeSystem,
    HCS_OPERATION operation,
    LPCWSTR options   // optional
);

パラメーター

名前方向
computeSystemHCS_SYSTEMin
operationHCS_OPERATIONin
optionsLPCWSTRinoptional

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT HcsFinalizeLiveMigration(
    HCS_SYSTEM computeSystem,
    HCS_OPERATION operation,
    LPCWSTR options   // optional
);
[DllImport("computecore.dll", ExactSpelling = true)]
static extern int HcsFinalizeLiveMigration(
    IntPtr computeSystem,   // HCS_SYSTEM
    IntPtr operation,   // HCS_OPERATION
    [MarshalAs(UnmanagedType.LPWStr)] string options   // LPCWSTR optional
);
<DllImport("computecore.dll", ExactSpelling:=True)>
Public Shared Function HcsFinalizeLiveMigration(
    computeSystem As IntPtr,   ' HCS_SYSTEM
    operation As IntPtr,   ' HCS_OPERATION
    <MarshalAs(UnmanagedType.LPWStr)> options As String   ' LPCWSTR optional
) As Integer
End Function
' computeSystem : HCS_SYSTEM
' operation : HCS_OPERATION
' options : LPCWSTR optional
Declare PtrSafe Function HcsFinalizeLiveMigration Lib "computecore" ( _
    ByVal computeSystem As LongPtr, _
    ByVal operation As LongPtr, _
    ByVal options As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

HcsFinalizeLiveMigration = ctypes.windll.computecore.HcsFinalizeLiveMigration
HcsFinalizeLiveMigration.restype = ctypes.c_int
HcsFinalizeLiveMigration.argtypes = [
    wintypes.HANDLE,  # computeSystem : HCS_SYSTEM
    wintypes.HANDLE,  # operation : HCS_OPERATION
    wintypes.LPCWSTR,  # options : LPCWSTR optional
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('computecore.dll')
HcsFinalizeLiveMigration = Fiddle::Function.new(
  lib['HcsFinalizeLiveMigration'],
  [
    Fiddle::TYPE_VOIDP,  # computeSystem : HCS_SYSTEM
    Fiddle::TYPE_VOIDP,  # operation : HCS_OPERATION
    Fiddle::TYPE_VOIDP,  # options : LPCWSTR optional
  ],
  Fiddle::TYPE_INT)
#[link(name = "computecore")]
extern "system" {
    fn HcsFinalizeLiveMigration(
        computeSystem: *mut core::ffi::c_void,  // HCS_SYSTEM
        operation: *mut core::ffi::c_void,  // HCS_OPERATION
        options: *const u16  // LPCWSTR optional
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("computecore.dll")]
public static extern int HcsFinalizeLiveMigration(IntPtr computeSystem, IntPtr operation, [MarshalAs(UnmanagedType.LPWStr)] string options);
"@
$api = Add-Type -MemberDefinition $sig -Name 'computecore_HcsFinalizeLiveMigration' -Namespace Win32 -PassThru
# $api::HcsFinalizeLiveMigration(computeSystem, operation, options)
#uselib "computecore.dll"
#func global HcsFinalizeLiveMigration "HcsFinalizeLiveMigration" sptr, sptr, sptr
; HcsFinalizeLiveMigration computeSystem, operation, options   ; 戻り値は stat
; computeSystem : HCS_SYSTEM -> "sptr"
; operation : HCS_OPERATION -> "sptr"
; options : LPCWSTR optional -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "computecore.dll"
#cfunc global HcsFinalizeLiveMigration "HcsFinalizeLiveMigration" sptr, sptr, wstr
; res = HcsFinalizeLiveMigration(computeSystem, operation, options)
; computeSystem : HCS_SYSTEM -> "sptr"
; operation : HCS_OPERATION -> "sptr"
; options : LPCWSTR optional -> "wstr"
; HRESULT HcsFinalizeLiveMigration(HCS_SYSTEM computeSystem, HCS_OPERATION operation, LPCWSTR options)
#uselib "computecore.dll"
#cfunc global HcsFinalizeLiveMigration "HcsFinalizeLiveMigration" intptr, intptr, wstr
; res = HcsFinalizeLiveMigration(computeSystem, operation, options)
; computeSystem : HCS_SYSTEM -> "intptr"
; operation : HCS_OPERATION -> "intptr"
; options : LPCWSTR optional -> "wstr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	computecore = windows.NewLazySystemDLL("computecore.dll")
	procHcsFinalizeLiveMigration = computecore.NewProc("HcsFinalizeLiveMigration")
)

// computeSystem (HCS_SYSTEM), operation (HCS_OPERATION), options (LPCWSTR optional)
r1, _, err := procHcsFinalizeLiveMigration.Call(
	uintptr(computeSystem),
	uintptr(operation),
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(options))),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function HcsFinalizeLiveMigration(
  computeSystem: THandle;   // HCS_SYSTEM
  operation: THandle;   // HCS_OPERATION
  options: PWideChar   // LPCWSTR optional
): Integer; stdcall;
  external 'computecore.dll' name 'HcsFinalizeLiveMigration';
result := DllCall("computecore\HcsFinalizeLiveMigration"
    , "Ptr", computeSystem   ; HCS_SYSTEM
    , "Ptr", operation   ; HCS_OPERATION
    , "WStr", options   ; LPCWSTR optional
    , "Int")   ; return: HRESULT
●HcsFinalizeLiveMigration(computeSystem, operation, options) = DLL("computecore.dll", "int HcsFinalizeLiveMigration(void*, void*, char*)")
# 呼び出し: HcsFinalizeLiveMigration(computeSystem, operation, options)
# computeSystem : HCS_SYSTEM -> "void*"
# operation : HCS_OPERATION -> "void*"
# options : LPCWSTR optional -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。