FindFirstUrlCacheEntryExA function (wininet.h)

Starts a filtered enumeration of the Internet cache.


HANDLE FindFirstUrlCacheEntryExA(
  [in]      LPCSTR                       lpszUrlSearchPattern,
  [in]      DWORD                        dwFlags,
  [in]      DWORD                        dwFilter,
  [in]      GROUPID                      GroupId,
  [out]     LPINTERNET_CACHE_ENTRY_INFOA lpFirstCacheEntryInfo,
  [in, out] LPDWORD                      lpcbCacheEntryInfo,
  [out]     LPVOID                       lpGroupAttributes,
  [in, out] LPDWORD                      lpcbGroupAttributes,
  [in]      LPVOID                       lpReserved


[in] lpszUrlSearchPattern

A pointer to a string that contains the source name pattern to search for. This parameter can only be set to "cookie:", "visited:", or NULL. Set this parameter to "cookie:" to enumerate the cookies or "visited:" to enumerate the URL History entries in the cache. If this parameter is NULL, FindFirstUrlCacheEntryEx returns all content entries in the cache.

[in] dwFlags

Controls the enumeration. No flags are currently implemented; this parameter must be set to zero.

[in] dwFilter

A bitmask indicating the type of cache entry and its properties. The cache entry types include: history entries (URLHISTORY_CACHE_ENTRY), cookie entries (COOKIE_CACHE_ENTRY), and normal cached content (NORMAL_CACHE_ENTRY).

This parameter can be zero or more of the following property flags, and cache type flags listed below.

Value Meaning
Cookie cache entry.
Cache entry file that has been edited externally. This cache entry type is exempt from scavenging.
Normal cache entry; can be deleted to recover space for new entries.
Partial response cache entry.
Sticky cache entry; exempt from scavenging.
Not currently implemented.
Not currently implemented.
Visited link cache entry.

[in] GroupId

ID of the cache group to be enumerated. Set this parameter to zero to enumerate all entries that are not grouped.

[out] lpFirstCacheEntryInfo

Pointer to a INTERNET_CACHE_ENTRY_INFO structure to receive the cache entry information.

[in, out] lpcbCacheEntryInfo

Pointer to variable that indicates the size of the structure referenced by the lpFirstCacheEntryInfo parameter, in bytes.

[out] lpGroupAttributes

This parameter is reserved and must be NULL.

[in, out] lpcbGroupAttributes

This parameter is reserved and must be NULL.

[in] lpReserved

This parameter is reserved and must be NULL.

Return value

Returns a valid handle if successful, or NULL otherwise. To get specific error information, call GetLastError. If the function finds no matching files, GetLastError returns ERROR_NO_MORE_FILES.


The handle returned from FindFirstUrlCacheEntryEx is used in all subsequent calls to FindNextUrlCacheEntryEx. At the end of the enumeration, the application should call FindCloseUrlCache.

Like all other aspects of the WinINet API, this function cannot be safely called from within DllMain or the constructors and destructors of global objects.

Note  WinINet does not support server implementations. In addition, it should not be used from a service. For server implementations or services use Microsoft Windows HTTP Services (WinHTTP).


The wininet.h header defines FindFirstUrlCacheEntryEx as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.


Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header wininet.h
Library Wininet.lib
DLL Wininet.dll

See also


WinINet Functions