ホーム › Media.Audio › acmStreamPrepareHeader
acmStreamPrepareHeader
関数ACM変換に使うストリームヘッダーとバッファを準備する。
シグネチャ
// MSACM32.dll
#include <windows.h>
DWORD acmStreamPrepareHeader(
HACMSTREAM has,
ACMSTREAMHEADER* pash,
DWORD fdwPrepare
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| has | HACMSTREAM | in |
| pash | ACMSTREAMHEADER* | inout |
| fdwPrepare | DWORD | in |
戻り値の型: DWORD
各言語での呼び出し定義
// MSACM32.dll
#include <windows.h>
DWORD acmStreamPrepareHeader(
HACMSTREAM has,
ACMSTREAMHEADER* pash,
DWORD fdwPrepare
);[DllImport("MSACM32.dll", ExactSpelling = true)]
static extern uint acmStreamPrepareHeader(
IntPtr has, // HACMSTREAM
IntPtr pash, // ACMSTREAMHEADER* in/out
uint fdwPrepare // DWORD
);<DllImport("MSACM32.dll", ExactSpelling:=True)>
Public Shared Function acmStreamPrepareHeader(
has As IntPtr, ' HACMSTREAM
pash As IntPtr, ' ACMSTREAMHEADER* in/out
fdwPrepare As UInteger ' DWORD
) As UInteger
End Function' has : HACMSTREAM
' pash : ACMSTREAMHEADER* in/out
' fdwPrepare : DWORD
Declare PtrSafe Function acmStreamPrepareHeader Lib "msacm32" ( _
ByVal has As LongPtr, _
ByVal pash As LongPtr, _
ByVal fdwPrepare As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
acmStreamPrepareHeader = ctypes.windll.msacm32.acmStreamPrepareHeader
acmStreamPrepareHeader.restype = wintypes.DWORD
acmStreamPrepareHeader.argtypes = [
wintypes.HANDLE, # has : HACMSTREAM
ctypes.c_void_p, # pash : ACMSTREAMHEADER* in/out
wintypes.DWORD, # fdwPrepare : DWORD
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('MSACM32.dll')
acmStreamPrepareHeader = Fiddle::Function.new(
lib['acmStreamPrepareHeader'],
[
Fiddle::TYPE_VOIDP, # has : HACMSTREAM
Fiddle::TYPE_VOIDP, # pash : ACMSTREAMHEADER* in/out
-Fiddle::TYPE_INT, # fdwPrepare : DWORD
],
-Fiddle::TYPE_INT)#[link(name = "msacm32")]
extern "system" {
fn acmStreamPrepareHeader(
has: *mut core::ffi::c_void, // HACMSTREAM
pash: *mut ACMSTREAMHEADER, // ACMSTREAMHEADER* in/out
fdwPrepare: u32 // DWORD
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("MSACM32.dll")]
public static extern uint acmStreamPrepareHeader(IntPtr has, IntPtr pash, uint fdwPrepare);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MSACM32_acmStreamPrepareHeader' -Namespace Win32 -PassThru
# $api::acmStreamPrepareHeader(has, pash, fdwPrepare)#uselib "MSACM32.dll"
#func global acmStreamPrepareHeader "acmStreamPrepareHeader" sptr, sptr, sptr
; acmStreamPrepareHeader has, varptr(pash), fdwPrepare ; 戻り値は stat
; has : HACMSTREAM -> "sptr"
; pash : ACMSTREAMHEADER* in/out -> "sptr"
; fdwPrepare : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "MSACM32.dll" #cfunc global acmStreamPrepareHeader "acmStreamPrepareHeader" sptr, var, int ; res = acmStreamPrepareHeader(has, pash, fdwPrepare) ; has : HACMSTREAM -> "sptr" ; pash : ACMSTREAMHEADER* in/out -> "var" ; fdwPrepare : DWORD -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "MSACM32.dll" #cfunc global acmStreamPrepareHeader "acmStreamPrepareHeader" sptr, sptr, int ; res = acmStreamPrepareHeader(has, varptr(pash), fdwPrepare) ; has : HACMSTREAM -> "sptr" ; pash : ACMSTREAMHEADER* in/out -> "sptr" ; fdwPrepare : DWORD -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; DWORD acmStreamPrepareHeader(HACMSTREAM has, ACMSTREAMHEADER* pash, DWORD fdwPrepare) #uselib "MSACM32.dll" #cfunc global acmStreamPrepareHeader "acmStreamPrepareHeader" intptr, var, int ; res = acmStreamPrepareHeader(has, pash, fdwPrepare) ; has : HACMSTREAM -> "intptr" ; pash : ACMSTREAMHEADER* in/out -> "var" ; fdwPrepare : DWORD -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; DWORD acmStreamPrepareHeader(HACMSTREAM has, ACMSTREAMHEADER* pash, DWORD fdwPrepare) #uselib "MSACM32.dll" #cfunc global acmStreamPrepareHeader "acmStreamPrepareHeader" intptr, intptr, int ; res = acmStreamPrepareHeader(has, varptr(pash), fdwPrepare) ; has : HACMSTREAM -> "intptr" ; pash : ACMSTREAMHEADER* in/out -> "intptr" ; fdwPrepare : DWORD -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
msacm32 = windows.NewLazySystemDLL("MSACM32.dll")
procacmStreamPrepareHeader = msacm32.NewProc("acmStreamPrepareHeader")
)
// has (HACMSTREAM), pash (ACMSTREAMHEADER* in/out), fdwPrepare (DWORD)
r1, _, err := procacmStreamPrepareHeader.Call(
uintptr(has),
uintptr(pash),
uintptr(fdwPrepare),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction acmStreamPrepareHeader(
has: THandle; // HACMSTREAM
pash: Pointer; // ACMSTREAMHEADER* in/out
fdwPrepare: DWORD // DWORD
): DWORD; stdcall;
external 'MSACM32.dll' name 'acmStreamPrepareHeader';result := DllCall("MSACM32\acmStreamPrepareHeader"
, "Ptr", has ; HACMSTREAM
, "Ptr", pash ; ACMSTREAMHEADER* in/out
, "UInt", fdwPrepare ; DWORD
, "UInt") ; return: DWORD●acmStreamPrepareHeader(has, pash, fdwPrepare) = DLL("MSACM32.dll", "dword acmStreamPrepareHeader(void*, void*, dword)")
# 呼び出し: acmStreamPrepareHeader(has, pash, fdwPrepare)
# has : HACMSTREAM -> "void*"
# pash : ACMSTREAMHEADER* in/out -> "void*"
# fdwPrepare : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。