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

lineGetAgentSessionInfo

関数
指定したエージェントセッションの情報を取得する。
DLLTAPI32.dll呼出規約winapi

シグネチャ

// TAPI32.dll
#include <windows.h>

INT lineGetAgentSessionInfo(
    DWORD hLine,
    DWORD hAgentSession,
    LINEAGENTSESSIONINFO* lpAgentSessionInfo
);

パラメーター

名前方向
hLineDWORDin
hAgentSessionDWORDin
lpAgentSessionInfoLINEAGENTSESSIONINFO*inout

戻り値の型: INT

各言語での呼び出し定義

// TAPI32.dll
#include <windows.h>

INT lineGetAgentSessionInfo(
    DWORD hLine,
    DWORD hAgentSession,
    LINEAGENTSESSIONINFO* lpAgentSessionInfo
);
[DllImport("TAPI32.dll", ExactSpelling = true)]
static extern int lineGetAgentSessionInfo(
    uint hLine,   // DWORD
    uint hAgentSession,   // DWORD
    IntPtr lpAgentSessionInfo   // LINEAGENTSESSIONINFO* in/out
);
<DllImport("TAPI32.dll", ExactSpelling:=True)>
Public Shared Function lineGetAgentSessionInfo(
    hLine As UInteger,   ' DWORD
    hAgentSession As UInteger,   ' DWORD
    lpAgentSessionInfo As IntPtr   ' LINEAGENTSESSIONINFO* in/out
) As Integer
End Function
' hLine : DWORD
' hAgentSession : DWORD
' lpAgentSessionInfo : LINEAGENTSESSIONINFO* in/out
Declare PtrSafe Function lineGetAgentSessionInfo Lib "tapi32" ( _
    ByVal hLine As Long, _
    ByVal hAgentSession As Long, _
    ByVal lpAgentSessionInfo As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

lineGetAgentSessionInfo = ctypes.windll.tapi32.lineGetAgentSessionInfo
lineGetAgentSessionInfo.restype = ctypes.c_int
lineGetAgentSessionInfo.argtypes = [
    wintypes.DWORD,  # hLine : DWORD
    wintypes.DWORD,  # hAgentSession : DWORD
    ctypes.c_void_p,  # lpAgentSessionInfo : LINEAGENTSESSIONINFO* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('TAPI32.dll')
lineGetAgentSessionInfo = Fiddle::Function.new(
  lib['lineGetAgentSessionInfo'],
  [
    -Fiddle::TYPE_INT,  # hLine : DWORD
    -Fiddle::TYPE_INT,  # hAgentSession : DWORD
    Fiddle::TYPE_VOIDP,  # lpAgentSessionInfo : LINEAGENTSESSIONINFO* in/out
  ],
  Fiddle::TYPE_INT)
#[link(name = "tapi32")]
extern "system" {
    fn lineGetAgentSessionInfo(
        hLine: u32,  // DWORD
        hAgentSession: u32,  // DWORD
        lpAgentSessionInfo: *mut LINEAGENTSESSIONINFO  // LINEAGENTSESSIONINFO* in/out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("TAPI32.dll")]
public static extern int lineGetAgentSessionInfo(uint hLine, uint hAgentSession, IntPtr lpAgentSessionInfo);
"@
$api = Add-Type -MemberDefinition $sig -Name 'TAPI32_lineGetAgentSessionInfo' -Namespace Win32 -PassThru
# $api::lineGetAgentSessionInfo(hLine, hAgentSession, lpAgentSessionInfo)
#uselib "TAPI32.dll"
#func global lineGetAgentSessionInfo "lineGetAgentSessionInfo" sptr, sptr, sptr
; lineGetAgentSessionInfo hLine, hAgentSession, varptr(lpAgentSessionInfo)   ; 戻り値は stat
; hLine : DWORD -> "sptr"
; hAgentSession : DWORD -> "sptr"
; lpAgentSessionInfo : LINEAGENTSESSIONINFO* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "TAPI32.dll"
#cfunc global lineGetAgentSessionInfo "lineGetAgentSessionInfo" int, int, var
; res = lineGetAgentSessionInfo(hLine, hAgentSession, lpAgentSessionInfo)
; hLine : DWORD -> "int"
; hAgentSession : DWORD -> "int"
; lpAgentSessionInfo : LINEAGENTSESSIONINFO* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; INT lineGetAgentSessionInfo(DWORD hLine, DWORD hAgentSession, LINEAGENTSESSIONINFO* lpAgentSessionInfo)
#uselib "TAPI32.dll"
#cfunc global lineGetAgentSessionInfo "lineGetAgentSessionInfo" int, int, var
; res = lineGetAgentSessionInfo(hLine, hAgentSession, lpAgentSessionInfo)
; hLine : DWORD -> "int"
; hAgentSession : DWORD -> "int"
; lpAgentSessionInfo : LINEAGENTSESSIONINFO* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	tapi32 = windows.NewLazySystemDLL("TAPI32.dll")
	proclineGetAgentSessionInfo = tapi32.NewProc("lineGetAgentSessionInfo")
)

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