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

lineGetCountryA

関数
指定した国のダイヤル規則や国番号情報を取得する(ANSI版)。
DLLTAPI32.dll文字セットANSI (-A)呼出規約winapi

シグネチャ

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

INT lineGetCountryA(
    DWORD dwCountryID,
    DWORD dwAPIVersion,
    LINECOUNTRYLIST* lpLineCountryList
);

パラメーター

名前方向
dwCountryIDDWORDin
dwAPIVersionDWORDin
lpLineCountryListLINECOUNTRYLIST*inout

戻り値の型: INT

各言語での呼び出し定義

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

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

lineGetCountryA = ctypes.windll.tapi32.lineGetCountryA
lineGetCountryA.restype = ctypes.c_int
lineGetCountryA.argtypes = [
    wintypes.DWORD,  # dwCountryID : DWORD
    wintypes.DWORD,  # dwAPIVersion : DWORD
    ctypes.c_void_p,  # lpLineCountryList : LINECOUNTRYLIST* in/out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	tapi32 = windows.NewLazySystemDLL("TAPI32.dll")
	proclineGetCountryA = tapi32.NewProc("lineGetCountryA")
)

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