ホーム › NetworkManagement.NetworkPolicyServer › RADIUS_ATTRIBUTE_ARRAY
RADIUS_ATTRIBUTE_ARRAY
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbSize | DWORD | 4 | +0 | +0 | この構造体のサイズをバイト単位で示す値。 |
| Add | INT_PTR | 8/4 | +8 | +4 | 属性を配列に追加する関数へのポインタ。 |
| AttributeAt | INT_PTR | 8/4 | +16 | +8 | 指定インデックスの属性を取得する関数へのポインタ。 |
| GetSize | INT_PTR | 8/4 | +24 | +12 | 配列内の属性数を返す関数へのポインタ。 |
| InsertAt | INT_PTR | 8/4 | +32 | +16 | 指定位置に属性を挿入する関数へのポインタ。 |
| RemoveAt | INT_PTR | 8/4 | +40 | +20 | 指定位置の属性を削除する関数へのポインタ。 |
| SetAt | INT_PTR | 8/4 | +48 | +24 | 指定位置の属性を設定する関数へのポインタ。 |
各言語での定義
#include <windows.h>
// RADIUS_ATTRIBUTE_ARRAY (x64 56 / x86 28 バイト)
typedef struct RADIUS_ATTRIBUTE_ARRAY {
DWORD cbSize;
INT_PTR Add;
INT_PTR AttributeAt;
INT_PTR GetSize;
INT_PTR InsertAt;
INT_PTR RemoveAt;
INT_PTR SetAt;
} RADIUS_ATTRIBUTE_ARRAY;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RADIUS_ATTRIBUTE_ARRAY
{
public uint cbSize;
public IntPtr Add;
public IntPtr AttributeAt;
public IntPtr GetSize;
public IntPtr InsertAt;
public IntPtr RemoveAt;
public IntPtr SetAt;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RADIUS_ATTRIBUTE_ARRAY
Public cbSize As UInteger
Public Add As IntPtr
Public AttributeAt As IntPtr
Public GetSize As IntPtr
Public InsertAt As IntPtr
Public RemoveAt As IntPtr
Public SetAt As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class RADIUS_ATTRIBUTE_ARRAY(ctypes.Structure):
_fields_ = [
("cbSize", wintypes.DWORD),
("Add", ctypes.c_ssize_t),
("AttributeAt", ctypes.c_ssize_t),
("GetSize", ctypes.c_ssize_t),
("InsertAt", ctypes.c_ssize_t),
("RemoveAt", ctypes.c_ssize_t),
("SetAt", ctypes.c_ssize_t),
]#[repr(C)]
pub struct RADIUS_ATTRIBUTE_ARRAY {
pub cbSize: u32,
pub Add: isize,
pub AttributeAt: isize,
pub GetSize: isize,
pub InsertAt: isize,
pub RemoveAt: isize,
pub SetAt: isize,
}import "golang.org/x/sys/windows"
type RADIUS_ATTRIBUTE_ARRAY struct {
cbSize uint32
Add uintptr
AttributeAt uintptr
GetSize uintptr
InsertAt uintptr
RemoveAt uintptr
SetAt uintptr
}type
RADIUS_ATTRIBUTE_ARRAY = record
cbSize: DWORD;
Add: NativeInt;
AttributeAt: NativeInt;
GetSize: NativeInt;
InsertAt: NativeInt;
RemoveAt: NativeInt;
SetAt: NativeInt;
end;const RADIUS_ATTRIBUTE_ARRAY = extern struct {
cbSize: u32,
Add: isize,
AttributeAt: isize,
GetSize: isize,
InsertAt: isize,
RemoveAt: isize,
SetAt: isize,
};type
RADIUS_ATTRIBUTE_ARRAY {.bycopy.} = object
cbSize: uint32
Add: int
AttributeAt: int
GetSize: int
InsertAt: int
RemoveAt: int
SetAt: intstruct RADIUS_ATTRIBUTE_ARRAY
{
uint cbSize;
ptrdiff_t Add;
ptrdiff_t AttributeAt;
ptrdiff_t GetSize;
ptrdiff_t InsertAt;
ptrdiff_t RemoveAt;
ptrdiff_t SetAt;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; RADIUS_ATTRIBUTE_ARRAY サイズ: 28 バイト(x86)
dim st, 7 ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Add : INT_PTR (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; AttributeAt : INT_PTR (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; GetSize : INT_PTR (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; InsertAt : INT_PTR (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; RemoveAt : INT_PTR (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; SetAt : INT_PTR (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; RADIUS_ATTRIBUTE_ARRAY サイズ: 56 バイト(x64)
dim st, 14 ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Add : INT_PTR (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; AttributeAt : INT_PTR (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; GetSize : INT_PTR (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; InsertAt : INT_PTR (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; RemoveAt : INT_PTR (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; SetAt : INT_PTR (+48, 8byte) qpoke st,48,値 / qpeek(st,48) ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global RADIUS_ATTRIBUTE_ARRAY
#field int cbSize
#field intptr Add
#field intptr AttributeAt
#field intptr GetSize
#field intptr InsertAt
#field intptr RemoveAt
#field intptr SetAt
#endstruct
stdim st, RADIUS_ATTRIBUTE_ARRAY ; NSTRUCT 変数を確保
st->cbSize = 100
mes "cbSize=" + st->cbSize