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

DOT11_RECV_EXTENSION_INFO_V2

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

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

フィールド

フィールドサイズx64x86説明
uVersionDWORD4+0+0この拡張情報構造体のバージョンを表す。
pvReservedvoid*8/4+8+4予約フィールド。NULL を設定する。
dot11PhyTypeDOT11_PHY_TYPE4+16+8受信に使われた PHY 種別を示す列挙値。
uChCenterFrequencyDWORD4+20+12受信チャネルの中心周波数を表す。
lRSSIINT4+24+16受信信号強度 RSSI を表す(dBm)。
uRSSIDWORD4+28+20正規化された RSSI 値を表す。
ucPriorityBYTE1+32+24受信フレームの優先度を表す。
ucDataRateBYTE1+33+25受信に使われたデータレートを表す。
ucPeerMacAddressBYTE6+34+26送信元ピアの MAC アドレス。
dwExtendedStatusDWORD4+40+32受信の拡張ステータスを表す。
hWEPOffloadContextHANDLE8/4+48+36WEP オフロードコンテキストのハンドル。
hAuthOffloadContextHANDLE8/4+56+40認証オフロードコンテキストのハンドル。
usWEPAppliedMaskWORD2+64+44WEP が適用されたフラグメントのビットマスクを表す。
usWPAMSDUPriorityWORD2+66+46WPA MSDU の優先度を表す。
dot11LowestIV48CounterDOT11_IV48_COUNTER8+68+48受信フラグメントの最小 IV48 カウンタ値を表す。
usDot11LeftRWBitMapWORD2+76+56リプレイウィンドウ左側のビットマップを表す。
dot11HighestIV48CounterDOT11_IV48_COUNTER8+80+60受信フラグメントの最大 IV48 カウンタ値を表す。
usDot11RightRWBitMapWORD2+88+68リプレイウィンドウ右側のビットマップを表す。
usNumberOfMPDUsReceivedWORD2+90+70受信した MPDU の個数を表す。
usNumberOfFragmentsWORD2+92+72受信したフラグメントの個数を表す。
pNdisPacketsvoid*8/4+96+76対応する NDIS パケットへのポインタ。

各言語での定義

#include <windows.h>

// DOT11_IV48_COUNTER  (x64 8 / x86 8 バイト)
typedef struct DOT11_IV48_COUNTER {
    DWORD uIV32Counter;
    WORD usIV16Counter;
} DOT11_IV48_COUNTER;

