WinINet Functions


FindFirstUrlCacheEntry Function

Begins the enumeration of the Internet cache.

Syntax

C++
HANDLE FindFirstUrlCacheEntry(
  __in     LPCTSTR lpszUrlSearchPattern,
  __out    LPINTERNET_CACHE_ENTRY_INFO lpFirstCacheEntryInfo,
  __inout  LPDWORD lpcbCacheEntryInfo
);

Parameters

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, FindFirstUrlCacheEntry returns all content entries in the cache.

lpFirstCacheEntryInfo [out]

Pointer to an INTERNET_CACHE_ENTRY_INFO structure.

lpcbCacheEntryInfo [in, out]

Pointer to a variable that specifies the size of the lpFirstCacheEntryInfo buffer, in TCHARs. When the function returns, the variable contains the number of TCHARs copied to the buffer, or the required size needed to retrieve the cache entry, in TCHARs.

Return Value

Returns a handle that the application can use in the FindNextUrlCacheEntry function to retrieve subsequent entries in the cache. If the function fails, the return value is NULL. To get extended error information, call GetLastError.

ERROR_INSUFFICIENT_BUFFER indicates that the size of lpFirstCacheEntryInfo as specified by lpdwFirstCacheEntryInfoBufferSize is not sufficient to contain all the information. The value returned in lpdwFirstCacheEntryInfoBufferSize indicates the buffer size necessary to contain all the information.

Remarks

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

FindFirstUrlCacheEntry and FindNextUrlCacheEntry return variable size information. If ERROR_INSUFFICIENT_BUFFER is returned, the application should allocate a buffer of the size specified by lpdwFirstCacheEntryInfoBufferSize. For more information, see Using Buffers.

Requirements

Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
VersionInternet Explorer 3.0 or later
HeaderWininet.h
LibraryWininet.lib
DLLWininet.dll
Unicode and ANSI namesFindFirstUrlCacheEntryW (Unicode) and FindFirstUrlCacheEntryA (ANSI)

See Also

Caching
WinINet Functions

Send comments about this topic to Microsoft

Build date: 10/8/2009

Tags :


Community Content

EricLaw-MSFT
It doesn't look work on IE7
I found this API doesn't get cache entries when I use IE7 on VISTA.
Is this a bug or restriction?

[ericlaw 13-08-09] The issue is that the API works on only the cache with the same integrity level as your program. Sites in Protected Mode IE (e.g. the Internet) run at Low Integrity; Low has its own cache which isn't visible to programs running at Medium integrity.

[tfl - 15-08-08] - Good question. In general, you should post questions like this to the MSDN Forums at http:/forums.microsoft.com/msdn. You are much more likely get a quick response using the forums than through the Community Content. And if you do find the answer, consider coming back to Community Content and sharing what you found out. I've tagged this post contentbug.
Tags : contentbug

Page view tracker