ホーム › Networking.WindowsWebServices › WS_SERVICE_ENDPOINT
WS_SERVICE_ENDPOINT
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| address | WS_ENDPOINT_ADDRESS | 40/20 | +0 | +0 | このエンドポイントのアドレス情報。 |
| channelBinding | WS_CHANNEL_BINDING | 4 | +40 | +20 | 使用するチャネルバインディング(HTTP/TCP等)を示す列挙値。 |
| channelType | WS_CHANNEL_TYPE | 4 | +44 | +24 | チャネルの通信パターン(request-reply/duplex等)を示す列挙値。 |
| securityDescription | WS_SECURITY_DESCRIPTION* | 8/4 | +48 | +28 | このエンドポイントに適用するセキュリティ記述へのポインタ。NULL可。 |
| contract | WS_SERVICE_CONTRACT* | 8/4 | +56 | +32 | このエンドポイントが提供するサービスコントラクトへのポインタ。 |
| authorizationCallback | WS_SERVICE_SECURITY_CALLBACK | 8/4 | +64 | +36 | 受信メッセージの認可判定を行うコールバック関数。NULL可。 |
| properties | WS_SERVICE_ENDPOINT_PROPERTY* | 8/4 | +72 | +40 | エンドポイント固有のプロパティ配列へのポインタ。NULL可。 |
| propertyCount | DWORD | 4 | +80 | +44 | properties配列の要素数。 |
| channelProperties | WS_CHANNEL_PROPERTIES | 16/8 | +88 | +48 | エンドポイントのチャネルに適用するプロパティ集合。 |
各言語での定義
#include <windows.h>
// WS_STRING (x64 16 / x86 8 バイト)
typedef struct WS_STRING {
DWORD length;
LPWSTR chars;
} WS_STRING;
// WS_ENDPOINT_ADDRESS (x64 40 / x86 20 バイト)
typedef struct WS_ENDPOINT_ADDRESS {
WS_STRING url;
WS_XML_BUFFER* headers;
WS_XML_BUFFER* extensions;
WS_ENDPOINT_IDENTITY* identity;
} WS_ENDPOINT_ADDRESS;
// WS_CHANNEL_PROPERTIES (x64 16 / x86 8 バイト)
typedef struct WS_CHANNEL_PROPERTIES {
WS_CHANNEL_PROPERTY* properties;
DWORD propertyCount;
} WS_CHANNEL_PROPERTIES;
// WS_SERVICE_ENDPOINT (x64 104 / x86 56 バイト)
typedef struct WS_SERVICE_ENDPOINT {
WS_ENDPOINT_ADDRESS address;
WS_CHANNEL_BINDING channelBinding;
WS_CHANNEL_TYPE channelType;
WS_SECURITY_DESCRIPTION* securityDescription;
WS_SERVICE_CONTRACT* contract;
WS_SERVICE_SECURITY_CALLBACK authorizationCallback;
WS_SERVICE_ENDPOINT_PROPERTY* properties;
DWORD propertyCount;
WS_CHANNEL_PROPERTIES channelProperties;
} WS_SERVICE_ENDPOINT;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WS_STRING
{
public uint length;
public IntPtr chars;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WS_ENDPOINT_ADDRESS
{
public WS_STRING url;
public IntPtr headers;
public IntPtr extensions;
public IntPtr identity;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WS_CHANNEL_PROPERTIES
{
public IntPtr properties;
public uint propertyCount;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WS_SERVICE_ENDPOINT
{
public WS_ENDPOINT_ADDRESS address;
public int channelBinding;
public int channelType;
public IntPtr securityDescription;
public IntPtr contract;
public IntPtr authorizationCallback;
public IntPtr properties;
public uint propertyCount;
public WS_CHANNEL_PROPERTIES channelProperties;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WS_STRING
Public length As UInteger
Public chars As IntPtr
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WS_ENDPOINT_ADDRESS
Public url As WS_STRING
Public headers As IntPtr
Public extensions As IntPtr
Public identity As IntPtr
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WS_CHANNEL_PROPERTIES
Public properties As IntPtr
Public propertyCount As UInteger
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WS_SERVICE_ENDPOINT
Public address As WS_ENDPOINT_ADDRESS
Public channelBinding As Integer
Public channelType As Integer
Public securityDescription As IntPtr
Public contract As IntPtr
Public authorizationCallback As IntPtr
Public properties As IntPtr
Public propertyCount As UInteger
Public channelProperties As WS_CHANNEL_PROPERTIES
End Structureimport ctypes
from ctypes import wintypes
class WS_STRING(ctypes.Structure):
_fields_ = [
("length", wintypes.DWORD),
("chars", ctypes.c_void_p),
]
class WS_ENDPOINT_ADDRESS(ctypes.Structure):
_fields_ = [
("url", WS_STRING),
("headers", ctypes.c_void_p),
("extensions", ctypes.c_void_p),
("identity", ctypes.c_void_p),
]
class WS_CHANNEL_PROPERTIES(ctypes.Structure):
_fields_ = [
("properties", ctypes.c_void_p),
("propertyCount", wintypes.DWORD),
]
class WS_SERVICE_ENDPOINT(ctypes.Structure):
_fields_ = [
("address", WS_ENDPOINT_ADDRESS),
("channelBinding", ctypes.c_int),
("channelType", ctypes.c_int),
("securityDescription", ctypes.c_void_p),
("contract", ctypes.c_void_p),
("authorizationCallback", ctypes.c_void_p),
("properties", ctypes.c_void_p),
("propertyCount", wintypes.DWORD),
("channelProperties", WS_CHANNEL_PROPERTIES),
]#[repr(C)]
pub struct WS_STRING {
pub length: u32,
pub chars: *mut core::ffi::c_void,
}
#[repr(C)]
pub struct WS_ENDPOINT_ADDRESS {
pub url: WS_STRING,
pub headers: *mut core::ffi::c_void,
pub extensions: *mut core::ffi::c_void,
pub identity: *mut core::ffi::c_void,
}
#[repr(C)]
pub struct WS_CHANNEL_PROPERTIES {
pub properties: *mut core::ffi::c_void,
pub propertyCount: u32,
}
#[repr(C)]
pub struct WS_SERVICE_ENDPOINT {
pub address: WS_ENDPOINT_ADDRESS,
pub channelBinding: i32,
pub channelType: i32,
pub securityDescription: *mut core::ffi::c_void,
pub contract: *mut core::ffi::c_void,
pub authorizationCallback: *mut core::ffi::c_void,
pub properties: *mut core::ffi::c_void,
pub propertyCount: u32,
pub channelProperties: WS_CHANNEL_PROPERTIES,
}import "golang.org/x/sys/windows"
type WS_STRING struct {
length uint32
chars uintptr
}
type WS_ENDPOINT_ADDRESS struct {
url WS_STRING
headers uintptr
extensions uintptr
identity uintptr
}
type WS_CHANNEL_PROPERTIES struct {
properties uintptr
propertyCount uint32
}
type WS_SERVICE_ENDPOINT struct {
address WS_ENDPOINT_ADDRESS
channelBinding int32
channelType int32
securityDescription uintptr
contract uintptr
authorizationCallback uintptr
properties uintptr
propertyCount uint32
channelProperties WS_CHANNEL_PROPERTIES
}type
WS_STRING = record
length: DWORD;
chars: Pointer;
end;
WS_ENDPOINT_ADDRESS = record
url: WS_STRING;
headers: Pointer;
extensions: Pointer;
identity: Pointer;
end;
WS_CHANNEL_PROPERTIES = record
properties: Pointer;
propertyCount: DWORD;
end;
WS_SERVICE_ENDPOINT = record
address: WS_ENDPOINT_ADDRESS;
channelBinding: Integer;
channelType: Integer;
securityDescription: Pointer;
contract: Pointer;
authorizationCallback: Pointer;
properties: Pointer;
propertyCount: DWORD;
channelProperties: WS_CHANNEL_PROPERTIES;
end;const WS_STRING = extern struct {
length: u32,
chars: ?*anyopaque,
};
const WS_ENDPOINT_ADDRESS = extern struct {
url: WS_STRING,
headers: ?*anyopaque,
extensions: ?*anyopaque,
identity: ?*anyopaque,
};
const WS_CHANNEL_PROPERTIES = extern struct {
properties: ?*anyopaque,
propertyCount: u32,
};
const WS_SERVICE_ENDPOINT = extern struct {
address: WS_ENDPOINT_ADDRESS,
channelBinding: i32,
channelType: i32,
securityDescription: ?*anyopaque,
contract: ?*anyopaque,
authorizationCallback: ?*anyopaque,
properties: ?*anyopaque,
propertyCount: u32,
channelProperties: WS_CHANNEL_PROPERTIES,
};type
WS_STRING {.bycopy.} = object
length: uint32
chars: pointer
WS_ENDPOINT_ADDRESS {.bycopy.} = object
url: WS_STRING
headers: pointer
extensions: pointer
identity: pointer
WS_CHANNEL_PROPERTIES {.bycopy.} = object
properties: pointer
propertyCount: uint32
WS_SERVICE_ENDPOINT {.bycopy.} = object
address: WS_ENDPOINT_ADDRESS
channelBinding: int32
channelType: int32
securityDescription: pointer
contract: pointer
authorizationCallback: pointer
properties: pointer
propertyCount: uint32
channelProperties: WS_CHANNEL_PROPERTIESstruct WS_STRING
{
uint length;
void* chars;
}
struct WS_ENDPOINT_ADDRESS
{
WS_STRING url;
void* headers;
void* extensions;
void* identity;
}
struct WS_CHANNEL_PROPERTIES
{
void* properties;
uint propertyCount;
}
struct WS_SERVICE_ENDPOINT
{
WS_ENDPOINT_ADDRESS address;
int channelBinding;
int channelType;
void* securityDescription;
void* contract;
void* authorizationCallback;
void* properties;
uint propertyCount;
WS_CHANNEL_PROPERTIES channelProperties;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; WS_SERVICE_ENDPOINT サイズ: 56 バイト(x86)
dim st, 14 ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; address : WS_ENDPOINT_ADDRESS (+0, 20byte) varptr(st)+0 を基点に操作(20byte:入れ子/配列)
; channelBinding : WS_CHANNEL_BINDING (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; channelType : WS_CHANNEL_TYPE (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; securityDescription : WS_SECURITY_DESCRIPTION* (+28, 4byte) varptr(st)+28 を基点に操作(4byte:入れ子/配列)
; contract : WS_SERVICE_CONTRACT* (+32, 4byte) varptr(st)+32 を基点に操作(4byte:入れ子/配列)
; authorizationCallback : WS_SERVICE_SECURITY_CALLBACK (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; properties : WS_SERVICE_ENDPOINT_PROPERTY* (+40, 4byte) varptr(st)+40 を基点に操作(4byte:入れ子/配列)
; propertyCount : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; channelProperties : WS_CHANNEL_PROPERTIES (+48, 8byte) varptr(st)+48 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WS_SERVICE_ENDPOINT サイズ: 104 バイト(x64)
dim st, 26 ; 4byte整数×26(構造体サイズ 104 / 4 切り上げ)
; address : WS_ENDPOINT_ADDRESS (+0, 40byte) varptr(st)+0 を基点に操作(40byte:入れ子/配列)
; channelBinding : WS_CHANNEL_BINDING (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; channelType : WS_CHANNEL_TYPE (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; securityDescription : WS_SECURITY_DESCRIPTION* (+48, 8byte) varptr(st)+48 を基点に操作(8byte:入れ子/配列)
; contract : WS_SERVICE_CONTRACT* (+56, 8byte) varptr(st)+56 を基点に操作(8byte:入れ子/配列)
; authorizationCallback : WS_SERVICE_SECURITY_CALLBACK (+64, 8byte) qpoke st,64,値 / qpeek(st,64) ※IronHSPのみ。3.7/3.8は lpoke st,64,下位 : lpoke st,68,上位
; properties : WS_SERVICE_ENDPOINT_PROPERTY* (+72, 8byte) varptr(st)+72 を基点に操作(8byte:入れ子/配列)
; propertyCount : DWORD (+80, 4byte) st.20 = 値 / 値 = st.20 (lpoke/lpeek も可)
; channelProperties : WS_CHANNEL_PROPERTIES (+88, 16byte) varptr(st)+88 を基点に操作(16byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global WS_STRING
#field int length
#field intptr chars
#endstruct
#defstruct global WS_ENDPOINT_ADDRESS
#field WS_STRING url
#field intptr headers
#field intptr extensions
#field intptr identity
#endstruct
#defstruct global WS_CHANNEL_PROPERTIES
#field intptr properties
#field int propertyCount
#endstruct
#defstruct global WS_SERVICE_ENDPOINT
#field WS_ENDPOINT_ADDRESS address
#field int channelBinding
#field int channelType
#field intptr securityDescription
#field intptr contract
#field intptr authorizationCallback
#field intptr properties
#field int propertyCount
#field WS_CHANNEL_PROPERTIES channelProperties
#endstruct
stdim st, WS_SERVICE_ENDPOINT ; NSTRUCT 変数を確保
st->channelBinding = 100
mes "channelBinding=" + st->channelBinding