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

WLAN_CONNECTION_PARAMETERS

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

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

フィールド

フィールドサイズx64x86説明
wlanConnectionModeWLAN_CONNECTION_MODE4+0+0使用する接続モード。
strProfileLPWSTR8/4+8+4接続に使用するプロファイル名またはプロファイルXML。NULL可。
pDot11SsidDOT11_SSID*8/4+16+8接続先SSIDへのポインタ。NULL可。
pDesiredBssidListDOT11_BSSID_LIST*8/4+24+12接続を希望するBSSIDリストへのポインタ。NULL可。
dot11BssTypeDOT11_BSS_TYPE4+32+16接続先BSSの種類(インフラ/独立)。
dwFlagsDWORD4+36+20接続動作を制御するフラグ。

各言語での定義

#include <windows.h>

// WLAN_CONNECTION_PARAMETERS  (x64 40 / x86 24 バイト)
typedef struct WLAN_CONNECTION_PARAMETERS {
    WLAN_CONNECTION_MODE wlanConnectionMode;
    LPWSTR strProfile;
    DOT11_SSID* pDot11Ssid;
    DOT11_BSSID_LIST* pDesiredBssidList;
    DOT11_BSS_TYPE dot11BssType;
    DWORD dwFlags;
} WLAN_CONNECTION_PARAMETERS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WLAN_CONNECTION_PARAMETERS
{
    public int wlanConnectionMode;
    public IntPtr strProfile;
    public IntPtr pDot11Ssid;
    public IntPtr pDesiredBssidList;
    public int dot11BssType;
    public uint dwFlags;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WLAN_CONNECTION_PARAMETERS
    Public wlanConnectionMode As Integer
    Public strProfile As IntPtr
    Public pDot11Ssid As IntPtr
    Public pDesiredBssidList As IntPtr
    Public dot11BssType As Integer
    Public dwFlags As UInteger
End Structure
import ctypes
from ctypes import wintypes

class WLAN_CONNECTION_PARAMETERS(ctypes.Structure):
    _fields_ = [
        ("wlanConnectionMode", ctypes.c_int),
        ("strProfile", ctypes.c_void_p),
        ("pDot11Ssid", ctypes.c_void_p),
        ("pDesiredBssidList", ctypes.c_void_p),
        ("dot11BssType", ctypes.c_int),
        ("dwFlags", wintypes.DWORD),
    ]
#[repr(C)]
pub struct WLAN_CONNECTION_PARAMETERS {
    pub wlanConnectionMode: i32,
    pub strProfile: *mut core::ffi::c_void,
    pub pDot11Ssid: *mut core::ffi::c_void,
    pub pDesiredBssidList: *mut core::ffi::c_void,
    pub dot11BssType: i32,
    pub dwFlags: u32,
}
import "golang.org/x/sys/windows"

type WLAN_CONNECTION_PARAMETERS struct {
	wlanConnectionMode int32
	strProfile uintptr
	pDot11Ssid uintptr
	pDesiredBssidList uintptr
	dot11BssType int32
	dwFlags uint32
}
type
  WLAN_CONNECTION_PARAMETERS = record
    wlanConnectionMode: Integer;
    strProfile: Pointer;
    pDot11Ssid: Pointer;
    pDesiredBssidList: Pointer;
    dot11BssType: Integer;
    dwFlags: DWORD;
  end;
const WLAN_CONNECTION_PARAMETERS = extern struct {
    wlanConnectionMode: i32,
    strProfile: ?*anyopaque,
    pDot11Ssid: ?*anyopaque,
    pDesiredBssidList: ?*anyopaque,
    dot11BssType: i32,
    dwFlags: u32,
};
type
  WLAN_CONNECTION_PARAMETERS {.bycopy.} = object
    wlanConnectionMode: int32
    strProfile: pointer
    pDot11Ssid: pointer
    pDesiredBssidList: pointer
    dot11BssType: int32
    dwFlags: uint32
struct WLAN_CONNECTION_PARAMETERS
{
    int wlanConnectionMode;
    void* strProfile;
    void* pDot11Ssid;
    void* pDesiredBssidList;
    int dot11BssType;
    uint dwFlags;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; WLAN_CONNECTION_PARAMETERS サイズ: 24 バイト(x86)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; wlanConnectionMode : WLAN_CONNECTION_MODE (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; strProfile : LPWSTR (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; pDot11Ssid : DOT11_SSID* (+8, 4byte)  varptr(st)+8 を基点に操作(4byte:入れ子/配列)
; pDesiredBssidList : DOT11_BSSID_LIST* (+12, 4byte)  varptr(st)+12 を基点に操作(4byte:入れ子/配列)
; dot11BssType : DOT11_BSS_TYPE (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; dwFlags : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WLAN_CONNECTION_PARAMETERS サイズ: 40 バイト(x64)
dim st, 10    ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; wlanConnectionMode : WLAN_CONNECTION_MODE (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; strProfile : LPWSTR (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; pDot11Ssid : DOT11_SSID* (+16, 8byte)  varptr(st)+16 を基点に操作(8byte:入れ子/配列)
; pDesiredBssidList : DOT11_BSSID_LIST* (+24, 8byte)  varptr(st)+24 を基点に操作(8byte:入れ子/配列)
; dot11BssType : DOT11_BSS_TYPE (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; dwFlags : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global WLAN_CONNECTION_PARAMETERS
    #field int wlanConnectionMode
    #field intptr strProfile
    #field intptr pDot11Ssid
    #field intptr pDesiredBssidList
    #field int dot11BssType
    #field int dwFlags
#endstruct

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