Win32 API 日本語リファレンス
ホームNetworking.HttpServer › HttpQueryServiceConfiguration

HttpQueryServiceConfiguration

関数
HTTPサービスの構成設定を取得する。
DLLHTTPAPI.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

// HTTPAPI.dll
#include <windows.h>

DWORD HttpQueryServiceConfiguration(
    HANDLE ServiceHandle,   // optional
    HTTP_SERVICE_CONFIG_ID ConfigId,
    void* pInput,   // optional
    DWORD InputLength,
    void* pOutput,   // optional
    DWORD OutputLength,
    DWORD* pReturnLength,   // optional
    OVERLAPPED* pOverlapped   // optional
);

パラメーター

名前方向
ServiceHandleHANDLEoptional
ConfigIdHTTP_SERVICE_CONFIG_IDin
pInputvoid*inoptional
InputLengthDWORDin
pOutputvoid*outoptional
OutputLengthDWORDin
pReturnLengthDWORD*outoptional
pOverlappedOVERLAPPED*optional

戻り値の型: DWORD

各言語での呼び出し定義

// HTTPAPI.dll
#include <windows.h>

DWORD HttpQueryServiceConfiguration(
    HANDLE ServiceHandle,   // optional
    HTTP_SERVICE_CONFIG_ID ConfigId,
    void* pInput,   // optional
    DWORD InputLength,
    void* pOutput,   // optional
    DWORD OutputLength,
    DWORD* pReturnLength,   // optional
    OVERLAPPED* pOverlapped   // optional
);
[DllImport("HTTPAPI.dll", ExactSpelling = true)]
static extern uint HttpQueryServiceConfiguration(
    IntPtr ServiceHandle,   // HANDLE optional
    int ConfigId,   // HTTP_SERVICE_CONFIG_ID
    IntPtr pInput,   // void* optional
    uint InputLength,   // DWORD
    IntPtr pOutput,   // void* optional, out
    uint OutputLength,   // DWORD
    IntPtr pReturnLength,   // DWORD* optional, out
    IntPtr pOverlapped   // OVERLAPPED* optional
);
<DllImport("HTTPAPI.dll", ExactSpelling:=True)>
Public Shared Function HttpQueryServiceConfiguration(
    ServiceHandle As IntPtr,   ' HANDLE optional
    ConfigId As Integer,   ' HTTP_SERVICE_CONFIG_ID
    pInput As IntPtr,   ' void* optional
    InputLength As UInteger,   ' DWORD
    pOutput As IntPtr,   ' void* optional, out
    OutputLength As UInteger,   ' DWORD
    pReturnLength As IntPtr,   ' DWORD* optional, out
    pOverlapped As IntPtr   ' OVERLAPPED* optional
) As UInteger
End Function
' ServiceHandle : HANDLE optional
' ConfigId : HTTP_SERVICE_CONFIG_ID
' pInput : void* optional
' InputLength : DWORD
' pOutput : void* optional, out
' OutputLength : DWORD
' pReturnLength : DWORD* optional, out
' pOverlapped : OVERLAPPED* optional
Declare PtrSafe Function HttpQueryServiceConfiguration Lib "httpapi" ( _
    ByVal ServiceHandle As LongPtr, _
    ByVal ConfigId As Long, _
    ByVal pInput As LongPtr, _
    ByVal InputLength As Long, _
    ByVal pOutput As LongPtr, _
    ByVal OutputLength As Long, _
    ByVal pReturnLength As LongPtr, _
    ByVal pOverlapped As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

HttpQueryServiceConfiguration = ctypes.windll.httpapi.HttpQueryServiceConfiguration
HttpQueryServiceConfiguration.restype = wintypes.DWORD
HttpQueryServiceConfiguration.argtypes = [
    wintypes.HANDLE,  # ServiceHandle : HANDLE optional
    ctypes.c_int,  # ConfigId : HTTP_SERVICE_CONFIG_ID
    ctypes.POINTER(None),  # pInput : void* optional
    wintypes.DWORD,  # InputLength : DWORD
    ctypes.POINTER(None),  # pOutput : void* optional, out
    wintypes.DWORD,  # OutputLength : DWORD
    ctypes.POINTER(wintypes.DWORD),  # pReturnLength : DWORD* optional, out
    ctypes.c_void_p,  # pOverlapped : OVERLAPPED* optional
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('HTTPAPI.dll')
HttpQueryServiceConfiguration = Fiddle::Function.new(
  lib['HttpQueryServiceConfiguration'],
  [
    Fiddle::TYPE_VOIDP,  # ServiceHandle : HANDLE optional
    Fiddle::TYPE_INT,  # ConfigId : HTTP_SERVICE_CONFIG_ID
    Fiddle::TYPE_VOIDP,  # pInput : void* optional
    -Fiddle::TYPE_INT,  # InputLength : DWORD
    Fiddle::TYPE_VOIDP,  # pOutput : void* optional, out
    -Fiddle::TYPE_INT,  # OutputLength : DWORD
    Fiddle::TYPE_VOIDP,  # pReturnLength : DWORD* optional, out
    Fiddle::TYPE_VOIDP,  # pOverlapped : OVERLAPPED* optional
  ],
  -Fiddle::TYPE_INT)
#[link(name = "httpapi")]
extern "system" {
    fn HttpQueryServiceConfiguration(
        ServiceHandle: *mut core::ffi::c_void,  // HANDLE optional
        ConfigId: i32,  // HTTP_SERVICE_CONFIG_ID
        pInput: *mut (),  // void* optional
        InputLength: u32,  // DWORD
        pOutput: *mut (),  // void* optional, out
        OutputLength: u32,  // DWORD
        pReturnLength: *mut u32,  // DWORD* optional, out
        pOverlapped: *mut OVERLAPPED  // OVERLAPPED* optional
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("HTTPAPI.dll")]
public static extern uint HttpQueryServiceConfiguration(IntPtr ServiceHandle, int ConfigId, IntPtr pInput, uint InputLength, IntPtr pOutput, uint OutputLength, IntPtr pReturnLength, IntPtr pOverlapped);
"@
$api = Add-Type -MemberDefinition $sig -Name 'HTTPAPI_HttpQueryServiceConfiguration' -Namespace Win32 -PassThru
# $api::HttpQueryServiceConfiguration(ServiceHandle, ConfigId, pInput, InputLength, pOutput, OutputLength, pReturnLength, pOverlapped)
#uselib "HTTPAPI.dll"
#func global HttpQueryServiceConfiguration "HttpQueryServiceConfiguration" sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr
; HttpQueryServiceConfiguration ServiceHandle, ConfigId, pInput, InputLength, pOutput, OutputLength, varptr(pReturnLength), varptr(pOverlapped)   ; 戻り値は stat
; ServiceHandle : HANDLE optional -> "sptr"
; ConfigId : HTTP_SERVICE_CONFIG_ID -> "sptr"
; pInput : void* optional -> "sptr"
; InputLength : DWORD -> "sptr"
; pOutput : void* optional, out -> "sptr"
; OutputLength : DWORD -> "sptr"
; pReturnLength : DWORD* optional, out -> "sptr"
; pOverlapped : OVERLAPPED* optional -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "HTTPAPI.dll"
#cfunc global HttpQueryServiceConfiguration "HttpQueryServiceConfiguration" sptr, int, sptr, int, sptr, int, var, var
; res = HttpQueryServiceConfiguration(ServiceHandle, ConfigId, pInput, InputLength, pOutput, OutputLength, pReturnLength, pOverlapped)
; ServiceHandle : HANDLE optional -> "sptr"
; ConfigId : HTTP_SERVICE_CONFIG_ID -> "int"
; pInput : void* optional -> "sptr"
; InputLength : DWORD -> "int"
; pOutput : void* optional, out -> "sptr"
; OutputLength : DWORD -> "int"
; pReturnLength : DWORD* optional, out -> "var"
; pOverlapped : OVERLAPPED* optional -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; DWORD HttpQueryServiceConfiguration(HANDLE ServiceHandle, HTTP_SERVICE_CONFIG_ID ConfigId, void* pInput, DWORD InputLength, void* pOutput, DWORD OutputLength, DWORD* pReturnLength, OVERLAPPED* pOverlapped)
#uselib "HTTPAPI.dll"
#cfunc global HttpQueryServiceConfiguration "HttpQueryServiceConfiguration" intptr, int, intptr, int, intptr, int, var, var
; res = HttpQueryServiceConfiguration(ServiceHandle, ConfigId, pInput, InputLength, pOutput, OutputLength, pReturnLength, pOverlapped)
; ServiceHandle : HANDLE optional -> "intptr"
; ConfigId : HTTP_SERVICE_CONFIG_ID -> "int"
; pInput : void* optional -> "intptr"
; InputLength : DWORD -> "int"
; pOutput : void* optional, out -> "intptr"
; OutputLength : DWORD -> "int"
; pReturnLength : DWORD* optional, out -> "var"
; pOverlapped : OVERLAPPED* optional -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	httpapi = windows.NewLazySystemDLL("HTTPAPI.dll")
	procHttpQueryServiceConfiguration = httpapi.NewProc("HttpQueryServiceConfiguration")
)

// ServiceHandle (HANDLE optional), ConfigId (HTTP_SERVICE_CONFIG_ID), pInput (void* optional), InputLength (DWORD), pOutput (void* optional, out), OutputLength (DWORD), pReturnLength (DWORD* optional, out), pOverlapped (OVERLAPPED* optional)
r1, _, err := procHttpQueryServiceConfiguration.Call(
	uintptr(ServiceHandle),
	uintptr(ConfigId),
	uintptr(pInput),
	uintptr(InputLength),
	uintptr(pOutput),
	uintptr(OutputLength),
	uintptr(pReturnLength),
	uintptr(pOverlapped),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // DWORD
function HttpQueryServiceConfiguration(
  ServiceHandle: THandle;   // HANDLE optional
  ConfigId: Integer;   // HTTP_SERVICE_CONFIG_ID
  pInput: Pointer;   // void* optional
  InputLength: DWORD;   // DWORD
  pOutput: Pointer;   // void* optional, out
  OutputLength: DWORD;   // DWORD
  pReturnLength: Pointer;   // DWORD* optional, out
  pOverlapped: Pointer   // OVERLAPPED* optional
): DWORD; stdcall;
  external 'HTTPAPI.dll' name 'HttpQueryServiceConfiguration';
result := DllCall("HTTPAPI\HttpQueryServiceConfiguration"
    , "Ptr", ServiceHandle   ; HANDLE optional
    , "Int", ConfigId   ; HTTP_SERVICE_CONFIG_ID
    , "Ptr", pInput   ; void* optional
    , "UInt", InputLength   ; DWORD
    , "Ptr", pOutput   ; void* optional, out
    , "UInt", OutputLength   ; DWORD
    , "Ptr", pReturnLength   ; DWORD* optional, out
    , "Ptr", pOverlapped   ; OVERLAPPED* optional
    , "UInt")   ; return: DWORD
●HttpQueryServiceConfiguration(ServiceHandle, ConfigId, pInput, InputLength, pOutput, OutputLength, pReturnLength, pOverlapped) = DLL("HTTPAPI.dll", "dword HttpQueryServiceConfiguration(void*, int, void*, dword, void*, dword, void*, void*)")
# 呼び出し: HttpQueryServiceConfiguration(ServiceHandle, ConfigId, pInput, InputLength, pOutput, OutputLength, pReturnLength, pOverlapped)
# ServiceHandle : HANDLE optional -> "void*"
# ConfigId : HTTP_SERVICE_CONFIG_ID -> "int"
# pInput : void* optional -> "void*"
# InputLength : DWORD -> "dword"
# pOutput : void* optional, out -> "void*"
# OutputLength : DWORD -> "dword"
# pReturnLength : DWORD* optional, out -> "void*"
# pOverlapped : OVERLAPPED* optional -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。