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