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

HttpIsFeatureSupported

関数
指定したHTTP機能が利用可能か判定する。
DLLHTTPAPI.dll呼出規約winapi

シグネチャ

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

BOOL HttpIsFeatureSupported(
    HTTP_FEATURE_ID FeatureId
);

パラメーター

名前方向
FeatureIdHTTP_FEATURE_IDin

戻り値の型: BOOL

各言語での呼び出し定義

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

BOOL HttpIsFeatureSupported(
    HTTP_FEATURE_ID FeatureId
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("HTTPAPI.dll", ExactSpelling = true)]
static extern bool HttpIsFeatureSupported(
    int FeatureId   // HTTP_FEATURE_ID
);
<DllImport("HTTPAPI.dll", ExactSpelling:=True)>
Public Shared Function HttpIsFeatureSupported(
    FeatureId As Integer   ' HTTP_FEATURE_ID
) As Boolean
End Function
' FeatureId : HTTP_FEATURE_ID
Declare PtrSafe Function HttpIsFeatureSupported Lib "httpapi" ( _
    ByVal FeatureId As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

HttpIsFeatureSupported = ctypes.windll.httpapi.HttpIsFeatureSupported
HttpIsFeatureSupported.restype = wintypes.BOOL
HttpIsFeatureSupported.argtypes = [
    ctypes.c_int,  # FeatureId : HTTP_FEATURE_ID
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('HTTPAPI.dll')
HttpIsFeatureSupported = Fiddle::Function.new(
  lib['HttpIsFeatureSupported'],
  [
    Fiddle::TYPE_INT,  # FeatureId : HTTP_FEATURE_ID
  ],
  Fiddle::TYPE_INT)
#[link(name = "httpapi")]
extern "system" {
    fn HttpIsFeatureSupported(
        FeatureId: i32  // HTTP_FEATURE_ID
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("HTTPAPI.dll")]
public static extern bool HttpIsFeatureSupported(int FeatureId);
"@
$api = Add-Type -MemberDefinition $sig -Name 'HTTPAPI_HttpIsFeatureSupported' -Namespace Win32 -PassThru
# $api::HttpIsFeatureSupported(FeatureId)
#uselib "HTTPAPI.dll"
#func global HttpIsFeatureSupported "HttpIsFeatureSupported" sptr
; HttpIsFeatureSupported FeatureId   ; 戻り値は stat
; FeatureId : HTTP_FEATURE_ID -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "HTTPAPI.dll"
#cfunc global HttpIsFeatureSupported "HttpIsFeatureSupported" int
; res = HttpIsFeatureSupported(FeatureId)
; FeatureId : HTTP_FEATURE_ID -> "int"
; BOOL HttpIsFeatureSupported(HTTP_FEATURE_ID FeatureId)
#uselib "HTTPAPI.dll"
#cfunc global HttpIsFeatureSupported "HttpIsFeatureSupported" int
; res = HttpIsFeatureSupported(FeatureId)
; FeatureId : HTTP_FEATURE_ID -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	httpapi = windows.NewLazySystemDLL("HTTPAPI.dll")
	procHttpIsFeatureSupported = httpapi.NewProc("HttpIsFeatureSupported")
)

// FeatureId (HTTP_FEATURE_ID)
r1, _, err := procHttpIsFeatureSupported.Call(
	uintptr(FeatureId),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // BOOL
function HttpIsFeatureSupported(
  FeatureId: Integer   // HTTP_FEATURE_ID
): BOOL; stdcall;
  external 'HTTPAPI.dll' name 'HttpIsFeatureSupported';
result := DllCall("HTTPAPI\HttpIsFeatureSupported"
    , "Int", FeatureId   ; HTTP_FEATURE_ID
    , "Int")   ; return: BOOL
●HttpIsFeatureSupported(FeatureId) = DLL("HTTPAPI.dll", "bool HttpIsFeatureSupported(int)")
# 呼び出し: HttpIsFeatureSupported(FeatureId)
# FeatureId : HTTP_FEATURE_ID -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。