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

HdvDestroyGuestMemoryAperture

関数
ゲストメモリのアパーチャマッピングを破棄する。
DLLvmdevicehost.dll呼出規約winapi

シグネチャ

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

HRESULT HdvDestroyGuestMemoryAperture(
    void* requestor,
    void* mappedAddress
);

パラメーター

名前方向
requestorvoid*in
mappedAddressvoid*in

戻り値の型: HRESULT

各言語での呼び出し定義

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

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

HdvDestroyGuestMemoryAperture = ctypes.windll.vmdevicehost.HdvDestroyGuestMemoryAperture
HdvDestroyGuestMemoryAperture.restype = ctypes.c_int
HdvDestroyGuestMemoryAperture.argtypes = [
    ctypes.POINTER(None),  # requestor : void*
    ctypes.POINTER(None),  # mappedAddress : void*
]
require 'fiddle'
require 'fiddle/import'

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

var (
	vmdevicehost = windows.NewLazySystemDLL("vmdevicehost.dll")
	procHdvDestroyGuestMemoryAperture = vmdevicehost.NewProc("HdvDestroyGuestMemoryAperture")
)

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