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