SAMPLE: CacheVW.exe Enumerates and Displays Wininet Cache

ID: Q172607

The information in this article applies to:

SUMMARY

CacheVW.exe is a sample that demonstrates how to enumerate and display Wininet cache entries. CacheVW.exe contains three files: Cachevw.cpp, Cachevw.rc, and Makefile. If you have Win32 SDK or Visual C++ installed, you can run the nmake utility to compile the sample. CacheVW.exe uses the following Wininet caching APIs:

MORE INFORMATION

The following file is available for download from the Microsoft Software Library:

 ~ CacheVW.exe (size: 20392 bytes) 

For more information about downloading files from the Microsoft Software Library, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q119591
   TITLE     : How to Obtain Microsoft Support Files from Online Services

FindNextUrlCacheEntry in Internet Explorer 3.x version of Wininet.dll has a bug where an entry is skipped if the initial buffer supplied is too small. When the function gets to an entry that is larger than the buffer supplied, it returns the buffer size required and the error ERROR_INSUFFICIENT_BUFFER. On the next call to FindNextUrlCacheEntry, it goes to the next cache entry instead of the one that returned ERROR_INSUFFICIENT_BUFFER. To work around the bug, use an initial buffer of at least 2048 bytes in FindNextURLCacheEntry. This bug will be fixed in the Internet Explorer 4.0 Wininet.dll. If the application is designed to run only with the Internet Explorer 4.0 version of Wininet.dll, it's better to dynamically allocate the buffer. The application could use a much smaller initial buffer--512 bytes, for example--to enumerate the cache. This is usually sufficient for most of cache entries.

In the Internet Explorer 3.x version of Wininet, the size cache entry info structure is limited to 2,048 bytes, and Wininet.h for Internet Explorer 3.0x has the following define:

   define MAX_CACHE_ENTRY_INFO_SIZE 4096

In Internet Explorer 4.0 there will be no size limit to the cache entry info structure and the MAX_CACHE_ENTRY_INFO_SIZE flag will also be removed from the Internet Explorer 4.0 Wininet.h file. Therefore application developers may need to define MAX_CACHE_ENTRY_INFO value themselves when porting their Wininet application from Internet Explorer 3.x to Internet Explorer 4.0 and using the Internet Explorer 4.0 version Wininet.h.

Additional query words:

Keywords          : kbIE300 kbIE400 kbIE401 kbWinInet 
Version           : WINDOWS:1.0,4.0,4.01

Last Reviewed: January 8, 1999