// DOT11_RECV_EXTENSION_INFO_V2  (x64 104 / x86 80 バイト)
typedef struct DOT11_RECV_EXTENSION_INFO_V2 {
    DWORD uVersion;
    void* pvReserved;
    DOT11_PHY_TYPE dot11PhyType;
    DWORD uChCenterFrequency;
    INT lRSSI;
    DWORD uRSSI;
    BYTE ucPriority;
    BYTE ucDataRate;
    BYTE ucPeerMacAddress[6];
    DWORD dwExtendedStatus;
    HANDLE hWEPOffloadContext;
    HANDLE hAuthOffloadContext;
    WORD usWEPAppliedMask;
    WORD usWPAMSDUPriority;
    DOT11_IV48_COUNTER dot11LowestIV48Counter;
    WORD usDot11LeftRWBitMap;
    DOT11_IV48_COUNTER dot11HighestIV48Counter;
    WORD usDot11RightRWBitMap;
    WORD usNumberOfMPDUsReceived;
    WORD usNumberOfFragments;
    void* pNdisPackets[1];
} DOT11_RECV_EXTENSION_INFO_V2;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DOT11_IV48_COUNTER
{
    public uint uIV32Counter;
    public ushort usIV16Counter;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DOT11_RECV_EXTENSION_INFO_V2
{
    public uint uVersion;
    public IntPtr pvReserved;
    public int dot11PhyType;
    public uint uChCenterFrequency;
    public int lRSSI;
    public uint uRSSI;
    public byte ucPriority;
    public byte ucDataRate;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] public byte[] ucPeerMacAddress;
    public uint dwExtendedStatus;
    public IntPtr hWEPOffloadContext;
    public IntPtr hAuthOffloadContext;
    public ushort usWEPAppliedMask;
    public ushort usWPAMSDUPriority;
    public DOT11_IV48_COUNTER dot11LowestIV48Counter;
    public ushort usDot11LeftRWBitMap;
    public DOT11_IV48_COUNTER dot11HighestIV48Counter;
    public ushort usDot11RightRWBitMap;
    public ushort usNumberOfMPDUsReceived;
    public ushort usNumberOfFragments;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public IntPtr[] pNdisPackets;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DOT11_IV48_COUNTER
    Public uIV32Counter As UInteger
    Public usIV16Counter As UShort
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DOT11_RECV_EXTENSION_INFO_V2
    Public uVersion As UInteger
    Public pvReserved As IntPtr
    Public dot11PhyType As Integer
    Public uChCenterFrequency As UInteger
    Public lRSSI As Integer
    Public uRSSI As UInteger
    Public ucPriority As Byte
    Public ucDataRate As Byte
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=6)> Public ucPeerMacAddress() As Byte
    Public dwExtendedStatus As UInteger
    Public hWEPOffloadContext As IntPtr
    Public hAuthOffloadContext As IntPtr
    Public usWEPAppliedMask As UShort
    Public usWPAMSDUPriority As UShort
    Public dot11LowestIV48Counter As DOT11_IV48_COUNTER
    Public usDot11LeftRWBitMap As UShort
    Public dot11HighestIV48Counter As DOT11_IV48_COUNTER
    Public usDot11RightRWBitMap As UShort
    Public usNumberOfMPDUsReceived As UShort
    Public usNumberOfFragments As UShort
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public pNdisPackets() As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class DOT11_IV48_COUNTER(ctypes.Structure):
    _fields_ = [
        ("uIV32Counter", wintypes.DWORD),
        ("usIV16Counter", ctypes.c_ushort),
    ]

class DOT11_RECV_EXTENSION_INFO_V2(ctypes.Structure):
    _fields_ = [
        ("uVersion", wintypes.DWORD),
        ("pvReserved", ctypes.c_void_p),
        ("dot11PhyType", ctypes.c_int),
        ("uChCenterFrequency", wintypes.DWORD),
        ("lRSSI", ctypes.c_int),
        ("uRSSI", wintypes.DWORD),
        ("ucPriority", ctypes.c_ubyte),
        ("ucDataRate", ctypes.c_ubyte),
        ("ucPeerMacAddress", ctypes.c_ubyte * 6),
        ("dwExtendedStatus", wintypes.DWORD),
        ("hWEPOffloadContext", ctypes.c_void_p),
        ("hAuthOffloadContext", ctypes.c_void_p),
        ("usWEPAppliedMask", ctypes.c_ushort),
        ("usWPAMSDUPriority", ctypes.c_ushort),
        ("dot11LowestIV48Counter", DOT11_IV48_COUNTER),
        ("usDot11LeftRWBitMap", ctypes.c_ushort),
        ("dot11HighestIV48Counter", DOT11_IV48_COUNTER),
        ("usDot11RightRWBitMap", ctypes.c_ushort),
        ("usNumberOfMPDUsReceived", ctypes.c_ushort),
        ("usNumberOfFragments", ctypes.c_ushort),
        ("pNdisPackets", ctypes.c_void_p * 1),
    ]
#[repr(C)]
pub struct DOT11_IV48_COUNTER {
    pub uIV32Counter: u32,
    pub usIV16Counter: u16,
}

