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

NDIS_802_11_CAPABILITY

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

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

フィールド

フィールドサイズx64x86説明
LengthDWORD4+0+0本構造体の長さ(バイト)。
VersionDWORD4+4+4本構造体のバージョン番号。
NoOfPMKIDsDWORD4+8+8サポートするPMKIDの最大数。
NoOfAuthEncryptPairsSupportedDWORD4+12+12AuthenticationEncryptionSupported配列の要素数。
AuthenticationEncryptionSupportedNDIS_802_11_AUTHENTICATION_ENCRYPTION8+16+16サポートする認証・暗号化方式の組を格納する可変長配列の先頭要素。

各言語での定義

#include <windows.h>

// NDIS_802_11_AUTHENTICATION_ENCRYPTION  (x64 8 / x86 8 バイト)
typedef struct NDIS_802_11_AUTHENTICATION_ENCRYPTION {
    NDIS_802_11_AUTHENTICATION_MODE AuthModeSupported;
    NDIS_802_11_WEP_STATUS EncryptStatusSupported;
} NDIS_802_11_AUTHENTICATION_ENCRYPTION;

// NDIS_802_11_CAPABILITY  (x64 24 / x86 24 バイト)
typedef struct NDIS_802_11_CAPABILITY {
    DWORD Length;
    DWORD Version;
    DWORD NoOfPMKIDs;
    DWORD NoOfAuthEncryptPairsSupported;
    NDIS_802_11_AUTHENTICATION_ENCRYPTION AuthenticationEncryptionSupported[1];
} NDIS_802_11_CAPABILITY;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct NDIS_802_11_AUTHENTICATION_ENCRYPTION
{
    public int AuthModeSupported;
    public int EncryptStatusSupported;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct NDIS_802_11_CAPABILITY
{
    public uint Length;
    public uint Version;
    public uint NoOfPMKIDs;
    public uint NoOfAuthEncryptPairsSupported;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public NDIS_802_11_AUTHENTICATION_ENCRYPTION[] AuthenticationEncryptionSupported;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure NDIS_802_11_AUTHENTICATION_ENCRYPTION
    Public AuthModeSupported As Integer
    Public EncryptStatusSupported As Integer
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure NDIS_802_11_CAPABILITY
    Public Length As UInteger
    Public Version As UInteger
    Public NoOfPMKIDs As UInteger
    Public NoOfAuthEncryptPairsSupported As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public AuthenticationEncryptionSupported() As NDIS_802_11_AUTHENTICATION_ENCRYPTION
End Structure
import ctypes
from ctypes import wintypes

class NDIS_802_11_AUTHENTICATION_ENCRYPTION(ctypes.Structure):
    _fields_ = [
        ("AuthModeSupported", ctypes.c_int),
        ("EncryptStatusSupported", ctypes.c_int),
    ]

class NDIS_802_11_CAPABILITY(ctypes.Structure):
    _fields_ = [
        ("Length", wintypes.DWORD),
        ("Version", wintypes.DWORD),
        ("NoOfPMKIDs", wintypes.DWORD),
        ("NoOfAuthEncryptPairsSupported", wintypes.DWORD),
        ("AuthenticationEncryptionSupported", NDIS_802_11_AUTHENTICATION_ENCRYPTION * 1),
    ]
#[repr(C)]
pub struct NDIS_802_11_AUTHENTICATION_ENCRYPTION {
    pub AuthModeSupported: i32,
    pub EncryptStatusSupported: i32,
}

#[repr(C)]
pub struct NDIS_802_11_CAPABILITY {
    pub Length: u32,
    pub Version: u32,
    pub NoOfPMKIDs: u32,
    pub NoOfAuthEncryptPairsSupported: u32,
    pub AuthenticationEncryptionSupported: [NDIS_802_11_AUTHENTICATION_ENCRYPTION; 1],
}
import "golang.org/x/sys/windows"

type NDIS_802_11_AUTHENTICATION_ENCRYPTION struct {
	AuthModeSupported int32
	EncryptStatusSupported int32
}

type NDIS_802_11_CAPABILITY struct {
	Length uint32
	Version uint32
	NoOfPMKIDs uint32
	NoOfAuthEncryptPairsSupported uint32
	AuthenticationEncryptionSupported [1]NDIS_802_11_AUTHENTICATION_ENCRYPTION
}
type
  NDIS_802_11_AUTHENTICATION_ENCRYPTION = record
    AuthModeSupported: Integer;
    EncryptStatusSupported: Integer;
  end;

  NDIS_802_11_CAPABILITY = record
    Length: DWORD;
    Version: DWORD;
    NoOfPMKIDs: DWORD;
    NoOfAuthEncryptPairsSupported: DWORD;
    AuthenticationEncryptionSupported: array[0..0] of NDIS_802_11_AUTHENTICATION_ENCRYPTION;
  end;
const NDIS_802_11_AUTHENTICATION_ENCRYPTION = extern struct {
    AuthModeSupported: i32,
    EncryptStatusSupported: i32,
};

const NDIS_802_11_CAPABILITY = extern struct {
    Length: u32,
    Version: u32,
    NoOfPMKIDs: u32,
    NoOfAuthEncryptPairsSupported: u32,
    AuthenticationEncryptionSupported: [1]NDIS_802_11_AUTHENTICATION_ENCRYPTION,
};
type
  NDIS_802_11_AUTHENTICATION_ENCRYPTION {.bycopy.} = object
    AuthModeSupported: int32
    EncryptStatusSupported: int32

  NDIS_802_11_CAPABILITY {.bycopy.} = object
    Length: uint32
    Version: uint32
    NoOfPMKIDs: uint32
    NoOfAuthEncryptPairsSupported: uint32
    AuthenticationEncryptionSupported: array[1, NDIS_802_11_AUTHENTICATION_ENCRYPTION]
struct NDIS_802_11_AUTHENTICATION_ENCRYPTION
{
    int AuthModeSupported;
    int EncryptStatusSupported;
}

struct NDIS_802_11_CAPABILITY
{
    uint Length;
    uint Version;
    uint NoOfPMKIDs;
    uint NoOfAuthEncryptPairsSupported;
    NDIS_802_11_AUTHENTICATION_ENCRYPTION[1] AuthenticationEncryptionSupported;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; NDIS_802_11_CAPABILITY サイズ: 24 バイト(x64)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; Length : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; Version : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; NoOfPMKIDs : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; NoOfAuthEncryptPairsSupported : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; AuthenticationEncryptionSupported : NDIS_802_11_AUTHENTICATION_ENCRYPTION (+16, 8byte)  varptr(st)+16 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global NDIS_802_11_AUTHENTICATION_ENCRYPTION
    #field int AuthModeSupported
    #field int EncryptStatusSupported
#endstruct

#defstruct global NDIS_802_11_CAPABILITY
    #field int Length
    #field int Version
    #field int NoOfPMKIDs
    #field int NoOfAuthEncryptPairsSupported
    #field NDIS_802_11_AUTHENTICATION_ENCRYPTION AuthenticationEncryptionSupported 1
#endstruct

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