ホーム › Networking.HttpServer › HttpDeleteServiceConfiguration
HttpDeleteServiceConfiguration
関数HTTPサービスの構成設定を削除する。
シグネチャ
// HTTPAPI.dll
#include <windows.h>
DWORD HttpDeleteServiceConfiguration(
HANDLE ServiceHandle, // optional
HTTP_SERVICE_CONFIG_ID ConfigId,
void* pConfigInformation,
DWORD ConfigInformationLength,
OVERLAPPED* pOverlapped // optional
);パラメーター
| 名前 | 型 | 方向 | 説明 | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ServiceHandle | HANDLE | optional | このパラメーターは予約されており、0 にする必要があります。 | ||||||||||||||
| ConfigId | HTTP_SERVICE_CONFIG_ID | in | 構成の種類です。このパラメーターは、HTTP_SERVICE_CONFIG_ID 列挙体のいずれかの値です。
| ||||||||||||||
| pConfigInformation | void* | in | ConfigId パラメーターで指定した構成の種類に必要なデータを格納するバッファーへのポインターです。
| ||||||||||||||
| ConfigInformationLength | DWORD | in | pConfigInformation バッファーのサイズ (バイト単位)。 | ||||||||||||||
| pOverlapped | OVERLAPPED* | optional | 将来の非同期操作のために予約されています。このパラメーターは NULL に設定する必要があります。 |
戻り値の型: DWORD
公式ドキュメント
HTTP Server API の構成ストアから、IP アドレスや SSL 証明書などの指定したデータを 1 レコードずつ削除します。
戻り値
関数が成功した場合、NO_ERROR を返します。
関数が失敗した場合、次のいずれかのエラーコードを返します。
| 値 | 意味 |
|---|---|
| いずれかのパラメーターが無効です。 | |
|
WinError.h で定義されている システムエラーコード。 |
出典・ライセンス: 上記「公式ドキュメント」の内容は 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 HttpDeleteServiceConfiguration(
HANDLE ServiceHandle, // optional
HTTP_SERVICE_CONFIG_ID ConfigId,
void* pConfigInformation,
DWORD ConfigInformationLength,
OVERLAPPED* pOverlapped // optional
);[DllImport("HTTPAPI.dll", ExactSpelling = true)]
static extern uint HttpDeleteServiceConfiguration(
IntPtr ServiceHandle, // HANDLE optional
int ConfigId, // HTTP_SERVICE_CONFIG_ID
IntPtr pConfigInformation, // void*
uint ConfigInformationLength, // DWORD
IntPtr pOverlapped // OVERLAPPED* optional
);<DllImport("HTTPAPI.dll", ExactSpelling:=True)>
Public Shared Function HttpDeleteServiceConfiguration(
ServiceHandle As IntPtr, ' HANDLE optional
ConfigId As Integer, ' HTTP_SERVICE_CONFIG_ID
pConfigInformation As IntPtr, ' void*
ConfigInformationLength As UInteger, ' DWORD
pOverlapped As IntPtr ' OVERLAPPED* optional
) As UInteger
End Function' ServiceHandle : HANDLE optional
' ConfigId : HTTP_SERVICE_CONFIG_ID
' pConfigInformation : void*
' ConfigInformationLength : DWORD
' pOverlapped : OVERLAPPED* optional
Declare PtrSafe Function HttpDeleteServiceConfiguration Lib "httpapi" ( _
ByVal ServiceHandle As LongPtr, _
ByVal ConfigId As Long, _
ByVal pConfigInformation As LongPtr, _
ByVal ConfigInformationLength As Long, _
ByVal pOverlapped As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
HttpDeleteServiceConfiguration = ctypes.windll.httpapi.HttpDeleteServiceConfiguration
HttpDeleteServiceConfiguration.restype = wintypes.DWORD
HttpDeleteServiceConfiguration.argtypes = [
wintypes.HANDLE, # ServiceHandle : HANDLE optional
ctypes.c_int, # ConfigId : HTTP_SERVICE_CONFIG_ID
ctypes.POINTER(None), # pConfigInformation : void*
wintypes.DWORD, # ConfigInformationLength : DWORD
ctypes.c_void_p, # pOverlapped : OVERLAPPED* optional
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('HTTPAPI.dll')
HttpDeleteServiceConfiguration = Fiddle::Function.new(
lib['HttpDeleteServiceConfiguration'],
[
Fiddle::TYPE_VOIDP, # ServiceHandle : HANDLE optional
Fiddle::TYPE_INT, # ConfigId : HTTP_SERVICE_CONFIG_ID
Fiddle::TYPE_VOIDP, # pConfigInformation : void*
-Fiddle::TYPE_INT, # ConfigInformationLength : DWORD
Fiddle::TYPE_VOIDP, # pOverlapped : OVERLAPPED* optional
],
-Fiddle::TYPE_INT)#[link(name = "httpapi")]
extern "system" {
fn HttpDeleteServiceConfiguration(
ServiceHandle: *mut core::ffi::c_void, // HANDLE optional
ConfigId: i32, // HTTP_SERVICE_CONFIG_ID
pConfigInformation: *mut (), // void*
ConfigInformationLength: u32, // DWORD
pOverlapped: *mut OVERLAPPED // OVERLAPPED* optional
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("HTTPAPI.dll")]
public static extern uint HttpDeleteServiceConfiguration(IntPtr ServiceHandle, int ConfigId, IntPtr pConfigInformation, uint ConfigInformationLength, IntPtr pOverlapped);
"@
$api = Add-Type -MemberDefinition $sig -Name 'HTTPAPI_HttpDeleteServiceConfiguration' -Namespace Win32 -PassThru
# $api::HttpDeleteServiceConfiguration(ServiceHandle, ConfigId, pConfigInformation, ConfigInformationLength, pOverlapped)#uselib "HTTPAPI.dll"
#func global HttpDeleteServiceConfiguration "HttpDeleteServiceConfiguration" sptr, sptr, sptr, sptr, sptr
; HttpDeleteServiceConfiguration ServiceHandle, ConfigId, pConfigInformation, ConfigInformationLength, varptr(pOverlapped) ; 戻り値は stat
; ServiceHandle : HANDLE optional -> "sptr"
; ConfigId : HTTP_SERVICE_CONFIG_ID -> "sptr"
; pConfigInformation : void* -> "sptr"
; ConfigInformationLength : DWORD -> "sptr"
; pOverlapped : OVERLAPPED* optional -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "HTTPAPI.dll" #cfunc global HttpDeleteServiceConfiguration "HttpDeleteServiceConfiguration" sptr, int, sptr, int, var ; res = HttpDeleteServiceConfiguration(ServiceHandle, ConfigId, pConfigInformation, ConfigInformationLength, pOverlapped) ; ServiceHandle : HANDLE optional -> "sptr" ; ConfigId : HTTP_SERVICE_CONFIG_ID -> "int" ; pConfigInformation : void* -> "sptr" ; ConfigInformationLength : DWORD -> "int" ; pOverlapped : OVERLAPPED* optional -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "HTTPAPI.dll" #cfunc global HttpDeleteServiceConfiguration "HttpDeleteServiceConfiguration" sptr, int, sptr, int, sptr ; res = HttpDeleteServiceConfiguration(ServiceHandle, ConfigId, pConfigInformation, ConfigInformationLength, varptr(pOverlapped)) ; ServiceHandle : HANDLE optional -> "sptr" ; ConfigId : HTTP_SERVICE_CONFIG_ID -> "int" ; pConfigInformation : void* -> "sptr" ; ConfigInformationLength : DWORD -> "int" ; pOverlapped : OVERLAPPED* optional -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; DWORD HttpDeleteServiceConfiguration(HANDLE ServiceHandle, HTTP_SERVICE_CONFIG_ID ConfigId, void* pConfigInformation, DWORD ConfigInformationLength, OVERLAPPED* pOverlapped) #uselib "HTTPAPI.dll" #cfunc global HttpDeleteServiceConfiguration "HttpDeleteServiceConfiguration" intptr, int, intptr, int, var ; res = HttpDeleteServiceConfiguration(ServiceHandle, ConfigId, pConfigInformation, ConfigInformationLength, pOverlapped) ; ServiceHandle : HANDLE optional -> "intptr" ; ConfigId : HTTP_SERVICE_CONFIG_ID -> "int" ; pConfigInformation : void* -> "intptr" ; ConfigInformationLength : DWORD -> "int" ; pOverlapped : OVERLAPPED* optional -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; DWORD HttpDeleteServiceConfiguration(HANDLE ServiceHandle, HTTP_SERVICE_CONFIG_ID ConfigId, void* pConfigInformation, DWORD ConfigInformationLength, OVERLAPPED* pOverlapped) #uselib "HTTPAPI.dll" #cfunc global HttpDeleteServiceConfiguration "HttpDeleteServiceConfiguration" intptr, int, intptr, int, intptr ; res = HttpDeleteServiceConfiguration(ServiceHandle, ConfigId, pConfigInformation, ConfigInformationLength, varptr(pOverlapped)) ; ServiceHandle : HANDLE optional -> "intptr" ; ConfigId : HTTP_SERVICE_CONFIG_ID -> "int" ; pConfigInformation : void* -> "intptr" ; ConfigInformationLength : DWORD -> "int" ; pOverlapped : OVERLAPPED* optional -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
httpapi = windows.NewLazySystemDLL("HTTPAPI.dll")
procHttpDeleteServiceConfiguration = httpapi.NewProc("HttpDeleteServiceConfiguration")
)
// ServiceHandle (HANDLE optional), ConfigId (HTTP_SERVICE_CONFIG_ID), pConfigInformation (void*), ConfigInformationLength (DWORD), pOverlapped (OVERLAPPED* optional)
r1, _, err := procHttpDeleteServiceConfiguration.Call(
uintptr(ServiceHandle),
uintptr(ConfigId),
uintptr(pConfigInformation),
uintptr(ConfigInformationLength),
uintptr(pOverlapped),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction HttpDeleteServiceConfiguration(
ServiceHandle: THandle; // HANDLE optional
ConfigId: Integer; // HTTP_SERVICE_CONFIG_ID
pConfigInformation: Pointer; // void*
ConfigInformationLength: DWORD; // DWORD
pOverlapped: Pointer // OVERLAPPED* optional
): DWORD; stdcall;
external 'HTTPAPI.dll' name 'HttpDeleteServiceConfiguration';result := DllCall("HTTPAPI\HttpDeleteServiceConfiguration"
, "Ptr", ServiceHandle ; HANDLE optional
, "Int", ConfigId ; HTTP_SERVICE_CONFIG_ID
, "Ptr", pConfigInformation ; void*
, "UInt", ConfigInformationLength ; DWORD
, "Ptr", pOverlapped ; OVERLAPPED* optional
, "UInt") ; return: DWORD●HttpDeleteServiceConfiguration(ServiceHandle, ConfigId, pConfigInformation, ConfigInformationLength, pOverlapped) = DLL("HTTPAPI.dll", "dword HttpDeleteServiceConfiguration(void*, int, void*, dword, void*)")
# 呼び出し: HttpDeleteServiceConfiguration(ServiceHandle, ConfigId, pConfigInformation, ConfigInformationLength, pOverlapped)
# ServiceHandle : HANDLE optional -> "void*"
# ConfigId : HTTP_SERVICE_CONFIG_ID -> "int"
# pConfigInformation : void* -> "void*"
# ConfigInformationLength : DWORD -> "dword"
# pOverlapped : OVERLAPPED* optional -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "httpapi" fn HttpDeleteServiceConfiguration(
ServiceHandle: ?*anyopaque, // HANDLE optional
ConfigId: i32, // HTTP_SERVICE_CONFIG_ID
pConfigInformation: ?*anyopaque, // void*
ConfigInformationLength: u32, // DWORD
pOverlapped: [*c]OVERLAPPED // OVERLAPPED* optional
) callconv(std.os.windows.WINAPI) u32;proc HttpDeleteServiceConfiguration(
ServiceHandle: pointer, # HANDLE optional
ConfigId: int32, # HTTP_SERVICE_CONFIG_ID
pConfigInformation: pointer, # void*
ConfigInformationLength: uint32, # DWORD
pOverlapped: ptr OVERLAPPED # OVERLAPPED* optional
): uint32 {.importc: "HttpDeleteServiceConfiguration", stdcall, dynlib: "HTTPAPI.dll".}pragma(lib, "httpapi");
extern(Windows)
uint HttpDeleteServiceConfiguration(
void* ServiceHandle, // HANDLE optional
int ConfigId, // HTTP_SERVICE_CONFIG_ID
void* pConfigInformation, // void*
uint ConfigInformationLength, // DWORD
OVERLAPPED* pOverlapped // OVERLAPPED* optional
);ccall((:HttpDeleteServiceConfiguration, "HTTPAPI.dll"), stdcall, UInt32,
(Ptr{Cvoid}, Int32, Ptr{Cvoid}, UInt32, Ptr{OVERLAPPED}),
ServiceHandle, ConfigId, pConfigInformation, ConfigInformationLength, pOverlapped)
# ServiceHandle : HANDLE optional -> Ptr{Cvoid}
# ConfigId : HTTP_SERVICE_CONFIG_ID -> Int32
# pConfigInformation : void* -> Ptr{Cvoid}
# ConfigInformationLength : DWORD -> UInt32
# pOverlapped : OVERLAPPED* optional -> Ptr{OVERLAPPED}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
uint32_t HttpDeleteServiceConfiguration(
void* ServiceHandle,
int32_t ConfigId,
void* pConfigInformation,
uint32_t ConfigInformationLength,
void* pOverlapped);
]]
local httpapi = ffi.load("httpapi")
-- httpapi.HttpDeleteServiceConfiguration(ServiceHandle, ConfigId, pConfigInformation, ConfigInformationLength, pOverlapped)
-- ServiceHandle : HANDLE optional
-- ConfigId : HTTP_SERVICE_CONFIG_ID
-- pConfigInformation : void*
-- ConfigInformationLength : DWORD
-- pOverlapped : OVERLAPPED* optional
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('HTTPAPI.dll');
const HttpDeleteServiceConfiguration = lib.func('__stdcall', 'HttpDeleteServiceConfiguration', 'uint32_t', ['void *', 'int32_t', 'void *', 'uint32_t', 'void *']);
// HttpDeleteServiceConfiguration(ServiceHandle, ConfigId, pConfigInformation, ConfigInformationLength, pOverlapped)
// ServiceHandle : HANDLE optional -> 'void *'
// ConfigId : HTTP_SERVICE_CONFIG_ID -> 'int32_t'
// pConfigInformation : void* -> 'void *'
// ConfigInformationLength : DWORD -> 'uint32_t'
// pOverlapped : OVERLAPPED* optional -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("HTTPAPI.dll", {
HttpDeleteServiceConfiguration: { parameters: ["pointer", "i32", "pointer", "u32", "pointer"], result: "u32" },
});
// lib.symbols.HttpDeleteServiceConfiguration(ServiceHandle, ConfigId, pConfigInformation, ConfigInformationLength, pOverlapped)
// ServiceHandle : HANDLE optional -> "pointer"
// ConfigId : HTTP_SERVICE_CONFIG_ID -> "i32"
// pConfigInformation : void* -> "pointer"
// ConfigInformationLength : DWORD -> "u32"
// pOverlapped : OVERLAPPED* optional -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
uint32_t HttpDeleteServiceConfiguration(
void* ServiceHandle,
int32_t ConfigId,
void* pConfigInformation,
uint32_t ConfigInformationLength,
void* pOverlapped);
C, "HTTPAPI.dll");
// $ffi->HttpDeleteServiceConfiguration(ServiceHandle, ConfigId, pConfigInformation, ConfigInformationLength, pOverlapped);
// ServiceHandle : HANDLE optional
// ConfigId : HTTP_SERVICE_CONFIG_ID
// pConfigInformation : void*
// ConfigInformationLength : DWORD
// pOverlapped : OVERLAPPED* 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 HttpDeleteServiceConfiguration(
Pointer ServiceHandle, // HANDLE optional
int ConfigId, // HTTP_SERVICE_CONFIG_ID
Pointer pConfigInformation, // void*
int ConfigInformationLength, // DWORD
Pointer pOverlapped // OVERLAPPED* optional
);
}@[Link("httpapi")]
lib LibHTTPAPI
fun HttpDeleteServiceConfiguration = HttpDeleteServiceConfiguration(
ServiceHandle : Void*, # HANDLE optional
ConfigId : Int32, # HTTP_SERVICE_CONFIG_ID
pConfigInformation : Void*, # void*
ConfigInformationLength : UInt32, # DWORD
pOverlapped : OVERLAPPED* # OVERLAPPED* optional
) : UInt32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef HttpDeleteServiceConfigurationNative = Uint32 Function(Pointer<Void>, Int32, Pointer<Void>, Uint32, Pointer<Void>);
typedef HttpDeleteServiceConfigurationDart = int Function(Pointer<Void>, int, Pointer<Void>, int, Pointer<Void>);
final HttpDeleteServiceConfiguration = DynamicLibrary.open('HTTPAPI.dll')
.lookupFunction<HttpDeleteServiceConfigurationNative, HttpDeleteServiceConfigurationDart>('HttpDeleteServiceConfiguration');
// ServiceHandle : HANDLE optional -> Pointer<Void>
// ConfigId : HTTP_SERVICE_CONFIG_ID -> Int32
// pConfigInformation : void* -> Pointer<Void>
// ConfigInformationLength : DWORD -> Uint32
// pOverlapped : OVERLAPPED* optional -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function HttpDeleteServiceConfiguration(
ServiceHandle: THandle; // HANDLE optional
ConfigId: Integer; // HTTP_SERVICE_CONFIG_ID
pConfigInformation: Pointer; // void*
ConfigInformationLength: DWORD; // DWORD
pOverlapped: Pointer // OVERLAPPED* optional
): DWORD; stdcall;
external 'HTTPAPI.dll' name 'HttpDeleteServiceConfiguration';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "HttpDeleteServiceConfiguration"
c_HttpDeleteServiceConfiguration :: Ptr () -> Int32 -> Ptr () -> Word32 -> Ptr () -> IO Word32
-- ServiceHandle : HANDLE optional -> Ptr ()
-- ConfigId : HTTP_SERVICE_CONFIG_ID -> Int32
-- pConfigInformation : void* -> Ptr ()
-- ConfigInformationLength : DWORD -> Word32
-- pOverlapped : OVERLAPPED* optional -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let httpdeleteserviceconfiguration =
foreign "HttpDeleteServiceConfiguration"
((ptr void) @-> int32_t @-> (ptr void) @-> uint32_t @-> (ptr void) @-> returning uint32_t)
(* ServiceHandle : HANDLE optional -> (ptr void) *)
(* ConfigId : HTTP_SERVICE_CONFIG_ID -> int32_t *)
(* pConfigInformation : void* -> (ptr void) *)
(* ConfigInformationLength : DWORD -> uint32_t *)
(* pOverlapped : OVERLAPPED* 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 ("HttpDeleteServiceConfiguration" http-delete-service-configuration :convention :stdcall) :uint32
(service-handle :pointer) ; HANDLE optional
(config-id :int32) ; HTTP_SERVICE_CONFIG_ID
(p-config-information :pointer) ; void*
(config-information-length :uint32) ; DWORD
(p-overlapped :pointer)) ; OVERLAPPED* optional
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $HttpDeleteServiceConfiguration = Win32::API::More->new('HTTPAPI',
'DWORD HttpDeleteServiceConfiguration(HANDLE ServiceHandle, int ConfigId, LPVOID pConfigInformation, DWORD ConfigInformationLength, LPVOID pOverlapped)');
# my $ret = $HttpDeleteServiceConfiguration->Call($ServiceHandle, $ConfigId, $pConfigInformation, $ConfigInformationLength, $pOverlapped);
# ServiceHandle : HANDLE optional -> HANDLE
# ConfigId : HTTP_SERVICE_CONFIG_ID -> int
# pConfigInformation : void* -> LPVOID
# ConfigInformationLength : DWORD -> DWORD
# pOverlapped : OVERLAPPED* optional -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。関連項目
公式の関連項目
- f HttpQueryServiceConfiguration — HTTPサービスの構成設定を取得する。
- f HttpSetServiceConfiguration — HTTPサービスの構成設定を登録する。
- f HttpUpdateServiceConfiguration — HTTPサービスの構成設定を更新する。