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