Win32 API 日本語リファレンス
ホームMedia.Audio › acmDriverID

acmDriverID

関数
ACMオブジェクトに対応するドライバーIDを取得する。
DLLMSACM32.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

// MSACM32.dll
#include <windows.h>

DWORD acmDriverID(
    HACMOBJ hao,
    HACMDRIVERID* phadid,
    DWORD fdwDriverID
);

パラメーター

名前方向
haoHACMOBJin
phadidHACMDRIVERID*inout
fdwDriverIDDWORDin

戻り値の型: DWORD

各言語での呼び出し定義

// MSACM32.dll
#include <windows.h>

DWORD acmDriverID(
    HACMOBJ hao,
    HACMDRIVERID* phadid,
    DWORD fdwDriverID
);
[DllImport("MSACM32.dll", ExactSpelling = true)]
static extern uint acmDriverID(
    IntPtr hao,   // HACMOBJ
    IntPtr phadid,   // HACMDRIVERID* in/out
    uint fdwDriverID   // DWORD
);
<DllImport("MSACM32.dll", ExactSpelling:=True)>
Public Shared Function acmDriverID(
    hao As IntPtr,   ' HACMOBJ
    phadid As IntPtr,   ' HACMDRIVERID* in/out
    fdwDriverID As UInteger   ' DWORD
) As UInteger
End Function
' hao : HACMOBJ
' phadid : HACMDRIVERID* in/out
' fdwDriverID : DWORD
Declare PtrSafe Function acmDriverID Lib "msacm32" ( _
    ByVal hao As LongPtr, _
    ByVal phadid As LongPtr, _
    ByVal fdwDriverID As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

acmDriverID = ctypes.windll.msacm32.acmDriverID
acmDriverID.restype = wintypes.DWORD
acmDriverID.argtypes = [
    wintypes.HANDLE,  # hao : HACMOBJ
    ctypes.c_void_p,  # phadid : HACMDRIVERID* in/out
    wintypes.DWORD,  # fdwDriverID : DWORD
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('MSACM32.dll')
acmDriverID = Fiddle::Function.new(
  lib['acmDriverID'],
  [
    Fiddle::TYPE_VOIDP,  # hao : HACMOBJ
    Fiddle::TYPE_VOIDP,  # phadid : HACMDRIVERID* in/out
    -Fiddle::TYPE_INT,  # fdwDriverID : DWORD
  ],
  -Fiddle::TYPE_INT)
#[link(name = "msacm32")]
extern "system" {
    fn acmDriverID(
        hao: *mut core::ffi::c_void,  // HACMOBJ
        phadid: *mut *mut core::ffi::c_void,  // HACMDRIVERID* in/out
        fdwDriverID: u32  // DWORD
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("MSACM32.dll")]
public static extern uint acmDriverID(IntPtr hao, IntPtr phadid, uint fdwDriverID);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MSACM32_acmDriverID' -Namespace Win32 -PassThru
# $api::acmDriverID(hao, phadid, fdwDriverID)
#uselib "MSACM32.dll"
#func global acmDriverID "acmDriverID" sptr, sptr, sptr
; acmDriverID hao, phadid, fdwDriverID   ; 戻り値は stat
; hao : HACMOBJ -> "sptr"
; phadid : HACMDRIVERID* in/out -> "sptr"
; fdwDriverID : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "MSACM32.dll"
#cfunc global acmDriverID "acmDriverID" sptr, sptr, int
; res = acmDriverID(hao, phadid, fdwDriverID)
; hao : HACMOBJ -> "sptr"
; phadid : HACMDRIVERID* in/out -> "sptr"
; fdwDriverID : DWORD -> "int"
; DWORD acmDriverID(HACMOBJ hao, HACMDRIVERID* phadid, DWORD fdwDriverID)
#uselib "MSACM32.dll"
#cfunc global acmDriverID "acmDriverID" intptr, intptr, int
; res = acmDriverID(hao, phadid, fdwDriverID)
; hao : HACMOBJ -> "intptr"
; phadid : HACMDRIVERID* in/out -> "intptr"
; fdwDriverID : DWORD -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	msacm32 = windows.NewLazySystemDLL("MSACM32.dll")
	procacmDriverID = msacm32.NewProc("acmDriverID")
)

// hao (HACMOBJ), phadid (HACMDRIVERID* in/out), fdwDriverID (DWORD)
r1, _, err := procacmDriverID.Call(
	uintptr(hao),
	uintptr(phadid),
	uintptr(fdwDriverID),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // DWORD
function acmDriverID(
  hao: THandle;   // HACMOBJ
  phadid: Pointer;   // HACMDRIVERID* in/out
  fdwDriverID: DWORD   // DWORD
): DWORD; stdcall;
  external 'MSACM32.dll' name 'acmDriverID';
result := DllCall("MSACM32\acmDriverID"
    , "Ptr", hao   ; HACMOBJ
    , "Ptr", phadid   ; HACMDRIVERID* in/out
    , "UInt", fdwDriverID   ; DWORD
    , "UInt")   ; return: DWORD
●acmDriverID(hao, phadid, fdwDriverID) = DLL("MSACM32.dll", "dword acmDriverID(void*, void*, dword)")
# 呼び出し: acmDriverID(hao, phadid, fdwDriverID)
# hao : HACMOBJ -> "void*"
# phadid : HACMDRIVERID* in/out -> "void*"
# fdwDriverID : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。