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

DOT11_SEND_INVITATION_RESPONSE_PARAMETERS

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

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

フィールド

フィールドサイズx64x86説明
HeaderNDIS_OBJECT_HEADER4+0+0NDISオブジェクトの種類・リビジョン・サイズを示す共通ヘッダー。
ReceiverDeviceAddressBYTE6+4+4招待応答の送信先デバイスアドレス(6バイト)。
DialogTokenBYTE1+10+10要求と応答を対応付けるダイアログトークン。
RequestContextvoid*8/4+16+12対応する受信要求のコンテキストポインタ。
uSendTimeoutDWORD4+24+16送信のタイムアウト(ミリ秒)。
StatusBYTE1+28+20応答に設定する状態コード。
MinimumConfigTimeoutDOT11_WFD_CONFIGURATION_TIMEOUT2+29+21最小構成タイムアウト設定。
GroupBSSIDBYTE6+31+23対象グループのBSSID(6バイト)。
bUseGroupBSSIDBOOLEAN1+37+29GroupBSSIDを使用するかを示す真偽値。
OperatingChannelDOT11_WFD_CHANNEL5+38+30運用チャネルの指定。
bUseSpecifiedOperatingChannelBOOLEAN1+43+35指定した運用チャネルを使用するかを示す真偽値。
uIEsOffsetDWORD4+44+36付随する情報要素(IE)への先頭からのオフセット(バイト)。
uIEsLengthDWORD4+48+40付随する情報要素(IE)の長さ(バイト)。

各言語での定義

#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_CONFIGURATION_TIMEOUT  (x64 2 / x86 2 バイト)
typedef struct DOT11_WFD_CONFIGURATION_TIMEOUT {
    BYTE GOTimeout;
    BYTE ClientTimeout;
} DOT11_WFD_CONFIGURATION_TIMEOUT;

// DOT11_WFD_CHANNEL  (x64 5 / x86 5 バイト)
typedef struct DOT11_WFD_CHANNEL {
    BYTE CountryRegionString[3];
    BYTE OperatingClass;
    BYTE ChannelNumber;
} DOT11_WFD_CHANNEL;

// DOT11_SEND_INVITATION_RESPONSE_PARAMETERS  (x64 56 / x86 44 バイト)
typedef struct DOT11_SEND_INVITATION_RESPONSE_PARAMETERS {
    NDIS_OBJECT_HEADER Header;
    BYTE ReceiverDeviceAddress[6];
    BYTE DialogToken;
    void* RequestContext;
    DWORD uSendTimeout;
    BYTE Status;
    DOT11_WFD_CONFIGURATION_TIMEOUT MinimumConfigTimeout;
    BYTE GroupBSSID[6];
    BOOLEAN bUseGroupBSSID;
    DOT11_WFD_CHANNEL OperatingChannel;
    BOOLEAN bUseSpecifiedOperatingChannel;
    DWORD uIEsOffset;
    DWORD uIEsLength;
} DOT11_SEND_INVITATION_RESPONSE_PARAMETERS;
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_CONFIGURATION_TIMEOUT
{
    public byte GOTimeout;
    public byte ClientTimeout;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DOT11_WFD_CHANNEL
{
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public byte[] CountryRegionString;
    public byte OperatingClass;
    public byte ChannelNumber;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DOT11_SEND_INVITATION_RESPONSE_PARAMETERS
{
    public NDIS_OBJECT_HEADER Header;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] public byte[] ReceiverDeviceAddress;
    public byte DialogToken;
    public IntPtr RequestContext;
    public uint uSendTimeout;
    public byte Status;
    public DOT11_WFD_CONFIGURATION_TIMEOUT MinimumConfigTimeout;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] public byte[] GroupBSSID;
    [MarshalAs(UnmanagedType.U1)] public bool bUseGroupBSSID;
    public DOT11_WFD_CHANNEL OperatingChannel;
    [MarshalAs(UnmanagedType.U1)] public bool bUseSpecifiedOperatingChannel;
    public uint uIEsOffset;
    public uint uIEsLength;
}
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_CONFIGURATION_TIMEOUT
    Public GOTimeout As Byte
    Public ClientTimeout As Byte
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DOT11_WFD_CHANNEL
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=3)> Public CountryRegionString() As Byte
    Public OperatingClass As Byte
    Public ChannelNumber As Byte
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DOT11_SEND_INVITATION_RESPONSE_PARAMETERS
    Public Header As NDIS_OBJECT_HEADER
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=6)> Public ReceiverDeviceAddress() As Byte
    Public DialogToken As Byte
    Public RequestContext As IntPtr
    Public uSendTimeout As UInteger
    Public Status As Byte
    Public MinimumConfigTimeout As DOT11_WFD_CONFIGURATION_TIMEOUT
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=6)> Public GroupBSSID() As Byte
    <MarshalAs(UnmanagedType.U1)> Public bUseGroupBSSID As Boolean
    Public OperatingChannel As DOT11_WFD_CHANNEL
    <MarshalAs(UnmanagedType.U1)> Public bUseSpecifiedOperatingChannel As Boolean
    Public uIEsOffset As UInteger
    Public uIEsLength 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_CONFIGURATION_TIMEOUT(ctypes.Structure):
    _fields_ = [
        ("GOTimeout", ctypes.c_ubyte),
        ("ClientTimeout", ctypes.c_ubyte),
    ]

