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

FindFirstUrlCacheEntryExA

関数
条件指定でURLキャッシュエントリ列挙を開始する(ANSI版)。
DLLWININET.dll文字セットANSI (-A)呼出規約winapiSetLastErrorあり対応OSWindows 2000 以降

シグネチャ

// WININET.dll  (ANSI / -A)
#include <windows.h>

HANDLE FindFirstUrlCacheEntryExA(
    LPCSTR lpszUrlSearchPattern,   // optional
    DWORD dwFlags,
    DWORD dwFilter,
    LONGLONG GroupId,
    INTERNET_CACHE_ENTRY_INFOA* lpFirstCacheEntryInfo,   // optional
    DWORD* lpcbCacheEntryInfo,
    void* lpGroupAttributes,   // optional
    DWORD* lpcbGroupAttributes,   // optional
    void* lpReserved   // optional
);

パラメーター

名前方向
lpszUrlSearchPatternLPCSTRinoptional
dwFlagsDWORDin
dwFilterDWORDin
GroupIdLONGLONGin
lpFirstCacheEntryInfoINTERNET_CACHE_ENTRY_INFOA*inoutoptional
lpcbCacheEntryInfoDWORD*inout
lpGroupAttributesvoid*optional
lpcbGroupAttributesDWORD*optional
lpReservedvoid*optional

戻り値の型: HANDLE

各言語での呼び出し定義

// WININET.dll  (ANSI / -A)
#include <windows.h>

