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

HttpDeleteServiceConfiguration

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

シグネチャ

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

DWORD HttpDeleteServiceConfiguration(
    HANDLE ServiceHandle,   // optional
    HTTP_SERVICE_CONFIG_ID ConfigId,
    void* pConfigInformation,
    DWORD ConfigInformationLength,
    OVERLAPPED* pOverlapped   // optional
);

パラメーター

名前方向
ServiceHandleHANDLEoptional
ConfigIdHTTP_SERVICE_CONFIG_IDin
pConfigInformationvoid*in
ConfigInformationLengthDWORDin
pOverlappedOVERLAPPED*optional

戻り値の型: DWORD

各言語での呼び出し定義

// 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 方式にも切替可。
出力引数:
; 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 方式にも切替可。
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   // DWORD
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';
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)。