ホーム › Media.MediaFoundation › MFBeginRegisterWorkQueueWithMMCSS
MFBeginRegisterWorkQueueWithMMCSS
関数作業キューをMMCSSタスクへ非同期で関連付け開始する。
シグネチャ
// MFPlat.dll
#include <windows.h>
HRESULT MFBeginRegisterWorkQueueWithMMCSS(
DWORD dwWorkQueueId,
LPCWSTR wszClass,
DWORD dwTaskId,
IMFAsyncCallback* pDoneCallback,
IUnknown* pDoneState
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| dwWorkQueueId | DWORD | in |
| wszClass | LPCWSTR | in |
| dwTaskId | DWORD | in |
| pDoneCallback | IMFAsyncCallback* | in |
| pDoneState | IUnknown* | in |
戻り値の型: HRESULT
各言語での呼び出し定義
// MFPlat.dll
#include <windows.h>
HRESULT MFBeginRegisterWorkQueueWithMMCSS(
DWORD dwWorkQueueId,
LPCWSTR wszClass,
DWORD dwTaskId,
IMFAsyncCallback* pDoneCallback,
IUnknown* pDoneState
);[DllImport("MFPlat.dll", ExactSpelling = true)]
static extern int MFBeginRegisterWorkQueueWithMMCSS(
uint dwWorkQueueId, // DWORD
[MarshalAs(UnmanagedType.LPWStr)] string wszClass, // LPCWSTR
uint dwTaskId, // DWORD
IntPtr pDoneCallback, // IMFAsyncCallback*
IntPtr pDoneState // IUnknown*
);<DllImport("MFPlat.dll", ExactSpelling:=True)>
Public Shared Function MFBeginRegisterWorkQueueWithMMCSS(
dwWorkQueueId As UInteger, ' DWORD
<MarshalAs(UnmanagedType.LPWStr)> wszClass As String, ' LPCWSTR
dwTaskId As UInteger, ' DWORD
pDoneCallback As IntPtr, ' IMFAsyncCallback*
pDoneState As IntPtr ' IUnknown*
) As Integer
End Function' dwWorkQueueId : DWORD
' wszClass : LPCWSTR
' dwTaskId : DWORD
' pDoneCallback : IMFAsyncCallback*
' pDoneState : IUnknown*
Declare PtrSafe Function MFBeginRegisterWorkQueueWithMMCSS Lib "mfplat" ( _
ByVal dwWorkQueueId As Long, _
ByVal wszClass As LongPtr, _
ByVal dwTaskId As Long, _
ByVal pDoneCallback As LongPtr, _
ByVal pDoneState As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
MFBeginRegisterWorkQueueWithMMCSS = ctypes.windll.mfplat.MFBeginRegisterWorkQueueWithMMCSS
MFBeginRegisterWorkQueueWithMMCSS.restype = ctypes.c_int
MFBeginRegisterWorkQueueWithMMCSS.argtypes = [
wintypes.DWORD, # dwWorkQueueId : DWORD
wintypes.LPCWSTR, # wszClass : LPCWSTR
wintypes.DWORD, # dwTaskId : DWORD
ctypes.c_void_p, # pDoneCallback : IMFAsyncCallback*
ctypes.c_void_p, # pDoneState : IUnknown*
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('MFPlat.dll')
MFBeginRegisterWorkQueueWithMMCSS = Fiddle::Function.new(
lib['MFBeginRegisterWorkQueueWithMMCSS'],
[
-Fiddle::TYPE_INT, # dwWorkQueueId : DWORD
Fiddle::TYPE_VOIDP, # wszClass : LPCWSTR
-Fiddle::TYPE_INT, # dwTaskId : DWORD
Fiddle::TYPE_VOIDP, # pDoneCallback : IMFAsyncCallback*
Fiddle::TYPE_VOIDP, # pDoneState : IUnknown*
],
Fiddle::TYPE_INT)#[link(name = "mfplat")]
extern "system" {
fn MFBeginRegisterWorkQueueWithMMCSS(
dwWorkQueueId: u32, // DWORD
wszClass: *const u16, // LPCWSTR
dwTaskId: u32, // DWORD
pDoneCallback: *mut core::ffi::c_void, // IMFAsyncCallback*
pDoneState: *mut core::ffi::c_void // IUnknown*
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("MFPlat.dll")]
public static extern int MFBeginRegisterWorkQueueWithMMCSS(uint dwWorkQueueId, [MarshalAs(UnmanagedType.LPWStr)] string wszClass, uint dwTaskId, IntPtr pDoneCallback, IntPtr pDoneState);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MFPlat_MFBeginRegisterWorkQueueWithMMCSS' -Namespace Win32 -PassThru
# $api::MFBeginRegisterWorkQueueWithMMCSS(dwWorkQueueId, wszClass, dwTaskId, pDoneCallback, pDoneState)#uselib "MFPlat.dll"
#func global MFBeginRegisterWorkQueueWithMMCSS "MFBeginRegisterWorkQueueWithMMCSS" sptr, sptr, sptr, sptr, sptr
; MFBeginRegisterWorkQueueWithMMCSS dwWorkQueueId, wszClass, dwTaskId, pDoneCallback, pDoneState ; 戻り値は stat
; dwWorkQueueId : DWORD -> "sptr"
; wszClass : LPCWSTR -> "sptr"
; dwTaskId : DWORD -> "sptr"
; pDoneCallback : IMFAsyncCallback* -> "sptr"
; pDoneState : IUnknown* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "MFPlat.dll"
#cfunc global MFBeginRegisterWorkQueueWithMMCSS "MFBeginRegisterWorkQueueWithMMCSS" int, wstr, int, sptr, sptr
; res = MFBeginRegisterWorkQueueWithMMCSS(dwWorkQueueId, wszClass, dwTaskId, pDoneCallback, pDoneState)
; dwWorkQueueId : DWORD -> "int"
; wszClass : LPCWSTR -> "wstr"
; dwTaskId : DWORD -> "int"
; pDoneCallback : IMFAsyncCallback* -> "sptr"
; pDoneState : IUnknown* -> "sptr"; HRESULT MFBeginRegisterWorkQueueWithMMCSS(DWORD dwWorkQueueId, LPCWSTR wszClass, DWORD dwTaskId, IMFAsyncCallback* pDoneCallback, IUnknown* pDoneState)
#uselib "MFPlat.dll"
#cfunc global MFBeginRegisterWorkQueueWithMMCSS "MFBeginRegisterWorkQueueWithMMCSS" int, wstr, int, intptr, intptr
; res = MFBeginRegisterWorkQueueWithMMCSS(dwWorkQueueId, wszClass, dwTaskId, pDoneCallback, pDoneState)
; dwWorkQueueId : DWORD -> "int"
; wszClass : LPCWSTR -> "wstr"
; dwTaskId : DWORD -> "int"
; pDoneCallback : IMFAsyncCallback* -> "intptr"
; pDoneState : IUnknown* -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
mfplat = windows.NewLazySystemDLL("MFPlat.dll")
procMFBeginRegisterWorkQueueWithMMCSS = mfplat.NewProc("MFBeginRegisterWorkQueueWithMMCSS")
)
// dwWorkQueueId (DWORD), wszClass (LPCWSTR), dwTaskId (DWORD), pDoneCallback (IMFAsyncCallback*), pDoneState (IUnknown*)
r1, _, err := procMFBeginRegisterWorkQueueWithMMCSS.Call(
uintptr(dwWorkQueueId),
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(wszClass))),
uintptr(dwTaskId),
uintptr(pDoneCallback),
uintptr(pDoneState),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction MFBeginRegisterWorkQueueWithMMCSS(
dwWorkQueueId: DWORD; // DWORD
wszClass: PWideChar; // LPCWSTR
dwTaskId: DWORD; // DWORD
pDoneCallback: Pointer; // IMFAsyncCallback*
pDoneState: Pointer // IUnknown*
): Integer; stdcall;
external 'MFPlat.dll' name 'MFBeginRegisterWorkQueueWithMMCSS';result := DllCall("MFPlat\MFBeginRegisterWorkQueueWithMMCSS"
, "UInt", dwWorkQueueId ; DWORD
, "WStr", wszClass ; LPCWSTR
, "UInt", dwTaskId ; DWORD
, "Ptr", pDoneCallback ; IMFAsyncCallback*
, "Ptr", pDoneState ; IUnknown*
, "Int") ; return: HRESULT●MFBeginRegisterWorkQueueWithMMCSS(dwWorkQueueId, wszClass, dwTaskId, pDoneCallback, pDoneState) = DLL("MFPlat.dll", "int MFBeginRegisterWorkQueueWithMMCSS(dword, char*, dword, void*, void*)")
# 呼び出し: MFBeginRegisterWorkQueueWithMMCSS(dwWorkQueueId, wszClass, dwTaskId, pDoneCallback, pDoneState)
# dwWorkQueueId : DWORD -> "dword"
# wszClass : LPCWSTR -> "char*"
# dwTaskId : DWORD -> "dword"
# pDoneCallback : IMFAsyncCallback* -> "void*"
# pDoneState : IUnknown* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。