#[repr(C)]
pub struct DOT11_RECV_EXTENSION_INFO_V2 {
    pub uVersion: u32,
    pub pvReserved: *mut core::ffi::c_void,
    pub dot11PhyType: i32,
    pub uChCenterFrequency: u32,
    pub lRSSI: i32,
    pub uRSSI: u32,
    pub ucPriority: u8,
    pub ucDataRate: u8,
    pub ucPeerMacAddress: [u8; 6],
    pub dwExtendedStatus: u32,
    pub hWEPOffloadContext: *mut core::ffi::c_void,
    pub hAuthOffloadContext: *mut core::ffi::c_void,
    pub usWEPAppliedMask: u16,
    pub usWPAMSDUPriority: u16,
    pub dot11LowestIV48Counter: DOT11_IV48_COUNTER,
    pub usDot11LeftRWBitMap: u16,
    pub dot11HighestIV48Counter: DOT11_IV48_COUNTER,
    pub usDot11RightRWBitMap: u16,
    pub usNumberOfMPDUsReceived: u16,
    pub usNumberOfFragments: u16,
    pub pNdisPackets: [*mut core::ffi::c_void; 1],
}
import "golang.org/x/sys/windows"

type DOT11_IV48_COUNTER struct {
	uIV32Counter uint32
	usIV16Counter uint16
}

type DOT11_RECV_EXTENSION_INFO_V2 struct {
	uVersion uint32
	pvReserved uintptr
	dot11PhyType int32
	uChCenterFrequency uint32
	lRSSI int32
	uRSSI uint32
	ucPriority byte
	ucDataRate byte
	ucPeerMacAddress [6]byte
	dwExtendedStatus uint32
	hWEPOffloadContext uintptr
	hAuthOffloadContext uintptr
	usWEPAppliedMask uint16
	usWPAMSDUPriority uint16
	dot11LowestIV48Counter DOT11_IV48_COUNTER
	usDot11LeftRWBitMap uint16
	dot11HighestIV48Counter DOT11_IV48_COUNTER
	usDot11RightRWBitMap uint16
	usNumberOfMPDUsReceived uint16
	usNumberOfFragments uint16
	pNdisPackets [1]uintptr
}
type
  DOT11_IV48_COUNTER = record
    uIV32Counter: DWORD;
    usIV16Counter: Word;
  end;

  DOT11_RECV_EXTENSION_INFO_V2 = record
    uVersion: DWORD;
    pvReserved: Pointer;
    dot11PhyType: Integer;
    uChCenterFrequency: DWORD;
    lRSSI: Integer;
    uRSSI: DWORD;
    ucPriority: Byte;
    ucDataRate: Byte;
    ucPeerMacAddress: array[0..5] of Byte;
    dwExtendedStatus: DWORD;
    hWEPOffloadContext: Pointer;
    hAuthOffloadContext: Pointer;
    usWEPAppliedMask: Word;
    usWPAMSDUPriority: Word;
    dot11LowestIV48Counter: DOT11_IV48_COUNTER;
    usDot11LeftRWBitMap: Word;
    dot11HighestIV48Counter: DOT11_IV48_COUNTER;
    usDot11RightRWBitMap: Word;
    usNumberOfMPDUsReceived: Word;
    usNumberOfFragments: Word;
    pNdisPackets: array[0..0] of Pointer;
  end;
const DOT11_IV48_COUNTER = extern struct {
    uIV32Counter: u32,
    usIV16Counter: u16,
};

