ホーム › Networking.HttpServer › HttpQueryRequestQueueProperty
HttpQueryRequestQueueProperty
関数リクエストキューのプロパティを取得する。
シグネチャ
// HTTPAPI.dll
#include <windows.h>
DWORD HttpQueryRequestQueueProperty(
HANDLE RequestQueueHandle,
HTTP_SERVER_PROPERTY Property,
void* PropertyInformation, // optional
DWORD PropertyInformationLength,
DWORD Reserved1, // optional
DWORD* ReturnLength, // optional
void* Reserved2 // optional
);パラメーター
| 名前 | 型 | 方向 | 説明 | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| RequestQueueHandle | HANDLE | in | プロパティを問い合わせる対象要求キューのハンドル。 | ||||||||
| Property | HTTP_SERVER_PROPERTY | in | 設定されるプロパティの種類を示す HTTP_SERVER_PROPERTY 列挙体のメンバー。次のいずれかを指定できます。 | ||||||||
| PropertyInformation | void* | outoptional | プロパティ情報を受け取るバッファーへのポインター。 pPropertyInformation は、設定されるプロパティに応じて、次のプロパティ情報値のいずれかを指します。
| ||||||||
| PropertyInformationLength | DWORD | in | pPropertyInformation パラメーターが指すバッファーの長さ(バイト単位)。 | ||||||||
| Reserved1 | DWORD | optional | 予約済み。ゼロでなければなりません。 | ||||||||
| ReturnLength | DWORD* | outoptional | NULL でない場合に、pPropertyInformation バッファーに返されるバイト数。 出力バッファーが小さすぎる場合、呼び出しは ERROR_MORE_DATA を返して失敗します。pReturnLength が指す値を使用すると、呼び出しを成功させるために必要なバッファーの最小長を判断できます。 | ||||||||
| Reserved2 | void* | optional | このパラメーターは予約済みであり、NULL でなければなりません。 |
戻り値の型: DWORD
公式ドキュメント
指定したハンドルで識別されるリクエストキューのプロパティを照会します。
戻り値
関数が成功した場合は NO_ERROR を返します。
関数が失敗した場合は、次のいずれかのエラーコードを返します。
| 値 | 意味 |
|---|---|
|
Reserved パラメーターがゼロでないか、pReserved パラメーターが NULL でありません。
Property パラメーターで指定されたプロパティの種類は、リクエストキューではサポートされていません。 pPropertyInformation パラメーターが NULL です。 PropertyInformationLength パラメーターがゼロです。 アプリケーションにリクエストキューを開く権限がありません。 |
|
| pPropertyInformation パラメーターが指すバッファーのサイズ(バイト単位)が小さすぎて、プロパティ情報を受け取れません。終了時に pReturnLength が指すサイズ以上のバッファーを指定して、関数を再度呼び出してください。 | |
| リクエストキューのハンドルが HTTP バージョン 1.0 のハンドルです。プロパティ管理は HTTP バージョン 2.0 以降のリクエストキューでのみサポートされます。 |
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での呼び出し定義
// HTTPAPI.dll
#include <windows.h>
DWORD HttpQueryRequestQueueProperty(
HANDLE RequestQueueHandle,
HTTP_SERVER_PROPERTY Property,
void* PropertyInformation, // optional
DWORD PropertyInformationLength,
DWORD Reserved1, // optional
DWORD* ReturnLength, // optional
void* Reserved2 // optional
);[DllImport("HTTPAPI.dll", ExactSpelling = true)]
static extern uint HttpQueryRequestQueueProperty(
IntPtr RequestQueueHandle, // HANDLE
int Property, // HTTP_SERVER_PROPERTY
IntPtr PropertyInformation, // void* optional, out
uint PropertyInformationLength, // DWORD
uint Reserved1, // DWORD optional
IntPtr ReturnLength, // DWORD* optional, out
IntPtr Reserved2 // void* optional
);<DllImport("HTTPAPI.dll", ExactSpelling:=True)>
Public Shared Function HttpQueryRequestQueueProperty(
RequestQueueHandle As IntPtr, ' HANDLE
[Property] As Integer, ' HTTP_SERVER_PROPERTY
PropertyInformation As IntPtr, ' void* optional, out
PropertyInformationLength As UInteger, ' DWORD
Reserved1 As UInteger, ' DWORD optional
ReturnLength As IntPtr, ' DWORD* optional, out
Reserved2 As IntPtr ' void* optional
) As UInteger
End Function' RequestQueueHandle : HANDLE
' Property : HTTP_SERVER_PROPERTY
' PropertyInformation : void* optional, out
' PropertyInformationLength : DWORD
' Reserved1 : DWORD optional
' ReturnLength : DWORD* optional, out
' Reserved2 : void* optional
Declare PtrSafe Function HttpQueryRequestQueueProperty Lib "httpapi" ( _
ByVal RequestQueueHandle As LongPtr, _
ByVal Property As Long, _
ByVal PropertyInformation As LongPtr, _
ByVal PropertyInformationLength As Long, _
ByVal Reserved1 As Long, _
ByVal ReturnLength As LongPtr, _
ByVal Reserved2 As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
HttpQueryRequestQueueProperty = ctypes.windll.httpapi.HttpQueryRequestQueueProperty
HttpQueryRequestQueueProperty.restype = wintypes.DWORD
HttpQueryRequestQueueProperty.argtypes = [
wintypes.HANDLE, # RequestQueueHandle : HANDLE
ctypes.c_int, # Property : HTTP_SERVER_PROPERTY
ctypes.POINTER(None), # PropertyInformation : void* optional, out
wintypes.DWORD, # PropertyInformationLength : DWORD
wintypes.DWORD, # Reserved1 : DWORD optional
ctypes.POINTER(wintypes.DWORD), # ReturnLength : DWORD* optional, out
ctypes.POINTER(None), # Reserved2 : void* optional
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('HTTPAPI.dll')
HttpQueryRequestQueueProperty = Fiddle::Function.new(
lib['HttpQueryRequestQueueProperty'],
[
Fiddle::TYPE_VOIDP, # RequestQueueHandle : HANDLE
Fiddle::TYPE_INT, # Property : HTTP_SERVER_PROPERTY
Fiddle::TYPE_VOIDP, # PropertyInformation : void* optional, out
-Fiddle::TYPE_INT, # PropertyInformationLength : DWORD
-Fiddle::TYPE_INT, # Reserved1 : DWORD optional
Fiddle::TYPE_VOIDP, # ReturnLength : DWORD* optional, out
Fiddle::TYPE_VOIDP, # Reserved2 : void* optional
],
-Fiddle::TYPE_INT)#[link(name = "httpapi")]
extern "system" {
fn HttpQueryRequestQueueProperty(
RequestQueueHandle: *mut core::ffi::c_void, // HANDLE
Property: i32, // HTTP_SERVER_PROPERTY
PropertyInformation: *mut (), // void* optional, out
PropertyInformationLength: u32, // DWORD
Reserved1: u32, // DWORD optional
ReturnLength: *mut u32, // DWORD* optional, out
Reserved2: *mut () // void* optional
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("HTTPAPI.dll")]
public static extern uint HttpQueryRequestQueueProperty(IntPtr RequestQueueHandle, int Property, IntPtr PropertyInformation, uint PropertyInformationLength, uint Reserved1, IntPtr ReturnLength, IntPtr Reserved2);
"@
$api = Add-Type -MemberDefinition $sig -Name 'HTTPAPI_HttpQueryRequestQueueProperty' -Namespace Win32 -PassThru
# $api::HttpQueryRequestQueueProperty(RequestQueueHandle, Property, PropertyInformation, PropertyInformationLength, Reserved1, ReturnLength, Reserved2)#uselib "HTTPAPI.dll"
#func global HttpQueryRequestQueueProperty "HttpQueryRequestQueueProperty" sptr, sptr, sptr, sptr, sptr, sptr, sptr
; HttpQueryRequestQueueProperty RequestQueueHandle, Property, PropertyInformation, PropertyInformationLength, Reserved1, varptr(ReturnLength), Reserved2 ; 戻り値は stat
; RequestQueueHandle : HANDLE -> "sptr"
; Property : HTTP_SERVER_PROPERTY -> "sptr"
; PropertyInformation : void* optional, out -> "sptr"
; PropertyInformationLength : DWORD -> "sptr"
; Reserved1 : DWORD optional -> "sptr"
; ReturnLength : DWORD* optional, out -> "sptr"
; Reserved2 : void* optional -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "HTTPAPI.dll" #cfunc global HttpQueryRequestQueueProperty "HttpQueryRequestQueueProperty" sptr, int, sptr, int, int, var, sptr ; res = HttpQueryRequestQueueProperty(RequestQueueHandle, Property, PropertyInformation, PropertyInformationLength, Reserved1, ReturnLength, Reserved2) ; RequestQueueHandle : HANDLE -> "sptr" ; Property : HTTP_SERVER_PROPERTY -> "int" ; PropertyInformation : void* optional, out -> "sptr" ; PropertyInformationLength : DWORD -> "int" ; Reserved1 : DWORD optional -> "int" ; ReturnLength : DWORD* optional, out -> "var" ; Reserved2 : void* optional -> "sptr" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "HTTPAPI.dll" #cfunc global HttpQueryRequestQueueProperty "HttpQueryRequestQueueProperty" sptr, int, sptr, int, int, sptr, sptr ; res = HttpQueryRequestQueueProperty(RequestQueueHandle, Property, PropertyInformation, PropertyInformationLength, Reserved1, varptr(ReturnLength), Reserved2) ; RequestQueueHandle : HANDLE -> "sptr" ; Property : HTTP_SERVER_PROPERTY -> "int" ; PropertyInformation : void* optional, out -> "sptr" ; PropertyInformationLength : DWORD -> "int" ; Reserved1 : DWORD optional -> "int" ; ReturnLength : DWORD* optional, out -> "sptr" ; Reserved2 : void* optional -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; DWORD HttpQueryRequestQueueProperty(HANDLE RequestQueueHandle, HTTP_SERVER_PROPERTY Property, void* PropertyInformation, DWORD PropertyInformationLength, DWORD Reserved1, DWORD* ReturnLength, void* Reserved2) #uselib "HTTPAPI.dll" #cfunc global HttpQueryRequestQueueProperty "HttpQueryRequestQueueProperty" intptr, int, intptr, int, int, var, intptr ; res = HttpQueryRequestQueueProperty(RequestQueueHandle, Property, PropertyInformation, PropertyInformationLength, Reserved1, ReturnLength, Reserved2) ; RequestQueueHandle : HANDLE -> "intptr" ; Property : HTTP_SERVER_PROPERTY -> "int" ; PropertyInformation : void* optional, out -> "intptr" ; PropertyInformationLength : DWORD -> "int" ; Reserved1 : DWORD optional -> "int" ; ReturnLength : DWORD* optional, out -> "var" ; Reserved2 : void* optional -> "intptr" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; DWORD HttpQueryRequestQueueProperty(HANDLE RequestQueueHandle, HTTP_SERVER_PROPERTY Property, void* PropertyInformation, DWORD PropertyInformationLength, DWORD Reserved1, DWORD* ReturnLength, void* Reserved2) #uselib "HTTPAPI.dll" #cfunc global HttpQueryRequestQueueProperty "HttpQueryRequestQueueProperty" intptr, int, intptr, int, int, intptr, intptr ; res = HttpQueryRequestQueueProperty(RequestQueueHandle, Property, PropertyInformation, PropertyInformationLength, Reserved1, varptr(ReturnLength), Reserved2) ; RequestQueueHandle : HANDLE -> "intptr" ; Property : HTTP_SERVER_PROPERTY -> "int" ; PropertyInformation : void* optional, out -> "intptr" ; PropertyInformationLength : DWORD -> "int" ; Reserved1 : DWORD optional -> "int" ; ReturnLength : DWORD* optional, out -> "intptr" ; Reserved2 : void* optional -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
httpapi = windows.NewLazySystemDLL("HTTPAPI.dll")
procHttpQueryRequestQueueProperty = httpapi.NewProc("HttpQueryRequestQueueProperty")
)
// RequestQueueHandle (HANDLE), Property (HTTP_SERVER_PROPERTY), PropertyInformation (void* optional, out), PropertyInformationLength (DWORD), Reserved1 (DWORD optional), ReturnLength (DWORD* optional, out), Reserved2 (void* optional)
r1, _, err := procHttpQueryRequestQueueProperty.Call(
uintptr(RequestQueueHandle),
uintptr(Property),
uintptr(PropertyInformation),
uintptr(PropertyInformationLength),
uintptr(Reserved1),
uintptr(ReturnLength),
uintptr(Reserved2),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction HttpQueryRequestQueueProperty(
RequestQueueHandle: THandle; // HANDLE
Property: Integer; // HTTP_SERVER_PROPERTY
PropertyInformation: Pointer; // void* optional, out
PropertyInformationLength: DWORD; // DWORD
Reserved1: DWORD; // DWORD optional
ReturnLength: Pointer; // DWORD* optional, out
Reserved2: Pointer // void* optional
): DWORD; stdcall;
external 'HTTPAPI.dll' name 'HttpQueryRequestQueueProperty';result := DllCall("HTTPAPI\HttpQueryRequestQueueProperty"
, "Ptr", RequestQueueHandle ; HANDLE
, "Int", Property ; HTTP_SERVER_PROPERTY
, "Ptr", PropertyInformation ; void* optional, out
, "UInt", PropertyInformationLength ; DWORD
, "UInt", Reserved1 ; DWORD optional
, "Ptr", ReturnLength ; DWORD* optional, out
, "Ptr", Reserved2 ; void* optional
, "UInt") ; return: DWORD●HttpQueryRequestQueueProperty(RequestQueueHandle, Property, PropertyInformation, PropertyInformationLength, Reserved1, ReturnLength, Reserved2) = DLL("HTTPAPI.dll", "dword HttpQueryRequestQueueProperty(void*, int, void*, dword, dword, void*, void*)")
# 呼び出し: HttpQueryRequestQueueProperty(RequestQueueHandle, Property, PropertyInformation, PropertyInformationLength, Reserved1, ReturnLength, Reserved2)
# RequestQueueHandle : HANDLE -> "void*"
# Property : HTTP_SERVER_PROPERTY -> "int"
# PropertyInformation : void* optional, out -> "void*"
# PropertyInformationLength : DWORD -> "dword"
# Reserved1 : DWORD optional -> "dword"
# ReturnLength : DWORD* optional, out -> "void*"
# Reserved2 : void* optional -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "httpapi" fn HttpQueryRequestQueueProperty(
RequestQueueHandle: ?*anyopaque, // HANDLE
Property: i32, // HTTP_SERVER_PROPERTY
PropertyInformation: ?*anyopaque, // void* optional, out
PropertyInformationLength: u32, // DWORD
Reserved1: u32, // DWORD optional
ReturnLength: [*c]u32, // DWORD* optional, out
Reserved2: ?*anyopaque // void* optional
) callconv(std.os.windows.WINAPI) u32;proc HttpQueryRequestQueueProperty(
RequestQueueHandle: pointer, # HANDLE
Property: int32, # HTTP_SERVER_PROPERTY
PropertyInformation: pointer, # void* optional, out
PropertyInformationLength: uint32, # DWORD
Reserved1: uint32, # DWORD optional
ReturnLength: ptr uint32, # DWORD* optional, out
Reserved2: pointer # void* optional
): uint32 {.importc: "HttpQueryRequestQueueProperty", stdcall, dynlib: "HTTPAPI.dll".}pragma(lib, "httpapi");
extern(Windows)
uint HttpQueryRequestQueueProperty(
void* RequestQueueHandle, // HANDLE
int Property, // HTTP_SERVER_PROPERTY
void* PropertyInformation, // void* optional, out
uint PropertyInformationLength, // DWORD
uint Reserved1, // DWORD optional
uint* ReturnLength, // DWORD* optional, out
void* Reserved2 // void* optional
);ccall((:HttpQueryRequestQueueProperty, "HTTPAPI.dll"), stdcall, UInt32,
(Ptr{Cvoid}, Int32, Ptr{Cvoid}, UInt32, UInt32, Ptr{UInt32}, Ptr{Cvoid}),
RequestQueueHandle, Property, PropertyInformation, PropertyInformationLength, Reserved1, ReturnLength, Reserved2)
# RequestQueueHandle : HANDLE -> Ptr{Cvoid}
# Property : HTTP_SERVER_PROPERTY -> Int32
# PropertyInformation : void* optional, out -> Ptr{Cvoid}
# PropertyInformationLength : DWORD -> UInt32
# Reserved1 : DWORD optional -> UInt32
# ReturnLength : DWORD* optional, out -> Ptr{UInt32}
# Reserved2 : void* optional -> Ptr{Cvoid}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
uint32_t HttpQueryRequestQueueProperty(
void* RequestQueueHandle,
int32_t Property,
void* PropertyInformation,
uint32_t PropertyInformationLength,
uint32_t Reserved1,
uint32_t* ReturnLength,
void* Reserved2);
]]
local httpapi = ffi.load("httpapi")
-- httpapi.HttpQueryRequestQueueProperty(RequestQueueHandle, Property, PropertyInformation, PropertyInformationLength, Reserved1, ReturnLength, Reserved2)
-- RequestQueueHandle : HANDLE
-- Property : HTTP_SERVER_PROPERTY
-- PropertyInformation : void* optional, out
-- PropertyInformationLength : DWORD
-- Reserved1 : DWORD optional
-- ReturnLength : DWORD* optional, out
-- Reserved2 : void* optional
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('HTTPAPI.dll');
const HttpQueryRequestQueueProperty = lib.func('__stdcall', 'HttpQueryRequestQueueProperty', 'uint32_t', ['void *', 'int32_t', 'void *', 'uint32_t', 'uint32_t', 'uint32_t *', 'void *']);
// HttpQueryRequestQueueProperty(RequestQueueHandle, Property, PropertyInformation, PropertyInformationLength, Reserved1, ReturnLength, Reserved2)
// RequestQueueHandle : HANDLE -> 'void *'
// Property : HTTP_SERVER_PROPERTY -> 'int32_t'
// PropertyInformation : void* optional, out -> 'void *'
// PropertyInformationLength : DWORD -> 'uint32_t'
// Reserved1 : DWORD optional -> 'uint32_t'
// ReturnLength : DWORD* optional, out -> 'uint32_t *'
// Reserved2 : void* optional -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("HTTPAPI.dll", {
HttpQueryRequestQueueProperty: { parameters: ["pointer", "i32", "pointer", "u32", "u32", "pointer", "pointer"], result: "u32" },
});
// lib.symbols.HttpQueryRequestQueueProperty(RequestQueueHandle, Property, PropertyInformation, PropertyInformationLength, Reserved1, ReturnLength, Reserved2)
// RequestQueueHandle : HANDLE -> "pointer"
// Property : HTTP_SERVER_PROPERTY -> "i32"
// PropertyInformation : void* optional, out -> "pointer"
// PropertyInformationLength : DWORD -> "u32"
// Reserved1 : DWORD optional -> "u32"
// ReturnLength : DWORD* optional, out -> "pointer"
// Reserved2 : void* optional -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
uint32_t HttpQueryRequestQueueProperty(
void* RequestQueueHandle,
int32_t Property,
void* PropertyInformation,
uint32_t PropertyInformationLength,
uint32_t Reserved1,
uint32_t* ReturnLength,
void* Reserved2);
C, "HTTPAPI.dll");
// $ffi->HttpQueryRequestQueueProperty(RequestQueueHandle, Property, PropertyInformation, PropertyInformationLength, Reserved1, ReturnLength, Reserved2);
// RequestQueueHandle : HANDLE
// Property : HTTP_SERVER_PROPERTY
// PropertyInformation : void* optional, out
// PropertyInformationLength : DWORD
// Reserved1 : DWORD optional
// ReturnLength : DWORD* optional, out
// Reserved2 : void* 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 Httpapi extends StdCallLibrary {
Httpapi INSTANCE = Native.load("httpapi", Httpapi.class);
int HttpQueryRequestQueueProperty(
Pointer RequestQueueHandle, // HANDLE
int Property, // HTTP_SERVER_PROPERTY
Pointer PropertyInformation, // void* optional, out
int PropertyInformationLength, // DWORD
int Reserved1, // DWORD optional
IntByReference ReturnLength, // DWORD* optional, out
Pointer Reserved2 // void* optional
);
}@[Link("httpapi")]
lib LibHTTPAPI
fun HttpQueryRequestQueueProperty = HttpQueryRequestQueueProperty(
RequestQueueHandle : Void*, # HANDLE
Property : Int32, # HTTP_SERVER_PROPERTY
PropertyInformation : Void*, # void* optional, out
PropertyInformationLength : UInt32, # DWORD
Reserved1 : UInt32, # DWORD optional
ReturnLength : UInt32*, # DWORD* optional, out
Reserved2 : Void* # void* optional
) : UInt32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef HttpQueryRequestQueuePropertyNative = Uint32 Function(Pointer<Void>, Int32, Pointer<Void>, Uint32, Uint32, Pointer<Uint32>, Pointer<Void>);
typedef HttpQueryRequestQueuePropertyDart = int Function(Pointer<Void>, int, Pointer<Void>, int, int, Pointer<Uint32>, Pointer<Void>);
final HttpQueryRequestQueueProperty = DynamicLibrary.open('HTTPAPI.dll')
.lookupFunction<HttpQueryRequestQueuePropertyNative, HttpQueryRequestQueuePropertyDart>('HttpQueryRequestQueueProperty');
// RequestQueueHandle : HANDLE -> Pointer<Void>
// Property : HTTP_SERVER_PROPERTY -> Int32
// PropertyInformation : void* optional, out -> Pointer<Void>
// PropertyInformationLength : DWORD -> Uint32
// Reserved1 : DWORD optional -> Uint32
// ReturnLength : DWORD* optional, out -> Pointer<Uint32>
// Reserved2 : void* optional -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function HttpQueryRequestQueueProperty(
RequestQueueHandle: THandle; // HANDLE
Property: Integer; // HTTP_SERVER_PROPERTY
PropertyInformation: Pointer; // void* optional, out
PropertyInformationLength: DWORD; // DWORD
Reserved1: DWORD; // DWORD optional
ReturnLength: Pointer; // DWORD* optional, out
Reserved2: Pointer // void* optional
): DWORD; stdcall;
external 'HTTPAPI.dll' name 'HttpQueryRequestQueueProperty';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "HttpQueryRequestQueueProperty"
c_HttpQueryRequestQueueProperty :: Ptr () -> Int32 -> Ptr () -> Word32 -> Word32 -> Ptr Word32 -> Ptr () -> IO Word32
-- RequestQueueHandle : HANDLE -> Ptr ()
-- Property : HTTP_SERVER_PROPERTY -> Int32
-- PropertyInformation : void* optional, out -> Ptr ()
-- PropertyInformationLength : DWORD -> Word32
-- Reserved1 : DWORD optional -> Word32
-- ReturnLength : DWORD* optional, out -> Ptr Word32
-- Reserved2 : void* optional -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let httpqueryrequestqueueproperty =
foreign "HttpQueryRequestQueueProperty"
((ptr void) @-> int32_t @-> (ptr void) @-> uint32_t @-> uint32_t @-> (ptr uint32_t) @-> (ptr void) @-> returning uint32_t)
(* RequestQueueHandle : HANDLE -> (ptr void) *)
(* Property : HTTP_SERVER_PROPERTY -> int32_t *)
(* PropertyInformation : void* optional, out -> (ptr void) *)
(* PropertyInformationLength : DWORD -> uint32_t *)
(* Reserved1 : DWORD optional -> uint32_t *)
(* ReturnLength : DWORD* optional, out -> (ptr uint32_t) *)
(* Reserved2 : void* optional -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library httpapi (t "HTTPAPI.dll"))
(cffi:use-foreign-library httpapi)
(cffi:defcfun ("HttpQueryRequestQueueProperty" http-query-request-queue-property :convention :stdcall) :uint32
(request-queue-handle :pointer) ; HANDLE
(property :int32) ; HTTP_SERVER_PROPERTY
(property-information :pointer) ; void* optional, out
(property-information-length :uint32) ; DWORD
(reserved1 :uint32) ; DWORD optional
(return-length :pointer) ; DWORD* optional, out
(reserved2 :pointer)) ; void* optional
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $HttpQueryRequestQueueProperty = Win32::API::More->new('HTTPAPI',
'DWORD HttpQueryRequestQueueProperty(HANDLE RequestQueueHandle, int Property, LPVOID PropertyInformation, DWORD PropertyInformationLength, DWORD Reserved1, LPVOID ReturnLength, LPVOID Reserved2)');
# my $ret = $HttpQueryRequestQueueProperty->Call($RequestQueueHandle, $Property, $PropertyInformation, $PropertyInformationLength, $Reserved1, $ReturnLength, $Reserved2);
# RequestQueueHandle : HANDLE -> HANDLE
# Property : HTTP_SERVER_PROPERTY -> int
# PropertyInformation : void* optional, out -> LPVOID
# PropertyInformationLength : DWORD -> DWORD
# Reserved1 : DWORD optional -> DWORD
# ReturnLength : DWORD* optional, out -> LPVOID
# Reserved2 : void* optional -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。関連項目
公式の関連項目
- f HttpCloseRequestQueue — HTTPリクエストキューのハンドルを閉じる。
- f HttpCreateRequestQueue — 名前付きのHTTPリクエストキューを作成する。
- f HttpSetRequestQueueProperty — リクエストキューのプロパティを設定する。
- f HttpShutdownRequestQueue — リクエストキューをシャットダウンし処理を停止する。