ホーム › Networking.WindowsWebServices › WsGetReaderProperty
WsGetReaderProperty
関数XMLリーダーのプロパティ値を取得する。
シグネチャ
// webservices.dll
#include <windows.h>
HRESULT WsGetReaderProperty(
WS_XML_READER* reader,
WS_XML_READER_PROPERTY_ID id,
void* value,
DWORD valueSize,
WS_ERROR* error // optional
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| reader | WS_XML_READER* | in |
| id | WS_XML_READER_PROPERTY_ID | in |
| value | void* | out |
| valueSize | DWORD | in |
| error | WS_ERROR* | inoptional |
戻り値の型: HRESULT
各言語での呼び出し定義
// webservices.dll
#include <windows.h>
HRESULT WsGetReaderProperty(
WS_XML_READER* reader,
WS_XML_READER_PROPERTY_ID id,
void* value,
DWORD valueSize,
WS_ERROR* error // optional
);[DllImport("webservices.dll", ExactSpelling = true)]
static extern int WsGetReaderProperty(
ref IntPtr reader, // WS_XML_READER*
int id, // WS_XML_READER_PROPERTY_ID
IntPtr value, // void* out
uint valueSize, // DWORD
IntPtr error // WS_ERROR* optional
);<DllImport("webservices.dll", ExactSpelling:=True)>
Public Shared Function WsGetReaderProperty(
ByRef reader As IntPtr, ' WS_XML_READER*
id As Integer, ' WS_XML_READER_PROPERTY_ID
value As IntPtr, ' void* out
valueSize As UInteger, ' DWORD
[error] As IntPtr ' WS_ERROR* optional
) As Integer
End Function' reader : WS_XML_READER*
' id : WS_XML_READER_PROPERTY_ID
' value : void* out
' valueSize : DWORD
' error : WS_ERROR* optional
Declare PtrSafe Function WsGetReaderProperty Lib "webservices" ( _
ByRef reader As LongPtr, _
ByVal id As Long, _
ByVal value As LongPtr, _
ByVal valueSize As Long, _
ByVal error As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
WsGetReaderProperty = ctypes.windll.webservices.WsGetReaderProperty
WsGetReaderProperty.restype = ctypes.c_int
WsGetReaderProperty.argtypes = [
ctypes.c_void_p, # reader : WS_XML_READER*
ctypes.c_int, # id : WS_XML_READER_PROPERTY_ID
ctypes.POINTER(None), # value : void* out
wintypes.DWORD, # valueSize : DWORD
ctypes.c_void_p, # error : WS_ERROR* optional
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('webservices.dll')
WsGetReaderProperty = Fiddle::Function.new(
lib['WsGetReaderProperty'],
[
Fiddle::TYPE_VOIDP, # reader : WS_XML_READER*
Fiddle::TYPE_INT, # id : WS_XML_READER_PROPERTY_ID
Fiddle::TYPE_VOIDP, # value : void* out
-Fiddle::TYPE_INT, # valueSize : DWORD
Fiddle::TYPE_VOIDP, # error : WS_ERROR* optional
],
Fiddle::TYPE_INT)#[link(name = "webservices")]
extern "system" {
fn WsGetReaderProperty(
reader: *mut isize, // WS_XML_READER*
id: i32, // WS_XML_READER_PROPERTY_ID
value: *mut (), // void* out
valueSize: u32, // DWORD
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 WsGetReaderProperty(ref IntPtr reader, int id, IntPtr value, uint valueSize, IntPtr error);
"@
$api = Add-Type -MemberDefinition $sig -Name 'webservices_WsGetReaderProperty' -Namespace Win32 -PassThru
# $api::WsGetReaderProperty(reader, id, value, valueSize, error)#uselib "webservices.dll"
#func global WsGetReaderProperty "WsGetReaderProperty" sptr, sptr, sptr, sptr, sptr
; WsGetReaderProperty reader, id, value, valueSize, error ; 戻り値は stat
; reader : WS_XML_READER* -> "sptr"
; id : WS_XML_READER_PROPERTY_ID -> "sptr"
; value : void* out -> "sptr"
; valueSize : DWORD -> "sptr"
; error : WS_ERROR* optional -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "webservices.dll"
#cfunc global WsGetReaderProperty "WsGetReaderProperty" int, int, sptr, int, int
; res = WsGetReaderProperty(reader, id, value, valueSize, error)
; reader : WS_XML_READER* -> "int"
; id : WS_XML_READER_PROPERTY_ID -> "int"
; value : void* out -> "sptr"
; valueSize : DWORD -> "int"
; error : WS_ERROR* optional -> "int"; HRESULT WsGetReaderProperty(WS_XML_READER* reader, WS_XML_READER_PROPERTY_ID id, void* value, DWORD valueSize, WS_ERROR* error)
#uselib "webservices.dll"
#cfunc global WsGetReaderProperty "WsGetReaderProperty" int, int, intptr, int, int
; res = WsGetReaderProperty(reader, id, value, valueSize, error)
; reader : WS_XML_READER* -> "int"
; id : WS_XML_READER_PROPERTY_ID -> "int"
; value : void* out -> "intptr"
; valueSize : DWORD -> "int"
; error : WS_ERROR* optional -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
webservices = windows.NewLazySystemDLL("webservices.dll")
procWsGetReaderProperty = webservices.NewProc("WsGetReaderProperty")
)
// reader (WS_XML_READER*), id (WS_XML_READER_PROPERTY_ID), value (void* out), valueSize (DWORD), error (WS_ERROR* optional)
r1, _, err := procWsGetReaderProperty.Call(
uintptr(reader),
uintptr(id),
uintptr(value),
uintptr(valueSize),
uintptr(error),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction WsGetReaderProperty(
reader: Pointer; // WS_XML_READER*
id: Integer; // WS_XML_READER_PROPERTY_ID
value: Pointer; // void* out
valueSize: DWORD; // DWORD
error: Pointer // WS_ERROR* optional
): Integer; stdcall;
external 'webservices.dll' name 'WsGetReaderProperty';result := DllCall("webservices\WsGetReaderProperty"
, "Ptr", reader ; WS_XML_READER*
, "Int", id ; WS_XML_READER_PROPERTY_ID
, "Ptr", value ; void* out
, "UInt", valueSize ; DWORD
, "Ptr", error ; WS_ERROR* optional
, "Int") ; return: HRESULT●WsGetReaderProperty(reader, id, value, valueSize, error) = DLL("webservices.dll", "int WsGetReaderProperty(void*, int, void*, dword, void*)")
# 呼び出し: WsGetReaderProperty(reader, id, value, valueSize, error)
# reader : WS_XML_READER* -> "void*"
# id : WS_XML_READER_PROPERTY_ID -> "int"
# value : void* out -> "void*"
# valueSize : DWORD -> "dword"
# error : WS_ERROR* optional -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。