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

WLAN_AUTH_CIPHER_PAIR_LIST

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

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

フィールド

フィールドサイズx64x86説明
dwNumberOfItemsDWORD4+0+0pAuthCipherPairListに含まれる認証/暗号ペアの数。
pAuthCipherPairListDOT11_AUTH_CIPHER_PAIR8+4+4認証アルゴリズムと暗号アルゴリズムのペアの配列(可変長の先頭要素)。

各言語での定義

#include <windows.h>

// DOT11_AUTH_CIPHER_PAIR  (x64 8 / x86 8 バイト)
typedef struct DOT11_AUTH_CIPHER_PAIR {
    DOT11_AUTH_ALGORITHM AuthAlgoId;
    DOT11_CIPHER_ALGORITHM CipherAlgoId;
} DOT11_AUTH_CIPHER_PAIR;

// WLAN_AUTH_CIPHER_PAIR_LIST  (x64 12 / x86 12 バイト)
typedef struct WLAN_AUTH_CIPHER_PAIR_LIST {
    DWORD dwNumberOfItems;
    DOT11_AUTH_CIPHER_PAIR pAuthCipherPairList[1];
} WLAN_AUTH_CIPHER_PAIR_LIST;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DOT11_AUTH_CIPHER_PAIR
{
    public int AuthAlgoId;
    public int CipherAlgoId;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WLAN_AUTH_CIPHER_PAIR_LIST
{
    public uint dwNumberOfItems;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public DOT11_AUTH_CIPHER_PAIR[] pAuthCipherPairList;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DOT11_AUTH_CIPHER_PAIR
    Public AuthAlgoId As Integer
    Public CipherAlgoId As Integer
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WLAN_AUTH_CIPHER_PAIR_LIST
    Public dwNumberOfItems As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public pAuthCipherPairList() As DOT11_AUTH_CIPHER_PAIR
End Structure
import ctypes
from ctypes import wintypes

class DOT11_AUTH_CIPHER_PAIR(ctypes.Structure):
    _fields_ = [
        ("AuthAlgoId", ctypes.c_int),
        ("CipherAlgoId", ctypes.c_int),
    ]

class WLAN_AUTH_CIPHER_PAIR_LIST(ctypes.Structure):
    _fields_ = [
        ("dwNumberOfItems", wintypes.DWORD),
        ("pAuthCipherPairList", DOT11_AUTH_CIPHER_PAIR * 1),
    ]
#[repr(C)]
pub struct DOT11_AUTH_CIPHER_PAIR {
    pub AuthAlgoId: i32,
    pub CipherAlgoId: i32,
}

#[repr(C)]
pub struct WLAN_AUTH_CIPHER_PAIR_LIST {
    pub dwNumberOfItems: u32,
    pub pAuthCipherPairList: [DOT11_AUTH_CIPHER_PAIR; 1],
}
import "golang.org/x/sys/windows"

type DOT11_AUTH_CIPHER_PAIR struct {
	AuthAlgoId int32
	CipherAlgoId int32
}

type WLAN_AUTH_CIPHER_PAIR_LIST struct {
	dwNumberOfItems uint32
	pAuthCipherPairList [1]DOT11_AUTH_CIPHER_PAIR
}
type
  DOT11_AUTH_CIPHER_PAIR = record
    AuthAlgoId: Integer;
    CipherAlgoId: Integer;
  end;

  WLAN_AUTH_CIPHER_PAIR_LIST = record
    dwNumberOfItems: DWORD;
    pAuthCipherPairList: array[0..0] of DOT11_AUTH_CIPHER_PAIR;
  end;
const DOT11_AUTH_CIPHER_PAIR = extern struct {
    AuthAlgoId: i32,
    CipherAlgoId: i32,
};

const WLAN_AUTH_CIPHER_PAIR_LIST = extern struct {
    dwNumberOfItems: u32,
    pAuthCipherPairList: [1]DOT11_AUTH_CIPHER_PAIR,
};
type
  DOT11_AUTH_CIPHER_PAIR {.bycopy.} = object
    AuthAlgoId: int32
    CipherAlgoId: int32

  WLAN_AUTH_CIPHER_PAIR_LIST {.bycopy.} = object
    dwNumberOfItems: uint32
    pAuthCipherPairList: array[1, DOT11_AUTH_CIPHER_PAIR]
struct DOT11_AUTH_CIPHER_PAIR
{
    int AuthAlgoId;
    int CipherAlgoId;
}

struct WLAN_AUTH_CIPHER_PAIR_LIST
{
    uint dwNumberOfItems;
    DOT11_AUTH_CIPHER_PAIR[1] pAuthCipherPairList;
}

HSP用 定義

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

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

#defstruct global WLAN_AUTH_CIPHER_PAIR_LIST
    #field int dwNumberOfItems
    #field DOT11_AUTH_CIPHER_PAIR pAuthCipherPairList 1
#endstruct

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