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

RTM_REGN_PROFILE

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

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

フィールド

フィールドサイズx64x86説明
MaxNextHopsInRouteDWORD4+0+01ルートに含められるネクストホップの最大数。
MaxHandlesInEnumDWORD4+4+41回の列挙で返せるハンドルの最大数。
ViewsSupportedDWORD4+8+8RTMがサポートするビューを示すビットマスク。
NumberOfViewsDWORD4+12+12サポートされるビューの数。

各言語での定義

#include <windows.h>

// RTM_REGN_PROFILE  (x64 16 / x86 16 バイト)
typedef struct RTM_REGN_PROFILE {
    DWORD MaxNextHopsInRoute;
    DWORD MaxHandlesInEnum;
    DWORD ViewsSupported;
    DWORD NumberOfViews;
} RTM_REGN_PROFILE;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RTM_REGN_PROFILE
{
    public uint MaxNextHopsInRoute;
    public uint MaxHandlesInEnum;
    public uint ViewsSupported;
    public uint NumberOfViews;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RTM_REGN_PROFILE
    Public MaxNextHopsInRoute As UInteger
    Public MaxHandlesInEnum As UInteger
    Public ViewsSupported As UInteger
    Public NumberOfViews As UInteger
End Structure
import ctypes
from ctypes import wintypes

class RTM_REGN_PROFILE(ctypes.Structure):
    _fields_ = [
        ("MaxNextHopsInRoute", wintypes.DWORD),
        ("MaxHandlesInEnum", wintypes.DWORD),
        ("ViewsSupported", wintypes.DWORD),
        ("NumberOfViews", wintypes.DWORD),
    ]
#[repr(C)]
pub struct RTM_REGN_PROFILE {
    pub MaxNextHopsInRoute: u32,
    pub MaxHandlesInEnum: u32,
    pub ViewsSupported: u32,
    pub NumberOfViews: u32,
}
import "golang.org/x/sys/windows"

type RTM_REGN_PROFILE struct {
	MaxNextHopsInRoute uint32
	MaxHandlesInEnum uint32
	ViewsSupported uint32
	NumberOfViews uint32
}
type
  RTM_REGN_PROFILE = record
    MaxNextHopsInRoute: DWORD;
    MaxHandlesInEnum: DWORD;
    ViewsSupported: DWORD;
    NumberOfViews: DWORD;
  end;
const RTM_REGN_PROFILE = extern struct {
    MaxNextHopsInRoute: u32,
    MaxHandlesInEnum: u32,
    ViewsSupported: u32,
    NumberOfViews: u32,
};
type
  RTM_REGN_PROFILE {.bycopy.} = object
    MaxNextHopsInRoute: uint32
    MaxHandlesInEnum: uint32
    ViewsSupported: uint32
    NumberOfViews: uint32
struct RTM_REGN_PROFILE
{
    uint MaxNextHopsInRoute;
    uint MaxHandlesInEnum;
    uint ViewsSupported;
    uint NumberOfViews;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; RTM_REGN_PROFILE サイズ: 16 バイト(x64)
dim st, 4    ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; MaxNextHopsInRoute : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; MaxHandlesInEnum : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; ViewsSupported : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; NumberOfViews : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global RTM_REGN_PROFILE
    #field int MaxNextHopsInRoute
    #field int MaxHandlesInEnum
    #field int ViewsSupported
    #field int NumberOfViews
#endstruct

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