ホーム › Devices.Tapi › lineProxyMessage
lineProxyMessage
関数プロキシ要求ハンドラからTAPIへメッセージを送出する。
シグネチャ
// TAPI32.dll
#include <windows.h>
INT lineProxyMessage(
DWORD hLine,
DWORD hCall,
DWORD dwMsg,
DWORD dwParam1,
DWORD dwParam2,
DWORD dwParam3
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| hLine | DWORD | in | プロキシメッセージを送出する対象の開いた回線のハンドル。 |
| hCall | DWORD | in | メッセージに関連する通話のハンドル。該当しない場合は0を指定する。 |
| dwMsg | DWORD | in | 送出するTAPIメッセージの種類を示すLINE_定数。 |
| dwParam1 | DWORD | in | メッセージに付随する第1パラメータ。メッセージ種別により意味が異なる。 |
| dwParam2 | DWORD | in | メッセージに付随する第2パラメータ。メッセージ種別により意味が異なる。 |
| dwParam3 | DWORD | in | メッセージに付随する第3パラメータ。メッセージ種別により意味が異なる。 |
戻り値の型: INT
各言語での呼び出し定義
// TAPI32.dll
#include <windows.h>
INT lineProxyMessage(
DWORD hLine,
DWORD hCall,
DWORD dwMsg,
DWORD dwParam1,
DWORD dwParam2,
DWORD dwParam3
);[DllImport("TAPI32.dll", ExactSpelling = true)]
static extern int lineProxyMessage(
uint hLine, // DWORD
uint hCall, // DWORD
uint dwMsg, // DWORD
uint dwParam1, // DWORD
uint dwParam2, // DWORD
uint dwParam3 // DWORD
);<DllImport("TAPI32.dll", ExactSpelling:=True)>
Public Shared Function lineProxyMessage(
hLine As UInteger, ' DWORD
hCall As UInteger, ' DWORD
dwMsg As UInteger, ' DWORD
dwParam1 As UInteger, ' DWORD
dwParam2 As UInteger, ' DWORD
dwParam3 As UInteger ' DWORD
) As Integer
End Function' hLine : DWORD
' hCall : DWORD
' dwMsg : DWORD
' dwParam1 : DWORD
' dwParam2 : DWORD
' dwParam3 : DWORD
Declare PtrSafe Function lineProxyMessage Lib "tapi32" ( _
ByVal hLine As Long, _
ByVal hCall As Long, _
ByVal dwMsg As Long, _
ByVal dwParam1 As Long, _
ByVal dwParam2 As Long, _
ByVal dwParam3 As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
lineProxyMessage = ctypes.windll.tapi32.lineProxyMessage
lineProxyMessage.restype = ctypes.c_int
lineProxyMessage.argtypes = [
wintypes.DWORD, # hLine : DWORD
wintypes.DWORD, # hCall : DWORD
wintypes.DWORD, # dwMsg : DWORD
wintypes.DWORD, # dwParam1 : DWORD
wintypes.DWORD, # dwParam2 : DWORD
wintypes.DWORD, # dwParam3 : DWORD
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('TAPI32.dll')
lineProxyMessage = Fiddle::Function.new(
lib['lineProxyMessage'],
[
-Fiddle::TYPE_INT, # hLine : DWORD
-Fiddle::TYPE_INT, # hCall : DWORD
-Fiddle::TYPE_INT, # dwMsg : DWORD
-Fiddle::TYPE_INT, # dwParam1 : DWORD
-Fiddle::TYPE_INT, # dwParam2 : DWORD
-Fiddle::TYPE_INT, # dwParam3 : DWORD
],
Fiddle::TYPE_INT)#[link(name = "tapi32")]
extern "system" {
fn lineProxyMessage(
hLine: u32, // DWORD
hCall: u32, // DWORD
dwMsg: u32, // DWORD
dwParam1: u32, // DWORD
dwParam2: u32, // DWORD
dwParam3: u32 // DWORD
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("TAPI32.dll")]
public static extern int lineProxyMessage(uint hLine, uint hCall, uint dwMsg, uint dwParam1, uint dwParam2, uint dwParam3);
"@
$api = Add-Type -MemberDefinition $sig -Name 'TAPI32_lineProxyMessage' -Namespace Win32 -PassThru
# $api::lineProxyMessage(hLine, hCall, dwMsg, dwParam1, dwParam2, dwParam3)#uselib "TAPI32.dll"
#func global lineProxyMessage "lineProxyMessage" sptr, sptr, sptr, sptr, sptr, sptr
; lineProxyMessage hLine, hCall, dwMsg, dwParam1, dwParam2, dwParam3 ; 戻り値は stat
; hLine : DWORD -> "sptr"
; hCall : DWORD -> "sptr"
; dwMsg : DWORD -> "sptr"
; dwParam1 : DWORD -> "sptr"
; dwParam2 : DWORD -> "sptr"
; dwParam3 : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "TAPI32.dll"
#cfunc global lineProxyMessage "lineProxyMessage" int, int, int, int, int, int
; res = lineProxyMessage(hLine, hCall, dwMsg, dwParam1, dwParam2, dwParam3)
; hLine : DWORD -> "int"
; hCall : DWORD -> "int"
; dwMsg : DWORD -> "int"
; dwParam1 : DWORD -> "int"
; dwParam2 : DWORD -> "int"
; dwParam3 : DWORD -> "int"; INT lineProxyMessage(DWORD hLine, DWORD hCall, DWORD dwMsg, DWORD dwParam1, DWORD dwParam2, DWORD dwParam3)
#uselib "TAPI32.dll"
#cfunc global lineProxyMessage "lineProxyMessage" int, int, int, int, int, int
; res = lineProxyMessage(hLine, hCall, dwMsg, dwParam1, dwParam2, dwParam3)
; hLine : DWORD -> "int"
; hCall : DWORD -> "int"
; dwMsg : DWORD -> "int"
; dwParam1 : DWORD -> "int"
; dwParam2 : DWORD -> "int"
; dwParam3 : DWORD -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
tapi32 = windows.NewLazySystemDLL("TAPI32.dll")
proclineProxyMessage = tapi32.NewProc("lineProxyMessage")
)
// hLine (DWORD), hCall (DWORD), dwMsg (DWORD), dwParam1 (DWORD), dwParam2 (DWORD), dwParam3 (DWORD)
r1, _, err := proclineProxyMessage.Call(
uintptr(hLine),
uintptr(hCall),
uintptr(dwMsg),
uintptr(dwParam1),
uintptr(dwParam2),
uintptr(dwParam3),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // INTfunction lineProxyMessage(
hLine: DWORD; // DWORD
hCall: DWORD; // DWORD
dwMsg: DWORD; // DWORD
dwParam1: DWORD; // DWORD
dwParam2: DWORD; // DWORD
dwParam3: DWORD // DWORD
): Integer; stdcall;
external 'TAPI32.dll' name 'lineProxyMessage';result := DllCall("TAPI32\lineProxyMessage"
, "UInt", hLine ; DWORD
, "UInt", hCall ; DWORD
, "UInt", dwMsg ; DWORD
, "UInt", dwParam1 ; DWORD
, "UInt", dwParam2 ; DWORD
, "UInt", dwParam3 ; DWORD
, "Int") ; return: INT●lineProxyMessage(hLine, hCall, dwMsg, dwParam1, dwParam2, dwParam3) = DLL("TAPI32.dll", "int lineProxyMessage(dword, dword, dword, dword, dword, dword)")
# 呼び出し: lineProxyMessage(hLine, hCall, dwMsg, dwParam1, dwParam2, dwParam3)
# hLine : DWORD -> "dword"
# hCall : DWORD -> "dword"
# dwMsg : DWORD -> "dword"
# dwParam1 : DWORD -> "dword"
# dwParam2 : DWORD -> "dword"
# dwParam3 : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "tapi32" fn lineProxyMessage(
hLine: u32, // DWORD
hCall: u32, // DWORD
dwMsg: u32, // DWORD
dwParam1: u32, // DWORD
dwParam2: u32, // DWORD
dwParam3: u32 // DWORD
) callconv(std.os.windows.WINAPI) i32;proc lineProxyMessage(
hLine: uint32, # DWORD
hCall: uint32, # DWORD
dwMsg: uint32, # DWORD
dwParam1: uint32, # DWORD
dwParam2: uint32, # DWORD
dwParam3: uint32 # DWORD
): int32 {.importc: "lineProxyMessage", stdcall, dynlib: "TAPI32.dll".}pragma(lib, "tapi32");
extern(Windows)
int lineProxyMessage(
uint hLine, // DWORD
uint hCall, // DWORD
uint dwMsg, // DWORD
uint dwParam1, // DWORD
uint dwParam2, // DWORD
uint dwParam3 // DWORD
);ccall((:lineProxyMessage, "TAPI32.dll"), stdcall, Int32,
(UInt32, UInt32, UInt32, UInt32, UInt32, UInt32),
hLine, hCall, dwMsg, dwParam1, dwParam2, dwParam3)
# hLine : DWORD -> UInt32
# hCall : DWORD -> UInt32
# dwMsg : DWORD -> UInt32
# dwParam1 : DWORD -> UInt32
# dwParam2 : DWORD -> UInt32
# dwParam3 : DWORD -> UInt32
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
int32_t lineProxyMessage(
uint32_t hLine,
uint32_t hCall,
uint32_t dwMsg,
uint32_t dwParam1,
uint32_t dwParam2,
uint32_t dwParam3);
]]
local tapi32 = ffi.load("tapi32")
-- tapi32.lineProxyMessage(hLine, hCall, dwMsg, dwParam1, dwParam2, dwParam3)
-- hLine : DWORD
-- hCall : DWORD
-- dwMsg : DWORD
-- dwParam1 : DWORD
-- dwParam2 : DWORD
-- dwParam3 : DWORD
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('TAPI32.dll');
const lineProxyMessage = lib.func('__stdcall', 'lineProxyMessage', 'int32_t', ['uint32_t', 'uint32_t', 'uint32_t', 'uint32_t', 'uint32_t', 'uint32_t']);
// lineProxyMessage(hLine, hCall, dwMsg, dwParam1, dwParam2, dwParam3)
// hLine : DWORD -> 'uint32_t'
// hCall : DWORD -> 'uint32_t'
// dwMsg : DWORD -> 'uint32_t'
// dwParam1 : DWORD -> 'uint32_t'
// dwParam2 : DWORD -> 'uint32_t'
// dwParam3 : DWORD -> 'uint32_t'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("TAPI32.dll", {
lineProxyMessage: { parameters: ["u32", "u32", "u32", "u32", "u32", "u32"], result: "i32" },
});
// lib.symbols.lineProxyMessage(hLine, hCall, dwMsg, dwParam1, dwParam2, dwParam3)
// hLine : DWORD -> "u32"
// hCall : DWORD -> "u32"
// dwMsg : DWORD -> "u32"
// dwParam1 : DWORD -> "u32"
// dwParam2 : DWORD -> "u32"
// dwParam3 : DWORD -> "u32"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int32_t lineProxyMessage(
uint32_t hLine,
uint32_t hCall,
uint32_t dwMsg,
uint32_t dwParam1,
uint32_t dwParam2,
uint32_t dwParam3);
C, "TAPI32.dll");
// $ffi->lineProxyMessage(hLine, hCall, dwMsg, dwParam1, dwParam2, dwParam3);
// hLine : DWORD
// hCall : DWORD
// dwMsg : DWORD
// dwParam1 : DWORD
// dwParam2 : DWORD
// dwParam3 : DWORD
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;
public interface Tapi32 extends StdCallLibrary {
Tapi32 INSTANCE = Native.load("tapi32", Tapi32.class);
int lineProxyMessage(
int hLine, // DWORD
int hCall, // DWORD
int dwMsg, // DWORD
int dwParam1, // DWORD
int dwParam2, // DWORD
int dwParam3 // DWORD
);
}@[Link("tapi32")]
lib LibTAPI32
fun lineProxyMessage = lineProxyMessage(
hLine : UInt32, # DWORD
hCall : UInt32, # DWORD
dwMsg : UInt32, # DWORD
dwParam1 : UInt32, # DWORD
dwParam2 : UInt32, # DWORD
dwParam3 : UInt32 # DWORD
) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef lineProxyMessageNative = Int32 Function(Uint32, Uint32, Uint32, Uint32, Uint32, Uint32);
typedef lineProxyMessageDart = int Function(int, int, int, int, int, int);
final lineProxyMessage = DynamicLibrary.open('TAPI32.dll')
.lookupFunction<lineProxyMessageNative, lineProxyMessageDart>('lineProxyMessage');
// hLine : DWORD -> Uint32
// hCall : DWORD -> Uint32
// dwMsg : DWORD -> Uint32
// dwParam1 : DWORD -> Uint32
// dwParam2 : DWORD -> Uint32
// dwParam3 : DWORD -> Uint32
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function lineProxyMessage(
hLine: DWORD; // DWORD
hCall: DWORD; // DWORD
dwMsg: DWORD; // DWORD
dwParam1: DWORD; // DWORD
dwParam2: DWORD; // DWORD
dwParam3: DWORD // DWORD
): Integer; stdcall;
external 'TAPI32.dll' name 'lineProxyMessage';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "lineProxyMessage"
c_lineProxyMessage :: Word32 -> Word32 -> Word32 -> Word32 -> Word32 -> Word32 -> IO Int32
-- hLine : DWORD -> Word32
-- hCall : DWORD -> Word32
-- dwMsg : DWORD -> Word32
-- dwParam1 : DWORD -> Word32
-- dwParam2 : DWORD -> Word32
-- dwParam3 : DWORD -> Word32
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let lineproxymessage =
foreign "lineProxyMessage"
(uint32_t @-> uint32_t @-> uint32_t @-> uint32_t @-> uint32_t @-> uint32_t @-> returning int32_t)
(* hLine : DWORD -> uint32_t *)
(* hCall : DWORD -> uint32_t *)
(* dwMsg : DWORD -> uint32_t *)
(* dwParam1 : DWORD -> uint32_t *)
(* dwParam2 : DWORD -> uint32_t *)
(* dwParam3 : DWORD -> uint32_t *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library tapi32 (t "TAPI32.dll"))
(cffi:use-foreign-library tapi32)
(cffi:defcfun ("lineProxyMessage" line-proxy-message :convention :stdcall) :int32
(h-line :uint32) ; DWORD
(h-call :uint32) ; DWORD
(dw-msg :uint32) ; DWORD
(dw-param1 :uint32) ; DWORD
(dw-param2 :uint32) ; DWORD
(dw-param3 :uint32)) ; DWORD
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $lineProxyMessage = Win32::API::More->new('TAPI32',
'int lineProxyMessage(DWORD hLine, DWORD hCall, DWORD dwMsg, DWORD dwParam1, DWORD dwParam2, DWORD dwParam3)');
# my $ret = $lineProxyMessage->Call($hLine, $hCall, $dwMsg, $dwParam1, $dwParam2, $dwParam3);
# hLine : DWORD -> DWORD
# hCall : DWORD -> DWORD
# dwMsg : DWORD -> DWORD
# dwParam1 : DWORD -> DWORD
# dwParam2 : DWORD -> DWORD
# dwParam3 : DWORD -> DWORD
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。