const DOT11_RECV_EXTENSION_INFO_V2 = extern struct {
    uVersion: u32,
    pvReserved: ?*anyopaque,
    dot11PhyType: i32,
    uChCenterFrequency: u32,
    lRSSI: i32,
    uRSSI: u32,
    ucPriority: u8,
    ucDataRate: u8,
    ucPeerMacAddress: [6]u8,
    dwExtendedStatus: u32,
    hWEPOffloadContext: ?*anyopaque,
    hAuthOffloadContext: ?*anyopaque,
    usWEPAppliedMask: u16,
    usWPAMSDUPriority: u16,
    dot11LowestIV48Counter: DOT11_IV48_COUNTER,
    usDot11LeftRWBitMap: u16,
    dot11HighestIV48Counter: DOT11_IV48_COUNTER,
    usDot11RightRWBitMap: u16,
    usNumberOfMPDUsReceived: u16,
    usNumberOfFragments: u16,
    pNdisPackets: [1]?*anyopaque,
};
type
  DOT11_IV48_COUNTER {.bycopy.} = object
    uIV32Counter: uint32
    usIV16Counter: uint16

  DOT11_RECV_EXTENSION_INFO_V2 {.bycopy.} = object
    uVersion: uint32
    pvReserved: pointer
    dot11PhyType: int32
    uChCenterFrequency: uint32
    lRSSI: int32
    uRSSI: uint32
    ucPriority: uint8
    ucDataRate: uint8
    ucPeerMacAddress: array[6, uint8]
    dwExtendedStatus: uint32
    hWEPOffloadContext: pointer
    hAuthOffloadContext: pointer
    usWEPAppliedMask: uint16
    usWPAMSDUPriority: uint16
    dot11LowestIV48Counter: DOT11_IV48_COUNTER
    usDot11LeftRWBitMap: uint16
    dot11HighestIV48Counter: DOT11_IV48_COUNTER
    usDot11RightRWBitMap: uint16
    usNumberOfMPDUsReceived: uint16
    usNumberOfFragments: uint16
    pNdisPackets: array[1, pointer]
struct DOT11_IV48_COUNTER
{
    uint uIV32Counter;
    ushort usIV16Counter;
}

