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