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