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

DOT11_WFD_ATTRIBUTES

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

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

フィールド

フィールドサイズx64x86説明
HeaderNDIS_OBJECT_HEADER4+0+0NDISオブジェクトの種類・リビジョン・サイズを示す共通ヘッダー。
uNumConcurrentGORoleDWORD4+4+4同時に担えるグループオーナー(GO)ロールの数。
uNumConcurrentClientRoleDWORD4+8+8同時に担えるクライアントロールの数。
WPSVersionsSupportedDWORD4+12+12サポートするWPSバージョンを示すビットマスク。
bServiceDiscoverySupportedBOOLEAN1+16+16サービスディスカバリをサポートするかを示す真偽値。
bClientDiscoverabilitySupportedBOOLEAN1+17+17クライアントの被検出性をサポートするかを示す真偽値。
bInfrastructureManagementSupportedBOOLEAN1+18+18インフラ管理をサポートするかを示す真偽値。
uMaxSecondaryDeviceTypeListSizeDWORD4+20+20セカンダリデバイスタイプリストの最大サイズ。
DeviceAddressBYTE6+24+24WFDデバイスアドレス(6バイト)。
uInterfaceAddressListCountDWORD4+32+32インターフェイスアドレスリストの要素数。
pInterfaceAddressListBYTE*8/4+40+36インターフェイスアドレスリストへのポインタ。
uNumSupportedCountryOrRegionStringsDWORD4+48+40サポートする国/地域文字列の数。
pSupportedCountryOrRegionStringsBYTE*8/4+56+44サポートする国/地域文字列配列へのポインタ。
uDiscoveryFilterListSizeDWORD4+64+48ディスカバリフィルタリストの最大サイズ。
uGORoleClientTableSizeDWORD4+68+52GOロール時のクライアントテーブルの最大サイズ。

各言語での定義

#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_WFD_ATTRIBUTES  (x64 72 / x86 56 バイト)
typedef struct DOT11_WFD_ATTRIBUTES {
    NDIS_OBJECT_HEADER Header;
    DWORD uNumConcurrentGORole;
    DWORD uNumConcurrentClientRole;
    DWORD WPSVersionsSupported;
    BOOLEAN bServiceDiscoverySupported;
    BOOLEAN bClientDiscoverabilitySupported;
    BOOLEAN bInfrastructureManagementSupported;
    DWORD uMaxSecondaryDeviceTypeListSize;
    BYTE DeviceAddress[6];
    DWORD uInterfaceAddressListCount;
    BYTE* pInterfaceAddressList;
    DWORD uNumSupportedCountryOrRegionStrings;
    BYTE* pSupportedCountryOrRegionStrings;
    DWORD uDiscoveryFilterListSize;
    DWORD uGORoleClientTableSize;
} DOT11_WFD_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_WFD_ATTRIBUTES
{
    public NDIS_OBJECT_HEADER Header;
    public uint uNumConcurrentGORole;
    public uint uNumConcurrentClientRole;
    public uint WPSVersionsSupported;
    [MarshalAs(UnmanagedType.U1)] public bool bServiceDiscoverySupported;
    [MarshalAs(UnmanagedType.U1)] public bool bClientDiscoverabilitySupported;
    [MarshalAs(UnmanagedType.U1)] public bool bInfrastructureManagementSupported;
    public uint uMaxSecondaryDeviceTypeListSize;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] public byte[] DeviceAddress;
    public uint uInterfaceAddressListCount;
    public IntPtr pInterfaceAddressList;
    public uint uNumSupportedCountryOrRegionStrings;
    public IntPtr pSupportedCountryOrRegionStrings;
    public uint uDiscoveryFilterListSize;
    public uint uGORoleClientTableSize;
}
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_WFD_ATTRIBUTES
    Public Header As NDIS_OBJECT_HEADER
    Public uNumConcurrentGORole As UInteger
    Public uNumConcurrentClientRole As UInteger
    Public WPSVersionsSupported As UInteger
    <MarshalAs(UnmanagedType.U1)> Public bServiceDiscoverySupported As Boolean
    <MarshalAs(UnmanagedType.U1)> Public bClientDiscoverabilitySupported As Boolean
    <MarshalAs(UnmanagedType.U1)> Public bInfrastructureManagementSupported As Boolean
    Public uMaxSecondaryDeviceTypeListSize As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=6)> Public DeviceAddress() As Byte
    Public uInterfaceAddressListCount As UInteger
    Public pInterfaceAddressList As IntPtr
    Public uNumSupportedCountryOrRegionStrings As UInteger
    Public pSupportedCountryOrRegionStrings As IntPtr
    Public uDiscoveryFilterListSize As UInteger
    Public uGORoleClientTableSize As UInteger
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_WFD_ATTRIBUTES(ctypes.Structure):
    _fields_ = [
        ("Header", NDIS_OBJECT_HEADER),
        ("uNumConcurrentGORole", wintypes.DWORD),
        ("uNumConcurrentClientRole", wintypes.DWORD),
        ("WPSVersionsSupported", wintypes.DWORD),
        ("bServiceDiscoverySupported", ctypes.c_byte),
        ("bClientDiscoverabilitySupported", ctypes.c_byte),
        ("bInfrastructureManagementSupported", ctypes.c_byte),
        ("uMaxSecondaryDeviceTypeListSize", wintypes.DWORD),
        ("DeviceAddress", ctypes.c_ubyte * 6),
        ("uInterfaceAddressListCount", wintypes.DWORD),
        ("pInterfaceAddressList", ctypes.c_void_p),
        ("uNumSupportedCountryOrRegionStrings", wintypes.DWORD),
        ("pSupportedCountryOrRegionStrings", ctypes.c_void_p),
        ("uDiscoveryFilterListSize", wintypes.DWORD),
        ("uGORoleClientTableSize", wintypes.DWORD),
    ]
