ホーム › Networking.WindowsWebServices › WsGetMappedHeader
WsGetMappedHeader
関数メッセージからマップ済みヘッダーを取得する。
シグネチャ
// webservices.dll
#include <windows.h>
HRESULT WsGetMappedHeader(
WS_MESSAGE* message,
const WS_XML_STRING* headerName,
WS_REPEATING_HEADER_OPTION repeatingOption,
DWORD headerIndex,
WS_TYPE valueType,
WS_READ_OPTION readOption,
WS_HEAP* heap, // optional
void* value,
DWORD valueSize,
WS_ERROR* error // optional
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| message | WS_MESSAGE* | in |
| headerName | WS_XML_STRING* | in |
| repeatingOption | WS_REPEATING_HEADER_OPTION | in |
| headerIndex | DWORD | in |
| valueType | WS_TYPE | in |
| readOption | WS_READ_OPTION | in |
| heap | WS_HEAP* | inoptional |
| value | void* | out |
| valueSize | DWORD | in |
| error | WS_ERROR* | inoptional |
戻り値の型: HRESULT
各言語での呼び出し定義
// webservices.dll
#include <windows.h>
HRESULT WsGetMappedHeader(
WS_MESSAGE* message,
const WS_XML_STRING* headerName,
WS_REPEATING_HEADER_OPTION repeatingOption,
DWORD headerIndex,
WS_TYPE valueType,
WS_READ_OPTION readOption,
WS_HEAP* heap, // optional
void* value,
DWORD valueSize,
WS_ERROR* error // optional
);[DllImport("webservices.dll", ExactSpelling = true)]
static extern int WsGetMappedHeader(
ref IntPtr message, // WS_MESSAGE*
IntPtr headerName, // WS_XML_STRING*
int repeatingOption, // WS_REPEATING_HEADER_OPTION
uint headerIndex, // DWORD
int valueType, // WS_TYPE
int readOption, // WS_READ_OPTION
IntPtr heap, // WS_HEAP* optional
IntPtr value, // void* out
uint valueSize, // DWORD
IntPtr error // WS_ERROR* optional
);<DllImport("webservices.dll", ExactSpelling:=True)>
Public Shared Function WsGetMappedHeader(
ByRef message As IntPtr, ' WS_MESSAGE*
headerName As IntPtr, ' WS_XML_STRING*
repeatingOption As Integer, ' WS_REPEATING_HEADER_OPTION
headerIndex As UInteger, ' DWORD
valueType As Integer, ' WS_TYPE
readOption As Integer, ' WS_READ_OPTION
heap As IntPtr, ' WS_HEAP* optional
value As IntPtr, ' void* out
valueSize As UInteger, ' DWORD
[error] As IntPtr ' WS_ERROR* optional
) As Integer
End Function' message : WS_MESSAGE*
' headerName : WS_XML_STRING*
' repeatingOption : WS_REPEATING_HEADER_OPTION
' headerIndex : DWORD
' valueType : WS_TYPE
' readOption : WS_READ_OPTION
' heap : WS_HEAP* optional
' value : void* out
' valueSize : DWORD
' error : WS_ERROR* optional
Declare PtrSafe Function WsGetMappedHeader Lib "webservices" ( _
ByRef message As LongPtr, _
ByVal headerName As LongPtr, _
ByVal repeatingOption As Long, _
ByVal headerIndex As Long, _
ByVal valueType As Long, _
ByVal readOption As Long, _
ByVal heap As LongPtr, _
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
WsGetMappedHeader = ctypes.windll.webservices.WsGetMappedHeader
WsGetMappedHeader.restype = ctypes.c_int
WsGetMappedHeader.argtypes = [
ctypes.c_void_p, # message : WS_MESSAGE*
ctypes.c_void_p, # headerName : WS_XML_STRING*
ctypes.c_int, # repeatingOption : WS_REPEATING_HEADER_OPTION
wintypes.DWORD, # headerIndex : DWORD
ctypes.c_int, # valueType : WS_TYPE
ctypes.c_int, # readOption : WS_READ_OPTION
ctypes.c_void_p, # heap : WS_HEAP* optional
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')
WsGetMappedHeader = Fiddle::Function.new(
lib['WsGetMappedHeader'],
[
Fiddle::TYPE_VOIDP, # message : WS_MESSAGE*
Fiddle::TYPE_VOIDP, # headerName : WS_XML_STRING*
Fiddle::TYPE_INT, # repeatingOption : WS_REPEATING_HEADER_OPTION
-Fiddle::TYPE_INT, # headerIndex : DWORD
Fiddle::TYPE_INT, # valueType : WS_TYPE
Fiddle::TYPE_INT, # readOption : WS_READ_OPTION
Fiddle::TYPE_VOIDP, # heap : WS_HEAP* optional
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 WsGetMappedHeader(
message: *mut isize, // WS_MESSAGE*
headerName: *const WS_XML_STRING, // WS_XML_STRING*
repeatingOption: i32, // WS_REPEATING_HEADER_OPTION
headerIndex: u32, // DWORD
valueType: i32, // WS_TYPE
readOption: i32, // WS_READ_OPTION
heap: *mut isize, // WS_HEAP* optional
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 WsGetMappedHeader(ref IntPtr message, IntPtr headerName, int repeatingOption, uint headerIndex, int valueType, int readOption, IntPtr heap, IntPtr value, uint valueSize, IntPtr error);
"@
$api = Add-Type -MemberDefinition $sig -Name 'webservices_WsGetMappedHeader' -Namespace Win32 -PassThru
# $api::WsGetMappedHeader(message, headerName, repeatingOption, headerIndex, valueType, readOption, heap, value, valueSize, error)#uselib "webservices.dll"
#func global WsGetMappedHeader "WsGetMappedHeader" sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr
; WsGetMappedHeader message, varptr(headerName), repeatingOption, headerIndex, valueType, readOption, heap, value, valueSize, error ; 戻り値は stat
; message : WS_MESSAGE* -> "sptr"
; headerName : WS_XML_STRING* -> "sptr"
; repeatingOption : WS_REPEATING_HEADER_OPTION -> "sptr"
; headerIndex : DWORD -> "sptr"
; valueType : WS_TYPE -> "sptr"
; readOption : WS_READ_OPTION -> "sptr"
; heap : WS_HEAP* optional -> "sptr"
; value : void* out -> "sptr"
; valueSize : DWORD -> "sptr"
; error : WS_ERROR* optional -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "webservices.dll" #cfunc global WsGetMappedHeader "WsGetMappedHeader" int, var, int, int, int, int, int, sptr, int, int ; res = WsGetMappedHeader(message, headerName, repeatingOption, headerIndex, valueType, readOption, heap, value, valueSize, error) ; message : WS_MESSAGE* -> "int" ; headerName : WS_XML_STRING* -> "var" ; repeatingOption : WS_REPEATING_HEADER_OPTION -> "int" ; headerIndex : DWORD -> "int" ; valueType : WS_TYPE -> "int" ; readOption : WS_READ_OPTION -> "int" ; heap : WS_HEAP* optional -> "int" ; value : void* out -> "sptr" ; valueSize : DWORD -> "int" ; error : WS_ERROR* optional -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "webservices.dll" #cfunc global WsGetMappedHeader "WsGetMappedHeader" int, sptr, int, int, int, int, int, sptr, int, int ; res = WsGetMappedHeader(message, varptr(headerName), repeatingOption, headerIndex, valueType, readOption, heap, value, valueSize, error) ; message : WS_MESSAGE* -> "int" ; headerName : WS_XML_STRING* -> "sptr" ; repeatingOption : WS_REPEATING_HEADER_OPTION -> "int" ; headerIndex : DWORD -> "int" ; valueType : WS_TYPE -> "int" ; readOption : WS_READ_OPTION -> "int" ; heap : WS_HEAP* optional -> "int" ; value : void* out -> "sptr" ; valueSize : DWORD -> "int" ; error : WS_ERROR* optional -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; HRESULT WsGetMappedHeader(WS_MESSAGE* message, WS_XML_STRING* headerName, WS_REPEATING_HEADER_OPTION repeatingOption, DWORD headerIndex, WS_TYPE valueType, WS_READ_OPTION readOption, WS_HEAP* heap, void* value, DWORD valueSize, WS_ERROR* error) #uselib "webservices.dll" #cfunc global WsGetMappedHeader "WsGetMappedHeader" int, var, int, int, int, int, int, intptr, int, int ; res = WsGetMappedHeader(message, headerName, repeatingOption, headerIndex, valueType, readOption, heap, value, valueSize, error) ; message : WS_MESSAGE* -> "int" ; headerName : WS_XML_STRING* -> "var" ; repeatingOption : WS_REPEATING_HEADER_OPTION -> "int" ; headerIndex : DWORD -> "int" ; valueType : WS_TYPE -> "int" ; readOption : WS_READ_OPTION -> "int" ; heap : WS_HEAP* optional -> "int" ; value : void* out -> "intptr" ; valueSize : DWORD -> "int" ; error : WS_ERROR* optional -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; HRESULT WsGetMappedHeader(WS_MESSAGE* message, WS_XML_STRING* headerName, WS_REPEATING_HEADER_OPTION repeatingOption, DWORD headerIndex, WS_TYPE valueType, WS_READ_OPTION readOption, WS_HEAP* heap, void* value, DWORD valueSize, WS_ERROR* error) #uselib "webservices.dll" #cfunc global WsGetMappedHeader "WsGetMappedHeader" int, intptr, int, int, int, int, int, intptr, int, int ; res = WsGetMappedHeader(message, varptr(headerName), repeatingOption, headerIndex, valueType, readOption, heap, value, valueSize, error) ; message : WS_MESSAGE* -> "int" ; headerName : WS_XML_STRING* -> "intptr" ; repeatingOption : WS_REPEATING_HEADER_OPTION -> "int" ; headerIndex : DWORD -> "int" ; valueType : WS_TYPE -> "int" ; readOption : WS_READ_OPTION -> "int" ; heap : WS_HEAP* optional -> "int" ; value : void* out -> "intptr" ; valueSize : DWORD -> "int" ; error : WS_ERROR* optional -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
webservices = windows.NewLazySystemDLL("webservices.dll")
procWsGetMappedHeader = webservices.NewProc("WsGetMappedHeader")
)
// message (WS_MESSAGE*), headerName (WS_XML_STRING*), repeatingOption (WS_REPEATING_HEADER_OPTION), headerIndex (DWORD), valueType (WS_TYPE), readOption (WS_READ_OPTION), heap (WS_HEAP* optional), value (void* out), valueSize (DWORD), error (WS_ERROR* optional)
r1, _, err := procWsGetMappedHeader.Call(
uintptr(message),
uintptr(headerName),
uintptr(repeatingOption),
uintptr(headerIndex),
uintptr(valueType),
uintptr(readOption),
uintptr(heap),
uintptr(value),
uintptr(valueSize),
uintptr(error),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction WsGetMappedHeader(
message: Pointer; // WS_MESSAGE*
headerName: Pointer; // WS_XML_STRING*
repeatingOption: Integer; // WS_REPEATING_HEADER_OPTION
headerIndex: DWORD; // DWORD
valueType: Integer; // WS_TYPE
readOption: Integer; // WS_READ_OPTION
heap: Pointer; // WS_HEAP* optional
value: Pointer; // void* out
valueSize: DWORD; // DWORD
error: Pointer // WS_ERROR* optional
): Integer; stdcall;
external 'webservices.dll' name 'WsGetMappedHeader';result := DllCall("webservices\WsGetMappedHeader"
, "Ptr", message ; WS_MESSAGE*
, "Ptr", headerName ; WS_XML_STRING*
, "Int", repeatingOption ; WS_REPEATING_HEADER_OPTION
, "UInt", headerIndex ; DWORD
, "Int", valueType ; WS_TYPE
, "Int", readOption ; WS_READ_OPTION
, "Ptr", heap ; WS_HEAP* optional
, "Ptr", value ; void* out
, "UInt", valueSize ; DWORD
, "Ptr", error ; WS_ERROR* optional
, "Int") ; return: HRESULT●WsGetMappedHeader(message, headerName, repeatingOption, headerIndex, valueType, readOption, heap, value, valueSize, error) = DLL("webservices.dll", "int WsGetMappedHeader(void*, void*, int, dword, int, int, void*, void*, dword, void*)")
# 呼び出し: WsGetMappedHeader(message, headerName, repeatingOption, headerIndex, valueType, readOption, heap, value, valueSize, error)
# message : WS_MESSAGE* -> "void*"
# headerName : WS_XML_STRING* -> "void*"
# repeatingOption : WS_REPEATING_HEADER_OPTION -> "int"
# headerIndex : DWORD -> "dword"
# valueType : WS_TYPE -> "int"
# readOption : WS_READ_OPTION -> "int"
# heap : WS_HEAP* optional -> "void*"
# value : void* out -> "void*"
# valueSize : DWORD -> "dword"
# error : WS_ERROR* optional -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。