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