ホーム › Devices.Tapi › LINEAGENTSESSIONENTRY
LINEAGENTSESSIONENTRY
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| hAgentSession | DWORD | 4 | +0 | +0 | このエージェントセッションを識別するハンドル値。 |
| hAgent | DWORD | 4 | +4 | +4 | セッションに属するエージェントのハンドル値。 |
| GroupID | GUID | 16 | +8 | +8 | セッションが担当するエージェントグループのGUID。 |
| dwWorkingAddressID | DWORD | 4 | +24 | +24 | セッションで作業対象とするアドレスのIDを表す。 |
各言語での定義
#include <windows.h>
// LINEAGENTSESSIONENTRY (x64 28 / x86 28 バイト)
#pragma pack(push, 1)
typedef struct LINEAGENTSESSIONENTRY {
DWORD hAgentSession;
DWORD hAgent;
GUID GroupID;
DWORD dwWorkingAddressID;
} LINEAGENTSESSIONENTRY;
#pragma pack(pop)using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct LINEAGENTSESSIONENTRY
{
public uint hAgentSession;
public uint hAgent;
public Guid GroupID;
public uint dwWorkingAddressID;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure LINEAGENTSESSIONENTRY
Public hAgentSession As UInteger
Public hAgent As UInteger
Public GroupID As Guid
Public dwWorkingAddressID As UInteger
End Structureimport ctypes
from ctypes import wintypes
class LINEAGENTSESSIONENTRY(ctypes.Structure):
_pack_ = 1
_fields_ = [
("hAgentSession", wintypes.DWORD),
("hAgent", wintypes.DWORD),
("GroupID", GUID),
("dwWorkingAddressID", wintypes.DWORD),
]#[repr(C, packed(1))]
pub struct LINEAGENTSESSIONENTRY {
pub hAgentSession: u32,
pub hAgent: u32,
pub GroupID: GUID,
pub dwWorkingAddressID: u32,
}import "golang.org/x/sys/windows"
type LINEAGENTSESSIONENTRY struct {
hAgentSession uint32
hAgent uint32
GroupID windows.GUID
dwWorkingAddressID uint32
}type
LINEAGENTSESSIONENTRY = packed record
hAgentSession: DWORD;
hAgent: DWORD;
GroupID: TGUID;
dwWorkingAddressID: DWORD;
end;const LINEAGENTSESSIONENTRY = extern struct {
hAgentSession: u32,
hAgent: u32,
GroupID: GUID,
dwWorkingAddressID: u32,
};type
LINEAGENTSESSIONENTRY {.packed.} = object
hAgentSession: uint32
hAgent: uint32
GroupID: GUID
dwWorkingAddressID: uint32align(1)
struct LINEAGENTSESSIONENTRY
{
uint hAgentSession;
uint hAgent;
GUID GroupID;
uint dwWorkingAddressID;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; LINEAGENTSESSIONENTRY サイズ: 28 バイト(x64)
dim st, 7 ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; hAgentSession : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; hAgent : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; GroupID : GUID (+8, 16byte) varptr(st)+8 を基点に操作(16byte:入れ子/配列)
; dwWorkingAddressID : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global GUID, pack=1
#field int Data1
#field short Data2
#field short Data3
#field byte Data4 8
#endstruct
#defstruct global LINEAGENTSESSIONENTRY, pack=1
#field int hAgentSession
#field int hAgent
#field GUID GroupID
#field int dwWorkingAddressID
#endstruct
stdim st, LINEAGENTSESSIONENTRY ; NSTRUCT 変数を確保
st->hAgentSession = 100
mes "hAgentSession=" + st->hAgentSession