Win32 API 日本語リファレンス
ホームMedia.MediaFoundation › MFAllocateSerialWorkQueue

MFAllocateSerialWorkQueue

関数
既存キューに連動する直列処理作業キューを割り当てる。
DLLMFPlat.dll呼出規約winapi対応OSwindows8.0

シグネチャ

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

HRESULT MFAllocateSerialWorkQueue(
    DWORD dwWorkQueue,
    DWORD* pdwWorkQueue
);

パラメーター

名前方向
dwWorkQueueDWORDin
pdwWorkQueueDWORD*out

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT MFAllocateSerialWorkQueue(
    DWORD dwWorkQueue,
    DWORD* pdwWorkQueue
);
[DllImport("MFPlat.dll", ExactSpelling = true)]
static extern int MFAllocateSerialWorkQueue(
    uint dwWorkQueue,   // DWORD
    out uint pdwWorkQueue   // DWORD* out
);
<DllImport("MFPlat.dll", ExactSpelling:=True)>
Public Shared Function MFAllocateSerialWorkQueue(
    dwWorkQueue As UInteger,   ' DWORD
    <Out> ByRef pdwWorkQueue As UInteger   ' DWORD* out
) As Integer
End Function
' dwWorkQueue : DWORD
' pdwWorkQueue : DWORD* out
Declare PtrSafe Function MFAllocateSerialWorkQueue Lib "mfplat" ( _
    ByVal dwWorkQueue As Long, _
    ByRef pdwWorkQueue As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

MFAllocateSerialWorkQueue = ctypes.windll.mfplat.MFAllocateSerialWorkQueue
MFAllocateSerialWorkQueue.restype = ctypes.c_int
MFAllocateSerialWorkQueue.argtypes = [
    wintypes.DWORD,  # dwWorkQueue : DWORD
    ctypes.POINTER(wintypes.DWORD),  # pdwWorkQueue : DWORD* out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('MFPlat.dll')
MFAllocateSerialWorkQueue = Fiddle::Function.new(
  lib['MFAllocateSerialWorkQueue'],
  [
    -Fiddle::TYPE_INT,  # dwWorkQueue : DWORD
    Fiddle::TYPE_VOIDP,  # pdwWorkQueue : DWORD* out
  ],
  Fiddle::TYPE_INT)
#[link(name = "mfplat")]
extern "system" {
    fn MFAllocateSerialWorkQueue(
        dwWorkQueue: u32,  // DWORD
        pdwWorkQueue: *mut u32  // DWORD* out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("MFPlat.dll")]
public static extern int MFAllocateSerialWorkQueue(uint dwWorkQueue, out uint pdwWorkQueue);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MFPlat_MFAllocateSerialWorkQueue' -Namespace Win32 -PassThru
# $api::MFAllocateSerialWorkQueue(dwWorkQueue, pdwWorkQueue)
#uselib "MFPlat.dll"
#func global MFAllocateSerialWorkQueue "MFAllocateSerialWorkQueue" sptr, sptr
; MFAllocateSerialWorkQueue dwWorkQueue, varptr(pdwWorkQueue)   ; 戻り値は stat
; dwWorkQueue : DWORD -> "sptr"
; pdwWorkQueue : DWORD* out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "MFPlat.dll"
#cfunc global MFAllocateSerialWorkQueue "MFAllocateSerialWorkQueue" int, var
; res = MFAllocateSerialWorkQueue(dwWorkQueue, pdwWorkQueue)
; dwWorkQueue : DWORD -> "int"
; pdwWorkQueue : DWORD* out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; HRESULT MFAllocateSerialWorkQueue(DWORD dwWorkQueue, DWORD* pdwWorkQueue)
#uselib "MFPlat.dll"
#cfunc global MFAllocateSerialWorkQueue "MFAllocateSerialWorkQueue" int, var
; res = MFAllocateSerialWorkQueue(dwWorkQueue, pdwWorkQueue)
; dwWorkQueue : DWORD -> "int"
; pdwWorkQueue : DWORD* out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	mfplat = windows.NewLazySystemDLL("MFPlat.dll")
	procMFAllocateSerialWorkQueue = mfplat.NewProc("MFAllocateSerialWorkQueue")
)

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