Win32 API 日本語リファレンス
ホームStorage.FileSystem › SetIoRingCompletionEvent

SetIoRingCompletionEvent

関数
I/Oリングの完了通知に使うイベントハンドルを設定する。
DLLapi-ms-win-core-ioring-l1-1-0.dll呼出規約winapi

シグネチャ

// api-ms-win-core-ioring-l1-1-0.dll
#include <windows.h>

HRESULT SetIoRingCompletionEvent(
    HIORING ioRing,
    HANDLE hEvent
);

パラメーター

名前方向
ioRingHIORINGin
hEventHANDLEin

戻り値の型: HRESULT

各言語での呼び出し定義

// api-ms-win-core-ioring-l1-1-0.dll
#include <windows.h>

HRESULT SetIoRingCompletionEvent(
    HIORING ioRing,
    HANDLE hEvent
);
[DllImport("api-ms-win-core-ioring-l1-1-0.dll", ExactSpelling = true)]
static extern int SetIoRingCompletionEvent(
    IntPtr ioRing,   // HIORING
    IntPtr hEvent   // HANDLE
);
<DllImport("api-ms-win-core-ioring-l1-1-0.dll", ExactSpelling:=True)>
Public Shared Function SetIoRingCompletionEvent(
    ioRing As IntPtr,   ' HIORING
    hEvent As IntPtr   ' HANDLE
) As Integer
End Function
' ioRing : HIORING
' hEvent : HANDLE
Declare PtrSafe Function SetIoRingCompletionEvent Lib "api-ms-win-core-ioring-l1-1-0" ( _
    ByVal ioRing As LongPtr, _
    ByVal hEvent As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

SetIoRingCompletionEvent = ctypes.windll.LoadLibrary("api-ms-win-core-ioring-l1-1-0.dll").SetIoRingCompletionEvent
SetIoRingCompletionEvent.restype = ctypes.c_int
SetIoRingCompletionEvent.argtypes = [
    wintypes.HANDLE,  # ioRing : HIORING
    wintypes.HANDLE,  # hEvent : HANDLE
]
require 'fiddle'
require 'fiddle/import'

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

var (
	api_ms_win_core_ioring_l1_1_0 = windows.NewLazySystemDLL("api-ms-win-core-ioring-l1-1-0.dll")
	procSetIoRingCompletionEvent = api_ms_win_core_ioring_l1_1_0.NewProc("SetIoRingCompletionEvent")
)

// ioRing (HIORING), hEvent (HANDLE)
r1, _, err := procSetIoRingCompletionEvent.Call(
	uintptr(ioRing),
	uintptr(hEvent),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function SetIoRingCompletionEvent(
  ioRing: THandle;   // HIORING
  hEvent: THandle   // HANDLE
): Integer; stdcall;
  external 'api-ms-win-core-ioring-l1-1-0.dll' name 'SetIoRingCompletionEvent';
result := DllCall("api-ms-win-core-ioring-l1-1-0\SetIoRingCompletionEvent"
    , "Ptr", ioRing   ; HIORING
    , "Ptr", hEvent   ; HANDLE
    , "Int")   ; return: HRESULT
●SetIoRingCompletionEvent(ioRing, hEvent) = DLL("api-ms-win-core-ioring-l1-1-0.dll", "int SetIoRingCompletionEvent(void*, void*)")
# 呼び出し: SetIoRingCompletionEvent(ioRing, hEvent)
# ioRing : HIORING -> "void*"
# hEvent : HANDLE -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。