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

DOT11_PHY_ATTRIBUTES

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

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

フィールド

フィールドサイズx64x86説明
HeaderNDIS_OBJECT_HEADER4+0+0NDIS オブジェクトのバージョン情報を含むヘッダー。
PhyTypeDOT11_PHY_TYPE4+4+4この属性が対象とする PHY 種別を示す列挙値。
bHardwarePhyStateBOOLEAN1+8+8PHY のハードウェア状態(オン/オフ)を示すフラグ。
bSoftwarePhyStateBOOLEAN1+9+9PHY のソフトウェア状態(オン/オフ)を示すフラグ。
bCFPollableBOOLEAN1+10+10CF ポーリング可能か示すフラグ。
uMPDUMaxLengthDWORD4+12+12対応する MPDU の最大長を表す。
TempTypeDOT11_TEMP_TYPE4+16+16温度範囲タイプを示す列挙値。
DiversitySupportDOT11_DIVERSITY_SUPPORT4+20+20ダイバーシティ対応状況を示す列挙値。
PhySpecificAttributes_PhySpecificAttributes_e__Union12+24+24PHY 種別固有の属性を保持する共用体。
uNumberSupportedPowerLevelsDWORD4+36+36対応する送信電力レベルの個数を表す。
TxPowerLevelsDWORD32+40+40各送信電力レベル値を格納する配列(mW単位)。
uNumDataRateMappingEntriesDWORD4+72+72DataRateMappingEntries の有効要素数を表す。
DataRateMappingEntriesDOT11_DATA_RATE_MAPPING_ENTRY504+76+76データレートマッピングエントリの配列。
SupportedDataRatesValueDOT11_SUPPORTED_DATA_RATES_VALUE_V2510+580+580対応する送受信データレート値を保持する構造体。

共用体: _PhySpecificAttributes_e__Union x64 12B / x86 12B

フィールドサイズx64x86
HRDSSSAttributesDOT11_HRDSSS_PHY_ATTRIBUTES8+0+0
OFDMAttributesDOT11_OFDM_PHY_ATTRIBUTES4+0+0
ERPAttributesDOT11_ERP_PHY_ATTRIBUTES12+0+0

各言語での定義

#include <windows.h>

// NDIS_OBJECT_HEADER  (x64 4 / x86 4 バイト)
typedef struct NDIS_OBJECT_HEADER {
    BYTE Type;
    BYTE Revision;
    WORD Size;
} NDIS_OBJECT_HEADER;

// DOT11_DATA_RATE_MAPPING_ENTRY  (x64 4 / x86 4 バイト)
typedef struct DOT11_DATA_RATE_MAPPING_ENTRY {
    BYTE ucDataRateIndex;
    BYTE ucDataRateFlag;
    WORD usDataRateValue;
} DOT11_DATA_RATE_MAPPING_ENTRY;

// DOT11_SUPPORTED_DATA_RATES_VALUE_V2  (x64 510 / x86 510 バイト)
typedef struct DOT11_SUPPORTED_DATA_RATES_VALUE_V2 {
    BYTE ucSupportedTxDataRatesValue[255];
    BYTE ucSupportedRxDataRatesValue[255];
} DOT11_SUPPORTED_DATA_RATES_VALUE_V2;

