Win32 API 日本語リファレンス
ホームAI.MachineLearning.WinML › WinMLCreateRuntime

WinMLCreateRuntime

関数
Windows機械学習の実行ランタイムを作成する。
DLLwinml.dll呼出規約winapi

シグネチャ

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

HRESULT WinMLCreateRuntime(
    IWinMLRuntime** runtime
);

パラメーター

名前方向
runtimeIWinMLRuntime**out

戻り値の型: HRESULT

各言語での呼び出し定義

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

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

WinMLCreateRuntime = ctypes.windll.winml.WinMLCreateRuntime
WinMLCreateRuntime.restype = ctypes.c_int
WinMLCreateRuntime.argtypes = [
    ctypes.c_void_p,  # runtime : IWinMLRuntime** out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	winml = windows.NewLazySystemDLL("winml.dll")
	procWinMLCreateRuntime = winml.NewProc("WinMLCreateRuntime")
)

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