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

SSTP_CONFIG_PARAMS

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

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

フィールド

フィールドサイズx64x86説明
dwNumPortsDWORD4+0+0

RRAS サーバー上で SSTP 接続を受け入れるように構成されているポートの数を指定する値です。dwNumPorts の最大値を次の表に示します。値 0 は指定できません。

意味
1
Windows Web Server 2008
1000
Windows Server 2008 Standard
30000
Windows Server 2008 Datacenter および Windows Server 2008 Enterprise
注意 dwNumPorts に、サービス開始時にレジストリで構成された上限 (Windows Server 2008 Standard および Windows Server 2008 Enterprise では既定で 1000) を超える値が格納されている場合、MprConfigServerGetInfoEx 関数および MprConfigServerSetInfoEx 関数は ERROR_SUCCESS_REBOOT_REQUIRED を返します。
dwPortFlagsDWORD4+4+4

SSTP 用に RRAS サーバー上で構成されているポートの種類を指定する値です。次の値がサポートされています。

意味
MPR_ENABLE_RAS_ON_DEVICE
設定されている場合、デバイスで RAS が有効になります。
isUseHttpsBOOL4+8+8HTTPS が使用される場合は TRUE、それ以外の場合は FALSE となる値です。
certAlgorithmDWORD4+12+12

使用される証明書のハッシュ アルゴリズムを指定する値です。次の値がサポートされています。

意味
CALG_SHA_256
256 ビット SHA ハッシュ アルゴリズム
sstpCertDetailsSSTP_CERT_INFO24/12+16+16SSTP ベースの証明書ハッシュを格納する SSTP_CERT_INFO 構造体です。

公式ドキュメント

SSTP_CONFIG_PARAMS 構造体は、RAS サーバー上の Secure Socket Tunneling Protocol (SSTP) のデバイス構成を取得および設定するために使用されます。

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

各言語での定義

#include <windows.h>

// CRYPT_INTEGER_BLOB  (x64 16 / x86 8 バイト)
typedef struct CRYPT_INTEGER_BLOB {
    DWORD cbData;
    BYTE* pbData;
} CRYPT_INTEGER_BLOB;

// SSTP_CERT_INFO  (x64 24 / x86 12 バイト)
typedef struct SSTP_CERT_INFO {
    BOOL isDefault;
    CRYPT_INTEGER_BLOB certBlob;
} SSTP_CERT_INFO;

