ホーム › Media.Multimedia › AVISaveOptionsFree
AVISaveOptionsFree
関数AVISaveOptionsで確保した圧縮オプション用メモリを解放する。
シグネチャ
// AVIFIL32.dll
#include <windows.h>
HRESULT AVISaveOptionsFree(
INT nStreams,
AVICOMPRESSOPTIONS** plpOptions
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| nStreams | INT | in | plpOptions で参照される AVICOMPRESSOPTIONS 構造体の数です。 |
| plpOptions | AVICOMPRESSOPTIONS** | in | AVICOMPRESSOPTIONS 構造体へのポインターの配列を指すポインターです。これらの構造体には、ダイアログ ボックスで設定された圧縮オプションが保持されます。各構造体について AVISaveOptions によって割り当てられたリソースが解放されます。 |
戻り値の型: HRESULT
公式ドキュメント
AVISaveOptionsFree 関数は、AVISaveOptions 関数によって割り当てられたリソースを解放します。
戻り値
AVIERR_OK を返します。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での呼び出し定義
// AVIFIL32.dll
#include <windows.h>
HRESULT AVISaveOptionsFree(
INT nStreams,
AVICOMPRESSOPTIONS** plpOptions
);[DllImport("AVIFIL32.dll", ExactSpelling = true)]
static extern int AVISaveOptionsFree(
int nStreams, // INT
IntPtr plpOptions // AVICOMPRESSOPTIONS**
);<DllImport("AVIFIL32.dll", ExactSpelling:=True)>
Public Shared Function AVISaveOptionsFree(
nStreams As Integer, ' INT
plpOptions As IntPtr ' AVICOMPRESSOPTIONS**
) As Integer
End Function' nStreams : INT
' plpOptions : AVICOMPRESSOPTIONS**
Declare PtrSafe Function AVISaveOptionsFree Lib "avifil32" ( _
ByVal nStreams As Long, _
ByVal plpOptions As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
AVISaveOptionsFree = ctypes.windll.avifil32.AVISaveOptionsFree
AVISaveOptionsFree.restype = ctypes.c_int
AVISaveOptionsFree.argtypes = [
ctypes.c_int, # nStreams : INT
ctypes.c_void_p, # plpOptions : AVICOMPRESSOPTIONS**
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('AVIFIL32.dll')
AVISaveOptionsFree = Fiddle::Function.new(
lib['AVISaveOptionsFree'],
[
Fiddle::TYPE_INT, # nStreams : INT
Fiddle::TYPE_VOIDP, # plpOptions : AVICOMPRESSOPTIONS**
],
Fiddle::TYPE_INT)#[link(name = "avifil32")]
extern "system" {
fn AVISaveOptionsFree(
nStreams: i32, // INT
plpOptions: *mut *mut AVICOMPRESSOPTIONS // AVICOMPRESSOPTIONS**
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("AVIFIL32.dll")]
public static extern int AVISaveOptionsFree(int nStreams, IntPtr plpOptions);
"@
$api = Add-Type -MemberDefinition $sig -Name 'AVIFIL32_AVISaveOptionsFree' -Namespace Win32 -PassThru
# $api::AVISaveOptionsFree(nStreams, plpOptions)#uselib "AVIFIL32.dll"
#func global AVISaveOptionsFree "AVISaveOptionsFree" sptr, sptr
; AVISaveOptionsFree nStreams, varptr(plpOptions) ; 戻り値は stat
; nStreams : INT -> "sptr"
; plpOptions : AVICOMPRESSOPTIONS** -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "AVIFIL32.dll" #cfunc global AVISaveOptionsFree "AVISaveOptionsFree" int, var ; res = AVISaveOptionsFree(nStreams, plpOptions) ; nStreams : INT -> "int" ; plpOptions : AVICOMPRESSOPTIONS** -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "AVIFIL32.dll" #cfunc global AVISaveOptionsFree "AVISaveOptionsFree" int, sptr ; res = AVISaveOptionsFree(nStreams, varptr(plpOptions)) ; nStreams : INT -> "int" ; plpOptions : AVICOMPRESSOPTIONS** -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; HRESULT AVISaveOptionsFree(INT nStreams, AVICOMPRESSOPTIONS** plpOptions) #uselib "AVIFIL32.dll" #cfunc global AVISaveOptionsFree "AVISaveOptionsFree" int, var ; res = AVISaveOptionsFree(nStreams, plpOptions) ; nStreams : INT -> "int" ; plpOptions : AVICOMPRESSOPTIONS** -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; HRESULT AVISaveOptionsFree(INT nStreams, AVICOMPRESSOPTIONS** plpOptions) #uselib "AVIFIL32.dll" #cfunc global AVISaveOptionsFree "AVISaveOptionsFree" int, intptr ; res = AVISaveOptionsFree(nStreams, varptr(plpOptions)) ; nStreams : INT -> "int" ; plpOptions : AVICOMPRESSOPTIONS** -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
avifil32 = windows.NewLazySystemDLL("AVIFIL32.dll")
procAVISaveOptionsFree = avifil32.NewProc("AVISaveOptionsFree")
)
// nStreams (INT), plpOptions (AVICOMPRESSOPTIONS**)
r1, _, err := procAVISaveOptionsFree.Call(
uintptr(nStreams),
uintptr(plpOptions),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction AVISaveOptionsFree(
nStreams: Integer; // INT
plpOptions: Pointer // AVICOMPRESSOPTIONS**
): Integer; stdcall;
external 'AVIFIL32.dll' name 'AVISaveOptionsFree';result := DllCall("AVIFIL32\AVISaveOptionsFree"
, "Int", nStreams ; INT
, "Ptr", plpOptions ; AVICOMPRESSOPTIONS**
, "Int") ; return: HRESULT●AVISaveOptionsFree(nStreams, plpOptions) = DLL("AVIFIL32.dll", "int AVISaveOptionsFree(int, void*)")
# 呼び出し: AVISaveOptionsFree(nStreams, plpOptions)
# nStreams : INT -> "int"
# plpOptions : AVICOMPRESSOPTIONS** -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "avifil32" fn AVISaveOptionsFree(
nStreams: i32, // INT
plpOptions: [*c][*c]AVICOMPRESSOPTIONS // AVICOMPRESSOPTIONS**
) callconv(std.os.windows.WINAPI) i32;proc AVISaveOptionsFree(
nStreams: int32, # INT
plpOptions: ptr AVICOMPRESSOPTIONS # AVICOMPRESSOPTIONS**
): int32 {.importc: "AVISaveOptionsFree", stdcall, dynlib: "AVIFIL32.dll".}pragma(lib, "avifil32");
extern(Windows)
int AVISaveOptionsFree(
int nStreams, // INT
AVICOMPRESSOPTIONS** plpOptions // AVICOMPRESSOPTIONS**
);ccall((:AVISaveOptionsFree, "AVIFIL32.dll"), stdcall, Int32,
(Int32, Ptr{AVICOMPRESSOPTIONS}),
nStreams, plpOptions)
# nStreams : INT -> Int32
# plpOptions : AVICOMPRESSOPTIONS** -> Ptr{AVICOMPRESSOPTIONS}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
int32_t AVISaveOptionsFree(
int32_t nStreams,
void* plpOptions);
]]
local avifil32 = ffi.load("avifil32")
-- avifil32.AVISaveOptionsFree(nStreams, plpOptions)
-- nStreams : INT
-- plpOptions : AVICOMPRESSOPTIONS**
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('AVIFIL32.dll');
const AVISaveOptionsFree = lib.func('__stdcall', 'AVISaveOptionsFree', 'int32_t', ['int32_t', 'void *']);
// AVISaveOptionsFree(nStreams, plpOptions)
// nStreams : INT -> 'int32_t'
// plpOptions : AVICOMPRESSOPTIONS** -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("AVIFIL32.dll", {
AVISaveOptionsFree: { parameters: ["i32", "pointer"], result: "i32" },
});
// lib.symbols.AVISaveOptionsFree(nStreams, plpOptions)
// nStreams : INT -> "i32"
// plpOptions : AVICOMPRESSOPTIONS** -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int32_t AVISaveOptionsFree(
int32_t nStreams,
void* plpOptions);
C, "AVIFIL32.dll");
// $ffi->AVISaveOptionsFree(nStreams, plpOptions);
// nStreams : INT
// plpOptions : AVICOMPRESSOPTIONS**
// 構造体/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 Avifil32 extends StdCallLibrary {
Avifil32 INSTANCE = Native.load("avifil32", Avifil32.class);
int AVISaveOptionsFree(
int nStreams, // INT
Pointer plpOptions // AVICOMPRESSOPTIONS**
);
}@[Link("avifil32")]
lib LibAVIFIL32
fun AVISaveOptionsFree = AVISaveOptionsFree(
nStreams : Int32, # INT
plpOptions : AVICOMPRESSOPTIONS** # AVICOMPRESSOPTIONS**
) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef AVISaveOptionsFreeNative = Int32 Function(Int32, Pointer<Void>);
typedef AVISaveOptionsFreeDart = int Function(int, Pointer<Void>);
final AVISaveOptionsFree = DynamicLibrary.open('AVIFIL32.dll')
.lookupFunction<AVISaveOptionsFreeNative, AVISaveOptionsFreeDart>('AVISaveOptionsFree');
// nStreams : INT -> Int32
// plpOptions : AVICOMPRESSOPTIONS** -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function AVISaveOptionsFree(
nStreams: Integer; // INT
plpOptions: Pointer // AVICOMPRESSOPTIONS**
): Integer; stdcall;
external 'AVIFIL32.dll' name 'AVISaveOptionsFree';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "AVISaveOptionsFree"
c_AVISaveOptionsFree :: Int32 -> Ptr () -> IO Int32
-- nStreams : INT -> Int32
-- plpOptions : AVICOMPRESSOPTIONS** -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let avisaveoptionsfree =
foreign "AVISaveOptionsFree"
(int32_t @-> (ptr void) @-> returning int32_t)
(* nStreams : INT -> int32_t *)
(* plpOptions : AVICOMPRESSOPTIONS** -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library avifil32 (t "AVIFIL32.dll"))
(cffi:use-foreign-library avifil32)
(cffi:defcfun ("AVISaveOptionsFree" avisave-options-free :convention :stdcall) :int32
(n-streams :int32) ; INT
(plp-options :pointer)) ; AVICOMPRESSOPTIONS**
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $AVISaveOptionsFree = Win32::API::More->new('AVIFIL32',
'int AVISaveOptionsFree(int nStreams, LPVOID plpOptions)');
# my $ret = $AVISaveOptionsFree->Call($nStreams, $plpOptions);
# nStreams : INT -> int
# plpOptions : AVICOMPRESSOPTIONS** -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。関連項目
使用する型