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

MFCreateProtectedEnvironmentAccess

関数
保護環境へのアクセスオブジェクトを生成する。
DLLMF.dll呼出規約winapi対応OSwindows8.0

シグネチャ

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

HRESULT MFCreateProtectedEnvironmentAccess(
    IMFProtectedEnvironmentAccess** ppAccess
);

パラメーター

名前方向
ppAccessIMFProtectedEnvironmentAccess**out

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT MFCreateProtectedEnvironmentAccess(
    IMFProtectedEnvironmentAccess** ppAccess
);
[DllImport("MF.dll", ExactSpelling = true)]
static extern int MFCreateProtectedEnvironmentAccess(
    IntPtr ppAccess   // IMFProtectedEnvironmentAccess** out
);
<DllImport("MF.dll", ExactSpelling:=True)>
Public Shared Function MFCreateProtectedEnvironmentAccess(
    ppAccess As IntPtr   ' IMFProtectedEnvironmentAccess** out
) As Integer
End Function
' ppAccess : IMFProtectedEnvironmentAccess** out
Declare PtrSafe Function MFCreateProtectedEnvironmentAccess Lib "mf" ( _
    ByVal ppAccess As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

MFCreateProtectedEnvironmentAccess = ctypes.windll.mf.MFCreateProtectedEnvironmentAccess
MFCreateProtectedEnvironmentAccess.restype = ctypes.c_int
MFCreateProtectedEnvironmentAccess.argtypes = [
    ctypes.c_void_p,  # ppAccess : IMFProtectedEnvironmentAccess** out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('MF.dll')
MFCreateProtectedEnvironmentAccess = Fiddle::Function.new(
  lib['MFCreateProtectedEnvironmentAccess'],
  [
    Fiddle::TYPE_VOIDP,  # ppAccess : IMFProtectedEnvironmentAccess** out
  ],
  Fiddle::TYPE_INT)
#[link(name = "mf")]
extern "system" {
    fn MFCreateProtectedEnvironmentAccess(
        ppAccess: *mut *mut core::ffi::c_void  // IMFProtectedEnvironmentAccess** out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("MF.dll")]
public static extern int MFCreateProtectedEnvironmentAccess(IntPtr ppAccess);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MF_MFCreateProtectedEnvironmentAccess' -Namespace Win32 -PassThru
# $api::MFCreateProtectedEnvironmentAccess(ppAccess)
#uselib "MF.dll"
#func global MFCreateProtectedEnvironmentAccess "MFCreateProtectedEnvironmentAccess" sptr
; MFCreateProtectedEnvironmentAccess ppAccess   ; 戻り値は stat
; ppAccess : IMFProtectedEnvironmentAccess** out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "MF.dll"
#cfunc global MFCreateProtectedEnvironmentAccess "MFCreateProtectedEnvironmentAccess" sptr
; res = MFCreateProtectedEnvironmentAccess(ppAccess)
; ppAccess : IMFProtectedEnvironmentAccess** out -> "sptr"
; HRESULT MFCreateProtectedEnvironmentAccess(IMFProtectedEnvironmentAccess** ppAccess)
#uselib "MF.dll"
#cfunc global MFCreateProtectedEnvironmentAccess "MFCreateProtectedEnvironmentAccess" intptr
; res = MFCreateProtectedEnvironmentAccess(ppAccess)
; ppAccess : IMFProtectedEnvironmentAccess** out -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	mf = windows.NewLazySystemDLL("MF.dll")
	procMFCreateProtectedEnvironmentAccess = mf.NewProc("MFCreateProtectedEnvironmentAccess")
)

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