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

RASPPPCCP

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

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

フィールド

フィールドサイズx64x86説明
dwSizeDWORD4+0+0この構造体のバイト単位のサイズ。
dwErrorDWORD4+4+4CCP(圧縮制御プロトコル)ネゴシエーションのエラーコード。0なら正常。
dwCompressionAlgorithmDWORD4+8+8クライアントが使用する圧縮アルゴリズム(RASCCPCA_*)。
dwOptionsDWORD4+12+12クライアントのCCPオプションフラグ(RASCCPO_*)。
dwServerCompressionAlgorithmDWORD4+16+16サーバーが使用する圧縮アルゴリズム。
dwServerOptionsDWORD4+20+20サーバーのCCPオプションフラグ。

各言語での定義

#include <windows.h>

// RASPPPCCP  (x64 24 / x86 24 バイト)
typedef struct RASPPPCCP {
    DWORD dwSize;
    DWORD dwError;
    DWORD dwCompressionAlgorithm;
    DWORD dwOptions;
    DWORD dwServerCompressionAlgorithm;
    DWORD dwServerOptions;
} RASPPPCCP;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RASPPPCCP
{
    public uint dwSize;
    public uint dwError;
    public uint dwCompressionAlgorithm;
    public uint dwOptions;
    public uint dwServerCompressionAlgorithm;
    public uint dwServerOptions;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RASPPPCCP
    Public dwSize As UInteger
    Public dwError As UInteger
    Public dwCompressionAlgorithm As UInteger
    Public dwOptions As UInteger
    Public dwServerCompressionAlgorithm As UInteger
    Public dwServerOptions As UInteger
End Structure
import ctypes
from ctypes import wintypes

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

type RASPPPCCP struct {
	dwSize uint32
	dwError uint32
	dwCompressionAlgorithm uint32
	dwOptions uint32
	dwServerCompressionAlgorithm uint32
	dwServerOptions uint32
}
type
  RASPPPCCP = record
    dwSize: DWORD;
    dwError: DWORD;
    dwCompressionAlgorithm: DWORD;
    dwOptions: DWORD;
    dwServerCompressionAlgorithm: DWORD;
    dwServerOptions: DWORD;
  end;
const RASPPPCCP = extern struct {
    dwSize: u32,
    dwError: u32,
    dwCompressionAlgorithm: u32,
    dwOptions: u32,
    dwServerCompressionAlgorithm: u32,
    dwServerOptions: u32,
};
type
  RASPPPCCP {.bycopy.} = object
    dwSize: uint32
    dwError: uint32
    dwCompressionAlgorithm: uint32
    dwOptions: uint32
    dwServerCompressionAlgorithm: uint32
    dwServerOptions: uint32
struct RASPPPCCP
{
    uint dwSize;
    uint dwError;
    uint dwCompressionAlgorithm;
    uint dwOptions;
    uint dwServerCompressionAlgorithm;
    uint dwServerOptions;
}

HSP用 定義

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

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

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