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

DOT11_KEY_ALGO_BIP_GMAC_256

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

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

フィールド

フィールドサイズx64x86説明
ucIPNBYTE6+0+0BIP-GMAC-256 のパケット番号(IPN、6バイト)。
ulBIPGmac256KeyLengthDWORD4+8+8BIP-GMAC-256 鍵のバイト長を表す。
ucBIPGmac256KeyBYTE1+12+12BIP-GMAC-256 鍵データを格納するバイト配列。可変長。

各言語での定義

#include <windows.h>

// DOT11_KEY_ALGO_BIP_GMAC_256  (x64 16 / x86 16 バイト)
typedef struct DOT11_KEY_ALGO_BIP_GMAC_256 {
    BYTE ucIPN[6];
    DWORD ulBIPGmac256KeyLength;
    BYTE ucBIPGmac256Key[1];
} DOT11_KEY_ALGO_BIP_GMAC_256;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DOT11_KEY_ALGO_BIP_GMAC_256
{
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] public byte[] ucIPN;
    public uint ulBIPGmac256KeyLength;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public byte[] ucBIPGmac256Key;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DOT11_KEY_ALGO_BIP_GMAC_256
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=6)> Public ucIPN() As Byte
    Public ulBIPGmac256KeyLength As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public ucBIPGmac256Key() As Byte
End Structure
import ctypes
from ctypes import wintypes

class DOT11_KEY_ALGO_BIP_GMAC_256(ctypes.Structure):
    _fields_ = [
        ("ucIPN", ctypes.c_ubyte * 6),
        ("ulBIPGmac256KeyLength", wintypes.DWORD),
        ("ucBIPGmac256Key", ctypes.c_ubyte * 1),
    ]
#[repr(C)]
pub struct DOT11_KEY_ALGO_BIP_GMAC_256 {
    pub ucIPN: [u8; 6],
    pub ulBIPGmac256KeyLength: u32,
    pub ucBIPGmac256Key: [u8; 1],
}
import "golang.org/x/sys/windows"

type DOT11_KEY_ALGO_BIP_GMAC_256 struct {
	ucIPN [6]byte
	ulBIPGmac256KeyLength uint32
	ucBIPGmac256Key [1]byte
}
type
  DOT11_KEY_ALGO_BIP_GMAC_256 = record
    ucIPN: array[0..5] of Byte;
    ulBIPGmac256KeyLength: DWORD;
    ucBIPGmac256Key: array[0..0] of Byte;
  end;
const DOT11_KEY_ALGO_BIP_GMAC_256 = extern struct {
    ucIPN: [6]u8,
    ulBIPGmac256KeyLength: u32,
    ucBIPGmac256Key: [1]u8,
};
type
  DOT11_KEY_ALGO_BIP_GMAC_256 {.bycopy.} = object
    ucIPN: array[6, uint8]
    ulBIPGmac256KeyLength: uint32
    ucBIPGmac256Key: array[1, uint8]
struct DOT11_KEY_ALGO_BIP_GMAC_256
{
    ubyte[6] ucIPN;
    uint ulBIPGmac256KeyLength;
    ubyte[1] ucBIPGmac256Key;
}

HSP用 定義

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

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

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