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

WLAN_RADIO_STATE

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

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

フィールド

フィールドサイズx64x86説明
dwNumberOfPhysDWORD4+0+0PhyRadioStateに含まれるPHYの数。
PhyRadioStateWLAN_PHY_RADIO_STATE768+4+4各PHYの無線状態の配列。

各言語での定義

#include <windows.h>

// WLAN_PHY_RADIO_STATE  (x64 12 / x86 12 バイト)
typedef struct WLAN_PHY_RADIO_STATE {
    DWORD dwPhyIndex;
    DOT11_RADIO_STATE dot11SoftwareRadioState;
    DOT11_RADIO_STATE dot11HardwareRadioState;
} WLAN_PHY_RADIO_STATE;

// WLAN_RADIO_STATE  (x64 772 / x86 772 バイト)
typedef struct WLAN_RADIO_STATE {
    DWORD dwNumberOfPhys;
    WLAN_PHY_RADIO_STATE PhyRadioState[64];
} WLAN_RADIO_STATE;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WLAN_PHY_RADIO_STATE
{
    public uint dwPhyIndex;
    public int dot11SoftwareRadioState;
    public int dot11HardwareRadioState;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WLAN_RADIO_STATE
{
    public uint dwNumberOfPhys;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] public WLAN_PHY_RADIO_STATE[] PhyRadioState;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WLAN_PHY_RADIO_STATE
    Public dwPhyIndex As UInteger
    Public dot11SoftwareRadioState As Integer
    Public dot11HardwareRadioState As Integer
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WLAN_RADIO_STATE
    Public dwNumberOfPhys As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=64)> Public PhyRadioState() As WLAN_PHY_RADIO_STATE
End Structure
import ctypes
from ctypes import wintypes

class WLAN_PHY_RADIO_STATE(ctypes.Structure):
    _fields_ = [
        ("dwPhyIndex", wintypes.DWORD),
        ("dot11SoftwareRadioState", ctypes.c_int),
        ("dot11HardwareRadioState", ctypes.c_int),
    ]

class WLAN_RADIO_STATE(ctypes.Structure):
    _fields_ = [
        ("dwNumberOfPhys", wintypes.DWORD),
        ("PhyRadioState", WLAN_PHY_RADIO_STATE * 64),
    ]
#[repr(C)]
pub struct WLAN_PHY_RADIO_STATE {
    pub dwPhyIndex: u32,
    pub dot11SoftwareRadioState: i32,
    pub dot11HardwareRadioState: i32,
}

#[repr(C)]
pub struct WLAN_RADIO_STATE {
    pub dwNumberOfPhys: u32,
    pub PhyRadioState: [WLAN_PHY_RADIO_STATE; 64],
}
import "golang.org/x/sys/windows"

type WLAN_PHY_RADIO_STATE struct {
	dwPhyIndex uint32
	dot11SoftwareRadioState int32
	dot11HardwareRadioState int32
}

type WLAN_RADIO_STATE struct {
	dwNumberOfPhys uint32
	PhyRadioState [64]WLAN_PHY_RADIO_STATE
}
type
  WLAN_PHY_RADIO_STATE = record
    dwPhyIndex: DWORD;
    dot11SoftwareRadioState: Integer;
    dot11HardwareRadioState: Integer;
  end;

  WLAN_RADIO_STATE = record
    dwNumberOfPhys: DWORD;
    PhyRadioState: array[0..63] of WLAN_PHY_RADIO_STATE;
  end;
const WLAN_PHY_RADIO_STATE = extern struct {
    dwPhyIndex: u32,
    dot11SoftwareRadioState: i32,
    dot11HardwareRadioState: i32,
};

const WLAN_RADIO_STATE = extern struct {
    dwNumberOfPhys: u32,
    PhyRadioState: [64]WLAN_PHY_RADIO_STATE,
};
type
  WLAN_PHY_RADIO_STATE {.bycopy.} = object
    dwPhyIndex: uint32
    dot11SoftwareRadioState: int32
    dot11HardwareRadioState: int32

  WLAN_RADIO_STATE {.bycopy.} = object
    dwNumberOfPhys: uint32
    PhyRadioState: array[64, WLAN_PHY_RADIO_STATE]
struct WLAN_PHY_RADIO_STATE
{
    uint dwPhyIndex;
    int dot11SoftwareRadioState;
    int dot11HardwareRadioState;
}

struct WLAN_RADIO_STATE
{
    uint dwNumberOfPhys;
    WLAN_PHY_RADIO_STATE[64] PhyRadioState;
}

HSP用 定義

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

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

#defstruct global WLAN_RADIO_STATE
    #field int dwNumberOfPhys
    #field WLAN_PHY_RADIO_STATE PhyRadioState 64
#endstruct

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