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

lineGetAgentSessionList

関数
エージェントに属するセッションの一覧を取得する。
DLLTAPI32.dll呼出規約winapi

シグネチャ

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

INT lineGetAgentSessionList(
    DWORD hLine,
    DWORD hAgent,
    LINEAGENTSESSIONLIST* lpAgentSessionList
);

パラメーター

名前方向
hLineDWORDin
hAgentDWORDin
lpAgentSessionListLINEAGENTSESSIONLIST*inout

戻り値の型: INT

各言語での呼び出し定義

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

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

lineGetAgentSessionList = ctypes.windll.tapi32.lineGetAgentSessionList
lineGetAgentSessionList.restype = ctypes.c_int
lineGetAgentSessionList.argtypes = [
    wintypes.DWORD,  # hLine : DWORD
    wintypes.DWORD,  # hAgent : DWORD
    ctypes.c_void_p,  # lpAgentSessionList : LINEAGENTSESSIONLIST* in/out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	tapi32 = windows.NewLazySystemDLL("TAPI32.dll")
	proclineGetAgentSessionList = tapi32.NewProc("lineGetAgentSessionList")
)

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