ホーム › NetworkManagement.Ndis › NDIS_802_11_WEP
NDIS_802_11_WEP
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Length | DWORD | 4 | +0 | +0 | 本構造体の長さ(バイト)。 |
| KeyIndex | DWORD | 4 | +4 | +4 | WEPキーのインデックス。最上位ビットで送信キーを示す。 |
| KeyLength | DWORD | 4 | +8 | +8 | KeyMaterialのWEPキー長(バイト)。 |
| KeyMaterial | BYTE | 1 | +12 | +12 | WEPキーデータを格納する可変長配列の先頭バイト。 |
各言語での定義
#include <windows.h>
// NDIS_802_11_WEP (x64 16 / x86 16 バイト)
typedef struct NDIS_802_11_WEP {
DWORD Length;
DWORD KeyIndex;
DWORD KeyLength;
BYTE KeyMaterial[1];
} NDIS_802_11_WEP;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct NDIS_802_11_WEP
{
public uint Length;
public uint KeyIndex;
public uint KeyLength;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public byte[] KeyMaterial;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure NDIS_802_11_WEP
Public Length As UInteger
Public KeyIndex As UInteger
Public KeyLength As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public KeyMaterial() As Byte
End Structureimport ctypes
from ctypes import wintypes
class NDIS_802_11_WEP(ctypes.Structure):
_fields_ = [
("Length", wintypes.DWORD),
("KeyIndex", wintypes.DWORD),
("KeyLength", wintypes.DWORD),
("KeyMaterial", ctypes.c_ubyte * 1),
]#[repr(C)]
pub struct NDIS_802_11_WEP {
pub Length: u32,
pub KeyIndex: u32,
pub KeyLength: u32,
pub KeyMaterial: [u8; 1],
}import "golang.org/x/sys/windows"
type NDIS_802_11_WEP struct {
Length uint32
KeyIndex uint32
KeyLength uint32
KeyMaterial [1]byte
}type
NDIS_802_11_WEP = record
Length: DWORD;
KeyIndex: DWORD;
KeyLength: DWORD;
KeyMaterial: array[0..0] of Byte;
end;const NDIS_802_11_WEP = extern struct {
Length: u32,
KeyIndex: u32,
KeyLength: u32,
KeyMaterial: [1]u8,
};type
NDIS_802_11_WEP {.bycopy.} = object
Length: uint32
KeyIndex: uint32
KeyLength: uint32
KeyMaterial: array[1, uint8]struct NDIS_802_11_WEP
{
uint Length;
uint KeyIndex;
uint KeyLength;
ubyte[1] KeyMaterial;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; NDIS_802_11_WEP サイズ: 16 バイト(x64)
dim st, 4 ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; Length : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; KeyIndex : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; KeyLength : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; KeyMaterial : BYTE (+12, 1byte) varptr(st)+12 を基点に操作(1byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global NDIS_802_11_WEP
#field int Length
#field int KeyIndex
#field int KeyLength
#field byte KeyMaterial 1
#endstruct
stdim st, NDIS_802_11_WEP ; NSTRUCT 変数を確保
st->Length = 100
mes "Length=" + st->Length