struct DOT11_RECV_EXTENSION_INFO_V2
{
    uint uVersion;
    void* pvReserved;
    int dot11PhyType;
    uint uChCenterFrequency;
    int lRSSI;
    uint uRSSI;
    ubyte ucPriority;
    ubyte ucDataRate;
    ubyte[6] ucPeerMacAddress;
    uint dwExtendedStatus;
    void* hWEPOffloadContext;
    void* hAuthOffloadContext;
    ushort usWEPAppliedMask;
    ushort usWPAMSDUPriority;
    DOT11_IV48_COUNTER dot11LowestIV48Counter;
    ushort usDot11LeftRWBitMap;
    DOT11_IV48_COUNTER dot11HighestIV48Counter;
    ushort usDot11RightRWBitMap;
    ushort usNumberOfMPDUsReceived;
    ushort usNumberOfFragments;
    void*[1] pNdisPackets;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DOT11_RECV_EXTENSION_INFO_V2 サイズ: 80 バイト(x86)
dim st, 20    ; 4byte整数×20(構造体サイズ 80 / 4 切り上げ)
; uVersion : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; pvReserved : void* (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dot11PhyType : DOT11_PHY_TYPE (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; uChCenterFrequency : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; lRSSI : INT (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; uRSSI : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; ucPriority : BYTE (+24, 1byte)  poke st,24,値  /  値 = peek(st,24)
; ucDataRate : BYTE (+25, 1byte)  poke st,25,値  /  値 = peek(st,25)
; ucPeerMacAddress : BYTE (+26, 6byte)  varptr(st)+26 を基点に操作(6byte:入れ子/配列)
; dwExtendedStatus : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; hWEPOffloadContext : HANDLE (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; hAuthOffloadContext : HANDLE (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; usWEPAppliedMask : WORD (+44, 2byte)  wpoke st,44,値  /  値 = wpeek(st,44)
; usWPAMSDUPriority : WORD (+46, 2byte)  wpoke st,46,値  /  値 = wpeek(st,46)
; dot11LowestIV48Counter : DOT11_IV48_COUNTER (+48, 8byte)  varptr(st)+48 を基点に操作(8byte:入れ子/配列)
; usDot11LeftRWBitMap : WORD (+56, 2byte)  wpoke st,56,値  /  値 = wpeek(st,56)
; dot11HighestIV48Counter : DOT11_IV48_COUNTER (+60, 8byte)  varptr(st)+60 を基点に操作(8byte:入れ子/配列)
; usDot11RightRWBitMap : WORD (+68, 2byte)  wpoke st,68,値  /  値 = wpeek(st,68)
; usNumberOfMPDUsReceived : WORD (+70, 2byte)  wpoke st,70,値  /  値 = wpeek(st,70)
; usNumberOfFragments : WORD (+72, 2byte)  wpoke st,72,値  /  値 = wpeek(st,72)
; pNdisPackets : void* (+76, 4byte)  varptr(st)+76 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DOT11_RECV_EXTENSION_INFO_V2 サイズ: 104 バイト(x64)
dim st, 26    ; 4byte整数×26(構造体サイズ 104 / 4 切り上げ)
; uVersion : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; pvReserved : void* (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; dot11PhyType : DOT11_PHY_TYPE (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; uChCenterFrequency : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; lRSSI : INT (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; uRSSI : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; ucPriority : BYTE (+32, 1byte)  poke st,32,値  /  値 = peek(st,32)
; ucDataRate : BYTE (+33, 1byte)  poke st,33,値  /  値 = peek(st,33)
; ucPeerMacAddress : BYTE (+34, 6byte)  varptr(st)+34 を基点に操作(6byte:入れ子/配列)
; dwExtendedStatus : DWORD (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; hWEPOffloadContext : HANDLE (+48, 8byte)  qpoke st,48,値 / qpeek(st,48)  ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; hAuthOffloadContext : HANDLE (+56, 8byte)  qpoke st,56,値 / qpeek(st,56)  ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; usWEPAppliedMask : WORD (+64, 2byte)  wpoke st,64,値  /  値 = wpeek(st,64)
; usWPAMSDUPriority : WORD (+66, 2byte)  wpoke st,66,値  /  値 = wpeek(st,66)
; dot11LowestIV48Counter : DOT11_IV48_COUNTER (+68, 8byte)  varptr(st)+68 を基点に操作(8byte:入れ子/配列)
; usDot11LeftRWBitMap : WORD (+76, 2byte)  wpoke st,76,値  /  値 = wpeek(st,76)
; dot11HighestIV48Counter : DOT11_IV48_COUNTER (+80, 8byte)  varptr(st)+80 を基点に操作(8byte:入れ子/配列)
; usDot11RightRWBitMap : WORD (+88, 2byte)  wpoke st,88,値  /  値 = wpeek(st,88)
; usNumberOfMPDUsReceived : WORD (+90, 2byte)  wpoke st,90,値  /  値 = wpeek(st,90)
; usNumberOfFragments : WORD (+92, 2byte)  wpoke st,92,値  /  値 = wpeek(st,92)
; pNdisPackets : void* (+96, 8byte)  varptr(st)+96 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global DOT11_IV48_COUNTER
    #field int uIV32Counter
    #field short usIV16Counter
#endstruct

#defstruct global DOT11_RECV_EXTENSION_INFO_V2
    #field int uVersion
    #field intptr pvReserved
    #field int dot11PhyType
    #field int uChCenterFrequency
    #field int lRSSI
    #field int uRSSI
    #field byte ucPriority
    #field byte ucDataRate
    #field byte ucPeerMacAddress 6
    #field int dwExtendedStatus
    #field intptr hWEPOffloadContext
    #field intptr hAuthOffloadContext
    #field short usWEPAppliedMask
    #field short usWPAMSDUPriority
    #field DOT11_IV48_COUNTER dot11LowestIV48Counter
    #field short usDot11LeftRWBitMap
    #field DOT11_IV48_COUNTER dot11HighestIV48Counter
    #field short usDot11RightRWBitMap
    #field short usNumberOfMPDUsReceived
    #field short usNumberOfFragments
    #field intptr pNdisPackets 1
#endstruct

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