ホーム › Networking.HttpServer › HttpSetRequestQueueProperty
HttpSetRequestQueueProperty
関数リクエストキューのプロパティを設定する。
シグネチャ
// HTTPAPI.dll
#include <windows.h>
DWORD HttpSetRequestQueueProperty(
HANDLE RequestQueueHandle,
HTTP_SERVER_PROPERTY Property,
void* PropertyInformation,
DWORD PropertyInformationLength,
DWORD Reserved1, // optional
void* Reserved2 // optional
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| RequestQueueHandle | HANDLE | in |
| Property | HTTP_SERVER_PROPERTY | in |
| PropertyInformation | void* | in |
| PropertyInformationLength | DWORD | in |
| Reserved1 | DWORD | optional |
| Reserved2 | void* | optional |
戻り値の型: DWORD
各言語での呼び出し定義
// HTTPAPI.dll
#include <windows.h>
DWORD HttpSetRequestQueueProperty(
HANDLE RequestQueueHandle,
HTTP_SERVER_PROPERTY Property,
void* PropertyInformation,
DWORD PropertyInformationLength,
DWORD Reserved1, // optional
void* Reserved2 // optional
);[DllImport("HTTPAPI.dll", ExactSpelling = true)]
static extern uint HttpSetRequestQueueProperty(
IntPtr RequestQueueHandle, // HANDLE
int Property, // HTTP_SERVER_PROPERTY
IntPtr PropertyInformation, // void*
uint PropertyInformationLength, // DWORD
uint Reserved1, // DWORD optional
IntPtr Reserved2 // void* optional
);<DllImport("HTTPAPI.dll", ExactSpelling:=True)>
Public Shared Function HttpSetRequestQueueProperty(
RequestQueueHandle As IntPtr, ' HANDLE
[Property] As Integer, ' HTTP_SERVER_PROPERTY
PropertyInformation As IntPtr, ' void*
PropertyInformationLength As UInteger, ' DWORD
Reserved1 As UInteger, ' DWORD optional
Reserved2 As IntPtr ' void* optional
) As UInteger
End Function' RequestQueueHandle : HANDLE
' Property : HTTP_SERVER_PROPERTY
' PropertyInformation : void*
' PropertyInformationLength : DWORD
' Reserved1 : DWORD optional
' Reserved2 : void* optional
Declare PtrSafe Function HttpSetRequestQueueProperty Lib "httpapi" ( _
ByVal RequestQueueHandle As LongPtr, _
ByVal Property As Long, _
ByVal PropertyInformation As LongPtr, _
ByVal PropertyInformationLength As Long, _
ByVal Reserved1 As Long, _
ByVal Reserved2 As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
HttpSetRequestQueueProperty = ctypes.windll.httpapi.HttpSetRequestQueueProperty
HttpSetRequestQueueProperty.restype = wintypes.DWORD
HttpSetRequestQueueProperty.argtypes = [
wintypes.HANDLE, # RequestQueueHandle : HANDLE
ctypes.c_int, # Property : HTTP_SERVER_PROPERTY
ctypes.POINTER(None), # PropertyInformation : void*
wintypes.DWORD, # PropertyInformationLength : DWORD
wintypes.DWORD, # Reserved1 : DWORD optional
ctypes.POINTER(None), # Reserved2 : void* optional
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('HTTPAPI.dll')
HttpSetRequestQueueProperty = Fiddle::Function.new(
lib['HttpSetRequestQueueProperty'],
[
Fiddle::TYPE_VOIDP, # RequestQueueHandle : HANDLE
Fiddle::TYPE_INT, # Property : HTTP_SERVER_PROPERTY
Fiddle::TYPE_VOIDP, # PropertyInformation : void*
-Fiddle::TYPE_INT, # PropertyInformationLength : DWORD
-Fiddle::TYPE_INT, # Reserved1 : DWORD optional
Fiddle::TYPE_VOIDP, # Reserved2 : void* optional
],
-Fiddle::TYPE_INT)#[link(name = "httpapi")]
extern "system" {
fn HttpSetRequestQueueProperty(
RequestQueueHandle: *mut core::ffi::c_void, // HANDLE
Property: i32, // HTTP_SERVER_PROPERTY
PropertyInformation: *mut (), // void*
PropertyInformationLength: u32, // DWORD
Reserved1: u32, // DWORD optional
Reserved2: *mut () // void* optional
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("HTTPAPI.dll")]
public static extern uint HttpSetRequestQueueProperty(IntPtr RequestQueueHandle, int Property, IntPtr PropertyInformation, uint PropertyInformationLength, uint Reserved1, IntPtr Reserved2);
"@
$api = Add-Type -MemberDefinition $sig -Name 'HTTPAPI_HttpSetRequestQueueProperty' -Namespace Win32 -PassThru
# $api::HttpSetRequestQueueProperty(RequestQueueHandle, Property, PropertyInformation, PropertyInformationLength, Reserved1, Reserved2)#uselib "HTTPAPI.dll"
#func global HttpSetRequestQueueProperty "HttpSetRequestQueueProperty" sptr, sptr, sptr, sptr, sptr, sptr
; HttpSetRequestQueueProperty RequestQueueHandle, Property, PropertyInformation, PropertyInformationLength, Reserved1, Reserved2 ; 戻り値は stat
; RequestQueueHandle : HANDLE -> "sptr"
; Property : HTTP_SERVER_PROPERTY -> "sptr"
; PropertyInformation : void* -> "sptr"
; PropertyInformationLength : DWORD -> "sptr"
; Reserved1 : DWORD optional -> "sptr"
; Reserved2 : void* optional -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "HTTPAPI.dll"
#cfunc global HttpSetRequestQueueProperty "HttpSetRequestQueueProperty" sptr, int, sptr, int, int, sptr
; res = HttpSetRequestQueueProperty(RequestQueueHandle, Property, PropertyInformation, PropertyInformationLength, Reserved1, Reserved2)
; RequestQueueHandle : HANDLE -> "sptr"
; Property : HTTP_SERVER_PROPERTY -> "int"
; PropertyInformation : void* -> "sptr"
; PropertyInformationLength : DWORD -> "int"
; Reserved1 : DWORD optional -> "int"
; Reserved2 : void* optional -> "sptr"; DWORD HttpSetRequestQueueProperty(HANDLE RequestQueueHandle, HTTP_SERVER_PROPERTY Property, void* PropertyInformation, DWORD PropertyInformationLength, DWORD Reserved1, void* Reserved2)
#uselib "HTTPAPI.dll"
#cfunc global HttpSetRequestQueueProperty "HttpSetRequestQueueProperty" intptr, int, intptr, int, int, intptr
; res = HttpSetRequestQueueProperty(RequestQueueHandle, Property, PropertyInformation, PropertyInformationLength, Reserved1, Reserved2)
; RequestQueueHandle : HANDLE -> "intptr"
; Property : HTTP_SERVER_PROPERTY -> "int"
; PropertyInformation : void* -> "intptr"
; PropertyInformationLength : DWORD -> "int"
; Reserved1 : DWORD optional -> "int"
; Reserved2 : void* optional -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
httpapi = windows.NewLazySystemDLL("HTTPAPI.dll")
procHttpSetRequestQueueProperty = httpapi.NewProc("HttpSetRequestQueueProperty")
)
// RequestQueueHandle (HANDLE), Property (HTTP_SERVER_PROPERTY), PropertyInformation (void*), PropertyInformationLength (DWORD), Reserved1 (DWORD optional), Reserved2 (void* optional)
r1, _, err := procHttpSetRequestQueueProperty.Call(
uintptr(RequestQueueHandle),
uintptr(Property),
uintptr(PropertyInformation),
uintptr(PropertyInformationLength),
uintptr(Reserved1),
uintptr(Reserved2),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction HttpSetRequestQueueProperty(
RequestQueueHandle: THandle; // HANDLE
Property: Integer; // HTTP_SERVER_PROPERTY
PropertyInformation: Pointer; // void*
PropertyInformationLength: DWORD; // DWORD
Reserved1: DWORD; // DWORD optional
Reserved2: Pointer // void* optional
): DWORD; stdcall;
external 'HTTPAPI.dll' name 'HttpSetRequestQueueProperty';result := DllCall("HTTPAPI\HttpSetRequestQueueProperty"
, "Ptr", RequestQueueHandle ; HANDLE
, "Int", Property ; HTTP_SERVER_PROPERTY
, "Ptr", PropertyInformation ; void*
, "UInt", PropertyInformationLength ; DWORD
, "UInt", Reserved1 ; DWORD optional
, "Ptr", Reserved2 ; void* optional
, "UInt") ; return: DWORD●HttpSetRequestQueueProperty(RequestQueueHandle, Property, PropertyInformation, PropertyInformationLength, Reserved1, Reserved2) = DLL("HTTPAPI.dll", "dword HttpSetRequestQueueProperty(void*, int, void*, dword, dword, void*)")
# 呼び出し: HttpSetRequestQueueProperty(RequestQueueHandle, Property, PropertyInformation, PropertyInformationLength, Reserved1, Reserved2)
# RequestQueueHandle : HANDLE -> "void*"
# Property : HTTP_SERVER_PROPERTY -> "int"
# PropertyInformation : void* -> "void*"
# PropertyInformationLength : DWORD -> "dword"
# Reserved1 : DWORD optional -> "dword"
# Reserved2 : void* optional -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。