ホーム › Networking.HttpServer › HttpFlushResponseCache
HttpFlushResponseCache
関数応答キャッシュ内のキャッシュ項目を破棄する。
シグネチャ
// HTTPAPI.dll
#include <windows.h>
DWORD HttpFlushResponseCache(
HANDLE RequestQueueHandle,
LPCWSTR UrlPrefix,
DWORD Flags,
OVERLAPPED* Overlapped // optional
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| RequestQueueHandle | HANDLE | in |
| UrlPrefix | LPCWSTR | in |
| Flags | DWORD | in |
| Overlapped | OVERLAPPED* | inoutoptional |
戻り値の型: DWORD
各言語での呼び出し定義
// HTTPAPI.dll
#include <windows.h>
DWORD HttpFlushResponseCache(
HANDLE RequestQueueHandle,
LPCWSTR UrlPrefix,
DWORD Flags,
OVERLAPPED* Overlapped // optional
);[DllImport("HTTPAPI.dll", ExactSpelling = true)]
static extern uint HttpFlushResponseCache(
IntPtr RequestQueueHandle, // HANDLE
[MarshalAs(UnmanagedType.LPWStr)] string UrlPrefix, // LPCWSTR
uint Flags, // DWORD
IntPtr Overlapped // OVERLAPPED* optional, in/out
);<DllImport("HTTPAPI.dll", ExactSpelling:=True)>
Public Shared Function HttpFlushResponseCache(
RequestQueueHandle As IntPtr, ' HANDLE
<MarshalAs(UnmanagedType.LPWStr)> UrlPrefix As String, ' LPCWSTR
Flags As UInteger, ' DWORD
Overlapped As IntPtr ' OVERLAPPED* optional, in/out
) As UInteger
End Function' RequestQueueHandle : HANDLE
' UrlPrefix : LPCWSTR
' Flags : DWORD
' Overlapped : OVERLAPPED* optional, in/out
Declare PtrSafe Function HttpFlushResponseCache Lib "httpapi" ( _
ByVal RequestQueueHandle As LongPtr, _
ByVal UrlPrefix As LongPtr, _
ByVal Flags As Long, _
ByVal Overlapped As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
HttpFlushResponseCache = ctypes.windll.httpapi.HttpFlushResponseCache
HttpFlushResponseCache.restype = wintypes.DWORD
HttpFlushResponseCache.argtypes = [
wintypes.HANDLE, # RequestQueueHandle : HANDLE
wintypes.LPCWSTR, # UrlPrefix : LPCWSTR
wintypes.DWORD, # Flags : DWORD
ctypes.c_void_p, # Overlapped : OVERLAPPED* optional, in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('HTTPAPI.dll')
HttpFlushResponseCache = Fiddle::Function.new(
lib['HttpFlushResponseCache'],
[
Fiddle::TYPE_VOIDP, # RequestQueueHandle : HANDLE
Fiddle::TYPE_VOIDP, # UrlPrefix : LPCWSTR
-Fiddle::TYPE_INT, # Flags : DWORD
Fiddle::TYPE_VOIDP, # Overlapped : OVERLAPPED* optional, in/out
],
-Fiddle::TYPE_INT)#[link(name = "httpapi")]
extern "system" {
fn HttpFlushResponseCache(
RequestQueueHandle: *mut core::ffi::c_void, // HANDLE
UrlPrefix: *const u16, // LPCWSTR
Flags: u32, // DWORD
Overlapped: *mut OVERLAPPED // OVERLAPPED* optional, in/out
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("HTTPAPI.dll")]
public static extern uint HttpFlushResponseCache(IntPtr RequestQueueHandle, [MarshalAs(UnmanagedType.LPWStr)] string UrlPrefix, uint Flags, IntPtr Overlapped);
"@
$api = Add-Type -MemberDefinition $sig -Name 'HTTPAPI_HttpFlushResponseCache' -Namespace Win32 -PassThru
# $api::HttpFlushResponseCache(RequestQueueHandle, UrlPrefix, Flags, Overlapped)#uselib "HTTPAPI.dll"
#func global HttpFlushResponseCache "HttpFlushResponseCache" sptr, sptr, sptr, sptr
; HttpFlushResponseCache RequestQueueHandle, UrlPrefix, Flags, varptr(Overlapped) ; 戻り値は stat
; RequestQueueHandle : HANDLE -> "sptr"
; UrlPrefix : LPCWSTR -> "sptr"
; Flags : DWORD -> "sptr"
; Overlapped : OVERLAPPED* optional, in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "HTTPAPI.dll" #cfunc global HttpFlushResponseCache "HttpFlushResponseCache" sptr, wstr, int, var ; res = HttpFlushResponseCache(RequestQueueHandle, UrlPrefix, Flags, Overlapped) ; RequestQueueHandle : HANDLE -> "sptr" ; UrlPrefix : LPCWSTR -> "wstr" ; Flags : DWORD -> "int" ; Overlapped : OVERLAPPED* optional, in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "HTTPAPI.dll" #cfunc global HttpFlushResponseCache "HttpFlushResponseCache" sptr, wstr, int, sptr ; res = HttpFlushResponseCache(RequestQueueHandle, UrlPrefix, Flags, varptr(Overlapped)) ; RequestQueueHandle : HANDLE -> "sptr" ; UrlPrefix : LPCWSTR -> "wstr" ; Flags : DWORD -> "int" ; Overlapped : OVERLAPPED* optional, in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; DWORD HttpFlushResponseCache(HANDLE RequestQueueHandle, LPCWSTR UrlPrefix, DWORD Flags, OVERLAPPED* Overlapped) #uselib "HTTPAPI.dll" #cfunc global HttpFlushResponseCache "HttpFlushResponseCache" intptr, wstr, int, var ; res = HttpFlushResponseCache(RequestQueueHandle, UrlPrefix, Flags, Overlapped) ; RequestQueueHandle : HANDLE -> "intptr" ; UrlPrefix : LPCWSTR -> "wstr" ; Flags : DWORD -> "int" ; Overlapped : OVERLAPPED* optional, in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; DWORD HttpFlushResponseCache(HANDLE RequestQueueHandle, LPCWSTR UrlPrefix, DWORD Flags, OVERLAPPED* Overlapped) #uselib "HTTPAPI.dll" #cfunc global HttpFlushResponseCache "HttpFlushResponseCache" intptr, wstr, int, intptr ; res = HttpFlushResponseCache(RequestQueueHandle, UrlPrefix, Flags, varptr(Overlapped)) ; RequestQueueHandle : HANDLE -> "intptr" ; UrlPrefix : LPCWSTR -> "wstr" ; Flags : DWORD -> "int" ; Overlapped : OVERLAPPED* optional, in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
httpapi = windows.NewLazySystemDLL("HTTPAPI.dll")
procHttpFlushResponseCache = httpapi.NewProc("HttpFlushResponseCache")
)
// RequestQueueHandle (HANDLE), UrlPrefix (LPCWSTR), Flags (DWORD), Overlapped (OVERLAPPED* optional, in/out)
r1, _, err := procHttpFlushResponseCache.Call(
uintptr(RequestQueueHandle),
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(UrlPrefix))),
uintptr(Flags),
uintptr(Overlapped),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction HttpFlushResponseCache(
RequestQueueHandle: THandle; // HANDLE
UrlPrefix: PWideChar; // LPCWSTR
Flags: DWORD; // DWORD
Overlapped: Pointer // OVERLAPPED* optional, in/out
): DWORD; stdcall;
external 'HTTPAPI.dll' name 'HttpFlushResponseCache';result := DllCall("HTTPAPI\HttpFlushResponseCache"
, "Ptr", RequestQueueHandle ; HANDLE
, "WStr", UrlPrefix ; LPCWSTR
, "UInt", Flags ; DWORD
, "Ptr", Overlapped ; OVERLAPPED* optional, in/out
, "UInt") ; return: DWORD●HttpFlushResponseCache(RequestQueueHandle, UrlPrefix, Flags, Overlapped) = DLL("HTTPAPI.dll", "dword HttpFlushResponseCache(void*, char*, dword, void*)")
# 呼び出し: HttpFlushResponseCache(RequestQueueHandle, UrlPrefix, Flags, Overlapped)
# RequestQueueHandle : HANDLE -> "void*"
# UrlPrefix : LPCWSTR -> "char*"
# Flags : DWORD -> "dword"
# Overlapped : OVERLAPPED* optional, in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。