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

DOT11_CURRENT_OPTIONAL_CAPABILITY

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

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

フィールド

フィールドサイズx64x86説明
uReservedDWORD4+0+0予約フィールド。ゼロを設定する。
bDot11CFPollableBOOLEAN1+4+4CF ポーリング可能か示すフラグ。
bDot11PCFBOOLEAN1+5+5PCF 機能が有効か示すフラグ。
bDot11PCFMPDUTransferToPCBOOLEAN1+6+6PCF による MPDU の PC への転送が有効か示すフラグ。
bStrictlyOrderedServiceClassBOOLEAN1+7+7厳密順序サービスクラスが有効か示すフラグ。

各言語での定義

#include <windows.h>

// DOT11_CURRENT_OPTIONAL_CAPABILITY  (x64 8 / x86 8 バイト)
typedef struct DOT11_CURRENT_OPTIONAL_CAPABILITY {
    DWORD uReserved;
    BOOLEAN bDot11CFPollable;
    BOOLEAN bDot11PCF;
    BOOLEAN bDot11PCFMPDUTransferToPC;
    BOOLEAN bStrictlyOrderedServiceClass;
} DOT11_CURRENT_OPTIONAL_CAPABILITY;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DOT11_CURRENT_OPTIONAL_CAPABILITY
{
    public uint uReserved;
    [MarshalAs(UnmanagedType.U1)] public bool bDot11CFPollable;
    [MarshalAs(UnmanagedType.U1)] public bool bDot11PCF;
    [MarshalAs(UnmanagedType.U1)] public bool bDot11PCFMPDUTransferToPC;
    [MarshalAs(UnmanagedType.U1)] public bool bStrictlyOrderedServiceClass;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DOT11_CURRENT_OPTIONAL_CAPABILITY
    Public uReserved As UInteger
    <MarshalAs(UnmanagedType.U1)> Public bDot11CFPollable As Boolean
    <MarshalAs(UnmanagedType.U1)> Public bDot11PCF As Boolean
    <MarshalAs(UnmanagedType.U1)> Public bDot11PCFMPDUTransferToPC As Boolean
    <MarshalAs(UnmanagedType.U1)> Public bStrictlyOrderedServiceClass As Boolean
End Structure
import ctypes
from ctypes import wintypes

class DOT11_CURRENT_OPTIONAL_CAPABILITY(ctypes.Structure):
    _fields_ = [
        ("uReserved", wintypes.DWORD),
        ("bDot11CFPollable", ctypes.c_byte),
        ("bDot11PCF", ctypes.c_byte),
        ("bDot11PCFMPDUTransferToPC", ctypes.c_byte),
        ("bStrictlyOrderedServiceClass", ctypes.c_byte),
    ]
#[repr(C)]
pub struct DOT11_CURRENT_OPTIONAL_CAPABILITY {
    pub uReserved: u32,
    pub bDot11CFPollable: u8,
    pub bDot11PCF: u8,
    pub bDot11PCFMPDUTransferToPC: u8,
    pub bStrictlyOrderedServiceClass: u8,
}
import "golang.org/x/sys/windows"

type DOT11_CURRENT_OPTIONAL_CAPABILITY struct {
	uReserved uint32
	bDot11CFPollable byte
	bDot11PCF byte
	bDot11PCFMPDUTransferToPC byte
	bStrictlyOrderedServiceClass byte
}
type
  DOT11_CURRENT_OPTIONAL_CAPABILITY = record
    uReserved: DWORD;
    bDot11CFPollable: ByteBool;
    bDot11PCF: ByteBool;
    bDot11PCFMPDUTransferToPC: ByteBool;
    bStrictlyOrderedServiceClass: ByteBool;
  end;
const DOT11_CURRENT_OPTIONAL_CAPABILITY = extern struct {
    uReserved: u32,
    bDot11CFPollable: u8,
    bDot11PCF: u8,
    bDot11PCFMPDUTransferToPC: u8,
    bStrictlyOrderedServiceClass: u8,
};
type
  DOT11_CURRENT_OPTIONAL_CAPABILITY {.bycopy.} = object
    uReserved: uint32
    bDot11CFPollable: uint8
    bDot11PCF: uint8
    bDot11PCFMPDUTransferToPC: uint8
    bStrictlyOrderedServiceClass: uint8
struct DOT11_CURRENT_OPTIONAL_CAPABILITY
{
    uint uReserved;
    ubyte bDot11CFPollable;
    ubyte bDot11PCF;
    ubyte bDot11PCFMPDUTransferToPC;
    ubyte bStrictlyOrderedServiceClass;
}

HSP用 定義

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

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

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