ホーム › Media.WindowsMediaFormat › WMCreateProfileManager
WMCreateProfileManager
関数Windows Mediaプロファイルマネージャを作成する。
シグネチャ
// WMVCore.dll
#include <windows.h>
HRESULT WMCreateProfileManager(
IWMProfileManager** ppProfileManager
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| ppProfileManager | IWMProfileManager** | out | 作成したプロファイルマネージャのIWMProfileManagerを受け取るポインタのアドレス。出力用。 |
戻り値の型: HRESULT
各言語での呼び出し定義
// WMVCore.dll
#include <windows.h>
HRESULT WMCreateProfileManager(
IWMProfileManager** ppProfileManager
);[DllImport("WMVCore.dll", ExactSpelling = true)]
static extern int WMCreateProfileManager(
IntPtr ppProfileManager // IWMProfileManager** out
);<DllImport("WMVCore.dll", ExactSpelling:=True)>
Public Shared Function WMCreateProfileManager(
ppProfileManager As IntPtr ' IWMProfileManager** out
) As Integer
End Function' ppProfileManager : IWMProfileManager** out
Declare PtrSafe Function WMCreateProfileManager Lib "wmvcore" ( _
ByVal ppProfileManager As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
WMCreateProfileManager = ctypes.windll.wmvcore.WMCreateProfileManager
WMCreateProfileManager.restype = ctypes.c_int
WMCreateProfileManager.argtypes = [
ctypes.c_void_p, # ppProfileManager : IWMProfileManager** out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('WMVCore.dll')
WMCreateProfileManager = Fiddle::Function.new(
lib['WMCreateProfileManager'],
[
Fiddle::TYPE_VOIDP, # ppProfileManager : IWMProfileManager** out
],
Fiddle::TYPE_INT)#[link(name = "wmvcore")]
extern "system" {
fn WMCreateProfileManager(
ppProfileManager: *mut *mut core::ffi::c_void // IWMProfileManager** out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("WMVCore.dll")]
public static extern int WMCreateProfileManager(IntPtr ppProfileManager);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WMVCore_WMCreateProfileManager' -Namespace Win32 -PassThru
# $api::WMCreateProfileManager(ppProfileManager)#uselib "WMVCore.dll"
#func global WMCreateProfileManager "WMCreateProfileManager" sptr
; WMCreateProfileManager ppProfileManager ; 戻り値は stat
; ppProfileManager : IWMProfileManager** out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "WMVCore.dll"
#cfunc global WMCreateProfileManager "WMCreateProfileManager" sptr
; res = WMCreateProfileManager(ppProfileManager)
; ppProfileManager : IWMProfileManager** out -> "sptr"; HRESULT WMCreateProfileManager(IWMProfileManager** ppProfileManager)
#uselib "WMVCore.dll"
#cfunc global WMCreateProfileManager "WMCreateProfileManager" intptr
; res = WMCreateProfileManager(ppProfileManager)
; ppProfileManager : IWMProfileManager** out -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
wmvcore = windows.NewLazySystemDLL("WMVCore.dll")
procWMCreateProfileManager = wmvcore.NewProc("WMCreateProfileManager")
)
// ppProfileManager (IWMProfileManager** out)
r1, _, err := procWMCreateProfileManager.Call(
uintptr(ppProfileManager),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction WMCreateProfileManager(
ppProfileManager: Pointer // IWMProfileManager** out
): Integer; stdcall;
external 'WMVCore.dll' name 'WMCreateProfileManager';result := DllCall("WMVCore\WMCreateProfileManager"
, "Ptr", ppProfileManager ; IWMProfileManager** out
, "Int") ; return: HRESULT●WMCreateProfileManager(ppProfileManager) = DLL("WMVCore.dll", "int WMCreateProfileManager(void*)")
# 呼び出し: WMCreateProfileManager(ppProfileManager)
# ppProfileManager : IWMProfileManager** out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "wmvcore" fn WMCreateProfileManager(
ppProfileManager: ?*anyopaque // IWMProfileManager** out
) callconv(std.os.windows.WINAPI) i32;proc WMCreateProfileManager(
ppProfileManager: pointer # IWMProfileManager** out
): int32 {.importc: "WMCreateProfileManager", stdcall, dynlib: "WMVCore.dll".}pragma(lib, "wmvcore");
extern(Windows)
int WMCreateProfileManager(
void* ppProfileManager // IWMProfileManager** out
);ccall((:WMCreateProfileManager, "WMVCore.dll"), stdcall, Int32,
(Ptr{Cvoid},),
ppProfileManager)
# ppProfileManager : IWMProfileManager** out -> Ptr{Cvoid}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
int32_t WMCreateProfileManager(
void* ppProfileManager);
]]
local wmvcore = ffi.load("wmvcore")
-- wmvcore.WMCreateProfileManager(ppProfileManager)
-- ppProfileManager : IWMProfileManager** out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('WMVCore.dll');
const WMCreateProfileManager = lib.func('__stdcall', 'WMCreateProfileManager', 'int32_t', ['void *']);
// WMCreateProfileManager(ppProfileManager)
// ppProfileManager : IWMProfileManager** out -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("WMVCore.dll", {
WMCreateProfileManager: { parameters: ["pointer"], result: "i32" },
});
// lib.symbols.WMCreateProfileManager(ppProfileManager)
// ppProfileManager : IWMProfileManager** out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int32_t WMCreateProfileManager(
void* ppProfileManager);
C, "WMVCore.dll");
// $ffi->WMCreateProfileManager(ppProfileManager);
// ppProfileManager : IWMProfileManager** 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 Wmvcore extends StdCallLibrary {
Wmvcore INSTANCE = Native.load("wmvcore", Wmvcore.class);
int WMCreateProfileManager(
Pointer ppProfileManager // IWMProfileManager** out
);
}@[Link("wmvcore")]
lib LibWMVCore
fun WMCreateProfileManager = WMCreateProfileManager(
ppProfileManager : Void* # IWMProfileManager** out
) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef WMCreateProfileManagerNative = Int32 Function(Pointer<Void>);
typedef WMCreateProfileManagerDart = int Function(Pointer<Void>);
final WMCreateProfileManager = DynamicLibrary.open('WMVCore.dll')
.lookupFunction<WMCreateProfileManagerNative, WMCreateProfileManagerDart>('WMCreateProfileManager');
// ppProfileManager : IWMProfileManager** out -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function WMCreateProfileManager(
ppProfileManager: Pointer // IWMProfileManager** out
): Integer; stdcall;
external 'WMVCore.dll' name 'WMCreateProfileManager';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "WMCreateProfileManager"
c_WMCreateProfileManager :: Ptr () -> IO Int32
-- ppProfileManager : IWMProfileManager** out -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let wmcreateprofilemanager =
foreign "WMCreateProfileManager"
((ptr void) @-> returning int32_t)
(* ppProfileManager : IWMProfileManager** out -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library wmvcore (t "WMVCore.dll"))
(cffi:use-foreign-library wmvcore)
(cffi:defcfun ("WMCreateProfileManager" wmcreate-profile-manager :convention :stdcall) :int32
(pp-profile-manager :pointer)) ; IWMProfileManager** out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $WMCreateProfileManager = Win32::API::More->new('WMVCore',
'int WMCreateProfileManager(LPVOID ppProfileManager)');
# my $ret = $WMCreateProfileManager->Call($ppProfileManager);
# ppProfileManager : IWMProfileManager** out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。関連項目
使用する型