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