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

lineGetAgentGroupListW

関数
エージェントがログオン可能なグループ一覧を取得する(Unicode版)。
DLLTAPI32.dll文字セットUnicode (-W)呼出規約winapi

シグネチャ

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

INT lineGetAgentGroupListW(
    DWORD hLine,
    DWORD dwAddressID,
    LINEAGENTGROUPLIST* lpAgentGroupList
);

パラメーター

名前方向
hLineDWORDin
dwAddressIDDWORDin
lpAgentGroupListLINEAGENTGROUPLIST*inout

戻り値の型: INT

各言語での呼び出し定義

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

INT lineGetAgentGroupListW(
    DWORD hLine,
    DWORD dwAddressID,
    LINEAGENTGROUPLIST* lpAgentGroupList
);
[DllImport("TAPI32.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
static extern int lineGetAgentGroupListW(
    uint hLine,   // DWORD
    uint dwAddressID,   // DWORD
    IntPtr lpAgentGroupList   // LINEAGENTGROUPLIST* in/out
);
<DllImport("TAPI32.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True)>
Public Shared Function lineGetAgentGroupListW(
    hLine As UInteger,   ' DWORD
    dwAddressID As UInteger,   ' DWORD
    lpAgentGroupList As IntPtr   ' LINEAGENTGROUPLIST* in/out
) As Integer
End Function
' hLine : DWORD
' dwAddressID : DWORD
' lpAgentGroupList : LINEAGENTGROUPLIST* in/out
Declare PtrSafe Function lineGetAgentGroupListW Lib "tapi32" ( _
    ByVal hLine As Long, _
    ByVal dwAddressID As Long, _
    ByVal lpAgentGroupList 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

lineGetAgentGroupListW = ctypes.windll.tapi32.lineGetAgentGroupListW
lineGetAgentGroupListW.restype = ctypes.c_int
lineGetAgentGroupListW.argtypes = [
    wintypes.DWORD,  # hLine : DWORD
    wintypes.DWORD,  # dwAddressID : DWORD
    ctypes.c_void_p,  # lpAgentGroupList : LINEAGENTGROUPLIST* in/out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	tapi32 = windows.NewLazySystemDLL("TAPI32.dll")
	proclineGetAgentGroupListW = tapi32.NewProc("lineGetAgentGroupListW")
)

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