// SSTP_CONFIG_PARAMS  (x64 40 / x86 28 バイト)
typedef struct SSTP_CONFIG_PARAMS {
    DWORD dwNumPorts;
    DWORD dwPortFlags;
    BOOL isUseHttps;
    DWORD certAlgorithm;
    SSTP_CERT_INFO sstpCertDetails;
} SSTP_CONFIG_PARAMS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CRYPT_INTEGER_BLOB
{
    public uint cbData;
    public IntPtr pbData;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SSTP_CERT_INFO
{
    [MarshalAs(UnmanagedType.Bool)] public bool isDefault;
    public CRYPT_INTEGER_BLOB certBlob;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SSTP_CONFIG_PARAMS
{
    public uint dwNumPorts;
    public uint dwPortFlags;
    [MarshalAs(UnmanagedType.Bool)] public bool isUseHttps;
    public uint certAlgorithm;
    public SSTP_CERT_INFO sstpCertDetails;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CRYPT_INTEGER_BLOB
    Public cbData As UInteger
    Public pbData As IntPtr
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SSTP_CERT_INFO
    <MarshalAs(UnmanagedType.Bool)> Public isDefault As Boolean
    Public certBlob As CRYPT_INTEGER_BLOB
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SSTP_CONFIG_PARAMS
    Public dwNumPorts As UInteger
    Public dwPortFlags As UInteger
    <MarshalAs(UnmanagedType.Bool)> Public isUseHttps As Boolean
    Public certAlgorithm As UInteger
    Public sstpCertDetails As SSTP_CERT_INFO
End Structure
import ctypes
from ctypes import wintypes

class CRYPT_INTEGER_BLOB(ctypes.Structure):
    _fields_ = [
        ("cbData", wintypes.DWORD),
        ("pbData", ctypes.c_void_p),
    ]

class SSTP_CERT_INFO(ctypes.Structure):
    _fields_ = [
        ("isDefault", wintypes.BOOL),
        ("certBlob", CRYPT_INTEGER_BLOB),
    ]

class SSTP_CONFIG_PARAMS(ctypes.Structure):
    _fields_ = [
        ("dwNumPorts", wintypes.DWORD),
        ("dwPortFlags", wintypes.DWORD),
        ("isUseHttps", wintypes.BOOL),
        ("certAlgorithm", wintypes.DWORD),
        ("sstpCertDetails", SSTP_CERT_INFO),
    ]
#[repr(C)]
pub struct CRYPT_INTEGER_BLOB {
    pub cbData: u32,
    pub pbData: *mut core::ffi::c_void,
}

#[repr(C)]
pub struct SSTP_CERT_INFO {
    pub isDefault: i32,
    pub certBlob: CRYPT_INTEGER_BLOB,
}

#[repr(C)]
pub struct SSTP_CONFIG_PARAMS {
    pub dwNumPorts: u32,
    pub dwPortFlags: u32,
    pub isUseHttps: i32,
    pub certAlgorithm: u32,
    pub sstpCertDetails: SSTP_CERT_INFO,
}
import "golang.org/x/sys/windows"

type CRYPT_INTEGER_BLOB struct {
	cbData uint32
	pbData uintptr
}

type SSTP_CERT_INFO struct {
	isDefault int32
	certBlob CRYPT_INTEGER_BLOB
}

type SSTP_CONFIG_PARAMS struct {
	dwNumPorts uint32
	dwPortFlags uint32
	isUseHttps int32
	certAlgorithm uint32
	sstpCertDetails SSTP_CERT_INFO
}
type
  CRYPT_INTEGER_BLOB = record
    cbData: DWORD;
    pbData: Pointer;
  end;

  SSTP_CERT_INFO = record
    isDefault: BOOL;
    certBlob: CRYPT_INTEGER_BLOB;
  end;

  SSTP_CONFIG_PARAMS = record
    dwNumPorts: DWORD;
    dwPortFlags: DWORD;
    isUseHttps: BOOL;
    certAlgorithm: DWORD;
    sstpCertDetails: SSTP_CERT_INFO;
  end;
const CRYPT_INTEGER_BLOB = extern struct {
    cbData: u32,
    pbData: ?*anyopaque,
};

const SSTP_CERT_INFO = extern struct {
    isDefault: i32,
    certBlob: CRYPT_INTEGER_BLOB,
};

const SSTP_CONFIG_PARAMS = extern struct {
    dwNumPorts: u32,
    dwPortFlags: u32,
    isUseHttps: i32,
    certAlgorithm: u32,
    sstpCertDetails: SSTP_CERT_INFO,
};
type
  CRYPT_INTEGER_BLOB {.bycopy.} = object
    cbData: uint32
    pbData: pointer

  SSTP_CERT_INFO {.bycopy.} = object
    isDefault: int32
    certBlob: CRYPT_INTEGER_BLOB

  SSTP_CONFIG_PARAMS {.bycopy.} = object
    dwNumPorts: uint32
    dwPortFlags: uint32
    isUseHttps: int32
    certAlgorithm: uint32
    sstpCertDetails: SSTP_CERT_INFO
struct CRYPT_INTEGER_BLOB
{
    uint cbData;
    void* pbData;
}

struct SSTP_CERT_INFO
{
    int isDefault;
    CRYPT_INTEGER_BLOB certBlob;
}

struct SSTP_CONFIG_PARAMS
{
    uint dwNumPorts;
    uint dwPortFlags;
    int isUseHttps;
    uint certAlgorithm;
    SSTP_CERT_INFO sstpCertDetails;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; SSTP_CONFIG_PARAMS サイズ: 28 バイト(x86)
dim st, 7    ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; dwNumPorts : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwPortFlags : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; isUseHttps : BOOL (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; certAlgorithm : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; sstpCertDetails : SSTP_CERT_INFO (+16, 12byte)  varptr(st)+16 を基点に操作(12byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SSTP_CONFIG_PARAMS サイズ: 40 バイト(x64)
dim st, 10    ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; dwNumPorts : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwPortFlags : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; isUseHttps : BOOL (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; certAlgorithm : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; sstpCertDetails : SSTP_CERT_INFO (+16, 24byte)  varptr(st)+16 を基点に操作(24byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global CRYPT_INTEGER_BLOB
    #field int cbData
    #field intptr pbData
#endstruct

#defstruct global SSTP_CERT_INFO
    #field bool isDefault
    #field CRYPT_INTEGER_BLOB certBlob
#endstruct

#defstruct global SSTP_CONFIG_PARAMS
    #field int dwNumPorts
    #field int dwPortFlags
    #field bool isUseHttps
    #field int certAlgorithm
    #field SSTP_CERT_INFO sstpCertDetails
#endstruct

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