WsRequestReply
関数シグネチャ
// webservices.dll
#include <windows.h>
HRESULT WsRequestReply(
WS_CHANNEL* channel,
WS_MESSAGE* requestMessage,
const WS_MESSAGE_DESCRIPTION* requestMessageDescription,
WS_WRITE_OPTION writeOption,
const void* requestBodyValue, // optional
DWORD requestBodyValueSize,
WS_MESSAGE* replyMessage,
const WS_MESSAGE_DESCRIPTION* replyMessageDescription,
WS_READ_OPTION readOption,
WS_HEAP* heap, // optional
void* value, // optional
DWORD valueSize,
const WS_ASYNC_CONTEXT* asyncContext, // optional
WS_ERROR* error // optional
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| channel | WS_CHANNEL* | in | 要求-応答操作を実行するチャネル。 |
| requestMessage | WS_MESSAGE* | in | 要求の送信に使用するメッセージオブジェクト。 メッセージオブジェクトは WS_MESSAGE_STATE_EMPTY または WS_MESSAGE_STATE_INITIALIZED の状態である必要があります。 |
| requestMessageDescription | WS_MESSAGE_DESCRIPTION* | in | WS_MESSAGE_DESCRIPTION の action フィールドは、要求メッセージの action ヘッダーとして使用されます。action が不要な場合、このフィールドは NULL でもかまいません。 WS_MESSAGE_DESCRIPTION の bodyElementDescription フィールドは、要求メッセージの本文をシリアル化するために使用されます。本文要素が不要な場合、このフィールドは NULL でもかまいません。bodyElementDescription に従って本文がどのようにシリアル化されるかについては、WsWriteBody を参照してください。 |
| writeOption | WS_WRITE_OPTION | in | 本文要素が必須かどうか、および値をどのように割り当てるかを指定します。 詳細については WS_WRITE_OPTION を参照してください。 |
| requestBodyValue | void* | inoptional | 要求オブジェクトの本文にシリアル化する値へのポインター。 |
| requestBodyValueSize | DWORD | in | シリアル化する要求値のサイズ (バイト単位)。 |
| replyMessage | WS_MESSAGE* | in | 応答の受信に使用するメッセージオブジェクト。 メッセージオブジェクトは WS_MESSAGE_STATE_EMPTY の状態である必要があります。 |
| replyMessageDescription | WS_MESSAGE_DESCRIPTION* | in | WS_MESSAGE_DESCRIPTION の action フィールドは、受信した応答メッセージの action ヘッダーを検証するために使用されます。action が不要な場合、このフィールドは NULL でもかまいません。NULL の場合、受信したメッセージに action ヘッダーが存在していても無視されます。 WS_MESSAGE_DESCRIPTION の bodyElementDescription フィールドは、応答メッセージの本文を逆シリアル化するために使用されます。本文要素が不要な場合、このフィールドは NULL でもかまいません。bodyElementDescription に従って本文がどのように逆シリアル化されるかについては、WsReadBody を参照してください。 |
| readOption | WS_READ_OPTION | in | 応答の本文要素が必須かどうか、および値をどのように割り当てるかを指定します。 詳細については、WS_READ_OPTION および WsReadBody を参照してください。 |
| heap | WS_HEAP* | inoptional | 逆シリアル化された応答本文の値を割り当てるために使用するヒープ。 指定された型でヒープが不要な場合、この パラメーターは NULL でもかまいません。 |
| value | void* | outoptional | 逆シリアル化された本文の値を格納する場所。 このパラメーターの解釈は WS_READ_OPTION によって異なります。 応答の WS_MESSAGE_DESCRIPTION の bodyElementDescription が NULL の場合、このパラメーターは変更されません。この場合、パラメーターを指定する必要はありません。 |
| valueSize | DWORD | in | このパラメーターの解釈は WS_READ_OPTION によって異なります。 |
| asyncContext | WS_ASYNC_CONTEXT* | inoptional | 関数を非同期に呼び出す方法に関する情報。同期的に呼び出す場合は NULL。 |
| error | WS_ERROR* | inoptional | 関数が失敗した場合に、追加のエラー情報を格納する場所を指定します。 |
戻り値の型: HRESULT
公式ドキュメント
要求メッセージを送信し、それに対応する応答メッセージを受信するために使用します。
戻り値
この関数は、次のいずれかの値を返すことがあります。
| 戻り値 | 説明 |
|---|---|
| 応答メッセージにフォールトが含まれていました。フォールトは WS_ERROR から WsGetErrorProperty を使用して取得できます。 | |
| 非同期操作はまだ保留中です。 | |
| 操作が中止されました。 | |
| オブジェクトの現在の状態では、この操作は許可されていません。 | |
| リモートエンドポイントが存在しないか、見つかりませんでした。 | |
| リモートエンドポイントによってアクセスが拒否されました。 | |
| リモートエンドポイントとの接続が終了しました。 | |
| リモートエンドポイントが要求を処理できませんでした。 | |
| リモートエンドポイントは、現在この場所ではサービスを提供していません。 | |
| リモートエンドポイントは過負荷のため、要求を処理できません。 | |
| リモートエンドポイントに到達できませんでした。 | |
| エンドポイントアドレスの URL が無効です。 | |
| 入力データが予期された形式ではないか、予期された値ではありませんでした。 | |
| 操作が、割り当てられた時間内に完了しませんでした。 | |
| HTTP プロキシサーバーによってアクセスが拒否されました。 | |
| HTTP プロキシサーバーが要求を処理できませんでした。 | |
| クォータを超過しました。 | |
| 受信したデータのセキュリティ検証に失敗しました。 | |
| Windows Web Services フレームワークでセキュリティ操作が失敗しました。 | |
| セキュリティトークンの有効期限が切れているため、サーバーによって拒否されました。 | |
| HTTP プロキシサーバーは、HTTP 認証方式 'basic' を必要とします。 | |
| HTTP プロキシサーバーは、HTTP 認証方式 'digest' を必要とします。 | |
| HTTP プロキシサーバーは、HTTP 認証方式 'negotiate' を必要とします。 | |
| HTTP プロキシサーバーは、HTTP 認証方式 'NTLM' を必要とします。 | |
| リモートエンドポイントは、HTTP 認証方式 'basic' を必要とします。 | |
| リモートエンドポイントは、HTTP 認証方式 'digest' を必要とします。 | |
| リモートエンドポイントは、HTTP 認証方式 'negotiate' を必要とします。 | |
| リモートエンドポイントは、HTTP 認証方式 'NTLM' を必要とします。 | |
| 現在のシステムクロックまたは署名済みファイル内のタイムスタンプに対して検証したときに、必要な証明書が有効期間内にありません。 | |
| 証明書の CN 名が、渡された値と一致しません。 | |
| 証明書チェーンは処理されましたが、信頼プロバイダーが信頼していないルート証明書で終了しました。 | |
| この証明書は、要求された用途には有効ではありません。 | |
| 失効サーバーがオフラインであったため、失効確認の関数は失効を確認できませんでした。 | |
| メモリが不足しました。 | |
| 1 つ以上の引数が無効です。 | |
|
この関数は、上記以外のエラーを返すことがあります。 |
解説(Remarks)
メッセージは WS_ADDRESSING_VERSION に応じて適切に関連付けられます。 要求と応答のメッセージの関連付けの詳細については、チャネル層の概要 を参照してください。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での呼び出し定義
// webservices.dll
#include <windows.h>
HRESULT WsRequestReply(
WS_CHANNEL* channel,
WS_MESSAGE* requestMessage,
const WS_MESSAGE_DESCRIPTION* requestMessageDescription,
WS_WRITE_OPTION writeOption,
const void* requestBodyValue, // optional
DWORD requestBodyValueSize,
WS_MESSAGE* replyMessage,
const WS_MESSAGE_DESCRIPTION* replyMessageDescription,
WS_READ_OPTION readOption,
WS_HEAP* heap, // optional
void* value, // optional
DWORD valueSize,
const WS_ASYNC_CONTEXT* asyncContext, // optional
WS_ERROR* error // optional
);[DllImport("webservices.dll", ExactSpelling = true)]
static extern int WsRequestReply(
ref IntPtr channel, // WS_CHANNEL*
ref IntPtr requestMessage, // WS_MESSAGE*
IntPtr requestMessageDescription, // WS_MESSAGE_DESCRIPTION*
int writeOption, // WS_WRITE_OPTION
IntPtr requestBodyValue, // void* optional
uint requestBodyValueSize, // DWORD
ref IntPtr replyMessage, // WS_MESSAGE*
IntPtr replyMessageDescription, // WS_MESSAGE_DESCRIPTION*
int readOption, // WS_READ_OPTION
IntPtr heap, // WS_HEAP* optional
IntPtr value, // void* optional, out
uint valueSize, // DWORD
IntPtr asyncContext, // WS_ASYNC_CONTEXT* optional
IntPtr error // WS_ERROR* optional
);<DllImport("webservices.dll", ExactSpelling:=True)>
Public Shared Function WsRequestReply(
ByRef channel As IntPtr, ' WS_CHANNEL*
ByRef requestMessage As IntPtr, ' WS_MESSAGE*
requestMessageDescription As IntPtr, ' WS_MESSAGE_DESCRIPTION*
writeOption As Integer, ' WS_WRITE_OPTION
requestBodyValue As IntPtr, ' void* optional
requestBodyValueSize As UInteger, ' DWORD
ByRef replyMessage As IntPtr, ' WS_MESSAGE*
replyMessageDescription As IntPtr, ' WS_MESSAGE_DESCRIPTION*
readOption As Integer, ' WS_READ_OPTION
heap As IntPtr, ' WS_HEAP* optional
value As IntPtr, ' void* optional, out
valueSize As UInteger, ' DWORD
asyncContext As IntPtr, ' WS_ASYNC_CONTEXT* optional
[error] As IntPtr ' WS_ERROR* optional
) As Integer
End Function' channel : WS_CHANNEL*
' requestMessage : WS_MESSAGE*
' requestMessageDescription : WS_MESSAGE_DESCRIPTION*
' writeOption : WS_WRITE_OPTION
' requestBodyValue : void* optional
' requestBodyValueSize : DWORD
' replyMessage : WS_MESSAGE*
' replyMessageDescription : WS_MESSAGE_DESCRIPTION*
' readOption : WS_READ_OPTION
' heap : WS_HEAP* optional
' value : void* optional, out
' valueSize : DWORD
' asyncContext : WS_ASYNC_CONTEXT* optional
' error : WS_ERROR* optional
Declare PtrSafe Function WsRequestReply Lib "webservices" ( _
ByRef channel As LongPtr, _
ByRef requestMessage As LongPtr, _
ByVal requestMessageDescription As LongPtr, _
ByVal writeOption As Long, _
ByVal requestBodyValue As LongPtr, _
ByVal requestBodyValueSize As Long, _
ByRef replyMessage As LongPtr, _
ByVal replyMessageDescription As LongPtr, _
ByVal readOption As Long, _
ByVal heap As LongPtr, _
ByVal value As LongPtr, _
ByVal valueSize As Long, _
ByVal asyncContext 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
WsRequestReply = ctypes.windll.webservices.WsRequestReply
WsRequestReply.restype = ctypes.c_int
WsRequestReply.argtypes = [
ctypes.c_void_p, # channel : WS_CHANNEL*
ctypes.c_void_p, # requestMessage : WS_MESSAGE*
ctypes.c_void_p, # requestMessageDescription : WS_MESSAGE_DESCRIPTION*
ctypes.c_int, # writeOption : WS_WRITE_OPTION
ctypes.POINTER(None), # requestBodyValue : void* optional
wintypes.DWORD, # requestBodyValueSize : DWORD
ctypes.c_void_p, # replyMessage : WS_MESSAGE*
ctypes.c_void_p, # replyMessageDescription : WS_MESSAGE_DESCRIPTION*
ctypes.c_int, # readOption : WS_READ_OPTION
ctypes.c_void_p, # heap : WS_HEAP* optional
ctypes.POINTER(None), # value : void* optional, out
wintypes.DWORD, # valueSize : DWORD
ctypes.c_void_p, # asyncContext : WS_ASYNC_CONTEXT* optional
ctypes.c_void_p, # error : WS_ERROR* optional
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('webservices.dll')
WsRequestReply = Fiddle::Function.new(
lib['WsRequestReply'],
[
Fiddle::TYPE_VOIDP, # channel : WS_CHANNEL*
Fiddle::TYPE_VOIDP, # requestMessage : WS_MESSAGE*
Fiddle::TYPE_VOIDP, # requestMessageDescription : WS_MESSAGE_DESCRIPTION*
Fiddle::TYPE_INT, # writeOption : WS_WRITE_OPTION
Fiddle::TYPE_VOIDP, # requestBodyValue : void* optional
-Fiddle::TYPE_INT, # requestBodyValueSize : DWORD
Fiddle::TYPE_VOIDP, # replyMessage : WS_MESSAGE*
Fiddle::TYPE_VOIDP, # replyMessageDescription : WS_MESSAGE_DESCRIPTION*
Fiddle::TYPE_INT, # readOption : WS_READ_OPTION
Fiddle::TYPE_VOIDP, # heap : WS_HEAP* optional
Fiddle::TYPE_VOIDP, # value : void* optional, out
-Fiddle::TYPE_INT, # valueSize : DWORD
Fiddle::TYPE_VOIDP, # asyncContext : WS_ASYNC_CONTEXT* optional
Fiddle::TYPE_VOIDP, # error : WS_ERROR* optional
],
Fiddle::TYPE_INT)#[link(name = "webservices")]
extern "system" {
fn WsRequestReply(
channel: *mut isize, // WS_CHANNEL*
requestMessage: *mut isize, // WS_MESSAGE*
requestMessageDescription: *const WS_MESSAGE_DESCRIPTION, // WS_MESSAGE_DESCRIPTION*
writeOption: i32, // WS_WRITE_OPTION
requestBodyValue: *const (), // void* optional
requestBodyValueSize: u32, // DWORD
replyMessage: *mut isize, // WS_MESSAGE*
replyMessageDescription: *const WS_MESSAGE_DESCRIPTION, // WS_MESSAGE_DESCRIPTION*
readOption: i32, // WS_READ_OPTION
heap: *mut isize, // WS_HEAP* optional
value: *mut (), // void* optional, out
valueSize: u32, // DWORD
asyncContext: *const WS_ASYNC_CONTEXT, // WS_ASYNC_CONTEXT* optional
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 WsRequestReply(ref IntPtr channel, ref IntPtr requestMessage, IntPtr requestMessageDescription, int writeOption, IntPtr requestBodyValue, uint requestBodyValueSize, ref IntPtr replyMessage, IntPtr replyMessageDescription, int readOption, IntPtr heap, IntPtr value, uint valueSize, IntPtr asyncContext, IntPtr error);
"@
$api = Add-Type -MemberDefinition $sig -Name 'webservices_WsRequestReply' -Namespace Win32 -PassThru
# $api::WsRequestReply(channel, requestMessage, requestMessageDescription, writeOption, requestBodyValue, requestBodyValueSize, replyMessage, replyMessageDescription, readOption, heap, value, valueSize, asyncContext, error)#uselib "webservices.dll"
#func global WsRequestReply "WsRequestReply" sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr
; WsRequestReply varptr(channel), varptr(requestMessage), varptr(requestMessageDescription), writeOption, requestBodyValue, requestBodyValueSize, varptr(replyMessage), varptr(replyMessageDescription), readOption, varptr(heap), value, valueSize, varptr(asyncContext), varptr(error) ; 戻り値は stat
; channel : WS_CHANNEL* -> "sptr"
; requestMessage : WS_MESSAGE* -> "sptr"
; requestMessageDescription : WS_MESSAGE_DESCRIPTION* -> "sptr"
; writeOption : WS_WRITE_OPTION -> "sptr"
; requestBodyValue : void* optional -> "sptr"
; requestBodyValueSize : DWORD -> "sptr"
; replyMessage : WS_MESSAGE* -> "sptr"
; replyMessageDescription : WS_MESSAGE_DESCRIPTION* -> "sptr"
; readOption : WS_READ_OPTION -> "sptr"
; heap : WS_HEAP* optional -> "sptr"
; value : void* optional, out -> "sptr"
; valueSize : DWORD -> "sptr"
; asyncContext : WS_ASYNC_CONTEXT* optional -> "sptr"
; error : WS_ERROR* optional -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "webservices.dll" #cfunc global WsRequestReply "WsRequestReply" var, var, var, int, sptr, int, var, var, int, var, sptr, int, var, var ; res = WsRequestReply(channel, requestMessage, requestMessageDescription, writeOption, requestBodyValue, requestBodyValueSize, replyMessage, replyMessageDescription, readOption, heap, value, valueSize, asyncContext, error) ; channel : WS_CHANNEL* -> "var" ; requestMessage : WS_MESSAGE* -> "var" ; requestMessageDescription : WS_MESSAGE_DESCRIPTION* -> "var" ; writeOption : WS_WRITE_OPTION -> "int" ; requestBodyValue : void* optional -> "sptr" ; requestBodyValueSize : DWORD -> "int" ; replyMessage : WS_MESSAGE* -> "var" ; replyMessageDescription : WS_MESSAGE_DESCRIPTION* -> "var" ; readOption : WS_READ_OPTION -> "int" ; heap : WS_HEAP* optional -> "var" ; value : void* optional, out -> "sptr" ; valueSize : DWORD -> "int" ; asyncContext : WS_ASYNC_CONTEXT* optional -> "var" ; error : WS_ERROR* optional -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "webservices.dll" #cfunc global WsRequestReply "WsRequestReply" sptr, sptr, sptr, int, sptr, int, sptr, sptr, int, sptr, sptr, int, sptr, sptr ; res = WsRequestReply(varptr(channel), varptr(requestMessage), varptr(requestMessageDescription), writeOption, requestBodyValue, requestBodyValueSize, varptr(replyMessage), varptr(replyMessageDescription), readOption, varptr(heap), value, valueSize, varptr(asyncContext), varptr(error)) ; channel : WS_CHANNEL* -> "sptr" ; requestMessage : WS_MESSAGE* -> "sptr" ; requestMessageDescription : WS_MESSAGE_DESCRIPTION* -> "sptr" ; writeOption : WS_WRITE_OPTION -> "int" ; requestBodyValue : void* optional -> "sptr" ; requestBodyValueSize : DWORD -> "int" ; replyMessage : WS_MESSAGE* -> "sptr" ; replyMessageDescription : WS_MESSAGE_DESCRIPTION* -> "sptr" ; readOption : WS_READ_OPTION -> "int" ; heap : WS_HEAP* optional -> "sptr" ; value : void* optional, out -> "sptr" ; valueSize : DWORD -> "int" ; asyncContext : WS_ASYNC_CONTEXT* optional -> "sptr" ; error : WS_ERROR* optional -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
; HRESULT WsRequestReply(WS_CHANNEL* channel, WS_MESSAGE* requestMessage, WS_MESSAGE_DESCRIPTION* requestMessageDescription, WS_WRITE_OPTION writeOption, void* requestBodyValue, DWORD requestBodyValueSize, WS_MESSAGE* replyMessage, WS_MESSAGE_DESCRIPTION* replyMessageDescription, WS_READ_OPTION readOption, WS_HEAP* heap, void* value, DWORD valueSize, WS_ASYNC_CONTEXT* asyncContext, WS_ERROR* error) #uselib "webservices.dll" #cfunc global WsRequestReply "WsRequestReply" var, var, var, int, intptr, int, var, var, int, var, intptr, int, var, var ; res = WsRequestReply(channel, requestMessage, requestMessageDescription, writeOption, requestBodyValue, requestBodyValueSize, replyMessage, replyMessageDescription, readOption, heap, value, valueSize, asyncContext, error) ; channel : WS_CHANNEL* -> "var" ; requestMessage : WS_MESSAGE* -> "var" ; requestMessageDescription : WS_MESSAGE_DESCRIPTION* -> "var" ; writeOption : WS_WRITE_OPTION -> "int" ; requestBodyValue : void* optional -> "intptr" ; requestBodyValueSize : DWORD -> "int" ; replyMessage : WS_MESSAGE* -> "var" ; replyMessageDescription : WS_MESSAGE_DESCRIPTION* -> "var" ; readOption : WS_READ_OPTION -> "int" ; heap : WS_HEAP* optional -> "var" ; value : void* optional, out -> "intptr" ; valueSize : DWORD -> "int" ; asyncContext : WS_ASYNC_CONTEXT* optional -> "var" ; error : WS_ERROR* optional -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; HRESULT WsRequestReply(WS_CHANNEL* channel, WS_MESSAGE* requestMessage, WS_MESSAGE_DESCRIPTION* requestMessageDescription, WS_WRITE_OPTION writeOption, void* requestBodyValue, DWORD requestBodyValueSize, WS_MESSAGE* replyMessage, WS_MESSAGE_DESCRIPTION* replyMessageDescription, WS_READ_OPTION readOption, WS_HEAP* heap, void* value, DWORD valueSize, WS_ASYNC_CONTEXT* asyncContext, WS_ERROR* error) #uselib "webservices.dll" #cfunc global WsRequestReply "WsRequestReply" intptr, intptr, intptr, int, intptr, int, intptr, intptr, int, intptr, intptr, int, intptr, intptr ; res = WsRequestReply(varptr(channel), varptr(requestMessage), varptr(requestMessageDescription), writeOption, requestBodyValue, requestBodyValueSize, varptr(replyMessage), varptr(replyMessageDescription), readOption, varptr(heap), value, valueSize, varptr(asyncContext), varptr(error)) ; channel : WS_CHANNEL* -> "intptr" ; requestMessage : WS_MESSAGE* -> "intptr" ; requestMessageDescription : WS_MESSAGE_DESCRIPTION* -> "intptr" ; writeOption : WS_WRITE_OPTION -> "int" ; requestBodyValue : void* optional -> "intptr" ; requestBodyValueSize : DWORD -> "int" ; replyMessage : WS_MESSAGE* -> "intptr" ; replyMessageDescription : WS_MESSAGE_DESCRIPTION* -> "intptr" ; readOption : WS_READ_OPTION -> "int" ; heap : WS_HEAP* optional -> "intptr" ; value : void* optional, out -> "intptr" ; valueSize : DWORD -> "int" ; asyncContext : WS_ASYNC_CONTEXT* optional -> "intptr" ; error : WS_ERROR* optional -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
webservices = windows.NewLazySystemDLL("webservices.dll")
procWsRequestReply = webservices.NewProc("WsRequestReply")
)
// channel (WS_CHANNEL*), requestMessage (WS_MESSAGE*), requestMessageDescription (WS_MESSAGE_DESCRIPTION*), writeOption (WS_WRITE_OPTION), requestBodyValue (void* optional), requestBodyValueSize (DWORD), replyMessage (WS_MESSAGE*), replyMessageDescription (WS_MESSAGE_DESCRIPTION*), readOption (WS_READ_OPTION), heap (WS_HEAP* optional), value (void* optional, out), valueSize (DWORD), asyncContext (WS_ASYNC_CONTEXT* optional), error (WS_ERROR* optional)
r1, _, err := procWsRequestReply.Call(
uintptr(channel),
uintptr(requestMessage),
uintptr(requestMessageDescription),
uintptr(writeOption),
uintptr(requestBodyValue),
uintptr(requestBodyValueSize),
uintptr(replyMessage),
uintptr(replyMessageDescription),
uintptr(readOption),
uintptr(heap),
uintptr(value),
uintptr(valueSize),
uintptr(asyncContext),
uintptr(error),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction WsRequestReply(
channel: Pointer; // WS_CHANNEL*
requestMessage: Pointer; // WS_MESSAGE*
requestMessageDescription: Pointer; // WS_MESSAGE_DESCRIPTION*
writeOption: Integer; // WS_WRITE_OPTION
requestBodyValue: Pointer; // void* optional
requestBodyValueSize: DWORD; // DWORD
replyMessage: Pointer; // WS_MESSAGE*
replyMessageDescription: Pointer; // WS_MESSAGE_DESCRIPTION*
readOption: Integer; // WS_READ_OPTION
heap: Pointer; // WS_HEAP* optional
value: Pointer; // void* optional, out
valueSize: DWORD; // DWORD
asyncContext: Pointer; // WS_ASYNC_CONTEXT* optional
error: Pointer // WS_ERROR* optional
): Integer; stdcall;
external 'webservices.dll' name 'WsRequestReply';result := DllCall("webservices\WsRequestReply"
, "Ptr", channel ; WS_CHANNEL*
, "Ptr", requestMessage ; WS_MESSAGE*
, "Ptr", requestMessageDescription ; WS_MESSAGE_DESCRIPTION*
, "Int", writeOption ; WS_WRITE_OPTION
, "Ptr", requestBodyValue ; void* optional
, "UInt", requestBodyValueSize ; DWORD
, "Ptr", replyMessage ; WS_MESSAGE*
, "Ptr", replyMessageDescription ; WS_MESSAGE_DESCRIPTION*
, "Int", readOption ; WS_READ_OPTION
, "Ptr", heap ; WS_HEAP* optional
, "Ptr", value ; void* optional, out
, "UInt", valueSize ; DWORD
, "Ptr", asyncContext ; WS_ASYNC_CONTEXT* optional
, "Ptr", error ; WS_ERROR* optional
, "Int") ; return: HRESULT●WsRequestReply(channel, requestMessage, requestMessageDescription, writeOption, requestBodyValue, requestBodyValueSize, replyMessage, replyMessageDescription, readOption, heap, value, valueSize, asyncContext, error) = DLL("webservices.dll", "int WsRequestReply(void*, void*, void*, int, void*, dword, void*, void*, int, void*, void*, dword, void*, void*)")
# 呼び出し: WsRequestReply(channel, requestMessage, requestMessageDescription, writeOption, requestBodyValue, requestBodyValueSize, replyMessage, replyMessageDescription, readOption, heap, value, valueSize, asyncContext, error)
# channel : WS_CHANNEL* -> "void*"
# requestMessage : WS_MESSAGE* -> "void*"
# requestMessageDescription : WS_MESSAGE_DESCRIPTION* -> "void*"
# writeOption : WS_WRITE_OPTION -> "int"
# requestBodyValue : void* optional -> "void*"
# requestBodyValueSize : DWORD -> "dword"
# replyMessage : WS_MESSAGE* -> "void*"
# replyMessageDescription : WS_MESSAGE_DESCRIPTION* -> "void*"
# readOption : WS_READ_OPTION -> "int"
# heap : WS_HEAP* optional -> "void*"
# value : void* optional, out -> "void*"
# valueSize : DWORD -> "dword"
# asyncContext : WS_ASYNC_CONTEXT* optional -> "void*"
# error : WS_ERROR* optional -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "webservices" fn WsRequestReply(
channel: [*c]isize, // WS_CHANNEL*
requestMessage: [*c]isize, // WS_MESSAGE*
requestMessageDescription: [*c]WS_MESSAGE_DESCRIPTION, // WS_MESSAGE_DESCRIPTION*
writeOption: i32, // WS_WRITE_OPTION
requestBodyValue: ?*anyopaque, // void* optional
requestBodyValueSize: u32, // DWORD
replyMessage: [*c]isize, // WS_MESSAGE*
replyMessageDescription: [*c]WS_MESSAGE_DESCRIPTION, // WS_MESSAGE_DESCRIPTION*
readOption: i32, // WS_READ_OPTION
heap: [*c]isize, // WS_HEAP* optional
value: ?*anyopaque, // void* optional, out
valueSize: u32, // DWORD
asyncContext: [*c]WS_ASYNC_CONTEXT, // WS_ASYNC_CONTEXT* optional
error: [*c]isize // WS_ERROR* optional
) callconv(std.os.windows.WINAPI) i32;proc WsRequestReply(
channel: ptr int, # WS_CHANNEL*
requestMessage: ptr int, # WS_MESSAGE*
requestMessageDescription: ptr WS_MESSAGE_DESCRIPTION, # WS_MESSAGE_DESCRIPTION*
writeOption: int32, # WS_WRITE_OPTION
requestBodyValue: pointer, # void* optional
requestBodyValueSize: uint32, # DWORD
replyMessage: ptr int, # WS_MESSAGE*
replyMessageDescription: ptr WS_MESSAGE_DESCRIPTION, # WS_MESSAGE_DESCRIPTION*
readOption: int32, # WS_READ_OPTION
heap: ptr int, # WS_HEAP* optional
value: pointer, # void* optional, out
valueSize: uint32, # DWORD
asyncContext: ptr WS_ASYNC_CONTEXT, # WS_ASYNC_CONTEXT* optional
error: ptr int # WS_ERROR* optional
): int32 {.importc: "WsRequestReply", stdcall, dynlib: "webservices.dll".}pragma(lib, "webservices");
extern(Windows)
int WsRequestReply(
ptrdiff_t* channel, // WS_CHANNEL*
ptrdiff_t* requestMessage, // WS_MESSAGE*
WS_MESSAGE_DESCRIPTION* requestMessageDescription, // WS_MESSAGE_DESCRIPTION*
int writeOption, // WS_WRITE_OPTION
void* requestBodyValue, // void* optional
uint requestBodyValueSize, // DWORD
ptrdiff_t* replyMessage, // WS_MESSAGE*
WS_MESSAGE_DESCRIPTION* replyMessageDescription, // WS_MESSAGE_DESCRIPTION*
int readOption, // WS_READ_OPTION
ptrdiff_t* heap, // WS_HEAP* optional
void* value, // void* optional, out
uint valueSize, // DWORD
WS_ASYNC_CONTEXT* asyncContext, // WS_ASYNC_CONTEXT* optional
ptrdiff_t* error // WS_ERROR* optional
);ccall((:WsRequestReply, "webservices.dll"), stdcall, Int32,
(Ptr{Int}, Ptr{Int}, Ptr{WS_MESSAGE_DESCRIPTION}, Int32, Ptr{Cvoid}, UInt32, Ptr{Int}, Ptr{WS_MESSAGE_DESCRIPTION}, Int32, Ptr{Int}, Ptr{Cvoid}, UInt32, Ptr{WS_ASYNC_CONTEXT}, Ptr{Int}),
channel, requestMessage, requestMessageDescription, writeOption, requestBodyValue, requestBodyValueSize, replyMessage, replyMessageDescription, readOption, heap, value, valueSize, asyncContext, error)
# channel : WS_CHANNEL* -> Ptr{Int}
# requestMessage : WS_MESSAGE* -> Ptr{Int}
# requestMessageDescription : WS_MESSAGE_DESCRIPTION* -> Ptr{WS_MESSAGE_DESCRIPTION}
# writeOption : WS_WRITE_OPTION -> Int32
# requestBodyValue : void* optional -> Ptr{Cvoid}
# requestBodyValueSize : DWORD -> UInt32
# replyMessage : WS_MESSAGE* -> Ptr{Int}
# replyMessageDescription : WS_MESSAGE_DESCRIPTION* -> Ptr{WS_MESSAGE_DESCRIPTION}
# readOption : WS_READ_OPTION -> Int32
# heap : WS_HEAP* optional -> Ptr{Int}
# value : void* optional, out -> Ptr{Cvoid}
# valueSize : DWORD -> UInt32
# asyncContext : WS_ASYNC_CONTEXT* optional -> Ptr{WS_ASYNC_CONTEXT}
# error : WS_ERROR* optional -> Ptr{Int}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
int32_t WsRequestReply(
intptr_t* channel,
intptr_t* requestMessage,
void* requestMessageDescription,
int32_t writeOption,
void* requestBodyValue,
uint32_t requestBodyValueSize,
intptr_t* replyMessage,
void* replyMessageDescription,
int32_t readOption,
intptr_t* heap,
void* value,
uint32_t valueSize,
void* asyncContext,
intptr_t* error);
]]
local webservices = ffi.load("webservices")
-- webservices.WsRequestReply(channel, requestMessage, requestMessageDescription, writeOption, requestBodyValue, requestBodyValueSize, replyMessage, replyMessageDescription, readOption, heap, value, valueSize, asyncContext, error)
-- channel : WS_CHANNEL*
-- requestMessage : WS_MESSAGE*
-- requestMessageDescription : WS_MESSAGE_DESCRIPTION*
-- writeOption : WS_WRITE_OPTION
-- requestBodyValue : void* optional
-- requestBodyValueSize : DWORD
-- replyMessage : WS_MESSAGE*
-- replyMessageDescription : WS_MESSAGE_DESCRIPTION*
-- readOption : WS_READ_OPTION
-- heap : WS_HEAP* optional
-- value : void* optional, out
-- valueSize : DWORD
-- asyncContext : WS_ASYNC_CONTEXT* optional
-- error : WS_ERROR* optional
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('webservices.dll');
const WsRequestReply = lib.func('__stdcall', 'WsRequestReply', 'int32_t', ['intptr_t *', 'intptr_t *', 'void *', 'int32_t', 'void *', 'uint32_t', 'intptr_t *', 'void *', 'int32_t', 'intptr_t *', 'void *', 'uint32_t', 'void *', 'intptr_t *']);
// WsRequestReply(channel, requestMessage, requestMessageDescription, writeOption, requestBodyValue, requestBodyValueSize, replyMessage, replyMessageDescription, readOption, heap, value, valueSize, asyncContext, error)
// channel : WS_CHANNEL* -> 'intptr_t *'
// requestMessage : WS_MESSAGE* -> 'intptr_t *'
// requestMessageDescription : WS_MESSAGE_DESCRIPTION* -> 'void *'
// writeOption : WS_WRITE_OPTION -> 'int32_t'
// requestBodyValue : void* optional -> 'void *'
// requestBodyValueSize : DWORD -> 'uint32_t'
// replyMessage : WS_MESSAGE* -> 'intptr_t *'
// replyMessageDescription : WS_MESSAGE_DESCRIPTION* -> 'void *'
// readOption : WS_READ_OPTION -> 'int32_t'
// heap : WS_HEAP* optional -> 'intptr_t *'
// value : void* optional, out -> 'void *'
// valueSize : DWORD -> 'uint32_t'
// asyncContext : WS_ASYNC_CONTEXT* optional -> 'void *'
// error : WS_ERROR* optional -> 'intptr_t *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("webservices.dll", {
WsRequestReply: { parameters: ["pointer", "pointer", "pointer", "i32", "pointer", "u32", "pointer", "pointer", "i32", "pointer", "pointer", "u32", "pointer", "pointer"], result: "i32" },
});
// lib.symbols.WsRequestReply(channel, requestMessage, requestMessageDescription, writeOption, requestBodyValue, requestBodyValueSize, replyMessage, replyMessageDescription, readOption, heap, value, valueSize, asyncContext, error)
// channel : WS_CHANNEL* -> "pointer"
// requestMessage : WS_MESSAGE* -> "pointer"
// requestMessageDescription : WS_MESSAGE_DESCRIPTION* -> "pointer"
// writeOption : WS_WRITE_OPTION -> "i32"
// requestBodyValue : void* optional -> "pointer"
// requestBodyValueSize : DWORD -> "u32"
// replyMessage : WS_MESSAGE* -> "pointer"
// replyMessageDescription : WS_MESSAGE_DESCRIPTION* -> "pointer"
// readOption : WS_READ_OPTION -> "i32"
// heap : WS_HEAP* optional -> "pointer"
// value : void* optional, out -> "pointer"
// valueSize : DWORD -> "u32"
// asyncContext : WS_ASYNC_CONTEXT* optional -> "pointer"
// error : WS_ERROR* optional -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int32_t WsRequestReply(
intptr_t* channel,
intptr_t* requestMessage,
void* requestMessageDescription,
int32_t writeOption,
void* requestBodyValue,
uint32_t requestBodyValueSize,
intptr_t* replyMessage,
void* replyMessageDescription,
int32_t readOption,
intptr_t* heap,
void* value,
uint32_t valueSize,
void* asyncContext,
intptr_t* error);
C, "webservices.dll");
// $ffi->WsRequestReply(channel, requestMessage, requestMessageDescription, writeOption, requestBodyValue, requestBodyValueSize, replyMessage, replyMessageDescription, readOption, heap, value, valueSize, asyncContext, error);
// channel : WS_CHANNEL*
// requestMessage : WS_MESSAGE*
// requestMessageDescription : WS_MESSAGE_DESCRIPTION*
// writeOption : WS_WRITE_OPTION
// requestBodyValue : void* optional
// requestBodyValueSize : DWORD
// replyMessage : WS_MESSAGE*
// replyMessageDescription : WS_MESSAGE_DESCRIPTION*
// readOption : WS_READ_OPTION
// heap : WS_HEAP* optional
// value : void* optional, out
// valueSize : DWORD
// asyncContext : WS_ASYNC_CONTEXT* optional
// error : WS_ERROR* optional
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;
public interface Webservices extends StdCallLibrary {
Webservices INSTANCE = Native.load("webservices", Webservices.class);
int WsRequestReply(
LongByReference channel, // WS_CHANNEL*
LongByReference requestMessage, // WS_MESSAGE*
Pointer requestMessageDescription, // WS_MESSAGE_DESCRIPTION*
int writeOption, // WS_WRITE_OPTION
Pointer requestBodyValue, // void* optional
int requestBodyValueSize, // DWORD
LongByReference replyMessage, // WS_MESSAGE*
Pointer replyMessageDescription, // WS_MESSAGE_DESCRIPTION*
int readOption, // WS_READ_OPTION
LongByReference heap, // WS_HEAP* optional
Pointer value, // void* optional, out
int valueSize, // DWORD
Pointer asyncContext, // WS_ASYNC_CONTEXT* optional
LongByReference error // WS_ERROR* optional
);
}@[Link("webservices")]
lib Libwebservices
fun WsRequestReply = WsRequestReply(
channel : LibC::SSizeT*, # WS_CHANNEL*
requestMessage : LibC::SSizeT*, # WS_MESSAGE*
requestMessageDescription : WS_MESSAGE_DESCRIPTION*, # WS_MESSAGE_DESCRIPTION*
writeOption : Int32, # WS_WRITE_OPTION
requestBodyValue : Void*, # void* optional
requestBodyValueSize : UInt32, # DWORD
replyMessage : LibC::SSizeT*, # WS_MESSAGE*
replyMessageDescription : WS_MESSAGE_DESCRIPTION*, # WS_MESSAGE_DESCRIPTION*
readOption : Int32, # WS_READ_OPTION
heap : LibC::SSizeT*, # WS_HEAP* optional
value : Void*, # void* optional, out
valueSize : UInt32, # DWORD
asyncContext : WS_ASYNC_CONTEXT*, # WS_ASYNC_CONTEXT* optional
error : LibC::SSizeT* # WS_ERROR* optional
) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef WsRequestReplyNative = Int32 Function(Pointer<IntPtr>, Pointer<IntPtr>, Pointer<Void>, Int32, Pointer<Void>, Uint32, Pointer<IntPtr>, Pointer<Void>, Int32, Pointer<IntPtr>, Pointer<Void>, Uint32, Pointer<Void>, Pointer<IntPtr>);
typedef WsRequestReplyDart = int Function(Pointer<IntPtr>, Pointer<IntPtr>, Pointer<Void>, int, Pointer<Void>, int, Pointer<IntPtr>, Pointer<Void>, int, Pointer<IntPtr>, Pointer<Void>, int, Pointer<Void>, Pointer<IntPtr>);
final WsRequestReply = DynamicLibrary.open('webservices.dll')
.lookupFunction<WsRequestReplyNative, WsRequestReplyDart>('WsRequestReply');
// channel : WS_CHANNEL* -> Pointer<IntPtr>
// requestMessage : WS_MESSAGE* -> Pointer<IntPtr>
// requestMessageDescription : WS_MESSAGE_DESCRIPTION* -> Pointer<Void>
// writeOption : WS_WRITE_OPTION -> Int32
// requestBodyValue : void* optional -> Pointer<Void>
// requestBodyValueSize : DWORD -> Uint32
// replyMessage : WS_MESSAGE* -> Pointer<IntPtr>
// replyMessageDescription : WS_MESSAGE_DESCRIPTION* -> Pointer<Void>
// readOption : WS_READ_OPTION -> Int32
// heap : WS_HEAP* optional -> Pointer<IntPtr>
// value : void* optional, out -> Pointer<Void>
// valueSize : DWORD -> Uint32
// asyncContext : WS_ASYNC_CONTEXT* optional -> Pointer<Void>
// error : WS_ERROR* optional -> Pointer<IntPtr>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function WsRequestReply(
channel: Pointer; // WS_CHANNEL*
requestMessage: Pointer; // WS_MESSAGE*
requestMessageDescription: Pointer; // WS_MESSAGE_DESCRIPTION*
writeOption: Integer; // WS_WRITE_OPTION
requestBodyValue: Pointer; // void* optional
requestBodyValueSize: DWORD; // DWORD
replyMessage: Pointer; // WS_MESSAGE*
replyMessageDescription: Pointer; // WS_MESSAGE_DESCRIPTION*
readOption: Integer; // WS_READ_OPTION
heap: Pointer; // WS_HEAP* optional
value: Pointer; // void* optional, out
valueSize: DWORD; // DWORD
asyncContext: Pointer; // WS_ASYNC_CONTEXT* optional
error: Pointer // WS_ERROR* optional
): Integer; stdcall;
external 'webservices.dll' name 'WsRequestReply';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "WsRequestReply"
c_WsRequestReply :: Ptr CIntPtr -> Ptr CIntPtr -> Ptr () -> Int32 -> Ptr () -> Word32 -> Ptr CIntPtr -> Ptr () -> Int32 -> Ptr CIntPtr -> Ptr () -> Word32 -> Ptr () -> Ptr CIntPtr -> IO Int32
-- channel : WS_CHANNEL* -> Ptr CIntPtr
-- requestMessage : WS_MESSAGE* -> Ptr CIntPtr
-- requestMessageDescription : WS_MESSAGE_DESCRIPTION* -> Ptr ()
-- writeOption : WS_WRITE_OPTION -> Int32
-- requestBodyValue : void* optional -> Ptr ()
-- requestBodyValueSize : DWORD -> Word32
-- replyMessage : WS_MESSAGE* -> Ptr CIntPtr
-- replyMessageDescription : WS_MESSAGE_DESCRIPTION* -> Ptr ()
-- readOption : WS_READ_OPTION -> Int32
-- heap : WS_HEAP* optional -> Ptr CIntPtr
-- value : void* optional, out -> Ptr ()
-- valueSize : DWORD -> Word32
-- asyncContext : WS_ASYNC_CONTEXT* optional -> Ptr ()
-- error : WS_ERROR* optional -> Ptr CIntPtr
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let wsrequestreply =
foreign "WsRequestReply"
((ptr intptr_t) @-> (ptr intptr_t) @-> (ptr void) @-> int32_t @-> (ptr void) @-> uint32_t @-> (ptr intptr_t) @-> (ptr void) @-> int32_t @-> (ptr intptr_t) @-> (ptr void) @-> uint32_t @-> (ptr void) @-> (ptr intptr_t) @-> returning int32_t)
(* channel : WS_CHANNEL* -> (ptr intptr_t) *)
(* requestMessage : WS_MESSAGE* -> (ptr intptr_t) *)
(* requestMessageDescription : WS_MESSAGE_DESCRIPTION* -> (ptr void) *)
(* writeOption : WS_WRITE_OPTION -> int32_t *)
(* requestBodyValue : void* optional -> (ptr void) *)
(* requestBodyValueSize : DWORD -> uint32_t *)
(* replyMessage : WS_MESSAGE* -> (ptr intptr_t) *)
(* replyMessageDescription : WS_MESSAGE_DESCRIPTION* -> (ptr void) *)
(* readOption : WS_READ_OPTION -> int32_t *)
(* heap : WS_HEAP* optional -> (ptr intptr_t) *)
(* value : void* optional, out -> (ptr void) *)
(* valueSize : DWORD -> uint32_t *)
(* asyncContext : WS_ASYNC_CONTEXT* optional -> (ptr void) *)
(* error : WS_ERROR* optional -> (ptr intptr_t) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library webservices (t "webservices.dll"))
(cffi:use-foreign-library webservices)
(cffi:defcfun ("WsRequestReply" ws-request-reply :convention :stdcall) :int32
(channel :pointer) ; WS_CHANNEL*
(request-message :pointer) ; WS_MESSAGE*
(request-message-description :pointer) ; WS_MESSAGE_DESCRIPTION*
(write-option :int32) ; WS_WRITE_OPTION
(request-body-value :pointer) ; void* optional
(request-body-value-size :uint32) ; DWORD
(reply-message :pointer) ; WS_MESSAGE*
(reply-message-description :pointer) ; WS_MESSAGE_DESCRIPTION*
(read-option :int32) ; WS_READ_OPTION
(heap :pointer) ; WS_HEAP* optional
(value :pointer) ; void* optional, out
(value-size :uint32) ; DWORD
(async-context :pointer) ; WS_ASYNC_CONTEXT* optional
(error :pointer)) ; WS_ERROR* optional
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $WsRequestReply = Win32::API::More->new('webservices',
'int WsRequestReply(LPVOID channel, LPVOID requestMessage, LPVOID requestMessageDescription, int writeOption, LPVOID requestBodyValue, DWORD requestBodyValueSize, LPVOID replyMessage, LPVOID replyMessageDescription, int readOption, LPVOID heap, LPVOID value, DWORD valueSize, LPVOID asyncContext, LPVOID error)');
# my $ret = $WsRequestReply->Call($channel, $requestMessage, $requestMessageDescription, $writeOption, $requestBodyValue, $requestBodyValueSize, $replyMessage, $replyMessageDescription, $readOption, $heap, $value, $valueSize, $asyncContext, $error);
# channel : WS_CHANNEL* -> LPVOID
# requestMessage : WS_MESSAGE* -> LPVOID
# requestMessageDescription : WS_MESSAGE_DESCRIPTION* -> LPVOID
# writeOption : WS_WRITE_OPTION -> int
# requestBodyValue : void* optional -> LPVOID
# requestBodyValueSize : DWORD -> DWORD
# replyMessage : WS_MESSAGE* -> LPVOID
# replyMessageDescription : WS_MESSAGE_DESCRIPTION* -> LPVOID
# readOption : WS_READ_OPTION -> int
# heap : WS_HEAP* optional -> LPVOID
# value : void* optional, out -> LPVOID
# valueSize : DWORD -> DWORD
# asyncContext : WS_ASYNC_CONTEXT* optional -> LPVOID
# error : WS_ERROR* optional -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。