ホーム › System.Threading › RtwqPutWorkItem
RtwqPutWorkItem
関数指定の作業キューに作業項目を投入して実行を要求する。
シグネチャ
// RTWorkQ.dll
#include <windows.h>
HRESULT RtwqPutWorkItem(
DWORD dwQueue,
INT lPriority,
IRtwqAsyncResult* result
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| dwQueue | DWORD | in |
| lPriority | INT | in |
| result | IRtwqAsyncResult* | in |
戻り値の型: HRESULT
各言語での呼び出し定義
// RTWorkQ.dll
#include <windows.h>
HRESULT RtwqPutWorkItem(
DWORD dwQueue,
INT lPriority,
IRtwqAsyncResult* result
);[DllImport("RTWorkQ.dll", ExactSpelling = true)]
static extern int RtwqPutWorkItem(
uint dwQueue, // DWORD
int lPriority, // INT
IntPtr result // IRtwqAsyncResult*
);<DllImport("RTWorkQ.dll", ExactSpelling:=True)>
Public Shared Function RtwqPutWorkItem(
dwQueue As UInteger, ' DWORD
lPriority As Integer, ' INT
result As IntPtr ' IRtwqAsyncResult*
) As Integer
End Function' dwQueue : DWORD
' lPriority : INT
' result : IRtwqAsyncResult*
Declare PtrSafe Function RtwqPutWorkItem Lib "rtworkq" ( _
ByVal dwQueue As Long, _
ByVal lPriority As Long, _
ByVal result As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
RtwqPutWorkItem = ctypes.windll.rtworkq.RtwqPutWorkItem
RtwqPutWorkItem.restype = ctypes.c_int
RtwqPutWorkItem.argtypes = [
wintypes.DWORD, # dwQueue : DWORD
ctypes.c_int, # lPriority : INT
ctypes.c_void_p, # result : IRtwqAsyncResult*
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('RTWorkQ.dll')
RtwqPutWorkItem = Fiddle::Function.new(
lib['RtwqPutWorkItem'],
[
-Fiddle::TYPE_INT, # dwQueue : DWORD
Fiddle::TYPE_INT, # lPriority : INT
Fiddle::TYPE_VOIDP, # result : IRtwqAsyncResult*
],
Fiddle::TYPE_INT)#[link(name = "rtworkq")]
extern "system" {
fn RtwqPutWorkItem(
dwQueue: u32, // DWORD
lPriority: i32, // INT
result: *mut core::ffi::c_void // IRtwqAsyncResult*
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("RTWorkQ.dll")]
public static extern int RtwqPutWorkItem(uint dwQueue, int lPriority, IntPtr result);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RTWorkQ_RtwqPutWorkItem' -Namespace Win32 -PassThru
# $api::RtwqPutWorkItem(dwQueue, lPriority, result)#uselib "RTWorkQ.dll"
#func global RtwqPutWorkItem "RtwqPutWorkItem" sptr, sptr, sptr
; RtwqPutWorkItem dwQueue, lPriority, result ; 戻り値は stat
; dwQueue : DWORD -> "sptr"
; lPriority : INT -> "sptr"
; result : IRtwqAsyncResult* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "RTWorkQ.dll"
#cfunc global RtwqPutWorkItem "RtwqPutWorkItem" int, int, sptr
; res = RtwqPutWorkItem(dwQueue, lPriority, result)
; dwQueue : DWORD -> "int"
; lPriority : INT -> "int"
; result : IRtwqAsyncResult* -> "sptr"; HRESULT RtwqPutWorkItem(DWORD dwQueue, INT lPriority, IRtwqAsyncResult* result)
#uselib "RTWorkQ.dll"
#cfunc global RtwqPutWorkItem "RtwqPutWorkItem" int, int, intptr
; res = RtwqPutWorkItem(dwQueue, lPriority, result)
; dwQueue : DWORD -> "int"
; lPriority : INT -> "int"
; result : IRtwqAsyncResult* -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
rtworkq = windows.NewLazySystemDLL("RTWorkQ.dll")
procRtwqPutWorkItem = rtworkq.NewProc("RtwqPutWorkItem")
)
// dwQueue (DWORD), lPriority (INT), result (IRtwqAsyncResult*)
r1, _, err := procRtwqPutWorkItem.Call(
uintptr(dwQueue),
uintptr(lPriority),
uintptr(result),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction RtwqPutWorkItem(
dwQueue: DWORD; // DWORD
lPriority: Integer; // INT
result: Pointer // IRtwqAsyncResult*
): Integer; stdcall;
external 'RTWorkQ.dll' name 'RtwqPutWorkItem';result := DllCall("RTWorkQ\RtwqPutWorkItem"
, "UInt", dwQueue ; DWORD
, "Int", lPriority ; INT
, "Ptr", result ; IRtwqAsyncResult*
, "Int") ; return: HRESULT●RtwqPutWorkItem(dwQueue, lPriority, result) = DLL("RTWorkQ.dll", "int RtwqPutWorkItem(dword, int, void*)")
# 呼び出し: RtwqPutWorkItem(dwQueue, lPriority, result)
# dwQueue : DWORD -> "dword"
# lPriority : INT -> "int"
# result : IRtwqAsyncResult* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。