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