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

lineUnparkA

関数
パークされた通話を取り出す関数のANSI版。
DLLTAPI32.dll文字セットANSI (-A)呼出規約winapi

シグネチャ

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

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

パラメーター

名前方向
hLineDWORDin
dwAddressIDDWORDin
lphCallDWORD*inout
lpszDestAddressLPCSTRin

戻り値の型: INT

各言語での呼び出し定義

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

INT lineUnparkA(
    DWORD hLine,
    DWORD dwAddressID,
    DWORD* lphCall,
    LPCSTR lpszDestAddress
);
[DllImport("TAPI32.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern int lineUnparkA(
    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 lineUnparkA(
    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 lineUnparkA 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

lineUnparkA = ctypes.windll.tapi32.lineUnparkA
lineUnparkA.restype = ctypes.c_int
lineUnparkA.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')
lineUnparkA = Fiddle::Function.new(
  lib['lineUnparkA'],
  [
    -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 lineUnparkA(
        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 lineUnparkA(uint hLine, uint dwAddressID, ref uint lphCall, [MarshalAs(UnmanagedType.LPStr)] string lpszDestAddress);
"@
$api = Add-Type -MemberDefinition $sig -Name 'TAPI32_lineUnparkA' -Namespace Win32 -PassThru
# $api::lineUnparkA(hLine, dwAddressID, lphCall, lpszDestAddress)
#uselib "TAPI32.dll"
#func global lineUnparkA "lineUnparkA" sptr, sptr, sptr, sptr
; lineUnparkA 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 lineUnparkA "lineUnparkA" int, int, var, str
; res = lineUnparkA(hLine, dwAddressID, lphCall, lpszDestAddress)
; hLine : DWORD -> "int"
; dwAddressID : DWORD -> "int"
; lphCall : DWORD* in/out -> "var"
; lpszDestAddress : LPCSTR -> "str"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; INT lineUnparkA(DWORD hLine, DWORD dwAddressID, DWORD* lphCall, LPCSTR lpszDestAddress)
#uselib "TAPI32.dll"
#cfunc global lineUnparkA "lineUnparkA" int, int, var, str
; res = lineUnparkA(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")
	proclineUnparkA = tapi32.NewProc("lineUnparkA")
)

// hLine (DWORD), dwAddressID (DWORD), lphCall (DWORD* in/out), lpszDestAddress (LPCSTR)
r1, _, err := proclineUnparkA.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 lineUnparkA(
  hLine: DWORD;   // DWORD
  dwAddressID: DWORD;   // DWORD
  lphCall: Pointer;   // DWORD* in/out
  lpszDestAddress: PAnsiChar   // LPCSTR
): Integer; stdcall;
  external 'TAPI32.dll' name 'lineUnparkA';
result := DllCall("TAPI32\lineUnparkA"
    , "UInt", hLine   ; DWORD
    , "UInt", dwAddressID   ; DWORD
    , "Ptr", lphCall   ; DWORD* in/out
    , "AStr", lpszDestAddress   ; LPCSTR
    , "Int")   ; return: INT
●lineUnparkA(hLine, dwAddressID, lphCall, lpszDestAddress) = DLL("TAPI32.dll", "int lineUnparkA(dword, dword, void*, char*)")
# 呼び出し: lineUnparkA(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)。