ホーム › NetworkManagement.WiFi › DOT11_IBSS_PARAMS
DOT11_IBSS_PARAMS
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Header | NDIS_OBJECT_HEADER | 4 | +0 | +0 | NDIS オブジェクトのバージョン情報を含むヘッダー。 |
| bJoinOnly | BOOLEAN | 1 | +4 | +4 | 既存 IBSS への参加のみを行うか示すフラグ。 |
| uIEsOffset | DWORD | 4 | +8 | +8 | 情報要素データへの先頭からのオフセット。 |
| uIEsLength | DWORD | 4 | +12 | +12 | 情報要素データのバイト長を表す。 |
各言語での定義
#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_IBSS_PARAMS (x64 16 / x86 16 バイト)
typedef struct DOT11_IBSS_PARAMS {
NDIS_OBJECT_HEADER Header;
BOOLEAN bJoinOnly;
DWORD uIEsOffset;
DWORD uIEsLength;
} DOT11_IBSS_PARAMS;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_IBSS_PARAMS
{
public NDIS_OBJECT_HEADER Header;
[MarshalAs(UnmanagedType.U1)] public bool bJoinOnly;
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_IBSS_PARAMS
Public Header As NDIS_OBJECT_HEADER
<MarshalAs(UnmanagedType.U1)> Public bJoinOnly As Boolean
Public uIEsOffset As UInteger
Public uIEsLength As UInteger
End Structureimport 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_IBSS_PARAMS(ctypes.Structure):
_fields_ = [
("Header", NDIS_OBJECT_HEADER),
("bJoinOnly", 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_IBSS_PARAMS {
pub Header: NDIS_OBJECT_HEADER,
pub bJoinOnly: 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_IBSS_PARAMS struct {
Header NDIS_OBJECT_HEADER
bJoinOnly byte
uIEsOffset uint32
uIEsLength uint32
}type
NDIS_OBJECT_HEADER = record
Type: Byte;
Revision: Byte;
Size: Word;
end;
DOT11_IBSS_PARAMS = record
Header: NDIS_OBJECT_HEADER;
bJoinOnly: ByteBool;
uIEsOffset: DWORD;
uIEsLength: DWORD;
end;const NDIS_OBJECT_HEADER = extern struct {
Type: u8,
Revision: u8,
Size: u16,
};
const DOT11_IBSS_PARAMS = extern struct {
Header: NDIS_OBJECT_HEADER,
bJoinOnly: u8,
uIEsOffset: u32,
uIEsLength: u32,
};type
NDIS_OBJECT_HEADER {.bycopy.} = object
Type: uint8
Revision: uint8
Size: uint16
DOT11_IBSS_PARAMS {.bycopy.} = object
Header: NDIS_OBJECT_HEADER
bJoinOnly: uint8
uIEsOffset: uint32
uIEsLength: uint32struct NDIS_OBJECT_HEADER
{
ubyte Type;
ubyte Revision;
ushort Size;
}
struct DOT11_IBSS_PARAMS
{
NDIS_OBJECT_HEADER Header;
ubyte bJoinOnly;
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整数の配列変数で操作します。(x64 レイアウト)
; DOT11_IBSS_PARAMS サイズ: 16 バイト(x64)
dim st, 4 ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; Header : NDIS_OBJECT_HEADER (+0, 4byte) varptr(st)+0 を基点に操作(4byte:入れ子/配列)
; bJoinOnly : BOOLEAN (+4, 1byte) poke st,4,値 / 値 = peek(st,4)
; uIEsOffset : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; uIEsLength : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (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_IBSS_PARAMS
#field NDIS_OBJECT_HEADER Header
#field bool1 bJoinOnly
#field int uIEsOffset
#field int uIEsLength
#endstruct
stdim st, DOT11_IBSS_PARAMS ; NSTRUCT 変数を確保
st->bJoinOnly = 100
mes "bJoinOnly=" + st->bJoinOnly