Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

FindFirstUrlCacheEntryEx function

Starts a filtered enumeration of the Internet cache.


HANDLE FindFirstUrlCacheEntryEx(
  _In_       LPCTSTR                     lpszUrlSearchPattern,
  _In_       DWORD                       dwFlags,
  _In_       DWORD                       dwFilter,
  _In_       GROUPID                     GroupId,
  _Out_      LPINTERNET_CACHE_ENTRY_INFO lpFirstCacheEntryInfo,
  _Inout_    LPDWORD                     lpdwEntryInfo,
  _Reserved_ LPVOID                      lpGroupAttributes,
  _Reserved_ LPDWORD                     lpcbGroupAttributes,
  _Reserved_ LPVOID                      lpReserved


lpszUrlSearchPattern [in]

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.

dwFlags [in]

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

dwFilter [in]

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.


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.


GroupId [in]

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

lpFirstCacheEntryInfo [out]

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

lpdwEntryInfo [in, out]

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

lpGroupAttributes [out]

This parameter is reserved and must be NULL.

lpcbGroupAttributes [in, out]

This parameter is reserved and must be NULL.

lpReserved [in]

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).


Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server







Unicode and ANSI names

FindFirstUrlCacheEntryExW (Unicode) and FindFirstUrlCacheEntryExA (ANSI)

See also

WinINet Functions



© 2015 Microsoft