ホーム › Devices.Tapi › phoneNegotiateExtVersion
phoneNegotiateExtVersion
関数電話デバイスの拡張バージョンを調停する。
シグネチャ
// TAPI32.dll
#include <windows.h>
INT phoneNegotiateExtVersion(
DWORD hPhoneApp,
DWORD dwDeviceID,
DWORD dwAPIVersion,
DWORD dwExtLowVersion,
DWORD dwExtHighVersion,
DWORD* lpdwExtVersion
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hPhoneApp | DWORD | in |
| dwDeviceID | DWORD | in |
| dwAPIVersion | DWORD | in |
| dwExtLowVersion | DWORD | in |
| dwExtHighVersion | DWORD | in |
| lpdwExtVersion | DWORD* | inout |
戻り値の型: INT
各言語での呼び出し定義
// TAPI32.dll
#include <windows.h>
INT phoneNegotiateExtVersion(
DWORD hPhoneApp,
DWORD dwDeviceID,
DWORD dwAPIVersion,
DWORD dwExtLowVersion,
DWORD dwExtHighVersion,
DWORD* lpdwExtVersion
);[DllImport("TAPI32.dll", ExactSpelling = true)]
static extern int phoneNegotiateExtVersion(
uint hPhoneApp, // DWORD
uint dwDeviceID, // DWORD
uint dwAPIVersion, // DWORD
uint dwExtLowVersion, // DWORD
uint dwExtHighVersion, // DWORD
ref uint lpdwExtVersion // DWORD* in/out
);<DllImport("TAPI32.dll", ExactSpelling:=True)>
Public Shared Function phoneNegotiateExtVersion(
hPhoneApp As UInteger, ' DWORD
dwDeviceID As UInteger, ' DWORD
dwAPIVersion As UInteger, ' DWORD
dwExtLowVersion As UInteger, ' DWORD
dwExtHighVersion As UInteger, ' DWORD
ByRef lpdwExtVersion As UInteger ' DWORD* in/out
) As Integer
End Function' hPhoneApp : DWORD
' dwDeviceID : DWORD
' dwAPIVersion : DWORD
' dwExtLowVersion : DWORD
' dwExtHighVersion : DWORD
' lpdwExtVersion : DWORD* in/out
Declare PtrSafe Function phoneNegotiateExtVersion Lib "tapi32" ( _
ByVal hPhoneApp As Long, _
ByVal dwDeviceID As Long, _
ByVal dwAPIVersion As Long, _
ByVal dwExtLowVersion As Long, _
ByVal dwExtHighVersion As Long, _
ByRef lpdwExtVersion As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
phoneNegotiateExtVersion = ctypes.windll.tapi32.phoneNegotiateExtVersion
phoneNegotiateExtVersion.restype = ctypes.c_int
phoneNegotiateExtVersion.argtypes = [
wintypes.DWORD, # hPhoneApp : DWORD
wintypes.DWORD, # dwDeviceID : DWORD
wintypes.DWORD, # dwAPIVersion : DWORD
wintypes.DWORD, # dwExtLowVersion : DWORD
wintypes.DWORD, # dwExtHighVersion : DWORD
ctypes.POINTER(wintypes.DWORD), # lpdwExtVersion : DWORD* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('TAPI32.dll')
phoneNegotiateExtVersion = Fiddle::Function.new(
lib['phoneNegotiateExtVersion'],
[
-Fiddle::TYPE_INT, # hPhoneApp : DWORD
-Fiddle::TYPE_INT, # dwDeviceID : DWORD
-Fiddle::TYPE_INT, # dwAPIVersion : DWORD
-Fiddle::TYPE_INT, # dwExtLowVersion : DWORD
-Fiddle::TYPE_INT, # dwExtHighVersion : DWORD
Fiddle::TYPE_VOIDP, # lpdwExtVersion : DWORD* in/out
],
Fiddle::TYPE_INT)#[link(name = "tapi32")]
extern "system" {
fn phoneNegotiateExtVersion(
hPhoneApp: u32, // DWORD
dwDeviceID: u32, // DWORD
dwAPIVersion: u32, // DWORD
dwExtLowVersion: u32, // DWORD
dwExtHighVersion: u32, // DWORD
lpdwExtVersion: *mut u32 // DWORD* in/out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("TAPI32.dll")]
public static extern int phoneNegotiateExtVersion(uint hPhoneApp, uint dwDeviceID, uint dwAPIVersion, uint dwExtLowVersion, uint dwExtHighVersion, ref uint lpdwExtVersion);
"@
$api = Add-Type -MemberDefinition $sig -Name 'TAPI32_phoneNegotiateExtVersion' -Namespace Win32 -PassThru
# $api::phoneNegotiateExtVersion(hPhoneApp, dwDeviceID, dwAPIVersion, dwExtLowVersion, dwExtHighVersion, lpdwExtVersion)#uselib "TAPI32.dll"
#func global phoneNegotiateExtVersion "phoneNegotiateExtVersion" sptr, sptr, sptr, sptr, sptr, sptr
; phoneNegotiateExtVersion hPhoneApp, dwDeviceID, dwAPIVersion, dwExtLowVersion, dwExtHighVersion, varptr(lpdwExtVersion) ; 戻り値は stat
; hPhoneApp : DWORD -> "sptr"
; dwDeviceID : DWORD -> "sptr"
; dwAPIVersion : DWORD -> "sptr"
; dwExtLowVersion : DWORD -> "sptr"
; dwExtHighVersion : DWORD -> "sptr"
; lpdwExtVersion : DWORD* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "TAPI32.dll" #cfunc global phoneNegotiateExtVersion "phoneNegotiateExtVersion" int, int, int, int, int, var ; res = phoneNegotiateExtVersion(hPhoneApp, dwDeviceID, dwAPIVersion, dwExtLowVersion, dwExtHighVersion, lpdwExtVersion) ; hPhoneApp : DWORD -> "int" ; dwDeviceID : DWORD -> "int" ; dwAPIVersion : DWORD -> "int" ; dwExtLowVersion : DWORD -> "int" ; dwExtHighVersion : DWORD -> "int" ; lpdwExtVersion : DWORD* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "TAPI32.dll" #cfunc global phoneNegotiateExtVersion "phoneNegotiateExtVersion" int, int, int, int, int, sptr ; res = phoneNegotiateExtVersion(hPhoneApp, dwDeviceID, dwAPIVersion, dwExtLowVersion, dwExtHighVersion, varptr(lpdwExtVersion)) ; hPhoneApp : DWORD -> "int" ; dwDeviceID : DWORD -> "int" ; dwAPIVersion : DWORD -> "int" ; dwExtLowVersion : DWORD -> "int" ; dwExtHighVersion : DWORD -> "int" ; lpdwExtVersion : DWORD* in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; INT phoneNegotiateExtVersion(DWORD hPhoneApp, DWORD dwDeviceID, DWORD dwAPIVersion, DWORD dwExtLowVersion, DWORD dwExtHighVersion, DWORD* lpdwExtVersion) #uselib "TAPI32.dll" #cfunc global phoneNegotiateExtVersion "phoneNegotiateExtVersion" int, int, int, int, int, var ; res = phoneNegotiateExtVersion(hPhoneApp, dwDeviceID, dwAPIVersion, dwExtLowVersion, dwExtHighVersion, lpdwExtVersion) ; hPhoneApp : DWORD -> "int" ; dwDeviceID : DWORD -> "int" ; dwAPIVersion : DWORD -> "int" ; dwExtLowVersion : DWORD -> "int" ; dwExtHighVersion : DWORD -> "int" ; lpdwExtVersion : DWORD* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; INT phoneNegotiateExtVersion(DWORD hPhoneApp, DWORD dwDeviceID, DWORD dwAPIVersion, DWORD dwExtLowVersion, DWORD dwExtHighVersion, DWORD* lpdwExtVersion) #uselib "TAPI32.dll" #cfunc global phoneNegotiateExtVersion "phoneNegotiateExtVersion" int, int, int, int, int, intptr ; res = phoneNegotiateExtVersion(hPhoneApp, dwDeviceID, dwAPIVersion, dwExtLowVersion, dwExtHighVersion, varptr(lpdwExtVersion)) ; hPhoneApp : DWORD -> "int" ; dwDeviceID : DWORD -> "int" ; dwAPIVersion : DWORD -> "int" ; dwExtLowVersion : DWORD -> "int" ; dwExtHighVersion : DWORD -> "int" ; lpdwExtVersion : DWORD* in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
tapi32 = windows.NewLazySystemDLL("TAPI32.dll")
procphoneNegotiateExtVersion = tapi32.NewProc("phoneNegotiateExtVersion")
)
// hPhoneApp (DWORD), dwDeviceID (DWORD), dwAPIVersion (DWORD), dwExtLowVersion (DWORD), dwExtHighVersion (DWORD), lpdwExtVersion (DWORD* in/out)
r1, _, err := procphoneNegotiateExtVersion.Call(
uintptr(hPhoneApp),
uintptr(dwDeviceID),
uintptr(dwAPIVersion),
uintptr(dwExtLowVersion),
uintptr(dwExtHighVersion),
uintptr(lpdwExtVersion),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // INTfunction phoneNegotiateExtVersion(
hPhoneApp: DWORD; // DWORD
dwDeviceID: DWORD; // DWORD
dwAPIVersion: DWORD; // DWORD
dwExtLowVersion: DWORD; // DWORD
dwExtHighVersion: DWORD; // DWORD
lpdwExtVersion: Pointer // DWORD* in/out
): Integer; stdcall;
external 'TAPI32.dll' name 'phoneNegotiateExtVersion';result := DllCall("TAPI32\phoneNegotiateExtVersion"
, "UInt", hPhoneApp ; DWORD
, "UInt", dwDeviceID ; DWORD
, "UInt", dwAPIVersion ; DWORD
, "UInt", dwExtLowVersion ; DWORD
, "UInt", dwExtHighVersion ; DWORD
, "Ptr", lpdwExtVersion ; DWORD* in/out
, "Int") ; return: INT●phoneNegotiateExtVersion(hPhoneApp, dwDeviceID, dwAPIVersion, dwExtLowVersion, dwExtHighVersion, lpdwExtVersion) = DLL("TAPI32.dll", "int phoneNegotiateExtVersion(dword, dword, dword, dword, dword, void*)")
# 呼び出し: phoneNegotiateExtVersion(hPhoneApp, dwDeviceID, dwAPIVersion, dwExtLowVersion, dwExtHighVersion, lpdwExtVersion)
# hPhoneApp : DWORD -> "dword"
# dwDeviceID : DWORD -> "dword"
# dwAPIVersion : DWORD -> "dword"
# dwExtLowVersion : DWORD -> "dword"
# dwExtHighVersion : DWORD -> "dword"
# lpdwExtVersion : DWORD* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。