// DOT11_PHY_ATTRIBUTES  (x64 1092 / x86 1092 バイト)
typedef struct DOT11_PHY_ATTRIBUTES {
    NDIS_OBJECT_HEADER Header;
    DOT11_PHY_TYPE PhyType;
    BOOLEAN bHardwarePhyState;
    BOOLEAN bSoftwarePhyState;
    BOOLEAN bCFPollable;
    DWORD uMPDUMaxLength;
    DOT11_TEMP_TYPE TempType;
    DOT11_DIVERSITY_SUPPORT DiversitySupport;
    _PhySpecificAttributes_e__Union PhySpecificAttributes;
    DWORD uNumberSupportedPowerLevels;
    DWORD TxPowerLevels[8];
    DWORD uNumDataRateMappingEntries;
    DOT11_DATA_RATE_MAPPING_ENTRY DataRateMappingEntries[126];
    DOT11_SUPPORTED_DATA_RATES_VALUE_V2 SupportedDataRatesValue;
} DOT11_PHY_ATTRIBUTES;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct NDIS_OBJECT_HEADER
{
    public byte Type;
    public byte Revision;
    public ushort Size;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DOT11_DATA_RATE_MAPPING_ENTRY
{
    public byte ucDataRateIndex;
    public byte ucDataRateFlag;
    public ushort usDataRateValue;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DOT11_SUPPORTED_DATA_RATES_VALUE_V2
{
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 255)] public byte[] ucSupportedTxDataRatesValue;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 255)] public byte[] ucSupportedRxDataRatesValue;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DOT11_PHY_ATTRIBUTES
{
    public NDIS_OBJECT_HEADER Header;
    public int PhyType;
    [MarshalAs(UnmanagedType.U1)] public bool bHardwarePhyState;
    [MarshalAs(UnmanagedType.U1)] public bool bSoftwarePhyState;
    [MarshalAs(UnmanagedType.U1)] public bool bCFPollable;
    public uint uMPDUMaxLength;
    public int TempType;
    public int DiversitySupport;
    public _PhySpecificAttributes_e__Union PhySpecificAttributes;
    public uint uNumberSupportedPowerLevels;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] public uint[] TxPowerLevels;
    public uint uNumDataRateMappingEntries;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 126)] public DOT11_DATA_RATE_MAPPING_ENTRY[] DataRateMappingEntries;
    public DOT11_SUPPORTED_DATA_RATES_VALUE_V2 SupportedDataRatesValue;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure NDIS_OBJECT_HEADER
    Public Type As Byte
    Public Revision As Byte
    Public Size As UShort
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DOT11_DATA_RATE_MAPPING_ENTRY
    Public ucDataRateIndex As Byte
    Public ucDataRateFlag As Byte
    Public usDataRateValue As UShort
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DOT11_SUPPORTED_DATA_RATES_VALUE_V2
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=255)> Public ucSupportedTxDataRatesValue() As Byte
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=255)> Public ucSupportedRxDataRatesValue() As Byte
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DOT11_PHY_ATTRIBUTES
    Public Header As NDIS_OBJECT_HEADER
    Public PhyType As Integer
    <MarshalAs(UnmanagedType.U1)> Public bHardwarePhyState As Boolean
    <MarshalAs(UnmanagedType.U1)> Public bSoftwarePhyState As Boolean
    <MarshalAs(UnmanagedType.U1)> Public bCFPollable As Boolean
    Public uMPDUMaxLength As UInteger
    Public TempType As Integer
    Public DiversitySupport As Integer
    Public PhySpecificAttributes As _PhySpecificAttributes_e__Union
    Public uNumberSupportedPowerLevels As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=8)> Public TxPowerLevels() As UInteger
    Public uNumDataRateMappingEntries As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=126)> Public DataRateMappingEntries() As DOT11_DATA_RATE_MAPPING_ENTRY
    Public SupportedDataRatesValue As DOT11_SUPPORTED_DATA_RATES_VALUE_V2
End Structure
import ctypes
from ctypes import wintypes

class NDIS_OBJECT_HEADER(ctypes.Structure):
    _fields_ = [
        ("Type", ctypes.c_ubyte),
        ("Revision", ctypes.c_ubyte),
        ("Size", ctypes.c_ushort),
    ]

class DOT11_DATA_RATE_MAPPING_ENTRY(ctypes.Structure):
    _fields_ = [
        ("ucDataRateIndex", ctypes.c_ubyte),
        ("ucDataRateFlag", ctypes.c_ubyte),
        ("usDataRateValue", ctypes.c_ushort),
    ]

class DOT11_SUPPORTED_DATA_RATES_VALUE_V2(ctypes.Structure):
    _fields_ = [
        ("ucSupportedTxDataRatesValue", ctypes.c_ubyte * 255),
        ("ucSupportedRxDataRatesValue", ctypes.c_ubyte * 255),
    ]

