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

lineUnpark

関数
指定したアドレスでパークされた通話を取り出す。
DLLTAPI32.dll文字セットANSI (-A)呼出規約winapi

シグネチャ

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

INT lineUnpark(
    DWORD hLine,
    DWORD dwAddressID,
    DWORD* lphCall,
    LPCSTR lpszDestAddress
);

パラメーター

名前方向
hLineDWORDin
dwAddressIDDWORDin
lphCallDWORD*inout
lpszDestAddressLPCSTRin

戻り値の型: INT

各言語での呼び出し定義

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

INT lineUnpark(
    DWORD hLine,
    DWORD dwAddressID,
    DWORD* lphCall,
    LPCSTR lpszDestAddress
);
[DllImport("TAPI32.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern int lineUnpark(
    uint hLine,   // DWORD
    uint dwAddressID,   // DWORD
    ref uint lphCall,   // DWORD* in/out
    [MarshalAs(UnmanagedType.LPStr)] string lpszDestAddress   // LPCSTR
);
<DllImport("TAPI32.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Function lineUnpark(
    hLine As UInteger,   ' DWORD
    dwAddressID As UInteger,   ' DWORD
    ByRef lphCall As UInteger,   ' DWORD* in/out
    <MarshalAs(UnmanagedType.LPStr)> lpszDestAddress As String   ' LPCSTR
) As Integer
End Function
' hLine : DWORD
' dwAddressID : DWORD
' lphCall : DWORD* in/out
' lpszDestAddress : LPCSTR
Declare PtrSafe Function lineUnpark Lib "tapi32" ( _
    ByVal hLine As Long, _
    ByVal dwAddressID As Long, _
    ByRef lphCall As Long, _
    ByVal lpszDestAddress As String) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

lineUnpark = ctypes.windll.tapi32.lineUnpark
lineUnpark.restype = ctypes.c_int
lineUnpark.argtypes = [
    wintypes.DWORD,  # hLine : DWORD
    wintypes.DWORD,  # dwAddressID : DWORD
    ctypes.POINTER(wintypes.DWORD),  # lphCall : DWORD* in/out
    wintypes.LPCSTR,  # lpszDestAddress : LPCSTR
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('TAPI32.dll')
lineUnpark = Fiddle::Function.new(
  lib['lineUnpark'],
  [
    -Fiddle::TYPE_INT,  # hLine : DWORD
    -Fiddle::TYPE_INT,  # dwAddressID : DWORD
    Fiddle::TYPE_VOIDP,  # lphCall : DWORD* in/out
    Fiddle::TYPE_VOIDP,  # lpszDestAddress : LPCSTR
  ],
  Fiddle::TYPE_INT)
#[link(name = "tapi32")]
extern "system" {
    fn lineUnpark(
        hLine: u32,  // DWORD
        dwAddressID: u32,  // DWORD
        lphCall: *mut u32,  // DWORD* in/out
        lpszDestAddress: *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 lineUnpark(uint hLine, uint dwAddressID, ref uint lphCall, [MarshalAs(UnmanagedType.LPStr)] string lpszDestAddress);
"@
$api = Add-Type -MemberDefinition $sig -Name 'TAPI32_lineUnpark' -Namespace Win32 -PassThru
# $api::lineUnpark(hLine, dwAddressID, lphCall, lpszDestAddress)
#uselib "TAPI32.dll"
#func global lineUnpark "lineUnpark" sptr, sptr, sptr, sptr
; lineUnpark hLine, dwAddressID, varptr(lphCall), lpszDestAddress   ; 戻り値は stat
; hLine : DWORD -> "sptr"
; dwAddressID : DWORD -> "sptr"
; lphCall : DWORD* in/out -> "sptr"
; lpszDestAddress : LPCSTR -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "TAPI32.dll"
#cfunc global lineUnpark "lineUnpark" int, int, var, str
; res = lineUnpark(hLine, dwAddressID, lphCall, lpszDestAddress)
; hLine : DWORD -> "int"
; dwAddressID : DWORD -> "int"
; lphCall : DWORD* in/out -> "var"
; lpszDestAddress : LPCSTR -> "str"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; INT lineUnpark(DWORD hLine, DWORD dwAddressID, DWORD* lphCall, LPCSTR lpszDestAddress)
#uselib "TAPI32.dll"
#cfunc global lineUnpark "lineUnpark" int, int, var, str
; res = lineUnpark(hLine, dwAddressID, lphCall, lpszDestAddress)
; hLine : DWORD -> "int"
; dwAddressID : DWORD -> "int"
; lphCall : DWORD* in/out -> "var"
; lpszDestAddress : LPCSTR -> "str"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	tapi32 = windows.NewLazySystemDLL("TAPI32.dll")
	proclineUnpark = tapi32.NewProc("lineUnpark")
)

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