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

HdvDeliverGuestInterrupt

関数
ゲストにMSI割り込みを配信する。
DLLvmdevicehost.dll呼出規約winapi

シグネチャ

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

HRESULT HdvDeliverGuestInterrupt(
    void* requestor,
    ULONGLONG msiAddress,
    DWORD msiData
);

パラメーター

名前方向
requestorvoid*in
msiAddressULONGLONGin
msiDataDWORDin

戻り値の型: HRESULT

各言語での呼び出し定義

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

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

HdvDeliverGuestInterrupt = ctypes.windll.vmdevicehost.HdvDeliverGuestInterrupt
HdvDeliverGuestInterrupt.restype = ctypes.c_int
HdvDeliverGuestInterrupt.argtypes = [
    ctypes.POINTER(None),  # requestor : void*
    ctypes.c_ulonglong,  # msiAddress : ULONGLONG
    wintypes.DWORD,  # msiData : DWORD
]
require 'fiddle'
require 'fiddle/import'

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

var (
	vmdevicehost = windows.NewLazySystemDLL("vmdevicehost.dll")
	procHdvDeliverGuestInterrupt = vmdevicehost.NewProc("HdvDeliverGuestInterrupt")
)

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