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

WLAN_SECURITY_ATTRIBUTES

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

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

フィールド

フィールドサイズx64x86説明
bSecurityEnabledBOOL4+0+0セキュリティが有効かを示す真偽値。
bOneXEnabledBOOL4+4+4802.1X認証が有効かを示す真偽値。
dot11AuthAlgorithmDOT11_AUTH_ALGORITHM4+8+8使用している認証アルゴリズム。
dot11CipherAlgorithmDOT11_CIPHER_ALGORITHM4+12+12使用している暗号アルゴリズム。

各言語での定義

#include <windows.h>

// WLAN_SECURITY_ATTRIBUTES  (x64 16 / x86 16 バイト)
typedef struct WLAN_SECURITY_ATTRIBUTES {
    BOOL bSecurityEnabled;
    BOOL bOneXEnabled;
    DOT11_AUTH_ALGORITHM dot11AuthAlgorithm;
    DOT11_CIPHER_ALGORITHM dot11CipherAlgorithm;
} WLAN_SECURITY_ATTRIBUTES;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WLAN_SECURITY_ATTRIBUTES
{
    [MarshalAs(UnmanagedType.Bool)] public bool bSecurityEnabled;
    [MarshalAs(UnmanagedType.Bool)] public bool bOneXEnabled;
    public int dot11AuthAlgorithm;
    public int dot11CipherAlgorithm;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WLAN_SECURITY_ATTRIBUTES
    <MarshalAs(UnmanagedType.Bool)> Public bSecurityEnabled As Boolean
    <MarshalAs(UnmanagedType.Bool)> Public bOneXEnabled As Boolean
    Public dot11AuthAlgorithm As Integer
    Public dot11CipherAlgorithm As Integer
End Structure
import ctypes
from ctypes import wintypes

class WLAN_SECURITY_ATTRIBUTES(ctypes.Structure):
    _fields_ = [
        ("bSecurityEnabled", wintypes.BOOL),
        ("bOneXEnabled", wintypes.BOOL),
        ("dot11AuthAlgorithm", ctypes.c_int),
        ("dot11CipherAlgorithm", ctypes.c_int),
    ]
#[repr(C)]
pub struct WLAN_SECURITY_ATTRIBUTES {
    pub bSecurityEnabled: i32,
    pub bOneXEnabled: i32,
    pub dot11AuthAlgorithm: i32,
    pub dot11CipherAlgorithm: i32,
}
import "golang.org/x/sys/windows"

type WLAN_SECURITY_ATTRIBUTES struct {
	bSecurityEnabled int32
	bOneXEnabled int32
	dot11AuthAlgorithm int32
	dot11CipherAlgorithm int32
}
type
  WLAN_SECURITY_ATTRIBUTES = record
    bSecurityEnabled: BOOL;
    bOneXEnabled: BOOL;
    dot11AuthAlgorithm: Integer;
    dot11CipherAlgorithm: Integer;
  end;
const WLAN_SECURITY_ATTRIBUTES = extern struct {
    bSecurityEnabled: i32,
    bOneXEnabled: i32,
    dot11AuthAlgorithm: i32,
    dot11CipherAlgorithm: i32,
};
type
  WLAN_SECURITY_ATTRIBUTES {.bycopy.} = object
    bSecurityEnabled: int32
    bOneXEnabled: int32
    dot11AuthAlgorithm: int32
    dot11CipherAlgorithm: int32
struct WLAN_SECURITY_ATTRIBUTES
{
    int bSecurityEnabled;
    int bOneXEnabled;
    int dot11AuthAlgorithm;
    int dot11CipherAlgorithm;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WLAN_SECURITY_ATTRIBUTES サイズ: 16 バイト(x64)
dim st, 4    ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; bSecurityEnabled : BOOL (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; bOneXEnabled : BOOL (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dot11AuthAlgorithm : DOT11_AUTH_ALGORITHM (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; dot11CipherAlgorithm : DOT11_CIPHER_ALGORITHM (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global WLAN_SECURITY_ATTRIBUTES
    #field bool bSecurityEnabled
    #field bool bOneXEnabled
    #field int dot11AuthAlgorithm
    #field int dot11CipherAlgorithm
#endstruct

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