Microsoft KB Archive/172607

From BetaArchive Wiki
Knowledge Base


SAMPLE: CacheVW.exe Enumerates and Displays WinInet Cache

Article ID: 172607

Article Last Modified on 8/5/2004



APPLIES TO

  • Microsoft Internet Explorer 3.0
  • Microsoft Internet Explorer 4.0 128-Bit Edition
  • Microsoft Internet Explorer 4.01 Service Pack 2
  • Microsoft Windows Internet Services (WinInet)



This article was previously published under Q172607

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:

  • FindFirstUrlEntry
  • FindNextUrlCacheEntry
  • FindCloseUrlCache
  • GetCacheEntryInfo
  • RetrieveUrlCacheEntryStream
  • ReadUrlCacheEntryStream
  • UnlockUrlCachEntryStream


MORE INFORMATION

The following file is available for download from the Microsoft Download Center:

For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:

119591 How to Obtain Microsoft Support Files from Online Services


Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.

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: Cachevw

Keywords: kbinfo kbdownload kbfile kbsample KB172607