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

MFCreateSensorProfileCollection

関数
空のセンサープロファイルコレクションを生成する。
DLLMFSENSORGROUP.dll呼出規約winapi対応OSWindows 10 以降

シグネチャ

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

HRESULT MFCreateSensorProfileCollection(
    IMFSensorProfileCollection** ppSensorProfile
);

パラメーター

名前方向
ppSensorProfileIMFSensorProfileCollection**out

戻り値の型: HRESULT

各言語での呼び出し定義

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

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

MFCreateSensorProfileCollection = ctypes.windll.mfsensorgroup.MFCreateSensorProfileCollection
MFCreateSensorProfileCollection.restype = ctypes.c_int
MFCreateSensorProfileCollection.argtypes = [
    ctypes.c_void_p,  # ppSensorProfile : IMFSensorProfileCollection** out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	mfsensorgroup = windows.NewLazySystemDLL("MFSENSORGROUP.dll")
	procMFCreateSensorProfileCollection = mfsensorgroup.NewProc("MFCreateSensorProfileCollection")
)

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