class DOT11_PHY_ATTRIBUTES(ctypes.Structure):
    _fields_ = [
        ("Header", NDIS_OBJECT_HEADER),
        ("PhyType", ctypes.c_int),
        ("bHardwarePhyState", ctypes.c_byte),
        ("bSoftwarePhyState", ctypes.c_byte),
        ("bCFPollable", ctypes.c_byte),
        ("uMPDUMaxLength", wintypes.DWORD),
        ("TempType", ctypes.c_int),
        ("DiversitySupport", ctypes.c_int),
        ("PhySpecificAttributes", _PhySpecificAttributes_e__Union),
        ("uNumberSupportedPowerLevels", wintypes.DWORD),
        ("TxPowerLevels", wintypes.DWORD * 8),
        ("uNumDataRateMappingEntries", wintypes.DWORD),
        ("DataRateMappingEntries", DOT11_DATA_RATE_MAPPING_ENTRY * 126),
        ("SupportedDataRatesValue", DOT11_SUPPORTED_DATA_RATES_VALUE_V2),
    ]
#[repr(C)]
pub struct NDIS_OBJECT_HEADER {
    pub Type: u8,
    pub Revision: u8,
    pub Size: u16,
}

#[repr(C)]
pub struct DOT11_DATA_RATE_MAPPING_ENTRY {
    pub ucDataRateIndex: u8,
    pub ucDataRateFlag: u8,
    pub usDataRateValue: u16,
}

#[repr(C)]
pub struct DOT11_SUPPORTED_DATA_RATES_VALUE_V2 {
    pub ucSupportedTxDataRatesValue: [u8; 255],
    pub ucSupportedRxDataRatesValue: [u8; 255],
}

#[repr(C)]
pub struct DOT11_PHY_ATTRIBUTES {
    pub Header: NDIS_OBJECT_HEADER,
    pub PhyType: i32,
    pub bHardwarePhyState: u8,
    pub bSoftwarePhyState: u8,
    pub bCFPollable: u8,
    pub uMPDUMaxLength: u32,
    pub TempType: i32,
    pub DiversitySupport: i32,
    pub PhySpecificAttributes: _PhySpecificAttributes_e__Union,
    pub uNumberSupportedPowerLevels: u32,
    pub TxPowerLevels: [u32; 8],
    pub uNumDataRateMappingEntries: u32,
    pub DataRateMappingEntries: [DOT11_DATA_RATE_MAPPING_ENTRY; 126],
    pub SupportedDataRatesValue: DOT11_SUPPORTED_DATA_RATES_VALUE_V2,
}
import "golang.org/x/sys/windows"

type NDIS_OBJECT_HEADER struct {
	Type byte
	Revision byte
	Size uint16
}

type DOT11_DATA_RATE_MAPPING_ENTRY struct {
	ucDataRateIndex byte
	ucDataRateFlag byte
	usDataRateValue uint16
}

type DOT11_SUPPORTED_DATA_RATES_VALUE_V2 struct {
	ucSupportedTxDataRatesValue [255]byte
	ucSupportedRxDataRatesValue [255]byte
}

type DOT11_PHY_ATTRIBUTES struct {
	Header NDIS_OBJECT_HEADER
	PhyType int32
	bHardwarePhyState byte
	bSoftwarePhyState byte
	bCFPollable byte
	uMPDUMaxLength uint32
	TempType int32
	DiversitySupport int32
	PhySpecificAttributes _PhySpecificAttributes_e__Union
	uNumberSupportedPowerLevels uint32
	TxPowerLevels [8]uint32
	uNumDataRateMappingEntries uint32
	DataRateMappingEntries [126]DOT11_DATA_RATE_MAPPING_ENTRY
	SupportedDataRatesValue DOT11_SUPPORTED_DATA_RATES_VALUE_V2
}
type
  NDIS_OBJECT_HEADER = record
    Type: Byte;
    Revision: Byte;
    Size: Word;
  end;

  DOT11_DATA_RATE_MAPPING_ENTRY = record
    ucDataRateIndex: Byte;
    ucDataRateFlag: Byte;
    usDataRateValue: Word;
  end;

  DOT11_SUPPORTED_DATA_RATES_VALUE_V2 = record
    ucSupportedTxDataRatesValue: array[0..254] of Byte;
    ucSupportedRxDataRatesValue: array[0..254] of Byte;
  end;

  DOT11_PHY_ATTRIBUTES = record
    Header: NDIS_OBJECT_HEADER;
    PhyType: Integer;
    bHardwarePhyState: ByteBool;
    bSoftwarePhyState: ByteBool;
    bCFPollable: ByteBool;
    uMPDUMaxLength: DWORD;
    TempType: Integer;
    DiversitySupport: Integer;
    PhySpecificAttributes: _PhySpecificAttributes_e__Union;
    uNumberSupportedPowerLevels: DWORD;
    TxPowerLevels: array[0..7] of DWORD;
    uNumDataRateMappingEntries: DWORD;
    DataRateMappingEntries: array[0..125] of DOT11_DATA_RATE_MAPPING_ENTRY;
    SupportedDataRatesValue: DOT11_SUPPORTED_DATA_RATES_VALUE_V2;
  end;
