RetrieveUrlCacheEntryStream Function
RetrieveUrlCacheEntryStream Function

Provides the most efficient and implementation-independent way to access the cache data.

Syntax

HANDLE RetrieveUrlCacheEntryStream(
  __in     LPCTSTR lpszUrlName,
  __out    LPINTERNET_CACHE_ENTRY_INFO lpCacheEntryInfo,
  __inout  LPDWORD lpcbCacheEntryInfo,
  __in     BOOL fRandomRead,
  __in     DWORD dwReserved
);


Parameters

lpszUrlName [in]

Pointer to a null-terminated string that contains the source name of the cache entry. This must be a unique name. The name string should not contain any escape characters.

lpCacheEntryInfo [out]

Pointer to an INTERNET_CACHE_ENTRY_INFO structure that receives information about the cache entry.

lpcbCacheEntryInfo [in, out]

Pointer to a variable that specifies the size, in bytes, of the lpCacheEntryInfo buffer. When the function returns, the variable receives the number of bytes copied to the buffer or the required size, in bytes, of the buffer. Note that this buffer size must accommodate both the INTERNET_CACHE_ENTRY_INFO structure and the associated strings that are stored immediately following it.

fRandomRead [in]

Whether the stream is open for random access. Set the flag to TRUE to open the stream for random access.

dwReserved [in]

This parameter is reserved and must be 0.

Return Value

If the function succeeds, the function returns a valid handle for use in the ReadUrlCacheEntryStream and UnlockUrlCacheEntryStream functions.

If the function fails, it returns NULL. To get extended error information, call GetLastError.

Possible error values include the following.

Return codeDescription
ERROR_FILE_NOT_FOUND

The cache entry specified by the source name is not found in the cache storage.

ERROR_INSUFFICIENT_BUFFER

The size of lpCacheEntryInfo as specified by lpdwCacheEntryInfoBufferSize is not sufficient to contain all the information. The value returned in lpdwCacheEntryInfoBufferSize indicates the buffer size necessary to contain all the information.

 

Remarks

RetrieveUrlCacheEntryStream does not do any URL parsing, so a URL containing an anchor (#) will not be found in the cache, even if the resource is cached. For example, if the URL http://adatum.com/example.htm#sample is passed, the function returns ERROR_FILE_NOT_FOUND even if http://adatum.com/example.htm is in the cache.

Cache clients that do not need URL data in the form of a file should use this function to access the data for a particular URL.

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 namesRetrieveUrlCacheEntryStreamW (Unicode) and RetrieveUrlCacheEntryStreamA (ANSI)

See Also

Caching
WinINet Functions

Send comments about this topic to Microsoft

Build date: 11/19/2009

© 2009 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View