ホーム › Networking.WinInet › FindFirstUrlCacheEntryExW
FindFirstUrlCacheEntryExW
関数条件指定でURLキャッシュエントリ列挙を開始する(Unicode版)。
シグネチャ
// WININET.dll (Unicode / -W)
#include <windows.h>
HANDLE FindFirstUrlCacheEntryExW(
LPCWSTR lpszUrlSearchPattern, // optional
DWORD dwFlags,
DWORD dwFilter,
LONGLONG GroupId,
INTERNET_CACHE_ENTRY_INFOW* lpFirstCacheEntryInfo, // optional
DWORD* lpcbCacheEntryInfo,
void* lpGroupAttributes, // optional
DWORD* lpcbGroupAttributes, // optional
void* lpReserved // optional
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| lpszUrlSearchPattern | LPCWSTR | inoptional |
| dwFlags | DWORD | in |
| dwFilter | DWORD | in |
| GroupId | LONGLONG | in |
| lpFirstCacheEntryInfo | INTERNET_CACHE_ENTRY_INFOW* | inoutoptional |
| lpcbCacheEntryInfo | DWORD* | inout |
| lpGroupAttributes | void* | optional |
| lpcbGroupAttributes | DWORD* | optional |
| lpReserved | void* | optional |
戻り値の型: HANDLE
各言語での呼び出し定義
// WININET.dll (Unicode / -W)
#include <windows.h>
HANDLE FindFirstUrlCacheEntryExW(
LPCWSTR lpszUrlSearchPattern, // optional
DWORD dwFlags,
DWORD dwFilter,
LONGLONG GroupId,
INTERNET_CACHE_ENTRY_INFOW* lpFirstCacheEntryInfo, // optional
DWORD* lpcbCacheEntryInfo,
void* lpGroupAttributes, // optional
DWORD* lpcbGroupAttributes, // optional
void* lpReserved // optional
);[DllImport("WININET.dll", CharSet = CharSet.Unicode, SetLastError = true, ExactSpelling = true)]
static extern IntPtr FindFirstUrlCacheEntryExW(
[MarshalAs(UnmanagedType.LPWStr)] string lpszUrlSearchPattern, // LPCWSTR optional
uint dwFlags, // DWORD
uint dwFilter, // DWORD
long GroupId, // LONGLONG
IntPtr lpFirstCacheEntryInfo, // INTERNET_CACHE_ENTRY_INFOW* optional, in/out
ref uint lpcbCacheEntryInfo, // DWORD* in/out
IntPtr lpGroupAttributes, // void* optional
IntPtr lpcbGroupAttributes, // DWORD* optional
IntPtr lpReserved // void* optional
);<DllImport("WININET.dll", CharSet:=CharSet.Unicode, SetLastError:=True, ExactSpelling:=True)>
Public Shared Function FindFirstUrlCacheEntryExW(
<MarshalAs(UnmanagedType.LPWStr)> lpszUrlSearchPattern As String, ' LPCWSTR optional
dwFlags As UInteger, ' DWORD
dwFilter As UInteger, ' DWORD
GroupId As Long, ' LONGLONG
lpFirstCacheEntryInfo As IntPtr, ' INTERNET_CACHE_ENTRY_INFOW* optional, in/out
ByRef lpcbCacheEntryInfo As UInteger, ' DWORD* in/out
lpGroupAttributes As IntPtr, ' void* optional
lpcbGroupAttributes As IntPtr, ' DWORD* optional
lpReserved As IntPtr ' void* optional
) As IntPtr
End Function' lpszUrlSearchPattern : LPCWSTR optional
' dwFlags : DWORD
' dwFilter : DWORD
' GroupId : LONGLONG
' lpFirstCacheEntryInfo : INTERNET_CACHE_ENTRY_INFOW* optional, in/out
' lpcbCacheEntryInfo : DWORD* in/out
' lpGroupAttributes : void* optional
' lpcbGroupAttributes : DWORD* optional
' lpReserved : void* optional
Declare PtrSafe Function FindFirstUrlCacheEntryExW Lib "wininet" ( _
ByVal lpszUrlSearchPattern As LongPtr, _
ByVal dwFlags As Long, _
ByVal dwFilter As Long, _
ByVal GroupId As LongLong, _
ByVal lpFirstCacheEntryInfo As LongPtr, _
ByRef lpcbCacheEntryInfo As Long, _
ByVal lpGroupAttributes As LongPtr, _
ByVal lpcbGroupAttributes As LongPtr, _
ByVal lpReserved As LongPtr) As LongPtr
' 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
FindFirstUrlCacheEntryExW = ctypes.windll.wininet.FindFirstUrlCacheEntryExW
FindFirstUrlCacheEntryExW.restype = ctypes.c_void_p
FindFirstUrlCacheEntryExW.argtypes = [
wintypes.LPCWSTR, # lpszUrlSearchPattern : LPCWSTR optional
wintypes.DWORD, # dwFlags : DWORD
wintypes.DWORD, # dwFilter : DWORD
ctypes.c_longlong, # GroupId : LONGLONG
ctypes.c_void_p, # lpFirstCacheEntryInfo : INTERNET_CACHE_ENTRY_INFOW* optional, in/out
ctypes.POINTER(wintypes.DWORD), # lpcbCacheEntryInfo : DWORD* in/out
ctypes.POINTER(None), # lpGroupAttributes : void* optional
ctypes.POINTER(wintypes.DWORD), # lpcbGroupAttributes : DWORD* optional
ctypes.POINTER(None), # lpReserved : void* optional
]
# GetLastError: use ctypes.GetLastError() (or ctypes.WinDLL(use_last_error=True))require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('WININET.dll')
FindFirstUrlCacheEntryExW = Fiddle::Function.new(
lib['FindFirstUrlCacheEntryExW'],
[
Fiddle::TYPE_VOIDP, # lpszUrlSearchPattern : LPCWSTR optional
-Fiddle::TYPE_INT, # dwFlags : DWORD
-Fiddle::TYPE_INT, # dwFilter : DWORD
Fiddle::TYPE_LONG_LONG, # GroupId : LONGLONG
Fiddle::TYPE_VOIDP, # lpFirstCacheEntryInfo : INTERNET_CACHE_ENTRY_INFOW* optional, in/out
Fiddle::TYPE_VOIDP, # lpcbCacheEntryInfo : DWORD* in/out
Fiddle::TYPE_VOIDP, # lpGroupAttributes : void* optional
Fiddle::TYPE_VOIDP, # lpcbGroupAttributes : DWORD* optional
Fiddle::TYPE_VOIDP, # lpReserved : void* optional
],
Fiddle::TYPE_VOIDP)
# Wide strings: pass str.encode("UTF-16LE") + "\x00\x00"#[link(name = "wininet")]
extern "system" {
fn FindFirstUrlCacheEntryExW(
lpszUrlSearchPattern: *const u16, // LPCWSTR optional
dwFlags: u32, // DWORD
dwFilter: u32, // DWORD
GroupId: i64, // LONGLONG
lpFirstCacheEntryInfo: *mut INTERNET_CACHE_ENTRY_INFOW, // INTERNET_CACHE_ENTRY_INFOW* optional, in/out
lpcbCacheEntryInfo: *mut u32, // DWORD* in/out
lpGroupAttributes: *mut (), // void* optional
lpcbGroupAttributes: *mut u32, // DWORD* optional
lpReserved: *mut () // void* optional
) -> *mut core::ffi::c_void;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("WININET.dll", CharSet = CharSet.Unicode, SetLastError = true)]
public static extern IntPtr FindFirstUrlCacheEntryExW([MarshalAs(UnmanagedType.LPWStr)] string lpszUrlSearchPattern, uint dwFlags, uint dwFilter, long GroupId, IntPtr lpFirstCacheEntryInfo, ref uint lpcbCacheEntryInfo, IntPtr lpGroupAttributes, IntPtr lpcbGroupAttributes, IntPtr lpReserved);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WININET_FindFirstUrlCacheEntryExW' -Namespace Win32 -PassThru
# $api::FindFirstUrlCacheEntryExW(lpszUrlSearchPattern, dwFlags, dwFilter, GroupId, lpFirstCacheEntryInfo, lpcbCacheEntryInfo, lpGroupAttributes, lpcbGroupAttributes, lpReserved)#uselib "WININET.dll"
#func global FindFirstUrlCacheEntryExW "FindFirstUrlCacheEntryExW" wptr, wptr, wptr, wptr, wptr, wptr, wptr, wptr, wptr
; FindFirstUrlCacheEntryExW lpszUrlSearchPattern, dwFlags, dwFilter, GroupId, varptr(lpFirstCacheEntryInfo), varptr(lpcbCacheEntryInfo), lpGroupAttributes, varptr(lpcbGroupAttributes), lpReserved ; 戻り値は stat
; lpszUrlSearchPattern : LPCWSTR optional -> "wptr"
; dwFlags : DWORD -> "wptr"
; dwFilter : DWORD -> "wptr"
; GroupId : LONGLONG -> "wptr"
; lpFirstCacheEntryInfo : INTERNET_CACHE_ENTRY_INFOW* optional, in/out -> "wptr"
; lpcbCacheEntryInfo : DWORD* in/out -> "wptr"
; lpGroupAttributes : void* optional -> "wptr"
; lpcbGroupAttributes : DWORD* optional -> "wptr"
; lpReserved : void* optional -> "wptr"
; ※HSP3.7は int64 引数(64bit値渡し)に非対応です。
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "WININET.dll" #cfunc global FindFirstUrlCacheEntryExW "FindFirstUrlCacheEntryExW" wstr, int, int, int64, var, var, sptr, var, sptr ; res = FindFirstUrlCacheEntryExW(lpszUrlSearchPattern, dwFlags, dwFilter, GroupId, lpFirstCacheEntryInfo, lpcbCacheEntryInfo, lpGroupAttributes, lpcbGroupAttributes, lpReserved) ; lpszUrlSearchPattern : LPCWSTR optional -> "wstr" ; dwFlags : DWORD -> "int" ; dwFilter : DWORD -> "int" ; GroupId : LONGLONG -> "int64" ; lpFirstCacheEntryInfo : INTERNET_CACHE_ENTRY_INFOW* optional, in/out -> "var" ; lpcbCacheEntryInfo : DWORD* in/out -> "var" ; lpGroupAttributes : void* optional -> "sptr" ; lpcbGroupAttributes : DWORD* optional -> "var" ; lpReserved : void* optional -> "sptr" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。 ; ※int64 引数の DLL 値渡しは x64 ランタイム(hsp3_64)のみ対応(x86 は未対応)。#uselib "WININET.dll" #cfunc global FindFirstUrlCacheEntryExW "FindFirstUrlCacheEntryExW" wstr, int, int, int64, sptr, sptr, sptr, sptr, sptr ; res = FindFirstUrlCacheEntryExW(lpszUrlSearchPattern, dwFlags, dwFilter, GroupId, varptr(lpFirstCacheEntryInfo), varptr(lpcbCacheEntryInfo), lpGroupAttributes, varptr(lpcbGroupAttributes), lpReserved) ; lpszUrlSearchPattern : LPCWSTR optional -> "wstr" ; dwFlags : DWORD -> "int" ; dwFilter : DWORD -> "int" ; GroupId : LONGLONG -> "int64" ; lpFirstCacheEntryInfo : INTERNET_CACHE_ENTRY_INFOW* optional, in/out -> "sptr" ; lpcbCacheEntryInfo : DWORD* in/out -> "sptr" ; lpGroupAttributes : void* optional -> "sptr" ; lpcbGroupAttributes : DWORD* optional -> "sptr" ; lpReserved : void* optional -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。 ; ※int64 引数の DLL 値渡しは x64 ランタイム(hsp3_64)のみ対応(x86 は未対応)。
出力引数:
; HANDLE FindFirstUrlCacheEntryExW(LPCWSTR lpszUrlSearchPattern, DWORD dwFlags, DWORD dwFilter, LONGLONG GroupId, INTERNET_CACHE_ENTRY_INFOW* lpFirstCacheEntryInfo, DWORD* lpcbCacheEntryInfo, void* lpGroupAttributes, DWORD* lpcbGroupAttributes, void* lpReserved) #uselib "WININET.dll" #cfunc global FindFirstUrlCacheEntryExW "FindFirstUrlCacheEntryExW" wstr, int, int, int64, var, var, intptr, var, intptr ; res = FindFirstUrlCacheEntryExW(lpszUrlSearchPattern, dwFlags, dwFilter, GroupId, lpFirstCacheEntryInfo, lpcbCacheEntryInfo, lpGroupAttributes, lpcbGroupAttributes, lpReserved) ; lpszUrlSearchPattern : LPCWSTR optional -> "wstr" ; dwFlags : DWORD -> "int" ; dwFilter : DWORD -> "int" ; GroupId : LONGLONG -> "int64" ; lpFirstCacheEntryInfo : INTERNET_CACHE_ENTRY_INFOW* optional, in/out -> "var" ; lpcbCacheEntryInfo : DWORD* in/out -> "var" ; lpGroupAttributes : void* optional -> "intptr" ; lpcbGroupAttributes : DWORD* optional -> "var" ; lpReserved : void* optional -> "intptr" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; HANDLE FindFirstUrlCacheEntryExW(LPCWSTR lpszUrlSearchPattern, DWORD dwFlags, DWORD dwFilter, LONGLONG GroupId, INTERNET_CACHE_ENTRY_INFOW* lpFirstCacheEntryInfo, DWORD* lpcbCacheEntryInfo, void* lpGroupAttributes, DWORD* lpcbGroupAttributes, void* lpReserved) #uselib "WININET.dll" #cfunc global FindFirstUrlCacheEntryExW "FindFirstUrlCacheEntryExW" wstr, int, int, int64, intptr, intptr, intptr, intptr, intptr ; res = FindFirstUrlCacheEntryExW(lpszUrlSearchPattern, dwFlags, dwFilter, GroupId, varptr(lpFirstCacheEntryInfo), varptr(lpcbCacheEntryInfo), lpGroupAttributes, varptr(lpcbGroupAttributes), lpReserved) ; lpszUrlSearchPattern : LPCWSTR optional -> "wstr" ; dwFlags : DWORD -> "int" ; dwFilter : DWORD -> "int" ; GroupId : LONGLONG -> "int64" ; lpFirstCacheEntryInfo : INTERNET_CACHE_ENTRY_INFOW* optional, in/out -> "intptr" ; lpcbCacheEntryInfo : DWORD* in/out -> "intptr" ; lpGroupAttributes : void* optional -> "intptr" ; lpcbGroupAttributes : DWORD* optional -> "intptr" ; lpReserved : void* optional -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
wininet = windows.NewLazySystemDLL("WININET.dll")
procFindFirstUrlCacheEntryExW = wininet.NewProc("FindFirstUrlCacheEntryExW")
)
// lpszUrlSearchPattern (LPCWSTR optional), dwFlags (DWORD), dwFilter (DWORD), GroupId (LONGLONG), lpFirstCacheEntryInfo (INTERNET_CACHE_ENTRY_INFOW* optional, in/out), lpcbCacheEntryInfo (DWORD* in/out), lpGroupAttributes (void* optional), lpcbGroupAttributes (DWORD* optional), lpReserved (void* optional)
r1, _, err := procFindFirstUrlCacheEntryExW.Call(
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(lpszUrlSearchPattern))),
uintptr(dwFlags),
uintptr(dwFilter),
uintptr(GroupId),
uintptr(lpFirstCacheEntryInfo),
uintptr(lpcbCacheEntryInfo),
uintptr(lpGroupAttributes),
uintptr(lpcbGroupAttributes),
uintptr(lpReserved),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HANDLEfunction FindFirstUrlCacheEntryExW(
lpszUrlSearchPattern: PWideChar; // LPCWSTR optional
dwFlags: DWORD; // DWORD
dwFilter: DWORD; // DWORD
GroupId: Int64; // LONGLONG
lpFirstCacheEntryInfo: Pointer; // INTERNET_CACHE_ENTRY_INFOW* optional, in/out
lpcbCacheEntryInfo: Pointer; // DWORD* in/out
lpGroupAttributes: Pointer; // void* optional
lpcbGroupAttributes: Pointer; // DWORD* optional
lpReserved: Pointer // void* optional
): THandle; stdcall;
external 'WININET.dll' name 'FindFirstUrlCacheEntryExW';result := DllCall("WININET\FindFirstUrlCacheEntryExW"
, "WStr", lpszUrlSearchPattern ; LPCWSTR optional
, "UInt", dwFlags ; DWORD
, "UInt", dwFilter ; DWORD
, "Int64", GroupId ; LONGLONG
, "Ptr", lpFirstCacheEntryInfo ; INTERNET_CACHE_ENTRY_INFOW* optional, in/out
, "Ptr", lpcbCacheEntryInfo ; DWORD* in/out
, "Ptr", lpGroupAttributes ; void* optional
, "Ptr", lpcbGroupAttributes ; DWORD* optional
, "Ptr", lpReserved ; void* optional
, "Ptr") ; return: HANDLE●FindFirstUrlCacheEntryExW(lpszUrlSearchPattern, dwFlags, dwFilter, GroupId, lpFirstCacheEntryInfo, lpcbCacheEntryInfo, lpGroupAttributes, lpcbGroupAttributes, lpReserved) = DLL("WININET.dll", "void* FindFirstUrlCacheEntryExW(char*, dword, dword, int64, void*, void*, void*, void*, void*)")
# 呼び出し: FindFirstUrlCacheEntryExW(lpszUrlSearchPattern, dwFlags, dwFilter, GroupId, lpFirstCacheEntryInfo, lpcbCacheEntryInfo, lpGroupAttributes, lpcbGroupAttributes, lpReserved)
# lpszUrlSearchPattern : LPCWSTR optional -> "char*"
# dwFlags : DWORD -> "dword"
# dwFilter : DWORD -> "dword"
# GroupId : LONGLONG -> "int64"
# lpFirstCacheEntryInfo : INTERNET_CACHE_ENTRY_INFOW* optional, in/out -> "void*"
# lpcbCacheEntryInfo : DWORD* in/out -> "void*"
# lpGroupAttributes : void* optional -> "void*"
# lpcbGroupAttributes : DWORD* optional -> "void*"
# lpReserved : void* optional -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。