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

WHvDeleteNotificationPort

関数
パーティションの通知ポートを削除する。
DLLWinHvPlatform.dll呼出規約winapi

シグネチャ

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

HRESULT WHvDeleteNotificationPort(
    WHV_PARTITION_HANDLE Partition,
    void* PortHandle
);

パラメーター

名前方向
PartitionWHV_PARTITION_HANDLEin
PortHandlevoid*in

戻り値の型: HRESULT

各言語での呼び出し定義

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

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

WHvDeleteNotificationPort = ctypes.windll.winhvplatform.WHvDeleteNotificationPort
WHvDeleteNotificationPort.restype = ctypes.c_int
WHvDeleteNotificationPort.argtypes = [
    ctypes.c_ssize_t,  # Partition : WHV_PARTITION_HANDLE
    ctypes.POINTER(None),  # PortHandle : void*
]
require 'fiddle'
require 'fiddle/import'

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

var (
	winhvplatform = windows.NewLazySystemDLL("WinHvPlatform.dll")
	procWHvDeleteNotificationPort = winhvplatform.NewProc("WHvDeleteNotificationPort")
)

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