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

lineUnparkW

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

シグネチャ

// TAPI32.dll  (Unicode / -W)
#include <windows.h>

INT lineUnparkW(
    DWORD hLine,
    DWORD dwAddressID,
    DWORD* lphCall,
    LPCWSTR lpszDestAddress
);

パラメーター

名前方向
hLineDWORDin
dwAddressIDDWORDin
lphCallDWORD*inout
lpszDestAddressLPCWSTRin

戻り値の型: INT

各言語での呼び出し定義

// TAPI32.dll  (Unicode / -W)
#include <windows.h>

INT lineUnparkW(
    DWORD hLine,
    DWORD dwAddressID,
    DWORD* lphCall,
    LPCWSTR lpszDestAddress
);
[DllImport("TAPI32.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
static extern int lineUnparkW(
    uint hLine,   // DWORD
    uint dwAddressID,   // DWORD
    ref uint lphCall,   // DWORD* in/out
    [MarshalAs(UnmanagedType.LPWStr)] string lpszDestAddress   // LPCWSTR
);
<DllImport("TAPI32.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True)>
Public Shared Function lineUnparkW(
    hLine As UInteger,   ' DWORD
    dwAddressID As UInteger,   ' DWORD
    ByRef lphCall As UInteger,   ' DWORD* in/out
    <MarshalAs(UnmanagedType.LPWStr)> lpszDestAddress As String   ' LPCWSTR
) As Integer
End Function
' hLine : DWORD
' dwAddressID : DWORD
' lphCall : DWORD* in/out
' lpszDestAddress : LPCWSTR
Declare PtrSafe Function lineUnparkW Lib "tapi32" ( _
    ByVal hLine As Long, _
    ByVal dwAddressID As Long, _
    ByRef lphCall As Long, _
    ByVal lpszDestAddress As LongPtr) As Long
' Unicode(W): 文字列は ByVal As LongPtr とし StrPtr(unicodeStr) を渡す
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

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

lib = Fiddle.dlopen('TAPI32.dll')
lineUnparkW = Fiddle::Function.new(
  lib['lineUnparkW'],
  [
    -Fiddle::TYPE_INT,  # hLine : DWORD
    -Fiddle::TYPE_INT,  # dwAddressID : DWORD
    Fiddle::TYPE_VOIDP,  # lphCall : DWORD* in/out
    Fiddle::TYPE_VOIDP,  # lpszDestAddress : LPCWSTR
  ],
  Fiddle::TYPE_INT)
# Wide strings: pass str.encode("UTF-16LE") + "\x00\x00"
#[link(name = "tapi32")]
extern "system" {
    fn lineUnparkW(
        hLine: u32,  // DWORD
        dwAddressID: u32,  // DWORD
        lphCall: *mut u32,  // DWORD* in/out
        lpszDestAddress: *const u16  // LPCWSTR
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("TAPI32.dll", CharSet = CharSet.Unicode)]
public static extern int lineUnparkW(uint hLine, uint dwAddressID, ref uint lphCall, [MarshalAs(UnmanagedType.LPWStr)] string lpszDestAddress);
"@
$api = Add-Type -MemberDefinition $sig -Name 'TAPI32_lineUnparkW' -Namespace Win32 -PassThru
# $api::lineUnparkW(hLine, dwAddressID, lphCall, lpszDestAddress)
#uselib "TAPI32.dll"
#func global lineUnparkW "lineUnparkW" wptr, wptr, wptr, wptr
; lineUnparkW hLine, dwAddressID, varptr(lphCall), lpszDestAddress   ; 戻り値は stat
; hLine : DWORD -> "wptr"
; dwAddressID : DWORD -> "wptr"
; lphCall : DWORD* in/out -> "wptr"
; lpszDestAddress : LPCWSTR -> "wptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "TAPI32.dll"
#cfunc global lineUnparkW "lineUnparkW" int, int, var, wstr
; res = lineUnparkW(hLine, dwAddressID, lphCall, lpszDestAddress)
; hLine : DWORD -> "int"
; dwAddressID : DWORD -> "int"
; lphCall : DWORD* in/out -> "var"
; lpszDestAddress : LPCWSTR -> "wstr"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; INT lineUnparkW(DWORD hLine, DWORD dwAddressID, DWORD* lphCall, LPCWSTR lpszDestAddress)
#uselib "TAPI32.dll"
#cfunc global lineUnparkW "lineUnparkW" int, int, var, wstr
; res = lineUnparkW(hLine, dwAddressID, lphCall, lpszDestAddress)
; hLine : DWORD -> "int"
; dwAddressID : DWORD -> "int"
; lphCall : DWORD* in/out -> "var"
; lpszDestAddress : LPCWSTR -> "wstr"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	tapi32 = windows.NewLazySystemDLL("TAPI32.dll")
	proclineUnparkW = tapi32.NewProc("lineUnparkW")
)

// hLine (DWORD), dwAddressID (DWORD), lphCall (DWORD* in/out), lpszDestAddress (LPCWSTR)
r1, _, err := proclineUnparkW.Call(
	uintptr(hLine),
	uintptr(dwAddressID),
	uintptr(lphCall),
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(lpszDestAddress))),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // INT
function lineUnparkW(
  hLine: DWORD;   // DWORD
  dwAddressID: DWORD;   // DWORD
  lphCall: Pointer;   // DWORD* in/out
  lpszDestAddress: PWideChar   // LPCWSTR
): Integer; stdcall;
  external 'TAPI32.dll' name 'lineUnparkW';
result := DllCall("TAPI32\lineUnparkW"
    , "UInt", hLine   ; DWORD
    , "UInt", dwAddressID   ; DWORD
    , "Ptr", lphCall   ; DWORD* in/out
    , "WStr", lpszDestAddress   ; LPCWSTR
    , "Int")   ; return: INT
●lineUnparkW(hLine, dwAddressID, lphCall, lpszDestAddress) = DLL("TAPI32.dll", "int lineUnparkW(dword, dword, void*, char*)")
# 呼び出し: lineUnparkW(hLine, dwAddressID, lphCall, lpszDestAddress)
# hLine : DWORD -> "dword"
# dwAddressID : DWORD -> "dword"
# lphCall : DWORD* in/out -> "void*"
# lpszDestAddress : LPCWSTR -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。