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

lineGetProviderListA

関数
インストール済みプロバイダーの一覧を取得する(ANSI版)。
DLLTAPI32.dll文字セットANSI (-A)呼出規約winapi

シグネチャ

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

INT lineGetProviderListA(
    DWORD dwAPIVersion,
    LINEPROVIDERLIST* lpProviderList
);

パラメーター

名前方向
dwAPIVersionDWORDin
lpProviderListLINEPROVIDERLIST*inout

戻り値の型: INT

各言語での呼び出し定義

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

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

lineGetProviderListA = ctypes.windll.tapi32.lineGetProviderListA
lineGetProviderListA.restype = ctypes.c_int
lineGetProviderListA.argtypes = [
    wintypes.DWORD,  # dwAPIVersion : DWORD
    ctypes.c_void_p,  # lpProviderList : LINEPROVIDERLIST* in/out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	tapi32 = windows.NewLazySystemDLL("TAPI32.dll")
	proclineGetProviderListA = tapi32.NewProc("lineGetProviderListA")
)

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