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