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

MFCreateSensorProfileCollection

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

シグネチャ

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

HRESULT MFCreateSensorProfileCollection(
    IMFSensorProfileCollection** ppSensorProfile
);

パラメーター

名前方向説明
ppSensorProfileIMFSensorProfileCollection**out成功した場合、センサープロファイルコレクションを格納する IMFSensorProfileCollection を指します。

戻り値の型: HRESULT

公式ドキュメント

センサープロファイルコレクションを作成します。

戻り値

この関数は値を返しません。

出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)

各言語での呼び出し定義

// 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)。
const std = @import("std");

extern "mfsensorgroup" fn MFCreateSensorProfileCollection(
    ppSensorProfile: ?*anyopaque // IMFSensorProfileCollection** out
) callconv(std.os.windows.WINAPI) i32;
proc MFCreateSensorProfileCollection(
    ppSensorProfile: pointer  # IMFSensorProfileCollection** out
): int32 {.importc: "MFCreateSensorProfileCollection", stdcall, dynlib: "MFSENSORGROUP.dll".}
pragma(lib, "mfsensorgroup");
extern(Windows)
int MFCreateSensorProfileCollection(
    void* ppSensorProfile   // IMFSensorProfileCollection** out
);
ccall((:MFCreateSensorProfileCollection, "MFSENSORGROUP.dll"), stdcall, Int32,
      (Ptr{Cvoid},),
      ppSensorProfile)
# ppSensorProfile : IMFSensorProfileCollection** out -> Ptr{Cvoid}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
int32_t MFCreateSensorProfileCollection(
    void* ppSensorProfile);
]]
local mfsensorgroup = ffi.load("mfsensorgroup")
-- mfsensorgroup.MFCreateSensorProfileCollection(ppSensorProfile)
-- ppSensorProfile : IMFSensorProfileCollection** out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('MFSENSORGROUP.dll');
const MFCreateSensorProfileCollection = lib.func('__stdcall', 'MFCreateSensorProfileCollection', 'int32_t', ['void *']);
// MFCreateSensorProfileCollection(ppSensorProfile)
// ppSensorProfile : IMFSensorProfileCollection** out -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("MFSENSORGROUP.dll", {
  MFCreateSensorProfileCollection: { parameters: ["pointer"], result: "i32" },
});
// lib.symbols.MFCreateSensorProfileCollection(ppSensorProfile)
// ppSensorProfile : IMFSensorProfileCollection** out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
int32_t MFCreateSensorProfileCollection(
    void* ppSensorProfile);
C, "MFSENSORGROUP.dll");
// $ffi->MFCreateSensorProfileCollection(ppSensorProfile);
// ppSensorProfile : IMFSensorProfileCollection** out
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。
import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;

public interface Mfsensorgroup extends StdCallLibrary {
    Mfsensorgroup INSTANCE = Native.load("mfsensorgroup", Mfsensorgroup.class);
    int MFCreateSensorProfileCollection(
        Pointer ppSensorProfile   // IMFSensorProfileCollection** out
    );
}
@[Link("mfsensorgroup")]
lib LibMFSENSORGROUP
  fun MFCreateSensorProfileCollection = MFCreateSensorProfileCollection(
    ppSensorProfile : Void*   # IMFSensorProfileCollection** out
  ) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef MFCreateSensorProfileCollectionNative = Int32 Function(Pointer<Void>);
typedef MFCreateSensorProfileCollectionDart = int Function(Pointer<Void>);
final MFCreateSensorProfileCollection = DynamicLibrary.open('MFSENSORGROUP.dll')
    .lookupFunction<MFCreateSensorProfileCollectionNative, MFCreateSensorProfileCollectionDart>('MFCreateSensorProfileCollection');
// ppSensorProfile : IMFSensorProfileCollection** out -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function MFCreateSensorProfileCollection(
  ppSensorProfile: Pointer   // IMFSensorProfileCollection** out
): Integer; stdcall;
  external 'MFSENSORGROUP.dll' name 'MFCreateSensorProfileCollection';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "MFCreateSensorProfileCollection"
  c_MFCreateSensorProfileCollection :: Ptr () -> IO Int32
-- ppSensorProfile : IMFSensorProfileCollection** out -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let mfcreatesensorprofilecollection =
  foreign "MFCreateSensorProfileCollection"
    ((ptr void) @-> returning int32_t)
(* ppSensorProfile : IMFSensorProfileCollection** out -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library mfsensorgroup (t "MFSENSORGROUP.dll"))
(cffi:use-foreign-library mfsensorgroup)

(cffi:defcfun ("MFCreateSensorProfileCollection" mfcreate-sensor-profile-collection :convention :stdcall) :int32
  (pp-sensor-profile :pointer))   ; IMFSensorProfileCollection** out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $MFCreateSensorProfileCollection = Win32::API::More->new('MFSENSORGROUP',
    'int MFCreateSensorProfileCollection(LPVOID ppSensorProfile)');
# my $ret = $MFCreateSensorProfileCollection->Call($ppSensorProfile);
# ppSensorProfile : IMFSensorProfileCollection** out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。

関連項目

使用する型