ホーム › System.HostComputeSystem › HcsInitializeLiveMigrationOnSource
HcsInitializeLiveMigrationOnSource
関数移行元でライブマイグレーションを初期化する。
シグネチャ
// computecore.dll
#include <windows.h>
HRESULT HcsInitializeLiveMigrationOnSource(
HCS_SYSTEM computeSystem,
HCS_OPERATION operation,
LPCWSTR options // optional
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| computeSystem | HCS_SYSTEM | in |
| operation | HCS_OPERATION | in |
| options | LPCWSTR | inoptional |
戻り値の型: HRESULT
各言語での呼び出し定義
// computecore.dll
#include <windows.h>
HRESULT HcsInitializeLiveMigrationOnSource(
HCS_SYSTEM computeSystem,
HCS_OPERATION operation,
LPCWSTR options // optional
);[DllImport("computecore.dll", ExactSpelling = true)]
static extern int HcsInitializeLiveMigrationOnSource(
IntPtr computeSystem, // HCS_SYSTEM
IntPtr operation, // HCS_OPERATION
[MarshalAs(UnmanagedType.LPWStr)] string options // LPCWSTR optional
);<DllImport("computecore.dll", ExactSpelling:=True)>
Public Shared Function HcsInitializeLiveMigrationOnSource(
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 HcsInitializeLiveMigrationOnSource 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
HcsInitializeLiveMigrationOnSource = ctypes.windll.computecore.HcsInitializeLiveMigrationOnSource
HcsInitializeLiveMigrationOnSource.restype = ctypes.c_int
HcsInitializeLiveMigrationOnSource.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')
HcsInitializeLiveMigrationOnSource = Fiddle::Function.new(
lib['HcsInitializeLiveMigrationOnSource'],
[
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 HcsInitializeLiveMigrationOnSource(
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 HcsInitializeLiveMigrationOnSource(IntPtr computeSystem, IntPtr operation, [MarshalAs(UnmanagedType.LPWStr)] string options);
"@
$api = Add-Type -MemberDefinition $sig -Name 'computecore_HcsInitializeLiveMigrationOnSource' -Namespace Win32 -PassThru
# $api::HcsInitializeLiveMigrationOnSource(computeSystem, operation, options)#uselib "computecore.dll"
#func global HcsInitializeLiveMigrationOnSource "HcsInitializeLiveMigrationOnSource" sptr, sptr, sptr
; HcsInitializeLiveMigrationOnSource 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 HcsInitializeLiveMigrationOnSource "HcsInitializeLiveMigrationOnSource" sptr, sptr, wstr
; res = HcsInitializeLiveMigrationOnSource(computeSystem, operation, options)
; computeSystem : HCS_SYSTEM -> "sptr"
; operation : HCS_OPERATION -> "sptr"
; options : LPCWSTR optional -> "wstr"; HRESULT HcsInitializeLiveMigrationOnSource(HCS_SYSTEM computeSystem, HCS_OPERATION operation, LPCWSTR options)
#uselib "computecore.dll"
#cfunc global HcsInitializeLiveMigrationOnSource "HcsInitializeLiveMigrationOnSource" intptr, intptr, wstr
; res = HcsInitializeLiveMigrationOnSource(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")
procHcsInitializeLiveMigrationOnSource = computecore.NewProc("HcsInitializeLiveMigrationOnSource")
)
// computeSystem (HCS_SYSTEM), operation (HCS_OPERATION), options (LPCWSTR optional)
r1, _, err := procHcsInitializeLiveMigrationOnSource.Call(
uintptr(computeSystem),
uintptr(operation),
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(options))),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction HcsInitializeLiveMigrationOnSource(
computeSystem: THandle; // HCS_SYSTEM
operation: THandle; // HCS_OPERATION
options: PWideChar // LPCWSTR optional
): Integer; stdcall;
external 'computecore.dll' name 'HcsInitializeLiveMigrationOnSource';result := DllCall("computecore\HcsInitializeLiveMigrationOnSource"
, "Ptr", computeSystem ; HCS_SYSTEM
, "Ptr", operation ; HCS_OPERATION
, "WStr", options ; LPCWSTR optional
, "Int") ; return: HRESULT●HcsInitializeLiveMigrationOnSource(computeSystem, operation, options) = DLL("computecore.dll", "int HcsInitializeLiveMigrationOnSource(void*, void*, char*)")
# 呼び出し: HcsInitializeLiveMigrationOnSource(computeSystem, operation, options)
# computeSystem : HCS_SYSTEM -> "void*"
# operation : HCS_OPERATION -> "void*"
# options : LPCWSTR optional -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。