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

LINEAGENTSTATUS

構造体
サイズx64: 56 バイト / x86: 56 バイトパッキング1

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
dwTotalSizeDWORD4+0+0この構造体に割り当てられた総サイズをバイトで表す。
dwNeededSizeDWORD4+4+4全情報の格納に必要なサイズをバイトで表す。
dwUsedSizeDWORD4+8+8実際に使用されたサイズをバイトで表す。
dwNumEntriesDWORD4+12+12状態に含まれるグループエントリの個数を表す。
dwGroupListSizeDWORD4+16+16所属グループリストのサイズをバイトで表す。
dwGroupListOffsetDWORD4+20+20所属グループリストまでのオフセットをバイトで表す。
dwStateDWORD4+24+24現在のエージェント状態を示す値。
dwNextStateDWORD4+28+28予定される次のエージェント状態を示す値。
dwActivityIDDWORD4+32+32現在のエージェント活動を識別するIDを表す。
dwActivitySizeDWORD4+36+36活動名文字列のサイズをバイトで表す。
dwActivityOffsetDWORD4+40+40活動名文字列までのオフセットをバイトで表す。
dwAgentFeaturesDWORD4+44+44現在利用可能なエージェント機能を示すフラグ。
dwValidStatesDWORD4+48+48現在設定可能なエージェント状態を示すフラグ。
dwValidNextStatesDWORD4+52+52現在遷移可能な次状態を示すフラグ。

各言語での定義

#include <windows.h>

