ホーム › Media.MediaFoundation › MFUnlockWorkQueue
MFUnlockWorkQueue
関数指定した作業キューのロックを解除する。
シグネチャ
// MFPlat.dll
#include <windows.h>
HRESULT MFUnlockWorkQueue(
DWORD dwWorkQueue
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| dwWorkQueue | DWORD | in | ロックを解除するワークキューの識別子。この識別子は MFAllocateWorkQueue 関数によって返されます。 |
戻り値の型: HRESULT
公式ドキュメント
ワークキューのロックを解除します。(MFUnlockWorkQueue)
戻り値
この関数は HRESULT を返します。指定可能な値には以下の表に示すものが含まれますが、これらに限定されません。
| 戻り値 | 説明 |
|---|---|
| 関数は成功しました。 |
解説(Remarks)
アプリケーションは、MFAllocateWorkQueue の各呼び出しに対して 1 回、さらに MFLockWorkQueue の各呼び出しに対して 1 回、MFUnlockWorkQueue を呼び出す必要があります。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での呼び出し定義
// MFPlat.dll
#include <windows.h>
HRESULT MFUnlockWorkQueue(
DWORD dwWorkQueue
);[DllImport("MFPlat.dll", ExactSpelling = true)]
static extern int MFUnlockWorkQueue(
uint dwWorkQueue // DWORD
);<DllImport("MFPlat.dll", ExactSpelling:=True)>
Public Shared Function MFUnlockWorkQueue(
dwWorkQueue As UInteger ' DWORD
) As Integer
End Function' dwWorkQueue : DWORD
Declare PtrSafe Function MFUnlockWorkQueue Lib "mfplat" ( _
ByVal dwWorkQueue As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
MFUnlockWorkQueue = ctypes.windll.mfplat.MFUnlockWorkQueue
MFUnlockWorkQueue.restype = ctypes.c_int
MFUnlockWorkQueue.argtypes = [
wintypes.DWORD, # dwWorkQueue : DWORD
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('MFPlat.dll')
MFUnlockWorkQueue = Fiddle::Function.new(
lib['MFUnlockWorkQueue'],
[
-Fiddle::TYPE_INT, # dwWorkQueue : DWORD
],
Fiddle::TYPE_INT)#[link(name = "mfplat")]
extern "system" {
fn MFUnlockWorkQueue(
dwWorkQueue: u32 // DWORD
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("MFPlat.dll")]
public static extern int MFUnlockWorkQueue(uint dwWorkQueue);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MFPlat_MFUnlockWorkQueue' -Namespace Win32 -PassThru
# $api::MFUnlockWorkQueue(dwWorkQueue)#uselib "MFPlat.dll"
#func global MFUnlockWorkQueue "MFUnlockWorkQueue" sptr
; MFUnlockWorkQueue dwWorkQueue ; 戻り値は stat
; dwWorkQueue : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "MFPlat.dll"
#cfunc global MFUnlockWorkQueue "MFUnlockWorkQueue" int
; res = MFUnlockWorkQueue(dwWorkQueue)
; dwWorkQueue : DWORD -> "int"; HRESULT MFUnlockWorkQueue(DWORD dwWorkQueue)
#uselib "MFPlat.dll"
#cfunc global MFUnlockWorkQueue "MFUnlockWorkQueue" int
; res = MFUnlockWorkQueue(dwWorkQueue)
; dwWorkQueue : DWORD -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
mfplat = windows.NewLazySystemDLL("MFPlat.dll")
procMFUnlockWorkQueue = mfplat.NewProc("MFUnlockWorkQueue")
)
// dwWorkQueue (DWORD)
r1, _, err := procMFUnlockWorkQueue.Call(
uintptr(dwWorkQueue),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction MFUnlockWorkQueue(
dwWorkQueue: DWORD // DWORD
): Integer; stdcall;
external 'MFPlat.dll' name 'MFUnlockWorkQueue';result := DllCall("MFPlat\MFUnlockWorkQueue"
, "UInt", dwWorkQueue ; DWORD
, "Int") ; return: HRESULT●MFUnlockWorkQueue(dwWorkQueue) = DLL("MFPlat.dll", "int MFUnlockWorkQueue(dword)")
# 呼び出し: MFUnlockWorkQueue(dwWorkQueue)
# dwWorkQueue : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "mfplat" fn MFUnlockWorkQueue(
dwWorkQueue: u32 // DWORD
) callconv(std.os.windows.WINAPI) i32;proc MFUnlockWorkQueue(
dwWorkQueue: uint32 # DWORD
): int32 {.importc: "MFUnlockWorkQueue", stdcall, dynlib: "MFPlat.dll".}pragma(lib, "mfplat");
extern(Windows)
int MFUnlockWorkQueue(
uint dwWorkQueue // DWORD
);ccall((:MFUnlockWorkQueue, "MFPlat.dll"), stdcall, Int32,
(UInt32,),
dwWorkQueue)
# dwWorkQueue : DWORD -> UInt32
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
int32_t MFUnlockWorkQueue(
uint32_t dwWorkQueue);
]]
local mfplat = ffi.load("mfplat")
-- mfplat.MFUnlockWorkQueue(dwWorkQueue)
-- dwWorkQueue : DWORD
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('MFPlat.dll');
const MFUnlockWorkQueue = lib.func('__stdcall', 'MFUnlockWorkQueue', 'int32_t', ['uint32_t']);
// MFUnlockWorkQueue(dwWorkQueue)
// dwWorkQueue : DWORD -> 'uint32_t'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("MFPlat.dll", {
MFUnlockWorkQueue: { parameters: ["u32"], result: "i32" },
});
// lib.symbols.MFUnlockWorkQueue(dwWorkQueue)
// dwWorkQueue : DWORD -> "u32"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int32_t MFUnlockWorkQueue(
uint32_t dwWorkQueue);
C, "MFPlat.dll");
// $ffi->MFUnlockWorkQueue(dwWorkQueue);
// dwWorkQueue : DWORD
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;
public interface Mfplat extends StdCallLibrary {
Mfplat INSTANCE = Native.load("mfplat", Mfplat.class);
int MFUnlockWorkQueue(
int dwWorkQueue // DWORD
);
}@[Link("mfplat")]
lib LibMFPlat
fun MFUnlockWorkQueue = MFUnlockWorkQueue(
dwWorkQueue : UInt32 # DWORD
) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef MFUnlockWorkQueueNative = Int32 Function(Uint32);
typedef MFUnlockWorkQueueDart = int Function(int);
final MFUnlockWorkQueue = DynamicLibrary.open('MFPlat.dll')
.lookupFunction<MFUnlockWorkQueueNative, MFUnlockWorkQueueDart>('MFUnlockWorkQueue');
// dwWorkQueue : DWORD -> Uint32
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function MFUnlockWorkQueue(
dwWorkQueue: DWORD // DWORD
): Integer; stdcall;
external 'MFPlat.dll' name 'MFUnlockWorkQueue';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "MFUnlockWorkQueue"
c_MFUnlockWorkQueue :: Word32 -> IO Int32
-- dwWorkQueue : DWORD -> Word32
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let mfunlockworkqueue =
foreign "MFUnlockWorkQueue"
(uint32_t @-> returning int32_t)
(* dwWorkQueue : DWORD -> uint32_t *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library mfplat (t "MFPlat.dll"))
(cffi:use-foreign-library mfplat)
(cffi:defcfun ("MFUnlockWorkQueue" mfunlock-work-queue :convention :stdcall) :int32
(dw-work-queue :uint32)) ; DWORD
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $MFUnlockWorkQueue = Win32::API::More->new('MFPlat',
'int MFUnlockWorkQueue(DWORD dwWorkQueue)');
# my $ret = $MFUnlockWorkQueue->Call($dwWorkQueue);
# dwWorkQueue : DWORD -> DWORD
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。