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

DOT11_MSSECURITY_SETTINGS

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

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

フィールド

フィールドサイズx64x86説明
dot11AuthAlgorithmDOT11_AUTH_ALGORITHM4+0+0使用する802.11認証アルゴリズム(WPA/WPA2等)を示す列挙値。
dot11CipherAlgorithmDOT11_CIPHER_ALGORITHM4+4+4使用する暗号アルゴリズム(TKIP/CCMP等)を示す列挙値。
fOneXEnabledBOOL4+8+8802.1X認証を有効にするかを示すBOOL。TRUEで有効。
eapMethodTypeEAP_METHOD_TYPE16+12+12使用するEAP方式の種別を示す構造体。
dwEapConnectionDataLenDWORD4+28+28pEapConnectionDataのバイト長。
pEapConnectionDataBYTE*8/4+32+32EAP接続構成データへのポインター。NULL可。

各言語での定義

#include <windows.h>

// EAP_TYPE  (x64 12 / x86 12 バイト)
typedef struct EAP_TYPE {
    BYTE type;
    DWORD dwVendorId;
    DWORD dwVendorType;
} EAP_TYPE;

// EAP_METHOD_TYPE  (x64 16 / x86 16 バイト)
typedef struct EAP_METHOD_TYPE {
    EAP_TYPE eapType;
    DWORD dwAuthorId;
} EAP_METHOD_TYPE;

