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

WsGetMetadataEndpoints

関数
メタデータからエンドポイントの一覧を取得する。
DLLwebservices.dll呼出規約winapi対応OSWindows 7 以降

シグネチャ

// webservices.dll
#include <windows.h>

HRESULT WsGetMetadataEndpoints(
    WS_METADATA* metadata,
    WS_METADATA_ENDPOINTS* endpoints,
    WS_ERROR* error   // optional
);

パラメーター

名前方向
metadataWS_METADATA*in
endpointsWS_METADATA_ENDPOINTS*out
errorWS_ERROR*inoptional

戻り値の型: HRESULT

各言語での呼び出し定義

// webservices.dll
#include <windows.h>

HRESULT WsGetMetadataEndpoints(
    WS_METADATA* metadata,
    WS_METADATA_ENDPOINTS* endpoints,
    WS_ERROR* error   // optional
);
[DllImport("webservices.dll", ExactSpelling = true)]
static extern int WsGetMetadataEndpoints(
    ref IntPtr metadata,   // WS_METADATA*
    IntPtr endpoints,   // WS_METADATA_ENDPOINTS* out
    IntPtr error   // WS_ERROR* optional
);
<DllImport("webservices.dll", ExactSpelling:=True)>
Public Shared Function WsGetMetadataEndpoints(
    ByRef metadata As IntPtr,   ' WS_METADATA*
    endpoints As IntPtr,   ' WS_METADATA_ENDPOINTS* out
    [error] As IntPtr   ' WS_ERROR* optional
) As Integer
End Function
' metadata : WS_METADATA*
' endpoints : WS_METADATA_ENDPOINTS* out
' error : WS_ERROR* optional
Declare PtrSafe Function WsGetMetadataEndpoints Lib "webservices" ( _
    ByRef metadata As LongPtr, _
    ByVal endpoints As LongPtr, _
    ByVal error As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

WsGetMetadataEndpoints = ctypes.windll.webservices.WsGetMetadataEndpoints
WsGetMetadataEndpoints.restype = ctypes.c_int
WsGetMetadataEndpoints.argtypes = [
    ctypes.c_void_p,  # metadata : WS_METADATA*
    ctypes.c_void_p,  # endpoints : WS_METADATA_ENDPOINTS* out
    ctypes.c_void_p,  # error : WS_ERROR* optional
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('webservices.dll')
WsGetMetadataEndpoints = Fiddle::Function.new(
  lib['WsGetMetadataEndpoints'],
  [
    Fiddle::TYPE_VOIDP,  # metadata : WS_METADATA*
    Fiddle::TYPE_VOIDP,  # endpoints : WS_METADATA_ENDPOINTS* out
    Fiddle::TYPE_VOIDP,  # error : WS_ERROR* optional
  ],
  Fiddle::TYPE_INT)
#[link(name = "webservices")]
extern "system" {
    fn WsGetMetadataEndpoints(
        metadata: *mut isize,  // WS_METADATA*
        endpoints: *mut WS_METADATA_ENDPOINTS,  // WS_METADATA_ENDPOINTS* out
        error: *mut isize  // WS_ERROR* optional
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("webservices.dll")]
public static extern int WsGetMetadataEndpoints(ref IntPtr metadata, IntPtr endpoints, IntPtr error);
"@
$api = Add-Type -MemberDefinition $sig -Name 'webservices_WsGetMetadataEndpoints' -Namespace Win32 -PassThru
# $api::WsGetMetadataEndpoints(metadata, endpoints, error)
#uselib "webservices.dll"
#func global WsGetMetadataEndpoints "WsGetMetadataEndpoints" sptr, sptr, sptr
; WsGetMetadataEndpoints metadata, varptr(endpoints), error   ; 戻り値は stat
; metadata : WS_METADATA* -> "sptr"
; endpoints : WS_METADATA_ENDPOINTS* out -> "sptr"
; error : WS_ERROR* optional -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "webservices.dll"
#cfunc global WsGetMetadataEndpoints "WsGetMetadataEndpoints" int, var, int
; res = WsGetMetadataEndpoints(metadata, endpoints, error)
; metadata : WS_METADATA* -> "int"
; endpoints : WS_METADATA_ENDPOINTS* out -> "var"
; error : WS_ERROR* optional -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; HRESULT WsGetMetadataEndpoints(WS_METADATA* metadata, WS_METADATA_ENDPOINTS* endpoints, WS_ERROR* error)
#uselib "webservices.dll"
#cfunc global WsGetMetadataEndpoints "WsGetMetadataEndpoints" int, var, int
; res = WsGetMetadataEndpoints(metadata, endpoints, error)
; metadata : WS_METADATA* -> "int"
; endpoints : WS_METADATA_ENDPOINTS* out -> "var"
; error : WS_ERROR* optional -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	webservices = windows.NewLazySystemDLL("webservices.dll")
	procWsGetMetadataEndpoints = webservices.NewProc("WsGetMetadataEndpoints")
)

// metadata (WS_METADATA*), endpoints (WS_METADATA_ENDPOINTS* out), error (WS_ERROR* optional)
r1, _, err := procWsGetMetadataEndpoints.Call(
	uintptr(metadata),
	uintptr(endpoints),
	uintptr(error),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function WsGetMetadataEndpoints(
  metadata: Pointer;   // WS_METADATA*
  endpoints: Pointer;   // WS_METADATA_ENDPOINTS* out
  error: Pointer   // WS_ERROR* optional
): Integer; stdcall;
  external 'webservices.dll' name 'WsGetMetadataEndpoints';
result := DllCall("webservices\WsGetMetadataEndpoints"
    , "Ptr", metadata   ; WS_METADATA*
    , "Ptr", endpoints   ; WS_METADATA_ENDPOINTS* out
    , "Ptr", error   ; WS_ERROR* optional
    , "Int")   ; return: HRESULT
●WsGetMetadataEndpoints(metadata, endpoints, error) = DLL("webservices.dll", "int WsGetMetadataEndpoints(void*, void*, void*)")
# 呼び出し: WsGetMetadataEndpoints(metadata, endpoints, error)
# metadata : WS_METADATA* -> "void*"
# endpoints : WS_METADATA_ENDPOINTS* out -> "void*"
# error : WS_ERROR* optional -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。