class DOT11_WFD_CHANNEL(ctypes.Structure):
    _fields_ = [
        ("CountryRegionString", ctypes.c_ubyte * 3),
        ("OperatingClass", ctypes.c_ubyte),
        ("ChannelNumber", ctypes.c_ubyte),
    ]

class DOT11_SEND_INVITATION_RESPONSE_PARAMETERS(ctypes.Structure):
    _fields_ = [
        ("Header", NDIS_OBJECT_HEADER),
        ("ReceiverDeviceAddress", ctypes.c_ubyte * 6),
        ("DialogToken", ctypes.c_ubyte),
        ("RequestContext", ctypes.c_void_p),
        ("uSendTimeout", wintypes.DWORD),
        ("Status", ctypes.c_ubyte),
        ("MinimumConfigTimeout", DOT11_WFD_CONFIGURATION_TIMEOUT),
        ("GroupBSSID", ctypes.c_ubyte * 6),
        ("bUseGroupBSSID", ctypes.c_byte),
        ("OperatingChannel", DOT11_WFD_CHANNEL),
        ("bUseSpecifiedOperatingChannel", ctypes.c_byte),
        ("uIEsOffset", wintypes.DWORD),
        ("uIEsLength", wintypes.DWORD),
    ]
#[repr(C)]
pub struct NDIS_OBJECT_HEADER {
    pub Type: u8,
    pub Revision: u8,
    pub Size: u16,
}

#[repr(C)]
pub struct DOT11_WFD_CONFIGURATION_TIMEOUT {
    pub GOTimeout: u8,
    pub ClientTimeout: u8,
}

#[repr(C)]
pub struct DOT11_WFD_CHANNEL {
    pub CountryRegionString: [u8; 3],
    pub OperatingClass: u8,
    pub ChannelNumber: u8,
}

#[repr(C)]
pub struct DOT11_SEND_INVITATION_RESPONSE_PARAMETERS {
    pub Header: NDIS_OBJECT_HEADER,
    pub ReceiverDeviceAddress: [u8; 6],
    pub DialogToken: u8,
    pub RequestContext: *mut core::ffi::c_void,
    pub uSendTimeout: u32,
    pub Status: u8,
    pub MinimumConfigTimeout: DOT11_WFD_CONFIGURATION_TIMEOUT,
    pub GroupBSSID: [u8; 6],
    pub bUseGroupBSSID: u8,
    pub OperatingChannel: DOT11_WFD_CHANNEL,
    pub bUseSpecifiedOperatingChannel: u8,
    pub uIEsOffset: u32,
    pub uIEsLength: u32,
}
import "golang.org/x/sys/windows"

type NDIS_OBJECT_HEADER struct {
	Type byte
	Revision byte
	Size uint16
}

type DOT11_WFD_CONFIGURATION_TIMEOUT struct {
	GOTimeout byte
	ClientTimeout byte
}

type DOT11_WFD_CHANNEL struct {
	CountryRegionString [3]byte
	OperatingClass byte
	ChannelNumber byte
}

