ホーム › NetworkManagement.Rras › RASAMBW
RASAMBW
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwSize | DWORD | 4 | +0 | +0 | この構造体のバイト単位のサイズ。 |
| dwError | DWORD | 4 | +4 | +4 | AMB(認証メッセージブロック)処理中のエラーコード。0なら正常。 |
| szNetBiosError | WCHAR | 34 | +8 | +8 | NetBIOSエラーが発生した場合のエラー名(ワイド文字列)。 |
| bLana | BYTE | 1 | +42 | +42 | 接続に割り当てられたNetBIOSのLANアダプタ番号(LANA)。 |
各言語での定義
#include <windows.h>
// RASAMBW (x64 44 / x86 44 バイト)
typedef struct RASAMBW {
DWORD dwSize;
DWORD dwError;
WCHAR szNetBiosError[17];
BYTE bLana;
} RASAMBW;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RASAMBW
{
public uint dwSize;
public uint dwError;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 17)] public string szNetBiosError;
public byte bLana;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RASAMBW
Public dwSize As UInteger
Public dwError As UInteger
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=17)> Public szNetBiosError As String
Public bLana As Byte
End Structureimport ctypes
from ctypes import wintypes
class RASAMBW(ctypes.Structure):
_fields_ = [
("dwSize", wintypes.DWORD),
("dwError", wintypes.DWORD),
("szNetBiosError", ctypes.c_wchar * 17),
("bLana", ctypes.c_ubyte),
]#[repr(C)]
pub struct RASAMBW {
pub dwSize: u32,
pub dwError: u32,
pub szNetBiosError: [u16; 17],
pub bLana: u8,
}import "golang.org/x/sys/windows"
type RASAMBW struct {
dwSize uint32
dwError uint32
szNetBiosError [17]uint16
bLana byte
}type
RASAMBW = record
dwSize: DWORD;
dwError: DWORD;
szNetBiosError: array[0..16] of WideChar;
bLana: Byte;
end;const RASAMBW = extern struct {
dwSize: u32,
dwError: u32,
szNetBiosError: [17]u16,
bLana: u8,
};type
RASAMBW {.bycopy.} = object
dwSize: uint32
dwError: uint32
szNetBiosError: array[17, uint16]
bLana: uint8struct RASAMBW
{
uint dwSize;
uint dwError;
wchar[17] szNetBiosError;
ubyte bLana;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; RASAMBW サイズ: 44 バイト(x64)
dim st, 11 ; 4byte整数×11(構造体サイズ 44 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwError : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; szNetBiosError : WCHAR (+8, 34byte) varptr(st)+8 を基点に操作(34byte:入れ子/配列)
; bLana : BYTE (+42, 1byte) poke st,42,値 / 値 = peek(st,42)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global RASAMBW
#field int dwSize
#field int dwError
#field wchar szNetBiosError 17
#field byte bLana
#endstruct
stdim st, RASAMBW ; NSTRUCT 変数を確保
st->dwSize = 100
mes "dwSize=" + st->dwSize