// DOT11_MSSECURITY_SETTINGS  (x64 40 / x86 36 バイト)
typedef struct DOT11_MSSECURITY_SETTINGS {
    DOT11_AUTH_ALGORITHM dot11AuthAlgorithm;
    DOT11_CIPHER_ALGORITHM dot11CipherAlgorithm;
    BOOL fOneXEnabled;
    EAP_METHOD_TYPE eapMethodType;
    DWORD dwEapConnectionDataLen;
    BYTE* pEapConnectionData;
} DOT11_MSSECURITY_SETTINGS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct EAP_TYPE
{
    public byte type;
    public uint dwVendorId;
    public uint dwVendorType;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct EAP_METHOD_TYPE
{
    public EAP_TYPE eapType;
    public uint dwAuthorId;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DOT11_MSSECURITY_SETTINGS
{
    public int dot11AuthAlgorithm;
    public int dot11CipherAlgorithm;
    [MarshalAs(UnmanagedType.Bool)] public bool fOneXEnabled;
    public EAP_METHOD_TYPE eapMethodType;
    public uint dwEapConnectionDataLen;
    public IntPtr pEapConnectionData;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure EAP_TYPE
    Public type As Byte
    Public dwVendorId As UInteger
    Public dwVendorType As UInteger
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure EAP_METHOD_TYPE
    Public eapType As EAP_TYPE
    Public dwAuthorId As UInteger
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DOT11_MSSECURITY_SETTINGS
    Public dot11AuthAlgorithm As Integer
    Public dot11CipherAlgorithm As Integer
    <MarshalAs(UnmanagedType.Bool)> Public fOneXEnabled As Boolean
    Public eapMethodType As EAP_METHOD_TYPE
    Public dwEapConnectionDataLen As UInteger
    Public pEapConnectionData As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class EAP_TYPE(ctypes.Structure):
    _fields_ = [
        ("type", ctypes.c_ubyte),
        ("dwVendorId", wintypes.DWORD),
        ("dwVendorType", wintypes.DWORD),
    ]

class EAP_METHOD_TYPE(ctypes.Structure):
    _fields_ = [
        ("eapType", EAP_TYPE),
        ("dwAuthorId", wintypes.DWORD),
    ]

class DOT11_MSSECURITY_SETTINGS(ctypes.Structure):
    _fields_ = [
        ("dot11AuthAlgorithm", ctypes.c_int),
        ("dot11CipherAlgorithm", ctypes.c_int),
        ("fOneXEnabled", wintypes.BOOL),
        ("eapMethodType", EAP_METHOD_TYPE),
        ("dwEapConnectionDataLen", wintypes.DWORD),
        ("pEapConnectionData", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct EAP_TYPE {
    pub type: u8,
    pub dwVendorId: u32,
    pub dwVendorType: u32,
}

#[repr(C)]
pub struct EAP_METHOD_TYPE {
    pub eapType: EAP_TYPE,
    pub dwAuthorId: u32,
}

#[repr(C)]
pub struct DOT11_MSSECURITY_SETTINGS {
    pub dot11AuthAlgorithm: i32,
    pub dot11CipherAlgorithm: i32,
    pub fOneXEnabled: i32,
    pub eapMethodType: EAP_METHOD_TYPE,
    pub dwEapConnectionDataLen: u32,
    pub pEapConnectionData: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type EAP_TYPE struct {
	type byte
	dwVendorId uint32
	dwVendorType uint32
}

type EAP_METHOD_TYPE struct {
	eapType EAP_TYPE
	dwAuthorId uint32
}

type DOT11_MSSECURITY_SETTINGS struct {
	dot11AuthAlgorithm int32
	dot11CipherAlgorithm int32
	fOneXEnabled int32
	eapMethodType EAP_METHOD_TYPE
	dwEapConnectionDataLen uint32
	pEapConnectionData uintptr
}
type
  EAP_TYPE = record
    type: Byte;
    dwVendorId: DWORD;
    dwVendorType: DWORD;
  end;

  EAP_METHOD_TYPE = record
    eapType: EAP_TYPE;
    dwAuthorId: DWORD;
  end;

  DOT11_MSSECURITY_SETTINGS = record
    dot11AuthAlgorithm: Integer;
    dot11CipherAlgorithm: Integer;
    fOneXEnabled: BOOL;
    eapMethodType: EAP_METHOD_TYPE;
    dwEapConnectionDataLen: DWORD;
    pEapConnectionData: Pointer;
  end;
const EAP_TYPE = extern struct {
    type: u8,
    dwVendorId: u32,
    dwVendorType: u32,
};

const EAP_METHOD_TYPE = extern struct {
    eapType: EAP_TYPE,
    dwAuthorId: u32,
};

const DOT11_MSSECURITY_SETTINGS = extern struct {
    dot11AuthAlgorithm: i32,
    dot11CipherAlgorithm: i32,
    fOneXEnabled: i32,
    eapMethodType: EAP_METHOD_TYPE,
    dwEapConnectionDataLen: u32,
    pEapConnectionData: ?*anyopaque,
};
type
  EAP_TYPE {.bycopy.} = object
    type: uint8
    dwVendorId: uint32
    dwVendorType: uint32

  EAP_METHOD_TYPE {.bycopy.} = object
    eapType: EAP_TYPE
    dwAuthorId: uint32

  DOT11_MSSECURITY_SETTINGS {.bycopy.} = object
    dot11AuthAlgorithm: int32
    dot11CipherAlgorithm: int32
    fOneXEnabled: int32
    eapMethodType: EAP_METHOD_TYPE
    dwEapConnectionDataLen: uint32
    pEapConnectionData: pointer
struct EAP_TYPE
{
    ubyte type;
    uint dwVendorId;
    uint dwVendorType;
}

struct EAP_METHOD_TYPE
{
    EAP_TYPE eapType;
    uint dwAuthorId;
}

struct DOT11_MSSECURITY_SETTINGS
{
    int dot11AuthAlgorithm;
    int dot11CipherAlgorithm;
    int fOneXEnabled;
    EAP_METHOD_TYPE eapMethodType;
    uint dwEapConnectionDataLen;
    void* pEapConnectionData;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DOT11_MSSECURITY_SETTINGS サイズ: 36 バイト(x86)
dim st, 9    ; 4byte整数×9(構造体サイズ 36 / 4 切り上げ)
; dot11AuthAlgorithm : DOT11_AUTH_ALGORITHM (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dot11CipherAlgorithm : DOT11_CIPHER_ALGORITHM (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; fOneXEnabled : BOOL (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; eapMethodType : EAP_METHOD_TYPE (+12, 16byte)  varptr(st)+12 を基点に操作(16byte:入れ子/配列)
; dwEapConnectionDataLen : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; pEapConnectionData : BYTE* (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DOT11_MSSECURITY_SETTINGS サイズ: 40 バイト(x64)
dim st, 10    ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; dot11AuthAlgorithm : DOT11_AUTH_ALGORITHM (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dot11CipherAlgorithm : DOT11_CIPHER_ALGORITHM (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; fOneXEnabled : BOOL (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; eapMethodType : EAP_METHOD_TYPE (+12, 16byte)  varptr(st)+12 を基点に操作(16byte:入れ子/配列)
; dwEapConnectionDataLen : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; pEapConnectionData : BYTE* (+32, 8byte)  qpoke st,32,値 / qpeek(st,32)  ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global EAP_TYPE
    #field byte type
    #field int dwVendorId
    #field int dwVendorType
#endstruct

#defstruct global EAP_METHOD_TYPE
    #field EAP_TYPE eapType
    #field int dwAuthorId
#endstruct

#defstruct global DOT11_MSSECURITY_SETTINGS
    #field int dot11AuthAlgorithm
    #field int dot11CipherAlgorithm
    #field bool fOneXEnabled
    #field EAP_METHOD_TYPE eapMethodType
    #field int dwEapConnectionDataLen
    #field intptr pEapConnectionData
#endstruct

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