Win32 API 日本語リファレンス
ホームDevices.Tapi › lineGetAddressCaps

lineGetAddressCaps

関数
指定アドレスのテレフォニー機能や能力を取得する。
DLLTAPI32.dll文字セットANSI (-A)呼出規約winapi

シグネチャ

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

INT lineGetAddressCaps(
    DWORD hLineApp,
    DWORD dwDeviceID,
    DWORD dwAddressID,
    DWORD dwAPIVersion,
    DWORD dwExtVersion,
    LINEADDRESSCAPS* lpAddressCaps
);

パラメーター

名前方向
hLineAppDWORDin
dwDeviceIDDWORDin
dwAddressIDDWORDin
dwAPIVersionDWORDin
dwExtVersionDWORDin
lpAddressCapsLINEADDRESSCAPS*inout

戻り値の型: INT

各言語での呼び出し定義

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

INT lineGetAddressCaps(
    DWORD hLineApp,
    DWORD dwDeviceID,
    DWORD dwAddressID,
    DWORD dwAPIVersion,
    DWORD dwExtVersion,
    LINEADDRESSCAPS* lpAddressCaps
);
[DllImport("TAPI32.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern int lineGetAddressCaps(
    uint hLineApp,   // DWORD
    uint dwDeviceID,   // DWORD
    uint dwAddressID,   // DWORD
    uint dwAPIVersion,   // DWORD
    uint dwExtVersion,   // DWORD
    IntPtr lpAddressCaps   // LINEADDRESSCAPS* in/out
);
<DllImport("TAPI32.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Function lineGetAddressCaps(
    hLineApp As UInteger,   ' DWORD
    dwDeviceID As UInteger,   ' DWORD
    dwAddressID As UInteger,   ' DWORD
    dwAPIVersion As UInteger,   ' DWORD
    dwExtVersion As UInteger,   ' DWORD
    lpAddressCaps As IntPtr   ' LINEADDRESSCAPS* in/out
) As Integer
End Function
' hLineApp : DWORD
' dwDeviceID : DWORD
' dwAddressID : DWORD
' dwAPIVersion : DWORD
' dwExtVersion : DWORD
' lpAddressCaps : LINEADDRESSCAPS* in/out
Declare PtrSafe Function lineGetAddressCaps Lib "tapi32" ( _
    ByVal hLineApp As Long, _
    ByVal dwDeviceID As Long, _
    ByVal dwAddressID As Long, _
    ByVal dwAPIVersion As Long, _
    ByVal dwExtVersion As Long, _
    ByVal lpAddressCaps As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

lineGetAddressCaps = ctypes.windll.tapi32.lineGetAddressCaps
lineGetAddressCaps.restype = ctypes.c_int
lineGetAddressCaps.argtypes = [
    wintypes.DWORD,  # hLineApp : DWORD
    wintypes.DWORD,  # dwDeviceID : DWORD
    wintypes.DWORD,  # dwAddressID : DWORD
    wintypes.DWORD,  # dwAPIVersion : DWORD
    wintypes.DWORD,  # dwExtVersion : DWORD
    ctypes.c_void_p,  # lpAddressCaps : LINEADDRESSCAPS* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('TAPI32.dll')
lineGetAddressCaps = Fiddle::Function.new(
  lib['lineGetAddressCaps'],
  [
    -Fiddle::TYPE_INT,  # hLineApp : DWORD
    -Fiddle::TYPE_INT,  # dwDeviceID : DWORD
    -Fiddle::TYPE_INT,  # dwAddressID : DWORD
    -Fiddle::TYPE_INT,  # dwAPIVersion : DWORD
    -Fiddle::TYPE_INT,  # dwExtVersion : DWORD
    Fiddle::TYPE_VOIDP,  # lpAddressCaps : LINEADDRESSCAPS* in/out
  ],
  Fiddle::TYPE_INT)
#[link(name = "tapi32")]
extern "system" {
    fn lineGetAddressCaps(
        hLineApp: u32,  // DWORD
        dwDeviceID: u32,  // DWORD
        dwAddressID: u32,  // DWORD
        dwAPIVersion: u32,  // DWORD
        dwExtVersion: u32,  // DWORD
        lpAddressCaps: *mut LINEADDRESSCAPS  // LINEADDRESSCAPS* in/out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("TAPI32.dll", CharSet = CharSet.Ansi)]
public static extern int lineGetAddressCaps(uint hLineApp, uint dwDeviceID, uint dwAddressID, uint dwAPIVersion, uint dwExtVersion, IntPtr lpAddressCaps);
"@
$api = Add-Type -MemberDefinition $sig -Name 'TAPI32_lineGetAddressCaps' -Namespace Win32 -PassThru
# $api::lineGetAddressCaps(hLineApp, dwDeviceID, dwAddressID, dwAPIVersion, dwExtVersion, lpAddressCaps)
#uselib "TAPI32.dll"
#func global lineGetAddressCaps "lineGetAddressCaps" sptr, sptr, sptr, sptr, sptr, sptr
; lineGetAddressCaps hLineApp, dwDeviceID, dwAddressID, dwAPIVersion, dwExtVersion, varptr(lpAddressCaps)   ; 戻り値は stat
; hLineApp : DWORD -> "sptr"
; dwDeviceID : DWORD -> "sptr"
; dwAddressID : DWORD -> "sptr"
; dwAPIVersion : DWORD -> "sptr"
; dwExtVersion : DWORD -> "sptr"
; lpAddressCaps : LINEADDRESSCAPS* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "TAPI32.dll"
#cfunc global lineGetAddressCaps "lineGetAddressCaps" int, int, int, int, int, var
; res = lineGetAddressCaps(hLineApp, dwDeviceID, dwAddressID, dwAPIVersion, dwExtVersion, lpAddressCaps)
; hLineApp : DWORD -> "int"
; dwDeviceID : DWORD -> "int"
; dwAddressID : DWORD -> "int"
; dwAPIVersion : DWORD -> "int"
; dwExtVersion : DWORD -> "int"
; lpAddressCaps : LINEADDRESSCAPS* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; INT lineGetAddressCaps(DWORD hLineApp, DWORD dwDeviceID, DWORD dwAddressID, DWORD dwAPIVersion, DWORD dwExtVersion, LINEADDRESSCAPS* lpAddressCaps)
#uselib "TAPI32.dll"
#cfunc global lineGetAddressCaps "lineGetAddressCaps" int, int, int, int, int, var
; res = lineGetAddressCaps(hLineApp, dwDeviceID, dwAddressID, dwAPIVersion, dwExtVersion, lpAddressCaps)
; hLineApp : DWORD -> "int"
; dwDeviceID : DWORD -> "int"
; dwAddressID : DWORD -> "int"
; dwAPIVersion : DWORD -> "int"
; dwExtVersion : DWORD -> "int"
; lpAddressCaps : LINEADDRESSCAPS* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	tapi32 = windows.NewLazySystemDLL("TAPI32.dll")
	proclineGetAddressCaps = tapi32.NewProc("lineGetAddressCaps")
)

// hLineApp (DWORD), dwDeviceID (DWORD), dwAddressID (DWORD), dwAPIVersion (DWORD), dwExtVersion (DWORD), lpAddressCaps (LINEADDRESSCAPS* in/out)
r1, _, err := proclineGetAddressCaps.Call(
	uintptr(hLineApp),
	uintptr(dwDeviceID),
	uintptr(dwAddressID),
	uintptr(dwAPIVersion),
	uintptr(dwExtVersion),
	uintptr(lpAddressCaps),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // INT
function lineGetAddressCaps(
  hLineApp: DWORD;   // DWORD
  dwDeviceID: DWORD;   // DWORD
  dwAddressID: DWORD;   // DWORD
  dwAPIVersion: DWORD;   // DWORD
  dwExtVersion: DWORD;   // DWORD
  lpAddressCaps: Pointer   // LINEADDRESSCAPS* in/out
): Integer; stdcall;
  external 'TAPI32.dll' name 'lineGetAddressCaps';
result := DllCall("TAPI32\lineGetAddressCaps"
    , "UInt", hLineApp   ; DWORD
    , "UInt", dwDeviceID   ; DWORD
    , "UInt", dwAddressID   ; DWORD
    , "UInt", dwAPIVersion   ; DWORD
    , "UInt", dwExtVersion   ; DWORD
    , "Ptr", lpAddressCaps   ; LINEADDRESSCAPS* in/out
    , "Int")   ; return: INT
●lineGetAddressCaps(hLineApp, dwDeviceID, dwAddressID, dwAPIVersion, dwExtVersion, lpAddressCaps) = DLL("TAPI32.dll", "int lineGetAddressCaps(dword, dword, dword, dword, dword, void*)")
# 呼び出し: lineGetAddressCaps(hLineApp, dwDeviceID, dwAddressID, dwAPIVersion, dwExtVersion, lpAddressCaps)
# hLineApp : DWORD -> "dword"
# dwDeviceID : DWORD -> "dword"
# dwAddressID : DWORD -> "dword"
# dwAPIVersion : DWORD -> "dword"
# dwExtVersion : DWORD -> "dword"
# lpAddressCaps : LINEADDRESSCAPS* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。