HANDLE FindFirstUrlCacheEntryExA(
    LPCSTR lpszUrlSearchPattern,   // optional
    DWORD dwFlags,
    DWORD dwFilter,
    LONGLONG GroupId,
    INTERNET_CACHE_ENTRY_INFOA* lpFirstCacheEntryInfo,   // optional
    DWORD* lpcbCacheEntryInfo,
    void* lpGroupAttributes,   // optional
    DWORD* lpcbGroupAttributes,   // optional
    void* lpReserved   // optional
);
[DllImport("WININET.dll", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
static extern IntPtr FindFirstUrlCacheEntryExA(
    [MarshalAs(UnmanagedType.LPStr)] string lpszUrlSearchPattern,   // LPCSTR optional
    uint dwFlags,   // DWORD
    uint dwFilter,   // DWORD
    long GroupId,   // LONGLONG
    IntPtr lpFirstCacheEntryInfo,   // INTERNET_CACHE_ENTRY_INFOA* 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.Ansi, SetLastError:=True, ExactSpelling:=True)>
Public Shared Function FindFirstUrlCacheEntryExA(
    <MarshalAs(UnmanagedType.LPStr)> lpszUrlSearchPattern As String,   ' LPCSTR optional
    dwFlags As UInteger,   ' DWORD
    dwFilter As UInteger,   ' DWORD
    GroupId As Long,   ' LONGLONG
    lpFirstCacheEntryInfo As IntPtr,   ' INTERNET_CACHE_ENTRY_INFOA* 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 : LPCSTR optional
' dwFlags : DWORD
' dwFilter : DWORD
' GroupId : LONGLONG
' lpFirstCacheEntryInfo : INTERNET_CACHE_ENTRY_INFOA* optional, in/out
' lpcbCacheEntryInfo : DWORD* in/out
' lpGroupAttributes : void* optional
' lpcbGroupAttributes : DWORD* optional
' lpReserved : void* optional
Declare PtrSafe Function FindFirstUrlCacheEntryExA Lib "wininet" ( _
    ByVal lpszUrlSearchPattern As String, _
    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
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

FindFirstUrlCacheEntryExA = ctypes.windll.wininet.FindFirstUrlCacheEntryExA
FindFirstUrlCacheEntryExA.restype = ctypes.c_void_p
FindFirstUrlCacheEntryExA.argtypes = [
    wintypes.LPCSTR,  # lpszUrlSearchPattern : LPCSTR optional
    wintypes.DWORD,  # dwFlags : DWORD
    wintypes.DWORD,  # dwFilter : DWORD
    ctypes.c_longlong,  # GroupId : LONGLONG
    ctypes.c_void_p,  # lpFirstCacheEntryInfo : INTERNET_CACHE_ENTRY_INFOA* 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')
FindFirstUrlCacheEntryExA = Fiddle::Function.new(
  lib['FindFirstUrlCacheEntryExA'],
  [
    Fiddle::TYPE_VOIDP,  # lpszUrlSearchPattern : LPCSTR optional
    -Fiddle::TYPE_INT,  # dwFlags : DWORD
    -Fiddle::TYPE_INT,  # dwFilter : DWORD
    Fiddle::TYPE_LONG_LONG,  # GroupId : LONGLONG
    Fiddle::TYPE_VOIDP,  # lpFirstCacheEntryInfo : INTERNET_CACHE_ENTRY_INFOA* 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)
#[link(name = "wininet")]
extern "system" {
    fn FindFirstUrlCacheEntryExA(
        lpszUrlSearchPattern: *const u8,  // LPCSTR optional
        dwFlags: u32,  // DWORD
        dwFilter: u32,  // DWORD
        GroupId: i64,  // LONGLONG
        lpFirstCacheEntryInfo: *mut INTERNET_CACHE_ENTRY_INFOA,  // INTERNET_CACHE_ENTRY_INFOA* 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.Ansi, SetLastError = true)]
public static extern IntPtr FindFirstUrlCacheEntryExA([MarshalAs(UnmanagedType.LPStr)] 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_FindFirstUrlCacheEntryExA' -Namespace Win32 -PassThru
# $api::FindFirstUrlCacheEntryExA(lpszUrlSearchPattern, dwFlags, dwFilter, GroupId, lpFirstCacheEntryInfo, lpcbCacheEntryInfo, lpGroupAttributes, lpcbGroupAttributes, lpReserved)
#uselib "WININET.dll"
#func global FindFirstUrlCacheEntryExA "FindFirstUrlCacheEntryExA" sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr
; FindFirstUrlCacheEntryExA lpszUrlSearchPattern, dwFlags, dwFilter, GroupId, varptr(lpFirstCacheEntryInfo), varptr(lpcbCacheEntryInfo), lpGroupAttributes, varptr(lpcbGroupAttributes), lpReserved   ; 戻り値は stat
; lpszUrlSearchPattern : LPCSTR optional -> "sptr"
; dwFlags : DWORD -> "sptr"
; dwFilter : DWORD -> "sptr"
; GroupId : LONGLONG -> "sptr"
; lpFirstCacheEntryInfo : INTERNET_CACHE_ENTRY_INFOA* optional, in/out -> "sptr"
; lpcbCacheEntryInfo : DWORD* in/out -> "sptr"
; lpGroupAttributes : void* optional -> "sptr"
; lpcbGroupAttributes : DWORD* optional -> "sptr"
; lpReserved : void* optional -> "sptr"
; ※HSP3.7は int64 引数(64bit値渡し)に非対応です。
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "WININET.dll"
#cfunc global FindFirstUrlCacheEntryExA "FindFirstUrlCacheEntryExA" str, int, int, int64, var, var, sptr, var, sptr
; res = FindFirstUrlCacheEntryExA(lpszUrlSearchPattern, dwFlags, dwFilter, GroupId, lpFirstCacheEntryInfo, lpcbCacheEntryInfo, lpGroupAttributes, lpcbGroupAttributes, lpReserved)
; lpszUrlSearchPattern : LPCSTR optional -> "str"
; dwFlags : DWORD -> "int"
; dwFilter : DWORD -> "int"
; GroupId : LONGLONG -> "int64"
; lpFirstCacheEntryInfo : INTERNET_CACHE_ENTRY_INFOA* 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 は未対応)。
出力引数:
; HANDLE FindFirstUrlCacheEntryExA(LPCSTR lpszUrlSearchPattern, DWORD dwFlags, DWORD dwFilter, LONGLONG GroupId, INTERNET_CACHE_ENTRY_INFOA* lpFirstCacheEntryInfo, DWORD* lpcbCacheEntryInfo, void* lpGroupAttributes, DWORD* lpcbGroupAttributes, void* lpReserved)
#uselib "WININET.dll"
#cfunc global FindFirstUrlCacheEntryExA "FindFirstUrlCacheEntryExA" str, int, int, int64, var, var, intptr, var, intptr
; res = FindFirstUrlCacheEntryExA(lpszUrlSearchPattern, dwFlags, dwFilter, GroupId, lpFirstCacheEntryInfo, lpcbCacheEntryInfo, lpGroupAttributes, lpcbGroupAttributes, lpReserved)
; lpszUrlSearchPattern : LPCSTR optional -> "str"
; dwFlags : DWORD -> "int"
; dwFilter : DWORD -> "int"
; GroupId : LONGLONG -> "int64"
; lpFirstCacheEntryInfo : INTERNET_CACHE_ENTRY_INFOA* optional, in/out -> "var"
; lpcbCacheEntryInfo : DWORD* in/out -> "var"
; lpGroupAttributes : void* optional -> "intptr"
; lpcbGroupAttributes : DWORD* optional -> "var"
; lpReserved : void* optional -> "intptr"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	wininet = windows.NewLazySystemDLL("WININET.dll")
	procFindFirstUrlCacheEntryExA = wininet.NewProc("FindFirstUrlCacheEntryExA")
)

// lpszUrlSearchPattern (LPCSTR optional), dwFlags (DWORD), dwFilter (DWORD), GroupId (LONGLONG), lpFirstCacheEntryInfo (INTERNET_CACHE_ENTRY_INFOA* optional, in/out), lpcbCacheEntryInfo (DWORD* in/out), lpGroupAttributes (void* optional), lpcbGroupAttributes (DWORD* optional), lpReserved (void* optional)
r1, _, err := procFindFirstUrlCacheEntryExA.Call(
	uintptr(unsafe.Pointer(windows.BytePtrFromString(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   // HANDLE
function FindFirstUrlCacheEntryExA(
  lpszUrlSearchPattern: PAnsiChar;   // LPCSTR optional
  dwFlags: DWORD;   // DWORD
  dwFilter: DWORD;   // DWORD
  GroupId: Int64;   // LONGLONG
  lpFirstCacheEntryInfo: Pointer;   // INTERNET_CACHE_ENTRY_INFOA* 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 'FindFirstUrlCacheEntryExA';
result := DllCall("WININET\FindFirstUrlCacheEntryExA"
    , "AStr", lpszUrlSearchPattern   ; LPCSTR optional
    , "UInt", dwFlags   ; DWORD
    , "UInt", dwFilter   ; DWORD
    , "Int64", GroupId   ; LONGLONG
    , "Ptr", lpFirstCacheEntryInfo   ; INTERNET_CACHE_ENTRY_INFOA* optional, in/out
    , "Ptr", lpcbCacheEntryInfo   ; DWORD* in/out
    , "Ptr", lpGroupAttributes   ; void* optional
    , "Ptr", lpcbGroupAttributes   ; DWORD* optional
    , "Ptr", lpReserved   ; void* optional
    , "Ptr")   ; return: HANDLE
●FindFirstUrlCacheEntryExA(lpszUrlSearchPattern, dwFlags, dwFilter, GroupId, lpFirstCacheEntryInfo, lpcbCacheEntryInfo, lpGroupAttributes, lpcbGroupAttributes, lpReserved) = DLL("WININET.dll", "void* FindFirstUrlCacheEntryExA(char*, dword, dword, int64, void*, void*, void*, void*, void*)")
# 呼び出し: FindFirstUrlCacheEntryExA(lpszUrlSearchPattern, dwFlags, dwFilter, GroupId, lpFirstCacheEntryInfo, lpcbCacheEntryInfo, lpGroupAttributes, lpcbGroupAttributes, lpReserved)
# lpszUrlSearchPattern : LPCSTR optional -> "char*"
# dwFlags : DWORD -> "dword"
# dwFilter : DWORD -> "dword"
# GroupId : LONGLONG -> "int64"
# lpFirstCacheEntryInfo : INTERNET_CACHE_ENTRY_INFOA* 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)。