ホーム › System.Environment › TerminateEnclave
TerminateEnclave
関数実行中のエンクレーブを終了し全スレッドを停止する。
シグネチャ
// vertdll.dll
#include <windows.h>
BOOL TerminateEnclave(
void* lpAddress,
BOOL fWait
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| lpAddress | void* | in |
| fWait | BOOL | in |
戻り値の型: BOOL
各言語での呼び出し定義
// vertdll.dll
#include <windows.h>
BOOL TerminateEnclave(
void* lpAddress,
BOOL fWait
);[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("vertdll.dll", SetLastError = true, ExactSpelling = true)]
static extern bool TerminateEnclave(
IntPtr lpAddress, // void*
bool fWait // BOOL
);<DllImport("vertdll.dll", SetLastError:=True, ExactSpelling:=True)>
Public Shared Function TerminateEnclave(
lpAddress As IntPtr, ' void*
fWait As Boolean ' BOOL
) As Boolean
End Function' lpAddress : void*
' fWait : BOOL
Declare PtrSafe Function TerminateEnclave Lib "vertdll" ( _
ByVal lpAddress As LongPtr, _
ByVal fWait As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
TerminateEnclave = ctypes.windll.vertdll.TerminateEnclave
TerminateEnclave.restype = wintypes.BOOL
TerminateEnclave.argtypes = [
ctypes.POINTER(None), # lpAddress : void*
wintypes.BOOL, # fWait : BOOL
]
# GetLastError: use ctypes.GetLastError() (or ctypes.WinDLL(use_last_error=True))require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('vertdll.dll')
TerminateEnclave = Fiddle::Function.new(
lib['TerminateEnclave'],
[
Fiddle::TYPE_VOIDP, # lpAddress : void*
Fiddle::TYPE_INT, # fWait : BOOL
],
Fiddle::TYPE_INT)#[link(name = "vertdll")]
extern "system" {
fn TerminateEnclave(
lpAddress: *mut (), // void*
fWait: i32 // BOOL
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("vertdll.dll", SetLastError = true)]
public static extern bool TerminateEnclave(IntPtr lpAddress, bool fWait);
"@
$api = Add-Type -MemberDefinition $sig -Name 'vertdll_TerminateEnclave' -Namespace Win32 -PassThru
# $api::TerminateEnclave(lpAddress, fWait)#uselib "vertdll.dll"
#func global TerminateEnclave "TerminateEnclave" sptr, sptr
; TerminateEnclave lpAddress, fWait ; 戻り値は stat
; lpAddress : void* -> "sptr"
; fWait : BOOL -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "vertdll.dll"
#cfunc global TerminateEnclave "TerminateEnclave" sptr, int
; res = TerminateEnclave(lpAddress, fWait)
; lpAddress : void* -> "sptr"
; fWait : BOOL -> "int"; BOOL TerminateEnclave(void* lpAddress, BOOL fWait)
#uselib "vertdll.dll"
#cfunc global TerminateEnclave "TerminateEnclave" intptr, int
; res = TerminateEnclave(lpAddress, fWait)
; lpAddress : void* -> "intptr"
; fWait : BOOL -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
vertdll = windows.NewLazySystemDLL("vertdll.dll")
procTerminateEnclave = vertdll.NewProc("TerminateEnclave")
)
// lpAddress (void*), fWait (BOOL)
r1, _, err := procTerminateEnclave.Call(
uintptr(lpAddress),
uintptr(fWait),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLfunction TerminateEnclave(
lpAddress: Pointer; // void*
fWait: BOOL // BOOL
): BOOL; stdcall;
external 'vertdll.dll' name 'TerminateEnclave';result := DllCall("vertdll\TerminateEnclave"
, "Ptr", lpAddress ; void*
, "Int", fWait ; BOOL
, "Int") ; return: BOOL●TerminateEnclave(lpAddress, fWait) = DLL("vertdll.dll", "bool TerminateEnclave(void*, bool)")
# 呼び出し: TerminateEnclave(lpAddress, fWait)
# lpAddress : void* -> "void*"
# fWait : BOOL -> "bool"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。