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

ApplyPendingSavedStateFileReplayLog

関数
保存状態ファイルの保留中リプレイログを適用する。
DLLVmSavedStateDumpProvider.dll呼出規約winapi

シグネチャ

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

HRESULT ApplyPendingSavedStateFileReplayLog(
    LPCWSTR vmrsFile
);

パラメーター

名前方向
vmrsFileLPCWSTRin

戻り値の型: HRESULT

各言語での呼び出し定義

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

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

ApplyPendingSavedStateFileReplayLog = ctypes.windll.vmsavedstatedumpprovider.ApplyPendingSavedStateFileReplayLog
ApplyPendingSavedStateFileReplayLog.restype = ctypes.c_int
ApplyPendingSavedStateFileReplayLog.argtypes = [
    wintypes.LPCWSTR,  # vmrsFile : LPCWSTR
]
require 'fiddle'
require 'fiddle/import'

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

var (
	vmsavedstatedumpprovider = windows.NewLazySystemDLL("VmSavedStateDumpProvider.dll")
	procApplyPendingSavedStateFileReplayLog = vmsavedstatedumpprovider.NewProc("ApplyPendingSavedStateFileReplayLog")
)

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