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

HdvDestroySectionBackedMmioRange

関数
セクションを基にしたMMIO範囲を破棄する。
DLLvmdevicehost.dll呼出規約winapi

シグネチャ

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

HRESULT HdvDestroySectionBackedMmioRange(
    void* requestor,
    HDV_PCI_BAR_SELECTOR barIndex,
    ULONGLONG offsetInPages
);

パラメーター

名前方向
requestorvoid*in
barIndexHDV_PCI_BAR_SELECTORin
offsetInPagesULONGLONGin

戻り値の型: HRESULT

各言語での呼び出し定義

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

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

HdvDestroySectionBackedMmioRange = ctypes.windll.vmdevicehost.HdvDestroySectionBackedMmioRange
HdvDestroySectionBackedMmioRange.restype = ctypes.c_int
HdvDestroySectionBackedMmioRange.argtypes = [
    ctypes.POINTER(None),  # requestor : void*
    ctypes.c_int,  # barIndex : HDV_PCI_BAR_SELECTOR
    ctypes.c_ulonglong,  # offsetInPages : ULONGLONG
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('vmdevicehost.dll')
HdvDestroySectionBackedMmioRange = Fiddle::Function.new(
  lib['HdvDestroySectionBackedMmioRange'],
  [
    Fiddle::TYPE_VOIDP,  # requestor : void*
    Fiddle::TYPE_INT,  # barIndex : HDV_PCI_BAR_SELECTOR
    -Fiddle::TYPE_LONG_LONG,  # offsetInPages : ULONGLONG
  ],
  Fiddle::TYPE_INT)
#[link(name = "vmdevicehost")]
extern "system" {
    fn HdvDestroySectionBackedMmioRange(
        requestor: *mut (),  // void*
        barIndex: i32,  // HDV_PCI_BAR_SELECTOR
        offsetInPages: u64  // ULONGLONG
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("vmdevicehost.dll")]
public static extern int HdvDestroySectionBackedMmioRange(IntPtr requestor, int barIndex, ulong offsetInPages);
"@
$api = Add-Type -MemberDefinition $sig -Name 'vmdevicehost_HdvDestroySectionBackedMmioRange' -Namespace Win32 -PassThru
# $api::HdvDestroySectionBackedMmioRange(requestor, barIndex, offsetInPages)
#uselib "vmdevicehost.dll"
#func global HdvDestroySectionBackedMmioRange "HdvDestroySectionBackedMmioRange" sptr, sptr, sptr
; HdvDestroySectionBackedMmioRange requestor, barIndex, offsetInPages   ; 戻り値は stat
; requestor : void* -> "sptr"
; barIndex : HDV_PCI_BAR_SELECTOR -> "sptr"
; offsetInPages : ULONGLONG -> "sptr"
; ※HSP3.7は int64 引数(64bit値渡し)に非対応です。
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "vmdevicehost.dll"
#cfunc global HdvDestroySectionBackedMmioRange "HdvDestroySectionBackedMmioRange" sptr, int, int64
; res = HdvDestroySectionBackedMmioRange(requestor, barIndex, offsetInPages)
; requestor : void* -> "sptr"
; barIndex : HDV_PCI_BAR_SELECTOR -> "int"
; offsetInPages : ULONGLONG -> "int64"
; ※int64 引数の DLL 値渡しは x64 ランタイム(hsp3_64)のみ対応(x86 は未対応)。
; HRESULT HdvDestroySectionBackedMmioRange(void* requestor, HDV_PCI_BAR_SELECTOR barIndex, ULONGLONG offsetInPages)
#uselib "vmdevicehost.dll"
#cfunc global HdvDestroySectionBackedMmioRange "HdvDestroySectionBackedMmioRange" intptr, int, int64
; res = HdvDestroySectionBackedMmioRange(requestor, barIndex, offsetInPages)
; requestor : void* -> "intptr"
; barIndex : HDV_PCI_BAR_SELECTOR -> "int"
; offsetInPages : ULONGLONG -> "int64"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	vmdevicehost = windows.NewLazySystemDLL("vmdevicehost.dll")
	procHdvDestroySectionBackedMmioRange = vmdevicehost.NewProc("HdvDestroySectionBackedMmioRange")
)

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