type DOT11_SEND_INVITATION_RESPONSE_PARAMETERS struct {
	Header NDIS_OBJECT_HEADER
	ReceiverDeviceAddress [6]byte
	DialogToken byte
	RequestContext uintptr
	uSendTimeout uint32
	Status byte
	MinimumConfigTimeout DOT11_WFD_CONFIGURATION_TIMEOUT
	GroupBSSID [6]byte
	bUseGroupBSSID byte
	OperatingChannel DOT11_WFD_CHANNEL
	bUseSpecifiedOperatingChannel byte
	uIEsOffset uint32
	uIEsLength uint32
}
type
  NDIS_OBJECT_HEADER = record
    Type: Byte;
    Revision: Byte;
    Size: Word;
  end;

  DOT11_WFD_CONFIGURATION_TIMEOUT = record
    GOTimeout: Byte;
    ClientTimeout: Byte;
  end;

  DOT11_WFD_CHANNEL = record
    CountryRegionString: array[0..2] of Byte;
    OperatingClass: Byte;
    ChannelNumber: Byte;
  end;

  DOT11_SEND_INVITATION_RESPONSE_PARAMETERS = record
    Header: NDIS_OBJECT_HEADER;
    ReceiverDeviceAddress: array[0..5] of Byte;
    DialogToken: Byte;
    RequestContext: Pointer;
    uSendTimeout: DWORD;
    Status: Byte;
    MinimumConfigTimeout: DOT11_WFD_CONFIGURATION_TIMEOUT;
    GroupBSSID: array[0..5] of Byte;
    bUseGroupBSSID: ByteBool;
    OperatingChannel: DOT11_WFD_CHANNEL;
    bUseSpecifiedOperatingChannel: ByteBool;
    uIEsOffset: DWORD;
    uIEsLength: DWORD;
  end;
const NDIS_OBJECT_HEADER = extern struct {
    Type: u8,
    Revision: u8,
    Size: u16,
};

const DOT11_WFD_CONFIGURATION_TIMEOUT = extern struct {
    GOTimeout: u8,
    ClientTimeout: u8,
};

const DOT11_WFD_CHANNEL = extern struct {
    CountryRegionString: [3]u8,
    OperatingClass: u8,
    ChannelNumber: u8,
};

const DOT11_SEND_INVITATION_RESPONSE_PARAMETERS = extern struct {
    Header: NDIS_OBJECT_HEADER,
    ReceiverDeviceAddress: [6]u8,
    DialogToken: u8,
    RequestContext: ?*anyopaque,
    uSendTimeout: u32,
    Status: u8,
    MinimumConfigTimeout: DOT11_WFD_CONFIGURATION_TIMEOUT,
    GroupBSSID: [6]u8,
    bUseGroupBSSID: u8,
    OperatingChannel: DOT11_WFD_CHANNEL,
    bUseSpecifiedOperatingChannel: u8,
    uIEsOffset: u32,
    uIEsLength: u32,
};
type
  NDIS_OBJECT_HEADER {.bycopy.} = object
    Type: uint8
    Revision: uint8
    Size: uint16

  DOT11_WFD_CONFIGURATION_TIMEOUT {.bycopy.} = object
    GOTimeout: uint8
    ClientTimeout: uint8

  DOT11_WFD_CHANNEL {.bycopy.} = object
    CountryRegionString: array[3, uint8]
    OperatingClass: uint8
    ChannelNumber: uint8

  DOT11_SEND_INVITATION_RESPONSE_PARAMETERS {.bycopy.} = object
    Header: NDIS_OBJECT_HEADER
    ReceiverDeviceAddress: array[6, uint8]
    DialogToken: uint8
    RequestContext: pointer
    uSendTimeout: uint32
    Status: uint8
    MinimumConfigTimeout: DOT11_WFD_CONFIGURATION_TIMEOUT
    GroupBSSID: array[6, uint8]
    bUseGroupBSSID: uint8
    OperatingChannel: DOT11_WFD_CHANNEL
    bUseSpecifiedOperatingChannel: uint8
    uIEsOffset: uint32
    uIEsLength: uint32
struct NDIS_OBJECT_HEADER
{
    ubyte Type;
    ubyte Revision;
    ushort Size;
}

struct DOT11_WFD_CONFIGURATION_TIMEOUT
{
    ubyte GOTimeout;
    ubyte ClientTimeout;
}

struct DOT11_WFD_CHANNEL
{
    ubyte[3] CountryRegionString;
    ubyte OperatingClass;
    ubyte ChannelNumber;
}

