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

HttpCloseServerSession

関数
HTTPサーバーセッションを閉じる。
DLLHTTPAPI.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

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

DWORD HttpCloseServerSession(
    ULONGLONG ServerSessionId
);

パラメーター

名前方向
ServerSessionIdULONGLONGin

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD HttpCloseServerSession(
    ULONGLONG ServerSessionId
);
[DllImport("HTTPAPI.dll", ExactSpelling = true)]
static extern uint HttpCloseServerSession(
    ulong ServerSessionId   // ULONGLONG
);
<DllImport("HTTPAPI.dll", ExactSpelling:=True)>
Public Shared Function HttpCloseServerSession(
    ServerSessionId As ULong   ' ULONGLONG
) As UInteger
End Function
' ServerSessionId : ULONGLONG
Declare PtrSafe Function HttpCloseServerSession Lib "httpapi" ( _
    ByVal ServerSessionId As LongLong) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

HttpCloseServerSession = ctypes.windll.httpapi.HttpCloseServerSession
HttpCloseServerSession.restype = wintypes.DWORD
HttpCloseServerSession.argtypes = [
    ctypes.c_ulonglong,  # ServerSessionId : ULONGLONG
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('HTTPAPI.dll')
HttpCloseServerSession = Fiddle::Function.new(
  lib['HttpCloseServerSession'],
  [
    -Fiddle::TYPE_LONG_LONG,  # ServerSessionId : ULONGLONG
  ],
  -Fiddle::TYPE_INT)
#[link(name = "httpapi")]
extern "system" {
    fn HttpCloseServerSession(
        ServerSessionId: u64  // ULONGLONG
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("HTTPAPI.dll")]
public static extern uint HttpCloseServerSession(ulong ServerSessionId);
"@
$api = Add-Type -MemberDefinition $sig -Name 'HTTPAPI_HttpCloseServerSession' -Namespace Win32 -PassThru
# $api::HttpCloseServerSession(ServerSessionId)
#uselib "HTTPAPI.dll"
#func global HttpCloseServerSession "HttpCloseServerSession" sptr
; HttpCloseServerSession ServerSessionId   ; 戻り値は stat
; ServerSessionId : ULONGLONG -> "sptr"
; ※HSP3.7は int64 引数(64bit値渡し)に非対応です。
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "HTTPAPI.dll"
#cfunc global HttpCloseServerSession "HttpCloseServerSession" int64
; res = HttpCloseServerSession(ServerSessionId)
; ServerSessionId : ULONGLONG -> "int64"
; ※int64 引数の DLL 値渡しは x64 ランタイム(hsp3_64)のみ対応(x86 は未対応)。
; DWORD HttpCloseServerSession(ULONGLONG ServerSessionId)
#uselib "HTTPAPI.dll"
#cfunc global HttpCloseServerSession "HttpCloseServerSession" int64
; res = HttpCloseServerSession(ServerSessionId)
; ServerSessionId : ULONGLONG -> "int64"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	httpapi = windows.NewLazySystemDLL("HTTPAPI.dll")
	procHttpCloseServerSession = httpapi.NewProc("HttpCloseServerSession")
)

// ServerSessionId (ULONGLONG)
r1, _, err := procHttpCloseServerSession.Call(
	uintptr(ServerSessionId),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // DWORD
function HttpCloseServerSession(
  ServerSessionId: UInt64   // ULONGLONG
): DWORD; stdcall;
  external 'HTTPAPI.dll' name 'HttpCloseServerSession';
result := DllCall("HTTPAPI\HttpCloseServerSession"
    , "Int64", ServerSessionId   ; ULONGLONG
    , "UInt")   ; return: DWORD
●HttpCloseServerSession(ServerSessionId) = DLL("HTTPAPI.dll", "dword HttpCloseServerSession(qword)")
# 呼び出し: HttpCloseServerSession(ServerSessionId)
# ServerSessionId : ULONGLONG -> "qword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。