const NDIS_OBJECT_HEADER = extern struct {
    Type: u8,
    Revision: u8,
    Size: u16,
};

const DOT11_DATA_RATE_MAPPING_ENTRY = extern struct {
    ucDataRateIndex: u8,
    ucDataRateFlag: u8,
    usDataRateValue: u16,
};

const DOT11_SUPPORTED_DATA_RATES_VALUE_V2 = extern struct {
    ucSupportedTxDataRatesValue: [255]u8,
    ucSupportedRxDataRatesValue: [255]u8,
};

const DOT11_PHY_ATTRIBUTES = extern struct {
    Header: NDIS_OBJECT_HEADER,
    PhyType: i32,
    bHardwarePhyState: u8,
    bSoftwarePhyState: u8,
    bCFPollable: u8,
    uMPDUMaxLength: u32,
    TempType: i32,
    DiversitySupport: i32,
    PhySpecificAttributes: _PhySpecificAttributes_e__Union,
    uNumberSupportedPowerLevels: u32,
    TxPowerLevels: [8]u32,
    uNumDataRateMappingEntries: u32,
    DataRateMappingEntries: [126]DOT11_DATA_RATE_MAPPING_ENTRY,
    SupportedDataRatesValue: DOT11_SUPPORTED_DATA_RATES_VALUE_V2,
};
type
  NDIS_OBJECT_HEADER {.bycopy.} = object
    Type: uint8
    Revision: uint8
    Size: uint16

  DOT11_DATA_RATE_MAPPING_ENTRY {.bycopy.} = object
    ucDataRateIndex: uint8
    ucDataRateFlag: uint8
    usDataRateValue: uint16

  DOT11_SUPPORTED_DATA_RATES_VALUE_V2 {.bycopy.} = object
    ucSupportedTxDataRatesValue: array[255, uint8]
    ucSupportedRxDataRatesValue: array[255, uint8]

  DOT11_PHY_ATTRIBUTES {.bycopy.} = object
    Header: NDIS_OBJECT_HEADER
    PhyType: int32
    bHardwarePhyState: uint8
    bSoftwarePhyState: uint8
    bCFPollable: uint8
    uMPDUMaxLength: uint32
    TempType: int32
    DiversitySupport: int32
    PhySpecificAttributes: _PhySpecificAttributes_e__Union
    uNumberSupportedPowerLevels: uint32
    TxPowerLevels: array[8, uint32]
    uNumDataRateMappingEntries: uint32
    DataRateMappingEntries: array[126, DOT11_DATA_RATE_MAPPING_ENTRY]
    SupportedDataRatesValue: DOT11_SUPPORTED_DATA_RATES_VALUE_V2
struct NDIS_OBJECT_HEADER
{
    ubyte Type;
    ubyte Revision;
    ushort Size;
}

struct DOT11_DATA_RATE_MAPPING_ENTRY
{
    ubyte ucDataRateIndex;
    ubyte ucDataRateFlag;
    ushort usDataRateValue;
}

