ホーム › Networking.HttpServer › HttpSendResponseEntityBody
HttpSendResponseEntityBody
関数HTTPレスポンスのエンティティ本文を送信する。
シグネチャ
// HTTPAPI.dll
#include <windows.h>
DWORD HttpSendResponseEntityBody(
HANDLE RequestQueueHandle,
ULONGLONG RequestId,
DWORD Flags,
WORD EntityChunkCount, // optional
HTTP_DATA_CHUNK* EntityChunks, // optional
DWORD* BytesSent, // optional
void* Reserved1, // optional
DWORD Reserved2, // optional
OVERLAPPED* Overlapped, // optional
HTTP_LOG_DATA* LogData // optional
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| RequestQueueHandle | HANDLE | in |
| RequestId | ULONGLONG | in |
| Flags | DWORD | in |
| EntityChunkCount | WORD | inoptional |
| EntityChunks | HTTP_DATA_CHUNK* | inoptional |
| BytesSent | DWORD* | outoptional |
| Reserved1 | void* | optional |
| Reserved2 | DWORD | optional |
| Overlapped | OVERLAPPED* | inoutoptional |
| LogData | HTTP_LOG_DATA* | inoptional |
戻り値の型: DWORD
各言語での呼び出し定義
// HTTPAPI.dll
#include <windows.h>
DWORD HttpSendResponseEntityBody(
HANDLE RequestQueueHandle,
ULONGLONG RequestId,
DWORD Flags,
WORD EntityChunkCount, // optional
HTTP_DATA_CHUNK* EntityChunks, // optional
DWORD* BytesSent, // optional
void* Reserved1, // optional
DWORD Reserved2, // optional
OVERLAPPED* Overlapped, // optional
HTTP_LOG_DATA* LogData // optional
);[DllImport("HTTPAPI.dll", ExactSpelling = true)]
static extern uint HttpSendResponseEntityBody(
IntPtr RequestQueueHandle, // HANDLE
ulong RequestId, // ULONGLONG
uint Flags, // DWORD
ushort EntityChunkCount, // WORD optional
IntPtr EntityChunks, // HTTP_DATA_CHUNK* optional
IntPtr BytesSent, // DWORD* optional, out
IntPtr Reserved1, // void* optional
uint Reserved2, // DWORD optional
IntPtr Overlapped, // OVERLAPPED* optional, in/out
IntPtr LogData // HTTP_LOG_DATA* optional
);<DllImport("HTTPAPI.dll", ExactSpelling:=True)>
Public Shared Function HttpSendResponseEntityBody(
RequestQueueHandle As IntPtr, ' HANDLE
RequestId As ULong, ' ULONGLONG
Flags As UInteger, ' DWORD
EntityChunkCount As UShort, ' WORD optional
EntityChunks As IntPtr, ' HTTP_DATA_CHUNK* optional
BytesSent As IntPtr, ' DWORD* optional, out
Reserved1 As IntPtr, ' void* optional
Reserved2 As UInteger, ' DWORD optional
Overlapped As IntPtr, ' OVERLAPPED* optional, in/out
LogData As IntPtr ' HTTP_LOG_DATA* optional
) As UInteger
End Function' RequestQueueHandle : HANDLE
' RequestId : ULONGLONG
' Flags : DWORD
' EntityChunkCount : WORD optional
' EntityChunks : HTTP_DATA_CHUNK* optional
' BytesSent : DWORD* optional, out
' Reserved1 : void* optional
' Reserved2 : DWORD optional
' Overlapped : OVERLAPPED* optional, in/out
' LogData : HTTP_LOG_DATA* optional
Declare PtrSafe Function HttpSendResponseEntityBody Lib "httpapi" ( _
ByVal RequestQueueHandle As LongPtr, _
ByVal RequestId As LongLong, _
ByVal Flags As Long, _
ByVal EntityChunkCount As Integer, _
ByVal EntityChunks As LongPtr, _
ByVal BytesSent As LongPtr, _
ByVal Reserved1 As LongPtr, _
ByVal Reserved2 As Long, _
ByVal Overlapped As LongPtr, _
ByVal LogData As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
HttpSendResponseEntityBody = ctypes.windll.httpapi.HttpSendResponseEntityBody
HttpSendResponseEntityBody.restype = wintypes.DWORD
HttpSendResponseEntityBody.argtypes = [
wintypes.HANDLE, # RequestQueueHandle : HANDLE
ctypes.c_ulonglong, # RequestId : ULONGLONG
wintypes.DWORD, # Flags : DWORD
ctypes.c_ushort, # EntityChunkCount : WORD optional
ctypes.c_void_p, # EntityChunks : HTTP_DATA_CHUNK* optional
ctypes.POINTER(wintypes.DWORD), # BytesSent : DWORD* optional, out
ctypes.POINTER(None), # Reserved1 : void* optional
wintypes.DWORD, # Reserved2 : DWORD optional
ctypes.c_void_p, # Overlapped : OVERLAPPED* optional, in/out
ctypes.c_void_p, # LogData : HTTP_LOG_DATA* optional
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('HTTPAPI.dll')
HttpSendResponseEntityBody = Fiddle::Function.new(
lib['HttpSendResponseEntityBody'],
[
Fiddle::TYPE_VOIDP, # RequestQueueHandle : HANDLE
-Fiddle::TYPE_LONG_LONG, # RequestId : ULONGLONG
-Fiddle::TYPE_INT, # Flags : DWORD
-Fiddle::TYPE_SHORT, # EntityChunkCount : WORD optional
Fiddle::TYPE_VOIDP, # EntityChunks : HTTP_DATA_CHUNK* optional
Fiddle::TYPE_VOIDP, # BytesSent : DWORD* optional, out
Fiddle::TYPE_VOIDP, # Reserved1 : void* optional
-Fiddle::TYPE_INT, # Reserved2 : DWORD optional
Fiddle::TYPE_VOIDP, # Overlapped : OVERLAPPED* optional, in/out
Fiddle::TYPE_VOIDP, # LogData : HTTP_LOG_DATA* optional
],
-Fiddle::TYPE_INT)#[link(name = "httpapi")]
extern "system" {
fn HttpSendResponseEntityBody(
RequestQueueHandle: *mut core::ffi::c_void, // HANDLE
RequestId: u64, // ULONGLONG
Flags: u32, // DWORD
EntityChunkCount: u16, // WORD optional
EntityChunks: *mut HTTP_DATA_CHUNK, // HTTP_DATA_CHUNK* optional
BytesSent: *mut u32, // DWORD* optional, out
Reserved1: *mut (), // void* optional
Reserved2: u32, // DWORD optional
Overlapped: *mut OVERLAPPED, // OVERLAPPED* optional, in/out
LogData: *mut HTTP_LOG_DATA // HTTP_LOG_DATA* optional
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("HTTPAPI.dll")]
public static extern uint HttpSendResponseEntityBody(IntPtr RequestQueueHandle, ulong RequestId, uint Flags, ushort EntityChunkCount, IntPtr EntityChunks, IntPtr BytesSent, IntPtr Reserved1, uint Reserved2, IntPtr Overlapped, IntPtr LogData);
"@
$api = Add-Type -MemberDefinition $sig -Name 'HTTPAPI_HttpSendResponseEntityBody' -Namespace Win32 -PassThru
# $api::HttpSendResponseEntityBody(RequestQueueHandle, RequestId, Flags, EntityChunkCount, EntityChunks, BytesSent, Reserved1, Reserved2, Overlapped, LogData)#uselib "HTTPAPI.dll"
#func global HttpSendResponseEntityBody "HttpSendResponseEntityBody" sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr
; HttpSendResponseEntityBody RequestQueueHandle, RequestId, Flags, EntityChunkCount, varptr(EntityChunks), varptr(BytesSent), Reserved1, Reserved2, varptr(Overlapped), varptr(LogData) ; 戻り値は stat
; RequestQueueHandle : HANDLE -> "sptr"
; RequestId : ULONGLONG -> "sptr"
; Flags : DWORD -> "sptr"
; EntityChunkCount : WORD optional -> "sptr"
; EntityChunks : HTTP_DATA_CHUNK* optional -> "sptr"
; BytesSent : DWORD* optional, out -> "sptr"
; Reserved1 : void* optional -> "sptr"
; Reserved2 : DWORD optional -> "sptr"
; Overlapped : OVERLAPPED* optional, in/out -> "sptr"
; LogData : HTTP_LOG_DATA* optional -> "sptr"
; ※HSP3.7は int64 引数(64bit値渡し)に非対応です。
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "HTTPAPI.dll" #cfunc global HttpSendResponseEntityBody "HttpSendResponseEntityBody" sptr, int64, int, int, var, var, sptr, int, var, var ; res = HttpSendResponseEntityBody(RequestQueueHandle, RequestId, Flags, EntityChunkCount, EntityChunks, BytesSent, Reserved1, Reserved2, Overlapped, LogData) ; RequestQueueHandle : HANDLE -> "sptr" ; RequestId : ULONGLONG -> "int64" ; Flags : DWORD -> "int" ; EntityChunkCount : WORD optional -> "int" ; EntityChunks : HTTP_DATA_CHUNK* optional -> "var" ; BytesSent : DWORD* optional, out -> "var" ; Reserved1 : void* optional -> "sptr" ; Reserved2 : DWORD optional -> "int" ; Overlapped : OVERLAPPED* optional, in/out -> "var" ; LogData : HTTP_LOG_DATA* optional -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。 ; ※int64 引数の DLL 値渡しは x64 ランタイム(hsp3_64)のみ対応(x86 は未対応)。#uselib "HTTPAPI.dll" #cfunc global HttpSendResponseEntityBody "HttpSendResponseEntityBody" sptr, int64, int, int, sptr, sptr, sptr, int, sptr, sptr ; res = HttpSendResponseEntityBody(RequestQueueHandle, RequestId, Flags, EntityChunkCount, varptr(EntityChunks), varptr(BytesSent), Reserved1, Reserved2, varptr(Overlapped), varptr(LogData)) ; RequestQueueHandle : HANDLE -> "sptr" ; RequestId : ULONGLONG -> "int64" ; Flags : DWORD -> "int" ; EntityChunkCount : WORD optional -> "int" ; EntityChunks : HTTP_DATA_CHUNK* optional -> "sptr" ; BytesSent : DWORD* optional, out -> "sptr" ; Reserved1 : void* optional -> "sptr" ; Reserved2 : DWORD optional -> "int" ; Overlapped : OVERLAPPED* optional, in/out -> "sptr" ; LogData : HTTP_LOG_DATA* optional -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。 ; ※int64 引数の DLL 値渡しは x64 ランタイム(hsp3_64)のみ対応(x86 は未対応)。
出力引数:
; DWORD HttpSendResponseEntityBody(HANDLE RequestQueueHandle, ULONGLONG RequestId, DWORD Flags, WORD EntityChunkCount, HTTP_DATA_CHUNK* EntityChunks, DWORD* BytesSent, void* Reserved1, DWORD Reserved2, OVERLAPPED* Overlapped, HTTP_LOG_DATA* LogData) #uselib "HTTPAPI.dll" #cfunc global HttpSendResponseEntityBody "HttpSendResponseEntityBody" intptr, int64, int, int, var, var, intptr, int, var, var ; res = HttpSendResponseEntityBody(RequestQueueHandle, RequestId, Flags, EntityChunkCount, EntityChunks, BytesSent, Reserved1, Reserved2, Overlapped, LogData) ; RequestQueueHandle : HANDLE -> "intptr" ; RequestId : ULONGLONG -> "int64" ; Flags : DWORD -> "int" ; EntityChunkCount : WORD optional -> "int" ; EntityChunks : HTTP_DATA_CHUNK* optional -> "var" ; BytesSent : DWORD* optional, out -> "var" ; Reserved1 : void* optional -> "intptr" ; Reserved2 : DWORD optional -> "int" ; Overlapped : OVERLAPPED* optional, in/out -> "var" ; LogData : HTTP_LOG_DATA* optional -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; DWORD HttpSendResponseEntityBody(HANDLE RequestQueueHandle, ULONGLONG RequestId, DWORD Flags, WORD EntityChunkCount, HTTP_DATA_CHUNK* EntityChunks, DWORD* BytesSent, void* Reserved1, DWORD Reserved2, OVERLAPPED* Overlapped, HTTP_LOG_DATA* LogData) #uselib "HTTPAPI.dll" #cfunc global HttpSendResponseEntityBody "HttpSendResponseEntityBody" intptr, int64, int, int, intptr, intptr, intptr, int, intptr, intptr ; res = HttpSendResponseEntityBody(RequestQueueHandle, RequestId, Flags, EntityChunkCount, varptr(EntityChunks), varptr(BytesSent), Reserved1, Reserved2, varptr(Overlapped), varptr(LogData)) ; RequestQueueHandle : HANDLE -> "intptr" ; RequestId : ULONGLONG -> "int64" ; Flags : DWORD -> "int" ; EntityChunkCount : WORD optional -> "int" ; EntityChunks : HTTP_DATA_CHUNK* optional -> "intptr" ; BytesSent : DWORD* optional, out -> "intptr" ; Reserved1 : void* optional -> "intptr" ; Reserved2 : DWORD optional -> "int" ; Overlapped : OVERLAPPED* optional, in/out -> "intptr" ; LogData : HTTP_LOG_DATA* optional -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
httpapi = windows.NewLazySystemDLL("HTTPAPI.dll")
procHttpSendResponseEntityBody = httpapi.NewProc("HttpSendResponseEntityBody")
)
// RequestQueueHandle (HANDLE), RequestId (ULONGLONG), Flags (DWORD), EntityChunkCount (WORD optional), EntityChunks (HTTP_DATA_CHUNK* optional), BytesSent (DWORD* optional, out), Reserved1 (void* optional), Reserved2 (DWORD optional), Overlapped (OVERLAPPED* optional, in/out), LogData (HTTP_LOG_DATA* optional)
r1, _, err := procHttpSendResponseEntityBody.Call(
uintptr(RequestQueueHandle),
uintptr(RequestId),
uintptr(Flags),
uintptr(EntityChunkCount),
uintptr(EntityChunks),
uintptr(BytesSent),
uintptr(Reserved1),
uintptr(Reserved2),
uintptr(Overlapped),
uintptr(LogData),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction HttpSendResponseEntityBody(
RequestQueueHandle: THandle; // HANDLE
RequestId: UInt64; // ULONGLONG
Flags: DWORD; // DWORD
EntityChunkCount: Word; // WORD optional
EntityChunks: Pointer; // HTTP_DATA_CHUNK* optional
BytesSent: Pointer; // DWORD* optional, out
Reserved1: Pointer; // void* optional
Reserved2: DWORD; // DWORD optional
Overlapped: Pointer; // OVERLAPPED* optional, in/out
LogData: Pointer // HTTP_LOG_DATA* optional
): DWORD; stdcall;
external 'HTTPAPI.dll' name 'HttpSendResponseEntityBody';result := DllCall("HTTPAPI\HttpSendResponseEntityBody"
, "Ptr", RequestQueueHandle ; HANDLE
, "Int64", RequestId ; ULONGLONG
, "UInt", Flags ; DWORD
, "UShort", EntityChunkCount ; WORD optional
, "Ptr", EntityChunks ; HTTP_DATA_CHUNK* optional
, "Ptr", BytesSent ; DWORD* optional, out
, "Ptr", Reserved1 ; void* optional
, "UInt", Reserved2 ; DWORD optional
, "Ptr", Overlapped ; OVERLAPPED* optional, in/out
, "Ptr", LogData ; HTTP_LOG_DATA* optional
, "UInt") ; return: DWORD●HttpSendResponseEntityBody(RequestQueueHandle, RequestId, Flags, EntityChunkCount, EntityChunks, BytesSent, Reserved1, Reserved2, Overlapped, LogData) = DLL("HTTPAPI.dll", "dword HttpSendResponseEntityBody(void*, qword, dword, int, void*, void*, void*, dword, void*, void*)")
# 呼び出し: HttpSendResponseEntityBody(RequestQueueHandle, RequestId, Flags, EntityChunkCount, EntityChunks, BytesSent, Reserved1, Reserved2, Overlapped, LogData)
# RequestQueueHandle : HANDLE -> "void*"
# RequestId : ULONGLONG -> "qword"
# Flags : DWORD -> "dword"
# EntityChunkCount : WORD optional -> "int"
# EntityChunks : HTTP_DATA_CHUNK* optional -> "void*"
# BytesSent : DWORD* optional, out -> "void*"
# Reserved1 : void* optional -> "void*"
# Reserved2 : DWORD optional -> "dword"
# Overlapped : OVERLAPPED* optional, in/out -> "void*"
# LogData : HTTP_LOG_DATA* optional -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。