Win32 API 日本語リファレンス
ホームNetworking.WindowsWebServices › WS_METADATA_ENDPOINT

WS_METADATA_ENDPOINT

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

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

フィールド

フィールドサイズx64x86説明
endpointAddressWS_ENDPOINT_ADDRESS40/20+0+0メタデータから取得したエンドポイントのアドレス。
endpointPolicyWS_POLICY*8/4+40+20エンドポイントに適用されるポリシーへのポインタ。NULL可。
portNameWS_XML_STRING*8/4+48+24WSDLポート名を表すXML文字列へのポインタ。NULL可。
serviceNameWS_XML_STRING*8/4+56+28WSDLサービス名を表すXML文字列へのポインタ。NULL可。
serviceNsWS_XML_STRING*8/4+64+32WSDLサービスの名前空間URIを表すXML文字列へのポインタ。NULL可。
bindingNameWS_XML_STRING*8/4+72+36WSDLバインディング名を表すXML文字列へのポインタ。NULL可。
bindingNsWS_XML_STRING*8/4+80+40WSDLバインディングの名前空間URIを表すXML文字列へのポインタ。NULL可。
portTypeNameWS_XML_STRING*8/4+88+44WSDLポートタイプ名を表すXML文字列へのポインタ。NULL可。
portTypeNsWS_XML_STRING*8/4+96+48WSDLポートタイプの名前空間URIを表すXML文字列へのポインタ。NULL可。

各言語での定義

#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_METADATA_ENDPOINT  (x64 104 / x86 52 バイト)
typedef struct WS_METADATA_ENDPOINT {
    WS_ENDPOINT_ADDRESS endpointAddress;
    WS_POLICY* endpointPolicy;
    WS_XML_STRING* portName;
    WS_XML_STRING* serviceName;
    WS_XML_STRING* serviceNs;
    WS_XML_STRING* bindingName;
    WS_XML_STRING* bindingNs;
    WS_XML_STRING* portTypeName;
    WS_XML_STRING* portTypeNs;
} WS_METADATA_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_METADATA_ENDPOINT
{
    public WS_ENDPOINT_ADDRESS endpointAddress;
    public IntPtr endpointPolicy;
    public IntPtr portName;
    public IntPtr serviceName;
    public IntPtr serviceNs;
    public IntPtr bindingName;
    public IntPtr bindingNs;
    public IntPtr portTypeName;
    public IntPtr portTypeNs;
}
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_METADATA_ENDPOINT
    Public endpointAddress As WS_ENDPOINT_ADDRESS
    Public endpointPolicy As IntPtr
    Public portName As IntPtr
    Public serviceName As IntPtr
    Public serviceNs As IntPtr
    Public bindingName As IntPtr
    Public bindingNs As IntPtr
    Public portTypeName As IntPtr
    Public portTypeNs As IntPtr
End Structure
import 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_METADATA_ENDPOINT(ctypes.Structure):
    _fields_ = [
        ("endpointAddress", WS_ENDPOINT_ADDRESS),
        ("endpointPolicy", ctypes.c_void_p),
        ("portName", ctypes.c_void_p),
        ("serviceName", ctypes.c_void_p),
        ("serviceNs", ctypes.c_void_p),
        ("bindingName", ctypes.c_void_p),
        ("bindingNs", ctypes.c_void_p),
        ("portTypeName", ctypes.c_void_p),
        ("portTypeNs", ctypes.c_void_p),
    ]
#[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_METADATA_ENDPOINT {
    pub endpointAddress: WS_ENDPOINT_ADDRESS,
    pub endpointPolicy: *mut core::ffi::c_void,
    pub portName: *mut core::ffi::c_void,
    pub serviceName: *mut core::ffi::c_void,
    pub serviceNs: *mut core::ffi::c_void,
    pub bindingName: *mut core::ffi::c_void,
    pub bindingNs: *mut core::ffi::c_void,
    pub portTypeName: *mut core::ffi::c_void,
    pub portTypeNs: *mut core::ffi::c_void,
}
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_METADATA_ENDPOINT struct {
	endpointAddress WS_ENDPOINT_ADDRESS
	endpointPolicy uintptr
	portName uintptr
	serviceName uintptr
	serviceNs uintptr
	bindingName uintptr
	bindingNs uintptr
	portTypeName uintptr
	portTypeNs uintptr
}
type
  WS_STRING = record
    length: DWORD;
    chars: Pointer;
  end;

  WS_ENDPOINT_ADDRESS = record
    url: WS_STRING;
    headers: Pointer;
    extensions: Pointer;
    identity: Pointer;
  end;

  WS_METADATA_ENDPOINT = record
    endpointAddress: WS_ENDPOINT_ADDRESS;
    endpointPolicy: Pointer;
    portName: Pointer;
    serviceName: Pointer;
    serviceNs: Pointer;
    bindingName: Pointer;
    bindingNs: Pointer;
    portTypeName: Pointer;
    portTypeNs: Pointer;
  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_METADATA_ENDPOINT = extern struct {
    endpointAddress: WS_ENDPOINT_ADDRESS,
    endpointPolicy: ?*anyopaque,
    portName: ?*anyopaque,
    serviceName: ?*anyopaque,
    serviceNs: ?*anyopaque,
    bindingName: ?*anyopaque,
    bindingNs: ?*anyopaque,
    portTypeName: ?*anyopaque,
    portTypeNs: ?*anyopaque,
};
type
  WS_STRING {.bycopy.} = object
    length: uint32
    chars: pointer

  WS_ENDPOINT_ADDRESS {.bycopy.} = object
    url: WS_STRING
    headers: pointer
    extensions: pointer
    identity: pointer

  WS_METADATA_ENDPOINT {.bycopy.} = object
    endpointAddress: WS_ENDPOINT_ADDRESS
    endpointPolicy: pointer
    portName: pointer
    serviceName: pointer
    serviceNs: pointer
    bindingName: pointer
    bindingNs: pointer
    portTypeName: pointer
    portTypeNs: pointer
