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

CreatePropertyStore

関数
空のプロパティストアオブジェクトを生成する。
DLLMFPlat.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

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

HRESULT CreatePropertyStore(
    IPropertyStore** ppStore
);

パラメーター

名前方向
ppStoreIPropertyStore**out

戻り値の型: HRESULT

各言語での呼び出し定義

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

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

CreatePropertyStore = ctypes.windll.mfplat.CreatePropertyStore
CreatePropertyStore.restype = ctypes.c_int
CreatePropertyStore.argtypes = [
    ctypes.c_void_p,  # ppStore : IPropertyStore** out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	mfplat = windows.NewLazySystemDLL("MFPlat.dll")
	procCreatePropertyStore = mfplat.NewProc("CreatePropertyStore")
)

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