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+0PPP 制御プロトコルのネゴシエーションの結果を指定します。値が 0 の場合は成功を示します。0 以外の値は失敗を示し、制御プロトコルのネゴシエーション中に発生した実際の致命的なエラーを表します。
wszAddressWCHAR46+4+4RAS 接続におけるクライアントの IPX アドレスを保持する Unicode 文字列を指定します。このアドレス文字列は net.node の形式であり、たとえば "1234ABCD.12AB34CD56EF" のようになります。

公式ドキュメント

PPP_IPXCP_INFO 構造体は、PPP の Internetwork Packet Exchange (IPX) プロジェクション操作の結果を格納します。

解説(Remarks)

PPP_IPXCP_INFO 構造体は、32 ビット版の Windows Server 2003 またはそれ以前のオペレーティング システムを実行しているコンピューターを管理する場合にのみ使用できます。Windows 2000 64-bit Edition は IPX プロトコルをサポートしていません。

出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)

各言語での定義

#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