This function stores data in the specified file in the Internet cache and associates it with the given URL.
At a Glance
Header file: | Wininet.h |
Windows CE versions: | 2.12 and later |
Syntax
BOOL CommitUrlCacheEntry ( LPCTSTR lpszUrlName,
LPCTSTR lpszLocalFileName, FILETIME ExpireTime,
FILETIME LastModifiedTime, DWORD CacheEntryType,
LPBYTE lpHeaderInfo, DWORD dwHeaderSize,
LPCTSTR lpszFileExtension, DWORD dwReserved);
Parameters
lpszUrlName
[in] Address of a string variable that contains the source name of the cache entry. The name string must be unique and should not contain any escape characters.
lpszLocalFileName
[in] Address of a string variable that contains the name of the local file that is being cached. This should be the same name as that returned by CreateUrlCacheEntry.
ExpireTime
[in] FILETIME structure that contains the expire date and time (in Greenwich mean time) of the file that is being cached. If the expire date and time is unknown, set this parameter to zero.
LastModifiedTime
[in] FILETIME structure that contains the last modified date and time (in Greenwich mean time) of the URL that is being cached. If the last modified date and time is unknown, set this parameter to zero.
CacheEntryType
[in] Unsigned long integer value that contains the cache type bitmask. Currently, the cache entry type values have not been finalized, so this value does not serve a real purpose at this point, except for STICKY_CACHE_ENTRY. This can be a combination of the following values:
COOKIE_CACHE_ENTRY | TRACK_CACHE_ENTRY |
EDITED_CACHE_ENTRY | TRACK_OFFLINE_CACHE_ENTRY |
NORMAL_CACHE_ENTRY | TRACK_ONLINE_CACHE_ENTRY |
SPARCE_CACHE_ENTRY | URLHISTORY_CACHE_ENTRY |
STICKY_CACHE_ENTRY |
lpHeaderInfo
[in] Address of the buffer containing the header information. If this parameter is not NULL, the header information is treated as extended attributes of the URL and is returned in the INTERNET_CACHE_ENTRY_INFO structure.
dwHeaderSize
[in] Unsigned long integer value that contains the size of the header information. If lpHeaderInfo is not NULL, this value is assumed to indicate the size of the buffer that will store the header information. An application can maintain headers as part of the data and provide dwHeaderSize together with a NULL value for lpHeaderInfo.
lpszFileExtension
[in] Address of a buffer that contains information maintained in the cache database for future use.
dwReserved
[in] Reserved. Must be set to zero.
Return Values
Returns TRUE if successful, or FALSE otherwise.
Remarks
If the cache storage is full, this function invokes cache cleanup to make space for this new file. If the cache entry already exists, the function overwrites the entry if it is not in use. An entry is in use when it has been retrieved with RetrieveUrlCacheEntryFile.
Clients that add entries to the cache should set the headers to at least "HTTP/1.0 200 OK\r\n\r\n"; otherwise, client applications which use the Win32 Internet functions may disregard the entry.
See Also