struct DOT11_SEND_INVITATION_RESPONSE_PARAMETERS
{
    NDIS_OBJECT_HEADER Header;
    ubyte[6] ReceiverDeviceAddress;
    ubyte DialogToken;
    void* RequestContext;
    uint uSendTimeout;
    ubyte Status;
    DOT11_WFD_CONFIGURATION_TIMEOUT MinimumConfigTimeout;
    ubyte[6] GroupBSSID;
    ubyte bUseGroupBSSID;
    DOT11_WFD_CHANNEL OperatingChannel;
    ubyte bUseSpecifiedOperatingChannel;
    uint uIEsOffset;
    uint uIEsLength;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DOT11_SEND_INVITATION_RESPONSE_PARAMETERS サイズ: 44 バイト(x86)
dim st, 11    ; 4byte整数×11(構造体サイズ 44 / 4 切り上げ)
; Header : NDIS_OBJECT_HEADER (+0, 4byte)  varptr(st)+0 を基点に操作(4byte:入れ子/配列)
; ReceiverDeviceAddress : BYTE (+4, 6byte)  varptr(st)+4 を基点に操作(6byte:入れ子/配列)
; DialogToken : BYTE (+10, 1byte)  poke st,10,値  /  値 = peek(st,10)
; RequestContext : void* (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; uSendTimeout : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; Status : BYTE (+20, 1byte)  poke st,20,値  /  値 = peek(st,20)
; MinimumConfigTimeout : DOT11_WFD_CONFIGURATION_TIMEOUT (+21, 2byte)  varptr(st)+21 を基点に操作(2byte:入れ子/配列)
; GroupBSSID : BYTE (+23, 6byte)  varptr(st)+23 を基点に操作(6byte:入れ子/配列)
; bUseGroupBSSID : BOOLEAN (+29, 1byte)  poke st,29,値  /  値 = peek(st,29)
; OperatingChannel : DOT11_WFD_CHANNEL (+30, 5byte)  varptr(st)+30 を基点に操作(5byte:入れ子/配列)
; bUseSpecifiedOperatingChannel : BOOLEAN (+35, 1byte)  poke st,35,値  /  値 = peek(st,35)
; uIEsOffset : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; uIEsLength : DWORD (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DOT11_SEND_INVITATION_RESPONSE_PARAMETERS サイズ: 56 バイト(x64)
dim st, 14    ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; Header : NDIS_OBJECT_HEADER (+0, 4byte)  varptr(st)+0 を基点に操作(4byte:入れ子/配列)
; ReceiverDeviceAddress : BYTE (+4, 6byte)  varptr(st)+4 を基点に操作(6byte:入れ子/配列)
; DialogToken : BYTE (+10, 1byte)  poke st,10,値  /  値 = peek(st,10)
; RequestContext : void* (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; uSendTimeout : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; Status : BYTE (+28, 1byte)  poke st,28,値  /  値 = peek(st,28)
; MinimumConfigTimeout : DOT11_WFD_CONFIGURATION_TIMEOUT (+29, 2byte)  varptr(st)+29 を基点に操作(2byte:入れ子/配列)
; GroupBSSID : BYTE (+31, 6byte)  varptr(st)+31 を基点に操作(6byte:入れ子/配列)
; bUseGroupBSSID : BOOLEAN (+37, 1byte)  poke st,37,値  /  値 = peek(st,37)
; OperatingChannel : DOT11_WFD_CHANNEL (+38, 5byte)  varptr(st)+38 を基点に操作(5byte:入れ子/配列)
; bUseSpecifiedOperatingChannel : BOOLEAN (+43, 1byte)  poke st,43,値  /  値 = peek(st,43)
; uIEsOffset : DWORD (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; uIEsLength : DWORD (+48, 4byte)  st.12 = 値  /  値 = st.12   (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_CONFIGURATION_TIMEOUT
    #field byte GOTimeout
    #field byte ClientTimeout
#endstruct

#defstruct global DOT11_WFD_CHANNEL
    #field byte CountryRegionString 3
    #field byte OperatingClass
    #field byte ChannelNumber
#endstruct

#defstruct global DOT11_SEND_INVITATION_RESPONSE_PARAMETERS
    #field NDIS_OBJECT_HEADER Header
    #field byte ReceiverDeviceAddress 6
    #field byte DialogToken
    #field intptr RequestContext
    #field int uSendTimeout
    #field byte Status
    #field DOT11_WFD_CONFIGURATION_TIMEOUT MinimumConfigTimeout
    #field byte GroupBSSID 6
    #field bool1 bUseGroupBSSID
    #field DOT11_WFD_CHANNEL OperatingChannel
    #field bool1 bUseSpecifiedOperatingChannel
    #field int uIEsOffset
    #field int uIEsLength
#endstruct

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