struct WS_STRING
{
    uint length;
    void* chars;
}

struct WS_ENDPOINT_ADDRESS
{
    WS_STRING url;
    void* headers;
    void* extensions;
    void* identity;
}

struct WS_METADATA_ENDPOINT
{
    WS_ENDPOINT_ADDRESS endpointAddress;
    void* endpointPolicy;
    void* portName;
    void* serviceName;
    void* serviceNs;
    void* bindingName;
    void* bindingNs;
    void* portTypeName;
    void* portTypeNs;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; WS_METADATA_ENDPOINT サイズ: 52 バイト(x86)
dim st, 13    ; 4byte整数×13(構造体サイズ 52 / 4 切り上げ)
; endpointAddress : WS_ENDPOINT_ADDRESS (+0, 20byte)  varptr(st)+0 を基点に操作(20byte:入れ子/配列)
; endpointPolicy : WS_POLICY* (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; portName : WS_XML_STRING* (+24, 4byte)  varptr(st)+24 を基点に操作(4byte:入れ子/配列)
; serviceName : WS_XML_STRING* (+28, 4byte)  varptr(st)+28 を基点に操作(4byte:入れ子/配列)
; serviceNs : WS_XML_STRING* (+32, 4byte)  varptr(st)+32 を基点に操作(4byte:入れ子/配列)
; bindingName : WS_XML_STRING* (+36, 4byte)  varptr(st)+36 を基点に操作(4byte:入れ子/配列)
; bindingNs : WS_XML_STRING* (+40, 4byte)  varptr(st)+40 を基点に操作(4byte:入れ子/配列)
; portTypeName : WS_XML_STRING* (+44, 4byte)  varptr(st)+44 を基点に操作(4byte:入れ子/配列)
; portTypeNs : WS_XML_STRING* (+48, 4byte)  varptr(st)+48 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WS_METADATA_ENDPOINT サイズ: 104 バイト(x64)
dim st, 26    ; 4byte整数×26(構造体サイズ 104 / 4 切り上げ)
; endpointAddress : WS_ENDPOINT_ADDRESS (+0, 40byte)  varptr(st)+0 を基点に操作(40byte:入れ子/配列)
; endpointPolicy : WS_POLICY* (+40, 8byte)  qpoke st,40,値 / qpeek(st,40)  ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; portName : WS_XML_STRING* (+48, 8byte)  varptr(st)+48 を基点に操作(8byte:入れ子/配列)
; serviceName : WS_XML_STRING* (+56, 8byte)  varptr(st)+56 を基点に操作(8byte:入れ子/配列)
; serviceNs : WS_XML_STRING* (+64, 8byte)  varptr(st)+64 を基点に操作(8byte:入れ子/配列)
; bindingName : WS_XML_STRING* (+72, 8byte)  varptr(st)+72 を基点に操作(8byte:入れ子/配列)
; bindingNs : WS_XML_STRING* (+80, 8byte)  varptr(st)+80 を基点に操作(8byte:入れ子/配列)
; portTypeName : WS_XML_STRING* (+88, 8byte)  varptr(st)+88 を基点に操作(8byte:入れ子/配列)
; portTypeNs : WS_XML_STRING* (+96, 8byte)  varptr(st)+96 を基点に操作(8byte:入れ子/配列)
; ※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_METADATA_ENDPOINT
    #field WS_ENDPOINT_ADDRESS endpointAddress
    #field intptr endpointPolicy
    #field intptr portName
    #field intptr serviceName
    #field intptr serviceNs
    #field intptr bindingName
    #field intptr bindingNs
    #field intptr portTypeName
    #field intptr portTypeNs
#endstruct

stdim st, WS_METADATA_ENDPOINT        ; NSTRUCT 変数を確保