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

MIB_IPMCAST_BOUNDARY_TABLE

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

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

フィールド

フィールドサイズx64x86説明
dwNumEntriesDWORD4+0+0table配列に格納されたマルチキャスト境界エントリの数を示す。
tableMIB_IPMCAST_BOUNDARY16+4+4マルチキャスト境界行(MIB_IPMCAST_BOUNDARY)の可変長配列である。

各言語での定義

#include <windows.h>

// MIB_IPMCAST_BOUNDARY  (x64 16 / x86 16 バイト)
typedef struct MIB_IPMCAST_BOUNDARY {
    DWORD dwIfIndex;
    DWORD dwGroupAddress;
    DWORD dwGroupMask;
    DWORD dwStatus;
} MIB_IPMCAST_BOUNDARY;

// MIB_IPMCAST_BOUNDARY_TABLE  (x64 20 / x86 20 バイト)
typedef struct MIB_IPMCAST_BOUNDARY_TABLE {
    DWORD dwNumEntries;
    MIB_IPMCAST_BOUNDARY table[1];
} MIB_IPMCAST_BOUNDARY_TABLE;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct MIB_IPMCAST_BOUNDARY
{
    public uint dwIfIndex;
    public uint dwGroupAddress;
    public uint dwGroupMask;
    public uint dwStatus;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct MIB_IPMCAST_BOUNDARY_TABLE
{
    public uint dwNumEntries;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public MIB_IPMCAST_BOUNDARY[] table;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure MIB_IPMCAST_BOUNDARY
    Public dwIfIndex As UInteger
    Public dwGroupAddress As UInteger
    Public dwGroupMask As UInteger
    Public dwStatus As UInteger
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure MIB_IPMCAST_BOUNDARY_TABLE
    Public dwNumEntries As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public table() As MIB_IPMCAST_BOUNDARY
End Structure
import ctypes
from ctypes import wintypes

class MIB_IPMCAST_BOUNDARY(ctypes.Structure):
    _fields_ = [
        ("dwIfIndex", wintypes.DWORD),
        ("dwGroupAddress", wintypes.DWORD),
        ("dwGroupMask", wintypes.DWORD),
        ("dwStatus", wintypes.DWORD),
    ]

class MIB_IPMCAST_BOUNDARY_TABLE(ctypes.Structure):
    _fields_ = [
        ("dwNumEntries", wintypes.DWORD),
        ("table", MIB_IPMCAST_BOUNDARY * 1),
    ]
#[repr(C)]
pub struct MIB_IPMCAST_BOUNDARY {
    pub dwIfIndex: u32,
    pub dwGroupAddress: u32,
    pub dwGroupMask: u32,
    pub dwStatus: u32,
}

#[repr(C)]
pub struct MIB_IPMCAST_BOUNDARY_TABLE {
    pub dwNumEntries: u32,
    pub table: [MIB_IPMCAST_BOUNDARY; 1],
}
import "golang.org/x/sys/windows"

type MIB_IPMCAST_BOUNDARY struct {
	dwIfIndex uint32
	dwGroupAddress uint32
	dwGroupMask uint32
	dwStatus uint32
}

type MIB_IPMCAST_BOUNDARY_TABLE struct {
	dwNumEntries uint32
	table [1]MIB_IPMCAST_BOUNDARY
}
type
  MIB_IPMCAST_BOUNDARY = record
    dwIfIndex: DWORD;
    dwGroupAddress: DWORD;
    dwGroupMask: DWORD;
    dwStatus: DWORD;
  end;

  MIB_IPMCAST_BOUNDARY_TABLE = record
    dwNumEntries: DWORD;
    table: array[0..0] of MIB_IPMCAST_BOUNDARY;
  end;
const MIB_IPMCAST_BOUNDARY = extern struct {
    dwIfIndex: u32,
    dwGroupAddress: u32,
    dwGroupMask: u32,
    dwStatus: u32,
};

const MIB_IPMCAST_BOUNDARY_TABLE = extern struct {
    dwNumEntries: u32,
    table: [1]MIB_IPMCAST_BOUNDARY,
};
type
  MIB_IPMCAST_BOUNDARY {.bycopy.} = object
    dwIfIndex: uint32
    dwGroupAddress: uint32
    dwGroupMask: uint32
    dwStatus: uint32

  MIB_IPMCAST_BOUNDARY_TABLE {.bycopy.} = object
    dwNumEntries: uint32
    table: array[1, MIB_IPMCAST_BOUNDARY]
struct MIB_IPMCAST_BOUNDARY
{
    uint dwIfIndex;
    uint dwGroupAddress;
    uint dwGroupMask;
    uint dwStatus;
}

struct MIB_IPMCAST_BOUNDARY_TABLE
{
    uint dwNumEntries;
    MIB_IPMCAST_BOUNDARY[1] table;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; MIB_IPMCAST_BOUNDARY_TABLE サイズ: 20 バイト(x64)
dim st, 5    ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; dwNumEntries : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; table : MIB_IPMCAST_BOUNDARY (+4, 16byte)  varptr(st)+4 を基点に操作(16byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global MIB_IPMCAST_BOUNDARY
    #field int dwIfIndex
    #field int dwGroupAddress
    #field int dwGroupMask
    #field int dwStatus
#endstruct

#defstruct global MIB_IPMCAST_BOUNDARY_TABLE
    #field int dwNumEntries
    #field MIB_IPMCAST_BOUNDARY table 1
#endstruct

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