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

PPP_CCP_INFO

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

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

フィールド

フィールドサイズx64x86説明
dwErrorDWORD4+0+0CCP(圧縮制御プロトコル)のエラーコード。0なら正常。
dwCompressionAlgorithmDWORD4+4+4ローカルが使用する圧縮アルゴリズム。
dwOptionsDWORD4+8+8ローカルのCCPオプションフラグ。
dwRemoteCompressionAlgorithmDWORD4+12+12リモートが使用する圧縮アルゴリズム。
dwRemoteOptionsDWORD4+16+16リモートのCCPオプションフラグ。

各言語での定義

#include <windows.h>

// PPP_CCP_INFO  (x64 20 / x86 20 バイト)
typedef struct PPP_CCP_INFO {
    DWORD dwError;
    DWORD dwCompressionAlgorithm;
    DWORD dwOptions;
    DWORD dwRemoteCompressionAlgorithm;
    DWORD dwRemoteOptions;
} PPP_CCP_INFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct PPP_CCP_INFO
{
    public uint dwError;
    public uint dwCompressionAlgorithm;
    public uint dwOptions;
    public uint dwRemoteCompressionAlgorithm;
    public uint dwRemoteOptions;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure PPP_CCP_INFO
    Public dwError As UInteger
    Public dwCompressionAlgorithm As UInteger
    Public dwOptions As UInteger
    Public dwRemoteCompressionAlgorithm As UInteger
    Public dwRemoteOptions As UInteger
End Structure
import ctypes
from ctypes import wintypes

class PPP_CCP_INFO(ctypes.Structure):
    _fields_ = [
        ("dwError", wintypes.DWORD),
        ("dwCompressionAlgorithm", wintypes.DWORD),
        ("dwOptions", wintypes.DWORD),
        ("dwRemoteCompressionAlgorithm", wintypes.DWORD),
        ("dwRemoteOptions", wintypes.DWORD),
    ]
#[repr(C)]
pub struct PPP_CCP_INFO {
    pub dwError: u32,
    pub dwCompressionAlgorithm: u32,
    pub dwOptions: u32,
    pub dwRemoteCompressionAlgorithm: u32,
    pub dwRemoteOptions: u32,
}
import "golang.org/x/sys/windows"

type PPP_CCP_INFO struct {
	dwError uint32
	dwCompressionAlgorithm uint32
	dwOptions uint32
	dwRemoteCompressionAlgorithm uint32
	dwRemoteOptions uint32
}
type
  PPP_CCP_INFO = record
    dwError: DWORD;
    dwCompressionAlgorithm: DWORD;
    dwOptions: DWORD;
    dwRemoteCompressionAlgorithm: DWORD;
    dwRemoteOptions: DWORD;
  end;
const PPP_CCP_INFO = extern struct {
    dwError: u32,
    dwCompressionAlgorithm: u32,
    dwOptions: u32,
    dwRemoteCompressionAlgorithm: u32,
    dwRemoteOptions: u32,
};
type
  PPP_CCP_INFO {.bycopy.} = object
    dwError: uint32
    dwCompressionAlgorithm: uint32
    dwOptions: uint32
    dwRemoteCompressionAlgorithm: uint32
    dwRemoteOptions: uint32
struct PPP_CCP_INFO
{
    uint dwError;
    uint dwCompressionAlgorithm;
    uint dwOptions;
    uint dwRemoteCompressionAlgorithm;
    uint dwRemoteOptions;
}

HSP用 定義

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

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

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