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