struct DOT11_SUPPORTED_DATA_RATES_VALUE_V2
{
    ubyte[255] ucSupportedTxDataRatesValue;
    ubyte[255] ucSupportedRxDataRatesValue;
}

struct DOT11_PHY_ATTRIBUTES
{
    NDIS_OBJECT_HEADER Header;
    int PhyType;
    ubyte bHardwarePhyState;
    ubyte bSoftwarePhyState;
    ubyte bCFPollable;
    uint uMPDUMaxLength;
    int TempType;
    int DiversitySupport;
    _PhySpecificAttributes_e__Union PhySpecificAttributes;
    uint uNumberSupportedPowerLevels;
    uint[8] TxPowerLevels;
    uint uNumDataRateMappingEntries;
    DOT11_DATA_RATE_MAPPING_ENTRY[126] DataRateMappingEntries;
    DOT11_SUPPORTED_DATA_RATES_VALUE_V2 SupportedDataRatesValue;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DOT11_PHY_ATTRIBUTES サイズ: 1092 バイト(x64)
dim st, 273    ; 4byte整数×273(構造体サイズ 1092 / 4 切り上げ)
; Header : NDIS_OBJECT_HEADER (+0, 4byte)  varptr(st)+0 を基点に操作(4byte:入れ子/配列)
; PhyType : DOT11_PHY_TYPE (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; bHardwarePhyState : BOOLEAN (+8, 1byte)  poke st,8,値  /  値 = peek(st,8)
; bSoftwarePhyState : BOOLEAN (+9, 1byte)  poke st,9,値  /  値 = peek(st,9)
; bCFPollable : BOOLEAN (+10, 1byte)  poke st,10,値  /  値 = peek(st,10)
; uMPDUMaxLength : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; TempType : DOT11_TEMP_TYPE (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; DiversitySupport : DOT11_DIVERSITY_SUPPORT (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; PhySpecificAttributes : _PhySpecificAttributes_e__Union (+24, 12byte)  varptr(st)+24 を基点に操作(12byte:入れ子/配列)
; uNumberSupportedPowerLevels : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; TxPowerLevels : DWORD (+40, 32byte)  varptr(st)+40 を基点に操作(32byte:入れ子/配列)
; uNumDataRateMappingEntries : DWORD (+72, 4byte)  st.18 = 値  /  値 = st.18   (lpoke/lpeek も可)
; DataRateMappingEntries : DOT11_DATA_RATE_MAPPING_ENTRY (+76, 504byte)  varptr(st)+76 を基点に操作(504byte:入れ子/配列)
; SupportedDataRatesValue : DOT11_SUPPORTED_DATA_RATES_VALUE_V2 (+580, 510byte)  varptr(st)+580 を基点に操作(510byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global NDIS_OBJECT_HEADER
    #field byte Type
    #field byte Revision
    #field short Size
#endstruct

#defstruct global DOT11_DATA_RATE_MAPPING_ENTRY
    #field byte ucDataRateIndex
    #field byte ucDataRateFlag
    #field short usDataRateValue
#endstruct

#defstruct global DOT11_SUPPORTED_DATA_RATES_VALUE_V2
    #field byte ucSupportedTxDataRatesValue 255
    #field byte ucSupportedRxDataRatesValue 255
#endstruct

#defstruct global DOT11_PHY_ATTRIBUTES
    #field NDIS_OBJECT_HEADER Header
    #field int PhyType
    #field bool1 bHardwarePhyState
    #field bool1 bSoftwarePhyState
    #field bool1 bCFPollable
    #field int uMPDUMaxLength
    #field int TempType
    #field int DiversitySupport
    #field byte PhySpecificAttributes 12
    #field int uNumberSupportedPowerLevels
    #field int TxPowerLevels 8
    #field int uNumDataRateMappingEntries
    #field DOT11_DATA_RATE_MAPPING_ENTRY DataRateMappingEntries 126
    #field DOT11_SUPPORTED_DATA_RATES_VALUE_V2 SupportedDataRatesValue
#endstruct

stdim st, DOT11_PHY_ATTRIBUTES        ; NSTRUCT 変数を確保
st->PhyType = 100
mes "PhyType=" + st->PhyType
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。