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

ExecuteUmsThread

関数
指定のUMSワーカースレッドを実行する。
DLLKERNEL32.dll呼出規約winapiSetLastErrorあり対応OSWindows 7 以降

シグネチャ

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

BOOL ExecuteUmsThread(
    void* UmsThread
);

パラメーター

名前方向
UmsThreadvoid*inout

戻り値の型: BOOL

各言語での呼び出し定義

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

BOOL ExecuteUmsThread(
    void* UmsThread
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("KERNEL32.dll", SetLastError = true, ExactSpelling = true)]
static extern bool ExecuteUmsThread(
    IntPtr UmsThread   // void* in/out
);
<DllImport("KERNEL32.dll", SetLastError:=True, ExactSpelling:=True)>
Public Shared Function ExecuteUmsThread(
    UmsThread As IntPtr   ' void* in/out
) As Boolean
End Function
' UmsThread : void* in/out
Declare PtrSafe Function ExecuteUmsThread 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

ExecuteUmsThread = ctypes.windll.kernel32.ExecuteUmsThread
ExecuteUmsThread.restype = wintypes.BOOL
ExecuteUmsThread.argtypes = [
    ctypes.POINTER(None),  # UmsThread : void* in/out
]
# GetLastError: use ctypes.GetLastError() (or ctypes.WinDLL(use_last_error=True))
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('KERNEL32.dll')
ExecuteUmsThread = Fiddle::Function.new(
  lib['ExecuteUmsThread'],
  [
    Fiddle::TYPE_VOIDP,  # UmsThread : void* in/out
  ],
  Fiddle::TYPE_INT)
#[link(name = "kernel32")]
extern "system" {
    fn ExecuteUmsThread(
        UmsThread: *mut ()  // void* in/out
    ) -> 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 ExecuteUmsThread(IntPtr UmsThread);
"@
$api = Add-Type -MemberDefinition $sig -Name 'KERNEL32_ExecuteUmsThread' -Namespace Win32 -PassThru
# $api::ExecuteUmsThread(UmsThread)
#uselib "KERNEL32.dll"
#func global ExecuteUmsThread "ExecuteUmsThread" sptr
; ExecuteUmsThread UmsThread   ; 戻り値は stat
; UmsThread : void* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "KERNEL32.dll"
#cfunc global ExecuteUmsThread "ExecuteUmsThread" sptr
; res = ExecuteUmsThread(UmsThread)
; UmsThread : void* in/out -> "sptr"
; BOOL ExecuteUmsThread(void* UmsThread)
#uselib "KERNEL32.dll"
#cfunc global ExecuteUmsThread "ExecuteUmsThread" intptr
; res = ExecuteUmsThread(UmsThread)
; UmsThread : void* in/out -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	kernel32 = windows.NewLazySystemDLL("KERNEL32.dll")
	procExecuteUmsThread = kernel32.NewProc("ExecuteUmsThread")
)

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