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