ホーム › Networking.WinInet › DeleteUrlCacheContainerW
DeleteUrlCacheContainerW
関数URLキャッシュコンテナを削除する(Unicode版)。
シグネチャ
// WININET.dll (Unicode / -W)
#include <windows.h>
BOOL DeleteUrlCacheContainerW(
LPCWSTR Name,
DWORD dwOptions
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| Name | LPCWSTR | in |
| dwOptions | DWORD | in |
戻り値の型: BOOL
各言語での呼び出し定義
// WININET.dll (Unicode / -W)
#include <windows.h>
BOOL DeleteUrlCacheContainerW(
LPCWSTR Name,
DWORD dwOptions
);[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("WININET.dll", CharSet = CharSet.Unicode, SetLastError = true, ExactSpelling = true)]
static extern bool DeleteUrlCacheContainerW(
[MarshalAs(UnmanagedType.LPWStr)] string Name, // LPCWSTR
uint dwOptions // DWORD
);<DllImport("WININET.dll", CharSet:=CharSet.Unicode, SetLastError:=True, ExactSpelling:=True)>
Public Shared Function DeleteUrlCacheContainerW(
<MarshalAs(UnmanagedType.LPWStr)> Name As String, ' LPCWSTR
dwOptions As UInteger ' DWORD
) As Boolean
End Function' Name : LPCWSTR
' dwOptions : DWORD
Declare PtrSafe Function DeleteUrlCacheContainerW Lib "wininet" ( _
ByVal Name As LongPtr, _
ByVal dwOptions As Long) As Long
' Unicode(W): 文字列は ByVal As LongPtr とし StrPtr(unicodeStr) を渡す
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
DeleteUrlCacheContainerW = ctypes.windll.wininet.DeleteUrlCacheContainerW
DeleteUrlCacheContainerW.restype = wintypes.BOOL
DeleteUrlCacheContainerW.argtypes = [
wintypes.LPCWSTR, # Name : LPCWSTR
wintypes.DWORD, # dwOptions : DWORD
]
# GetLastError: use ctypes.GetLastError() (or ctypes.WinDLL(use_last_error=True))require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('WININET.dll')
DeleteUrlCacheContainerW = Fiddle::Function.new(
lib['DeleteUrlCacheContainerW'],
[
Fiddle::TYPE_VOIDP, # Name : LPCWSTR
-Fiddle::TYPE_INT, # dwOptions : DWORD
],
Fiddle::TYPE_INT)
# Wide strings: pass str.encode("UTF-16LE") + "\x00\x00"#[link(name = "wininet")]
extern "system" {
fn DeleteUrlCacheContainerW(
Name: *const u16, // LPCWSTR
dwOptions: u32 // DWORD
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("WININET.dll", CharSet = CharSet.Unicode, SetLastError = true)]
public static extern bool DeleteUrlCacheContainerW([MarshalAs(UnmanagedType.LPWStr)] string Name, uint dwOptions);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WININET_DeleteUrlCacheContainerW' -Namespace Win32 -PassThru
# $api::DeleteUrlCacheContainerW(Name, dwOptions)#uselib "WININET.dll"
#func global DeleteUrlCacheContainerW "DeleteUrlCacheContainerW" wptr, wptr
; DeleteUrlCacheContainerW Name, dwOptions ; 戻り値は stat
; Name : LPCWSTR -> "wptr"
; dwOptions : DWORD -> "wptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "WININET.dll"
#cfunc global DeleteUrlCacheContainerW "DeleteUrlCacheContainerW" wstr, int
; res = DeleteUrlCacheContainerW(Name, dwOptions)
; Name : LPCWSTR -> "wstr"
; dwOptions : DWORD -> "int"; BOOL DeleteUrlCacheContainerW(LPCWSTR Name, DWORD dwOptions)
#uselib "WININET.dll"
#cfunc global DeleteUrlCacheContainerW "DeleteUrlCacheContainerW" wstr, int
; res = DeleteUrlCacheContainerW(Name, dwOptions)
; Name : LPCWSTR -> "wstr"
; dwOptions : DWORD -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
wininet = windows.NewLazySystemDLL("WININET.dll")
procDeleteUrlCacheContainerW = wininet.NewProc("DeleteUrlCacheContainerW")
)
// Name (LPCWSTR), dwOptions (DWORD)
r1, _, err := procDeleteUrlCacheContainerW.Call(
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(Name))),
uintptr(dwOptions),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLfunction DeleteUrlCacheContainerW(
Name: PWideChar; // LPCWSTR
dwOptions: DWORD // DWORD
): BOOL; stdcall;
external 'WININET.dll' name 'DeleteUrlCacheContainerW';result := DllCall("WININET\DeleteUrlCacheContainerW"
, "WStr", Name ; LPCWSTR
, "UInt", dwOptions ; DWORD
, "Int") ; return: BOOL●DeleteUrlCacheContainerW(Name, dwOptions) = DLL("WININET.dll", "bool DeleteUrlCacheContainerW(char*, dword)")
# 呼び出し: DeleteUrlCacheContainerW(Name, dwOptions)
# Name : LPCWSTR -> "char*"
# dwOptions : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。