ホーム › System.Hypervisor › WHvUnregisterPartitionDoorbellEvent
WHvUnregisterPartitionDoorbellEvent
関数パーティションのドアベルイベント登録を解除する。
シグネチャ
// WinHvPlatform.dll
#include <windows.h>
HRESULT WHvUnregisterPartitionDoorbellEvent(
WHV_PARTITION_HANDLE Partition,
const WHV_DOORBELL_MATCH_DATA* MatchData
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| Partition | WHV_PARTITION_HANDLE | in | 対象パーティションのハンドルを指定する。 |
| MatchData | WHV_DOORBELL_MATCH_DATA* | in | 登録時に指定した一致条件と同一の構造体へのポインタを指定する。 |
戻り値の型: HRESULT
各言語での呼び出し定義
// WinHvPlatform.dll
#include <windows.h>
HRESULT WHvUnregisterPartitionDoorbellEvent(
WHV_PARTITION_HANDLE Partition,
const WHV_DOORBELL_MATCH_DATA* MatchData
);[DllImport("WinHvPlatform.dll", ExactSpelling = true)]
static extern int WHvUnregisterPartitionDoorbellEvent(
IntPtr Partition, // WHV_PARTITION_HANDLE
IntPtr MatchData // WHV_DOORBELL_MATCH_DATA*
);<DllImport("WinHvPlatform.dll", ExactSpelling:=True)>
Public Shared Function WHvUnregisterPartitionDoorbellEvent(
Partition As IntPtr, ' WHV_PARTITION_HANDLE
MatchData As IntPtr ' WHV_DOORBELL_MATCH_DATA*
) As Integer
End Function' Partition : WHV_PARTITION_HANDLE
' MatchData : WHV_DOORBELL_MATCH_DATA*
Declare PtrSafe Function WHvUnregisterPartitionDoorbellEvent Lib "winhvplatform" ( _
ByVal Partition As LongPtr, _
ByVal MatchData As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
WHvUnregisterPartitionDoorbellEvent = ctypes.windll.winhvplatform.WHvUnregisterPartitionDoorbellEvent
WHvUnregisterPartitionDoorbellEvent.restype = ctypes.c_int
WHvUnregisterPartitionDoorbellEvent.argtypes = [
ctypes.c_ssize_t, # Partition : WHV_PARTITION_HANDLE
ctypes.c_void_p, # MatchData : WHV_DOORBELL_MATCH_DATA*
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('WinHvPlatform.dll')
WHvUnregisterPartitionDoorbellEvent = Fiddle::Function.new(
lib['WHvUnregisterPartitionDoorbellEvent'],
[
Fiddle::TYPE_INTPTR_T, # Partition : WHV_PARTITION_HANDLE
Fiddle::TYPE_VOIDP, # MatchData : WHV_DOORBELL_MATCH_DATA*
],
Fiddle::TYPE_INT)#[link(name = "winhvplatform")]
extern "system" {
fn WHvUnregisterPartitionDoorbellEvent(
Partition: isize, // WHV_PARTITION_HANDLE
MatchData: *const WHV_DOORBELL_MATCH_DATA // WHV_DOORBELL_MATCH_DATA*
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("WinHvPlatform.dll")]
public static extern int WHvUnregisterPartitionDoorbellEvent(IntPtr Partition, IntPtr MatchData);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WinHvPlatform_WHvUnregisterPartitionDoorbellEvent' -Namespace Win32 -PassThru
# $api::WHvUnregisterPartitionDoorbellEvent(Partition, MatchData)#uselib "WinHvPlatform.dll"
#func global WHvUnregisterPartitionDoorbellEvent "WHvUnregisterPartitionDoorbellEvent" sptr, sptr
; WHvUnregisterPartitionDoorbellEvent Partition, varptr(MatchData) ; 戻り値は stat
; Partition : WHV_PARTITION_HANDLE -> "sptr"
; MatchData : WHV_DOORBELL_MATCH_DATA* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "WinHvPlatform.dll" #cfunc global WHvUnregisterPartitionDoorbellEvent "WHvUnregisterPartitionDoorbellEvent" sptr, var ; res = WHvUnregisterPartitionDoorbellEvent(Partition, MatchData) ; Partition : WHV_PARTITION_HANDLE -> "sptr" ; MatchData : WHV_DOORBELL_MATCH_DATA* -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "WinHvPlatform.dll" #cfunc global WHvUnregisterPartitionDoorbellEvent "WHvUnregisterPartitionDoorbellEvent" sptr, sptr ; res = WHvUnregisterPartitionDoorbellEvent(Partition, varptr(MatchData)) ; Partition : WHV_PARTITION_HANDLE -> "sptr" ; MatchData : WHV_DOORBELL_MATCH_DATA* -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; HRESULT WHvUnregisterPartitionDoorbellEvent(WHV_PARTITION_HANDLE Partition, WHV_DOORBELL_MATCH_DATA* MatchData) #uselib "WinHvPlatform.dll" #cfunc global WHvUnregisterPartitionDoorbellEvent "WHvUnregisterPartitionDoorbellEvent" intptr, var ; res = WHvUnregisterPartitionDoorbellEvent(Partition, MatchData) ; Partition : WHV_PARTITION_HANDLE -> "intptr" ; MatchData : WHV_DOORBELL_MATCH_DATA* -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; HRESULT WHvUnregisterPartitionDoorbellEvent(WHV_PARTITION_HANDLE Partition, WHV_DOORBELL_MATCH_DATA* MatchData) #uselib "WinHvPlatform.dll" #cfunc global WHvUnregisterPartitionDoorbellEvent "WHvUnregisterPartitionDoorbellEvent" intptr, intptr ; res = WHvUnregisterPartitionDoorbellEvent(Partition, varptr(MatchData)) ; Partition : WHV_PARTITION_HANDLE -> "intptr" ; MatchData : WHV_DOORBELL_MATCH_DATA* -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
winhvplatform = windows.NewLazySystemDLL("WinHvPlatform.dll")
procWHvUnregisterPartitionDoorbellEvent = winhvplatform.NewProc("WHvUnregisterPartitionDoorbellEvent")
)
// Partition (WHV_PARTITION_HANDLE), MatchData (WHV_DOORBELL_MATCH_DATA*)
r1, _, err := procWHvUnregisterPartitionDoorbellEvent.Call(
uintptr(Partition),
uintptr(MatchData),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction WHvUnregisterPartitionDoorbellEvent(
Partition: NativeInt; // WHV_PARTITION_HANDLE
MatchData: Pointer // WHV_DOORBELL_MATCH_DATA*
): Integer; stdcall;
external 'WinHvPlatform.dll' name 'WHvUnregisterPartitionDoorbellEvent';result := DllCall("WinHvPlatform\WHvUnregisterPartitionDoorbellEvent"
, "Ptr", Partition ; WHV_PARTITION_HANDLE
, "Ptr", MatchData ; WHV_DOORBELL_MATCH_DATA*
, "Int") ; return: HRESULT●WHvUnregisterPartitionDoorbellEvent(Partition, MatchData) = DLL("WinHvPlatform.dll", "int WHvUnregisterPartitionDoorbellEvent(int, void*)")
# 呼び出し: WHvUnregisterPartitionDoorbellEvent(Partition, MatchData)
# Partition : WHV_PARTITION_HANDLE -> "int"
# MatchData : WHV_DOORBELL_MATCH_DATA* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。