// LINEAGENTSTATUS  (x64 56 / x86 56 バイト)
#pragma pack(push, 1)
typedef struct LINEAGENTSTATUS {
    DWORD dwTotalSize;
    DWORD dwNeededSize;
    DWORD dwUsedSize;
    DWORD dwNumEntries;
    DWORD dwGroupListSize;
    DWORD dwGroupListOffset;
    DWORD dwState;
    DWORD dwNextState;
    DWORD dwActivityID;
    DWORD dwActivitySize;
    DWORD dwActivityOffset;
    DWORD dwAgentFeatures;
    DWORD dwValidStates;
    DWORD dwValidNextStates;
} LINEAGENTSTATUS;
#pragma pack(pop)
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct LINEAGENTSTATUS
{
    public uint dwTotalSize;
    public uint dwNeededSize;
    public uint dwUsedSize;
    public uint dwNumEntries;
    public uint dwGroupListSize;
    public uint dwGroupListOffset;
    public uint dwState;
    public uint dwNextState;
    public uint dwActivityID;
    public uint dwActivitySize;
    public uint dwActivityOffset;
    public uint dwAgentFeatures;
    public uint dwValidStates;
    public uint dwValidNextStates;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure LINEAGENTSTATUS
    Public dwTotalSize As UInteger
    Public dwNeededSize As UInteger
    Public dwUsedSize As UInteger
    Public dwNumEntries As UInteger
    Public dwGroupListSize As UInteger
    Public dwGroupListOffset As UInteger
    Public dwState As UInteger
    Public dwNextState As UInteger
    Public dwActivityID As UInteger
    Public dwActivitySize As UInteger
    Public dwActivityOffset As UInteger
    Public dwAgentFeatures As UInteger
    Public dwValidStates As UInteger
    Public dwValidNextStates As UInteger
End Structure
import ctypes
from ctypes import wintypes

class LINEAGENTSTATUS(ctypes.Structure):
    _pack_ = 1
    _fields_ = [
        ("dwTotalSize", wintypes.DWORD),
        ("dwNeededSize", wintypes.DWORD),
        ("dwUsedSize", wintypes.DWORD),
        ("dwNumEntries", wintypes.DWORD),
        ("dwGroupListSize", wintypes.DWORD),
        ("dwGroupListOffset", wintypes.DWORD),
        ("dwState", wintypes.DWORD),
        ("dwNextState", wintypes.DWORD),
        ("dwActivityID", wintypes.DWORD),
        ("dwActivitySize", wintypes.DWORD),
        ("dwActivityOffset", wintypes.DWORD),
        ("dwAgentFeatures", wintypes.DWORD),
        ("dwValidStates", wintypes.DWORD),
        ("dwValidNextStates", wintypes.DWORD),
    ]
#[repr(C, packed(1))]
pub struct LINEAGENTSTATUS {
    pub dwTotalSize: u32,
    pub dwNeededSize: u32,
    pub dwUsedSize: u32,
    pub dwNumEntries: u32,
    pub dwGroupListSize: u32,
    pub dwGroupListOffset: u32,
    pub dwState: u32,
    pub dwNextState: u32,
    pub dwActivityID: u32,
    pub dwActivitySize: u32,
    pub dwActivityOffset: u32,
    pub dwAgentFeatures: u32,
    pub dwValidStates: u32,
    pub dwValidNextStates: u32,
}
import "golang.org/x/sys/windows"

type LINEAGENTSTATUS struct {
	dwTotalSize uint32
	dwNeededSize uint32
	dwUsedSize uint32
	dwNumEntries uint32
	dwGroupListSize uint32
	dwGroupListOffset uint32
	dwState uint32
	dwNextState uint32
	dwActivityID uint32
	dwActivitySize uint32
	dwActivityOffset uint32
	dwAgentFeatures uint32
	dwValidStates uint32
	dwValidNextStates uint32
}
type
  LINEAGENTSTATUS = packed record
    dwTotalSize: DWORD;
    dwNeededSize: DWORD;
    dwUsedSize: DWORD;
    dwNumEntries: DWORD;
    dwGroupListSize: DWORD;
    dwGroupListOffset: DWORD;
    dwState: DWORD;
    dwNextState: DWORD;
    dwActivityID: DWORD;
    dwActivitySize: DWORD;
    dwActivityOffset: DWORD;
    dwAgentFeatures: DWORD;
    dwValidStates: DWORD;
    dwValidNextStates: DWORD;
  end;
const LINEAGENTSTATUS = extern struct {
    dwTotalSize: u32,
    dwNeededSize: u32,
    dwUsedSize: u32,
    dwNumEntries: u32,
    dwGroupListSize: u32,
    dwGroupListOffset: u32,
    dwState: u32,
    dwNextState: u32,
    dwActivityID: u32,
    dwActivitySize: u32,
    dwActivityOffset: u32,
    dwAgentFeatures: u32,
    dwValidStates: u32,
    dwValidNextStates: u32,
};
type
  LINEAGENTSTATUS {.packed.} = object
    dwTotalSize: uint32
    dwNeededSize: uint32
    dwUsedSize: uint32
    dwNumEntries: uint32
    dwGroupListSize: uint32
    dwGroupListOffset: uint32
    dwState: uint32
    dwNextState: uint32
    dwActivityID: uint32
    dwActivitySize: uint32
    dwActivityOffset: uint32
    dwAgentFeatures: uint32
    dwValidStates: uint32
    dwValidNextStates: uint32
align(1)
struct LINEAGENTSTATUS
{
    uint dwTotalSize;
    uint dwNeededSize;
    uint dwUsedSize;
    uint dwNumEntries;
    uint dwGroupListSize;
    uint dwGroupListOffset;
    uint dwState;
    uint dwNextState;
    uint dwActivityID;
    uint dwActivitySize;
    uint dwActivityOffset;
    uint dwAgentFeatures;
    uint dwValidStates;
    uint dwValidNextStates;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; LINEAGENTSTATUS サイズ: 56 バイト(x64)
dim st, 14    ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; dwTotalSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwNeededSize : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dwUsedSize : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; dwNumEntries : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; dwGroupListSize : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; dwGroupListOffset : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; dwState : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; dwNextState : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; dwActivityID : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; dwActivitySize : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; dwActivityOffset : DWORD (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; dwAgentFeatures : DWORD (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; dwValidStates : DWORD (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; dwValidNextStates : DWORD (+52, 4byte)  st.13 = 値  /  値 = st.13   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global LINEAGENTSTATUS, pack=1
    #field int dwTotalSize
    #field int dwNeededSize
    #field int dwUsedSize
    #field int dwNumEntries
    #field int dwGroupListSize
    #field int dwGroupListOffset
    #field int dwState
    #field int dwNextState
    #field int dwActivityID
    #field int dwActivitySize
    #field int dwActivityOffset
    #field int dwAgentFeatures
    #field int dwValidStates
    #field int dwValidNextStates
#endstruct

stdim st, LINEAGENTSTATUS        ; NSTRUCT 変数を確保
st->dwTotalSize = 100
mes "dwTotalSize=" + st->dwTotalSize