Win32 API 日本語リファレンス
ホームNetworkManagement.NetworkPolicyServer › RADIUS_EXTENSION_CONTROL_BLOCK

RADIUS_EXTENSION_CONTROL_BLOCK

構造体
サイズx64: 48 バイト / x86: 32 バイト

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

フィールド

フィールドサイズx64x86説明
cbSizeDWORD4+0+0この構造体のサイズをバイト単位で示す値。
dwVersionDWORD4+4+4拡張制御ブロックのバージョン番号。
repPointRADIUS_EXTENSION_POINT4+8+8拡張DLLが呼び出された処理ポイントを示すRADIUS_EXTENSION_POINT列挙値。
rcRequestTypeRADIUS_CODE4+12+12受信したRADIUS要求のコードを示すRADIUS_CODE列挙値。
rcResponseTypeRADIUS_CODE4+16+16送信予定の応答コードを示すRADIUS_CODE列挙値。
GetRequestINT_PTR8/4+24+20要求側の属性配列を取得する関数へのポインタ。
GetResponseINT_PTR8/4+32+24応答側の属性配列を取得する関数へのポインタ。
SetResponseTypeINT_PTR8/4+40+28応答タイプを設定する関数へのポインタ。

各言語での定義

#include <windows.h>

// RADIUS_EXTENSION_CONTROL_BLOCK  (x64 48 / x86 32 バイト)
typedef struct RADIUS_EXTENSION_CONTROL_BLOCK {
    DWORD cbSize;
    DWORD dwVersion;
    RADIUS_EXTENSION_POINT repPoint;
    RADIUS_CODE rcRequestType;
    RADIUS_CODE rcResponseType;
    INT_PTR GetRequest;
    INT_PTR GetResponse;
    INT_PTR SetResponseType;
} RADIUS_EXTENSION_CONTROL_BLOCK;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RADIUS_EXTENSION_CONTROL_BLOCK
{
    public uint cbSize;
    public uint dwVersion;
    public int repPoint;
    public int rcRequestType;
    public int rcResponseType;
    public IntPtr GetRequest;
    public IntPtr GetResponse;
    public IntPtr SetResponseType;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RADIUS_EXTENSION_CONTROL_BLOCK
    Public cbSize As UInteger
    Public dwVersion As UInteger
    Public repPoint As Integer
    Public rcRequestType As Integer
    Public rcResponseType As Integer
    Public GetRequest As IntPtr
    Public GetResponse As IntPtr
    Public SetResponseType As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class RADIUS_EXTENSION_CONTROL_BLOCK(ctypes.Structure):
    _fields_ = [
        ("cbSize", wintypes.DWORD),
        ("dwVersion", wintypes.DWORD),
        ("repPoint", ctypes.c_int),
        ("rcRequestType", ctypes.c_int),
        ("rcResponseType", ctypes.c_int),
        ("GetRequest", ctypes.c_ssize_t),
        ("GetResponse", ctypes.c_ssize_t),
        ("SetResponseType", ctypes.c_ssize_t),
    ]
#[repr(C)]
pub struct RADIUS_EXTENSION_CONTROL_BLOCK {
    pub cbSize: u32,
    pub dwVersion: u32,
    pub repPoint: i32,
    pub rcRequestType: i32,
    pub rcResponseType: i32,
    pub GetRequest: isize,
    pub GetResponse: isize,
    pub SetResponseType: isize,
}
import "golang.org/x/sys/windows"

type RADIUS_EXTENSION_CONTROL_BLOCK struct {
	cbSize uint32
	dwVersion uint32
	repPoint int32
	rcRequestType int32
	rcResponseType int32
	GetRequest uintptr
	GetResponse uintptr
	SetResponseType uintptr
}
type
  RADIUS_EXTENSION_CONTROL_BLOCK = record
    cbSize: DWORD;
    dwVersion: DWORD;
    repPoint: Integer;
    rcRequestType: Integer;
    rcResponseType: Integer;
    GetRequest: NativeInt;
    GetResponse: NativeInt;
    SetResponseType: NativeInt;
  end;
const RADIUS_EXTENSION_CONTROL_BLOCK = extern struct {
    cbSize: u32,
    dwVersion: u32,
    repPoint: i32,
    rcRequestType: i32,
    rcResponseType: i32,
    GetRequest: isize,
    GetResponse: isize,
    SetResponseType: isize,
};
type
  RADIUS_EXTENSION_CONTROL_BLOCK {.bycopy.} = object
    cbSize: uint32
    dwVersion: uint32
    repPoint: int32
    rcRequestType: int32
    rcResponseType: int32
    GetRequest: int
    GetResponse: int
    SetResponseType: int
struct RADIUS_EXTENSION_CONTROL_BLOCK
{
    uint cbSize;
    uint dwVersion;
    int repPoint;
    int rcRequestType;
    int rcResponseType;
    ptrdiff_t GetRequest;
    ptrdiff_t GetResponse;
    ptrdiff_t SetResponseType;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; RADIUS_EXTENSION_CONTROL_BLOCK サイズ: 32 バイト(x86)
dim st, 8    ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwVersion : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; repPoint : RADIUS_EXTENSION_POINT (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; rcRequestType : RADIUS_CODE (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; rcResponseType : RADIUS_CODE (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; GetRequest : INT_PTR (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; GetResponse : INT_PTR (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; SetResponseType : INT_PTR (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; RADIUS_EXTENSION_CONTROL_BLOCK サイズ: 48 バイト(x64)
dim st, 12    ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwVersion : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; repPoint : RADIUS_EXTENSION_POINT (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; rcRequestType : RADIUS_CODE (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; rcResponseType : RADIUS_CODE (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; GetRequest : INT_PTR (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; GetResponse : INT_PTR (+32, 8byte)  qpoke st,32,値 / qpeek(st,32)  ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; SetResponseType : INT_PTR (+40, 8byte)  qpoke st,40,値 / qpeek(st,40)  ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global RADIUS_EXTENSION_CONTROL_BLOCK
    #field int cbSize
    #field int dwVersion
    #field int repPoint
    #field int rcRequestType
    #field int rcResponseType
    #field intptr GetRequest
    #field intptr GetResponse
    #field intptr SetResponseType
#endstruct

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