#[repr(C)]
pub struct NDIS_OBJECT_HEADER {
    pub Type: u8,
    pub Revision: u8,
    pub Size: u16,
}

#[repr(C)]
pub struct DOT11_WFD_ATTRIBUTES {
    pub Header: NDIS_OBJECT_HEADER,
    pub uNumConcurrentGORole: u32,
    pub uNumConcurrentClientRole: u32,
    pub WPSVersionsSupported: u32,
    pub bServiceDiscoverySupported: u8,
    pub bClientDiscoverabilitySupported: u8,
    pub bInfrastructureManagementSupported: u8,
    pub uMaxSecondaryDeviceTypeListSize: u32,
    pub DeviceAddress: [u8; 6],
    pub uInterfaceAddressListCount: u32,
    pub pInterfaceAddressList: *mut core::ffi::c_void,
    pub uNumSupportedCountryOrRegionStrings: u32,
    pub pSupportedCountryOrRegionStrings: *mut core::ffi::c_void,
    pub uDiscoveryFilterListSize: u32,
    pub uGORoleClientTableSize: u32,
}
import "golang.org/x/sys/windows"

type NDIS_OBJECT_HEADER struct {
	Type byte
	Revision byte
	Size uint16
}

type DOT11_WFD_ATTRIBUTES struct {
	Header NDIS_OBJECT_HEADER
	uNumConcurrentGORole uint32
	uNumConcurrentClientRole uint32
	WPSVersionsSupported uint32
	bServiceDiscoverySupported byte
	bClientDiscoverabilitySupported byte
	bInfrastructureManagementSupported byte
	uMaxSecondaryDeviceTypeListSize uint32
	DeviceAddress [6]byte
	uInterfaceAddressListCount uint32
	pInterfaceAddressList uintptr
	uNumSupportedCountryOrRegionStrings uint32
	pSupportedCountryOrRegionStrings uintptr
	uDiscoveryFilterListSize uint32
	uGORoleClientTableSize uint32
}
type
  NDIS_OBJECT_HEADER = record
    Type: Byte;
    Revision: Byte;
    Size: Word;
  end;

  DOT11_WFD_ATTRIBUTES = record
    Header: NDIS_OBJECT_HEADER;
    uNumConcurrentGORole: DWORD;
    uNumConcurrentClientRole: DWORD;
    WPSVersionsSupported: DWORD;
    bServiceDiscoverySupported: ByteBool;
    bClientDiscoverabilitySupported: ByteBool;
    bInfrastructureManagementSupported: ByteBool;
    uMaxSecondaryDeviceTypeListSize: DWORD;
    DeviceAddress: array[0..5] of Byte;
    uInterfaceAddressListCount: DWORD;
    pInterfaceAddressList: Pointer;
    uNumSupportedCountryOrRegionStrings: DWORD;
    pSupportedCountryOrRegionStrings: Pointer;
    uDiscoveryFilterListSize: DWORD;
    uGORoleClientTableSize: DWORD;
  end;
const NDIS_OBJECT_HEADER = extern struct {
    Type: u8,
    Revision: u8,
    Size: u16,
};

const DOT11_WFD_ATTRIBUTES = extern struct {
    Header: NDIS_OBJECT_HEADER,
    uNumConcurrentGORole: u32,
    uNumConcurrentClientRole: u32,
    WPSVersionsSupported: u32,
    bServiceDiscoverySupported: u8,
    bClientDiscoverabilitySupported: u8,
    bInfrastructureManagementSupported: u8,
    uMaxSecondaryDeviceTypeListSize: u32,
    DeviceAddress: [6]u8,
    uInterfaceAddressListCount: u32,
    pInterfaceAddressList: ?*anyopaque,
    uNumSupportedCountryOrRegionStrings: u32,
    pSupportedCountryOrRegionStrings: ?*anyopaque,
    uDiscoveryFilterListSize: u32,
    uGORoleClientTableSize: u32,
};
type
  NDIS_OBJECT_HEADER {.bycopy.} = object
    Type: uint8
    Revision: uint8
    Size: uint16

  DOT11_WFD_ATTRIBUTES {.bycopy.} = object
    Header: NDIS_OBJECT_HEADER
    uNumConcurrentGORole: uint32
    uNumConcurrentClientRole: uint32
    WPSVersionsSupported: uint32
    bServiceDiscoverySupported: uint8
    bClientDiscoverabilitySupported: uint8
    bInfrastructureManagementSupported: uint8
    uMaxSecondaryDeviceTypeListSize: uint32
    DeviceAddress: array[6, uint8]
    uInterfaceAddressListCount: uint32
    pInterfaceAddressList: pointer
    uNumSupportedCountryOrRegionStrings: uint32
    pSupportedCountryOrRegionStrings: pointer
    uDiscoveryFilterListSize: uint32
    uGORoleClientTableSize: uint32
