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

acmDriverAddA

関数
ACMドライバーをシステムに追加登録する(ANSI版)。
DLLMSACM32.dll文字セットANSI (-A)呼出規約winapi対応OSWindows 2000 以降

シグネチャ

// MSACM32.dll  (ANSI / -A)
#include <windows.h>

DWORD acmDriverAddA(
    HACMDRIVERID* phadid,
    HINSTANCE hinstModule,
    LPARAM lParam,
    DWORD dwPriority,
    DWORD fdwAdd
);

パラメーター

名前方向
phadidHACMDRIVERID*inout
hinstModuleHINSTANCEin
lParamLPARAMin
dwPriorityDWORDin
fdwAddDWORDin

戻り値の型: DWORD

各言語での呼び出し定義

// MSACM32.dll  (ANSI / -A)
#include <windows.h>

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

acmDriverAddA = ctypes.windll.msacm32.acmDriverAddA
acmDriverAddA.restype = wintypes.DWORD
acmDriverAddA.argtypes = [
    ctypes.c_void_p,  # phadid : HACMDRIVERID* in/out
    wintypes.HANDLE,  # hinstModule : HINSTANCE
    ctypes.c_ssize_t,  # lParam : LPARAM
    wintypes.DWORD,  # dwPriority : DWORD
    wintypes.DWORD,  # fdwAdd : DWORD
]
require 'fiddle'
require 'fiddle/import'

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

var (
	msacm32 = windows.NewLazySystemDLL("MSACM32.dll")
	procacmDriverAddA = msacm32.NewProc("acmDriverAddA")
)

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