ホーム › Devices.Tapi › lineGetID
lineGetID
関数回線・アドレス・通話に関連するデバイス識別子を取得する。
シグネチャ
// TAPI32.dll (ANSI / -A)
#include <windows.h>
INT lineGetID(
DWORD hLine,
DWORD dwAddressID,
DWORD hCall,
DWORD dwSelect,
VARSTRING* lpDeviceID,
LPCSTR lpszDeviceClass
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hLine | DWORD | in |
| dwAddressID | DWORD | in |
| hCall | DWORD | in |
| dwSelect | DWORD | in |
| lpDeviceID | VARSTRING* | inout |
| lpszDeviceClass | LPCSTR | in |
戻り値の型: INT
各言語での呼び出し定義
// TAPI32.dll (ANSI / -A)
#include <windows.h>
INT lineGetID(
DWORD hLine,
DWORD dwAddressID,
DWORD hCall,
DWORD dwSelect,
VARSTRING* lpDeviceID,
LPCSTR lpszDeviceClass
);[DllImport("TAPI32.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern int lineGetID(
uint hLine, // DWORD
uint dwAddressID, // DWORD
uint hCall, // DWORD
uint dwSelect, // DWORD
IntPtr lpDeviceID, // VARSTRING* in/out
[MarshalAs(UnmanagedType.LPStr)] string lpszDeviceClass // LPCSTR
);<DllImport("TAPI32.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Function lineGetID(
hLine As UInteger, ' DWORD
dwAddressID As UInteger, ' DWORD
hCall As UInteger, ' DWORD
dwSelect As UInteger, ' DWORD
lpDeviceID As IntPtr, ' VARSTRING* in/out
<MarshalAs(UnmanagedType.LPStr)> lpszDeviceClass As String ' LPCSTR
) As Integer
End Function' hLine : DWORD
' dwAddressID : DWORD
' hCall : DWORD
' dwSelect : DWORD
' lpDeviceID : VARSTRING* in/out
' lpszDeviceClass : LPCSTR
Declare PtrSafe Function lineGetID Lib "tapi32" ( _
ByVal hLine As Long, _
ByVal dwAddressID As Long, _
ByVal hCall As Long, _
ByVal dwSelect As Long, _
ByVal lpDeviceID As LongPtr, _
ByVal lpszDeviceClass As String) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
lineGetID = ctypes.windll.tapi32.lineGetID
lineGetID.restype = ctypes.c_int
lineGetID.argtypes = [
wintypes.DWORD, # hLine : DWORD
wintypes.DWORD, # dwAddressID : DWORD
wintypes.DWORD, # hCall : DWORD
wintypes.DWORD, # dwSelect : DWORD
ctypes.c_void_p, # lpDeviceID : VARSTRING* in/out
wintypes.LPCSTR, # lpszDeviceClass : LPCSTR
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('TAPI32.dll')
lineGetID = Fiddle::Function.new(
lib['lineGetID'],
[
-Fiddle::TYPE_INT, # hLine : DWORD
-Fiddle::TYPE_INT, # dwAddressID : DWORD
-Fiddle::TYPE_INT, # hCall : DWORD
-Fiddle::TYPE_INT, # dwSelect : DWORD
Fiddle::TYPE_VOIDP, # lpDeviceID : VARSTRING* in/out
Fiddle::TYPE_VOIDP, # lpszDeviceClass : LPCSTR
],
Fiddle::TYPE_INT)#[link(name = "tapi32")]
extern "system" {
fn lineGetID(
hLine: u32, // DWORD
dwAddressID: u32, // DWORD
hCall: u32, // DWORD
dwSelect: u32, // DWORD
lpDeviceID: *mut VARSTRING, // VARSTRING* in/out
lpszDeviceClass: *const u8 // LPCSTR
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("TAPI32.dll", CharSet = CharSet.Ansi)]
public static extern int lineGetID(uint hLine, uint dwAddressID, uint hCall, uint dwSelect, IntPtr lpDeviceID, [MarshalAs(UnmanagedType.LPStr)] string lpszDeviceClass);
"@
$api = Add-Type -MemberDefinition $sig -Name 'TAPI32_lineGetID' -Namespace Win32 -PassThru
# $api::lineGetID(hLine, dwAddressID, hCall, dwSelect, lpDeviceID, lpszDeviceClass)#uselib "TAPI32.dll"
#func global lineGetID "lineGetID" sptr, sptr, sptr, sptr, sptr, sptr
; lineGetID hLine, dwAddressID, hCall, dwSelect, varptr(lpDeviceID), lpszDeviceClass ; 戻り値は stat
; hLine : DWORD -> "sptr"
; dwAddressID : DWORD -> "sptr"
; hCall : DWORD -> "sptr"
; dwSelect : DWORD -> "sptr"
; lpDeviceID : VARSTRING* in/out -> "sptr"
; lpszDeviceClass : LPCSTR -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "TAPI32.dll" #cfunc global lineGetID "lineGetID" int, int, int, int, var, str ; res = lineGetID(hLine, dwAddressID, hCall, dwSelect, lpDeviceID, lpszDeviceClass) ; hLine : DWORD -> "int" ; dwAddressID : DWORD -> "int" ; hCall : DWORD -> "int" ; dwSelect : DWORD -> "int" ; lpDeviceID : VARSTRING* in/out -> "var" ; lpszDeviceClass : LPCSTR -> "str" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "TAPI32.dll" #cfunc global lineGetID "lineGetID" int, int, int, int, sptr, str ; res = lineGetID(hLine, dwAddressID, hCall, dwSelect, varptr(lpDeviceID), lpszDeviceClass) ; hLine : DWORD -> "int" ; dwAddressID : DWORD -> "int" ; hCall : DWORD -> "int" ; dwSelect : DWORD -> "int" ; lpDeviceID : VARSTRING* in/out -> "sptr" ; lpszDeviceClass : LPCSTR -> "str" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; INT lineGetID(DWORD hLine, DWORD dwAddressID, DWORD hCall, DWORD dwSelect, VARSTRING* lpDeviceID, LPCSTR lpszDeviceClass) #uselib "TAPI32.dll" #cfunc global lineGetID "lineGetID" int, int, int, int, var, str ; res = lineGetID(hLine, dwAddressID, hCall, dwSelect, lpDeviceID, lpszDeviceClass) ; hLine : DWORD -> "int" ; dwAddressID : DWORD -> "int" ; hCall : DWORD -> "int" ; dwSelect : DWORD -> "int" ; lpDeviceID : VARSTRING* in/out -> "var" ; lpszDeviceClass : LPCSTR -> "str" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; INT lineGetID(DWORD hLine, DWORD dwAddressID, DWORD hCall, DWORD dwSelect, VARSTRING* lpDeviceID, LPCSTR lpszDeviceClass) #uselib "TAPI32.dll" #cfunc global lineGetID "lineGetID" int, int, int, int, intptr, str ; res = lineGetID(hLine, dwAddressID, hCall, dwSelect, varptr(lpDeviceID), lpszDeviceClass) ; hLine : DWORD -> "int" ; dwAddressID : DWORD -> "int" ; hCall : DWORD -> "int" ; dwSelect : DWORD -> "int" ; lpDeviceID : VARSTRING* in/out -> "intptr" ; lpszDeviceClass : LPCSTR -> "str" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
tapi32 = windows.NewLazySystemDLL("TAPI32.dll")
proclineGetID = tapi32.NewProc("lineGetID")
)
// hLine (DWORD), dwAddressID (DWORD), hCall (DWORD), dwSelect (DWORD), lpDeviceID (VARSTRING* in/out), lpszDeviceClass (LPCSTR)
r1, _, err := proclineGetID.Call(
uintptr(hLine),
uintptr(dwAddressID),
uintptr(hCall),
uintptr(dwSelect),
uintptr(lpDeviceID),
uintptr(unsafe.Pointer(windows.BytePtrFromString(lpszDeviceClass))),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // INTfunction lineGetID(
hLine: DWORD; // DWORD
dwAddressID: DWORD; // DWORD
hCall: DWORD; // DWORD
dwSelect: DWORD; // DWORD
lpDeviceID: Pointer; // VARSTRING* in/out
lpszDeviceClass: PAnsiChar // LPCSTR
): Integer; stdcall;
external 'TAPI32.dll' name 'lineGetID';result := DllCall("TAPI32\lineGetID"
, "UInt", hLine ; DWORD
, "UInt", dwAddressID ; DWORD
, "UInt", hCall ; DWORD
, "UInt", dwSelect ; DWORD
, "Ptr", lpDeviceID ; VARSTRING* in/out
, "AStr", lpszDeviceClass ; LPCSTR
, "Int") ; return: INT●lineGetID(hLine, dwAddressID, hCall, dwSelect, lpDeviceID, lpszDeviceClass) = DLL("TAPI32.dll", "int lineGetID(dword, dword, dword, dword, void*, char*)")
# 呼び出し: lineGetID(hLine, dwAddressID, hCall, dwSelect, lpDeviceID, lpszDeviceClass)
# hLine : DWORD -> "dword"
# dwAddressID : DWORD -> "dword"
# hCall : DWORD -> "dword"
# dwSelect : DWORD -> "dword"
# lpDeviceID : VARSTRING* in/out -> "void*"
# lpszDeviceClass : LPCSTR -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。