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

acmDriverRemove

関数
登録済みのACMドライバーを削除する。
DLLMSACM32.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

DWORD acmDriverRemove(
    HACMDRIVERID hadid,
    DWORD fdwRemove
);

パラメーター

名前方向
hadidHACMDRIVERIDin
fdwRemoveDWORDin

戻り値の型: DWORD

各言語での呼び出し定義

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

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

acmDriverRemove = ctypes.windll.msacm32.acmDriverRemove
acmDriverRemove.restype = wintypes.DWORD
acmDriverRemove.argtypes = [
    wintypes.HANDLE,  # hadid : HACMDRIVERID
    wintypes.DWORD,  # fdwRemove : DWORD
]
require 'fiddle'
require 'fiddle/import'

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

var (
	msacm32 = windows.NewLazySystemDLL("MSACM32.dll")
	procacmDriverRemove = msacm32.NewProc("acmDriverRemove")
)

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