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