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

PPP_IPXCP_INFO

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

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

フィールド

フィールドサイズx64x86説明
dwErrorDWORD4+0+0IPXCP(IPX制御プロトコル)のエラーコード。0なら正常。
wszAddressWCHAR46+4+4割り当てられたIPXアドレス(ワイド文字列)。

各言語での定義

#include <windows.h>

// PPP_IPXCP_INFO  (x64 52 / x86 52 バイト)
typedef struct PPP_IPXCP_INFO {
    DWORD dwError;
    WCHAR wszAddress[23];
} PPP_IPXCP_INFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct PPP_IPXCP_INFO
{
    public uint dwError;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 23)] public string wszAddress;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure PPP_IPXCP_INFO
    Public dwError As UInteger
    <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=23)> Public wszAddress As String
End Structure
import ctypes
from ctypes import wintypes

class PPP_IPXCP_INFO(ctypes.Structure):
    _fields_ = [
        ("dwError", wintypes.DWORD),
        ("wszAddress", ctypes.c_wchar * 23),
    ]
#[repr(C)]
pub struct PPP_IPXCP_INFO {
    pub dwError: u32,
    pub wszAddress: [u16; 23],
}
import "golang.org/x/sys/windows"

type PPP_IPXCP_INFO struct {
	dwError uint32
	wszAddress [23]uint16
}
type
  PPP_IPXCP_INFO = record
    dwError: DWORD;
    wszAddress: array[0..22] of WideChar;
  end;
const PPP_IPXCP_INFO = extern struct {
    dwError: u32,
    wszAddress: [23]u16,
};
type
  PPP_IPXCP_INFO {.bycopy.} = object
    dwError: uint32
    wszAddress: array[23, uint16]
struct PPP_IPXCP_INFO
{
    uint dwError;
    wchar[23] wszAddress;
}

HSP用 定義

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

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

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