struct NDIS_OBJECT_HEADER
{
    ubyte Type;
    ubyte Revision;
    ushort Size;
}

struct DOT11_WFD_ATTRIBUTES
{
    NDIS_OBJECT_HEADER Header;
    uint uNumConcurrentGORole;
    uint uNumConcurrentClientRole;
    uint WPSVersionsSupported;
    ubyte bServiceDiscoverySupported;
    ubyte bClientDiscoverabilitySupported;
    ubyte bInfrastructureManagementSupported;
    uint uMaxSecondaryDeviceTypeListSize;
    ubyte[6] DeviceAddress;
    uint uInterfaceAddressListCount;
    void* pInterfaceAddressList;
    uint uNumSupportedCountryOrRegionStrings;
    void* pSupportedCountryOrRegionStrings;
    uint uDiscoveryFilterListSize;
    uint uGORoleClientTableSize;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DOT11_WFD_ATTRIBUTES サイズ: 56 バイト(x86)
dim st, 14    ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; Header : NDIS_OBJECT_HEADER (+0, 4byte)  varptr(st)+0 を基点に操作(4byte:入れ子/配列)
; uNumConcurrentGORole : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; uNumConcurrentClientRole : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; WPSVersionsSupported : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; bServiceDiscoverySupported : BOOLEAN (+16, 1byte)  poke st,16,値  /  値 = peek(st,16)
; bClientDiscoverabilitySupported : BOOLEAN (+17, 1byte)  poke st,17,値  /  値 = peek(st,17)
; bInfrastructureManagementSupported : BOOLEAN (+18, 1byte)  poke st,18,値  /  値 = peek(st,18)
; uMaxSecondaryDeviceTypeListSize : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; DeviceAddress : BYTE (+24, 6byte)  varptr(st)+24 を基点に操作(6byte:入れ子/配列)
; uInterfaceAddressListCount : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; pInterfaceAddressList : BYTE* (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; uNumSupportedCountryOrRegionStrings : DWORD (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; pSupportedCountryOrRegionStrings : BYTE* (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; uDiscoveryFilterListSize : DWORD (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; uGORoleClientTableSize : DWORD (+52, 4byte)  st.13 = 値  /  値 = st.13   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DOT11_WFD_ATTRIBUTES サイズ: 72 バイト(x64)
dim st, 18    ; 4byte整数×18(構造体サイズ 72 / 4 切り上げ)
; Header : NDIS_OBJECT_HEADER (+0, 4byte)  varptr(st)+0 を基点に操作(4byte:入れ子/配列)
; uNumConcurrentGORole : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; uNumConcurrentClientRole : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; WPSVersionsSupported : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; bServiceDiscoverySupported : BOOLEAN (+16, 1byte)  poke st,16,値  /  値 = peek(st,16)
; bClientDiscoverabilitySupported : BOOLEAN (+17, 1byte)  poke st,17,値  /  値 = peek(st,17)
; bInfrastructureManagementSupported : BOOLEAN (+18, 1byte)  poke st,18,値  /  値 = peek(st,18)
; uMaxSecondaryDeviceTypeListSize : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; DeviceAddress : BYTE (+24, 6byte)  varptr(st)+24 を基点に操作(6byte:入れ子/配列)
; uInterfaceAddressListCount : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; pInterfaceAddressList : BYTE* (+40, 8byte)  qpoke st,40,値 / qpeek(st,40)  ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; uNumSupportedCountryOrRegionStrings : DWORD (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; pSupportedCountryOrRegionStrings : BYTE* (+56, 8byte)  qpoke st,56,値 / qpeek(st,56)  ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; uDiscoveryFilterListSize : DWORD (+64, 4byte)  st.16 = 値  /  値 = st.16   (lpoke/lpeek も可)
; uGORoleClientTableSize : DWORD (+68, 4byte)  st.17 = 値  /  値 = st.17   (lpoke/lpeek も可)
; ※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_WFD_ATTRIBUTES
    #field NDIS_OBJECT_HEADER Header
    #field int uNumConcurrentGORole
    #field int uNumConcurrentClientRole
    #field int WPSVersionsSupported
    #field bool1 bServiceDiscoverySupported
    #field bool1 bClientDiscoverabilitySupported
    #field bool1 bInfrastructureManagementSupported
    #field int uMaxSecondaryDeviceTypeListSize
    #field byte DeviceAddress 6
    #field int uInterfaceAddressListCount
    #field intptr pInterfaceAddressList
    #field int uNumSupportedCountryOrRegionStrings
    #field intptr pSupportedCountryOrRegionStrings
    #field int uDiscoveryFilterListSize
    #field int uGORoleClientTableSize
#endstruct

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