Microsoft Windows CE 3.0  

Handling Structures with Variable Size Data

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The cache can contain variable size data for each URL stored. This is reflected in the INTERNET_CACHE_ENTRY_INFOstructure. When the cache functions return this structure, they create a buffer that is always the size of INTERNET_CACHE_ENTRY_INFOplus any variable size data. If a pointer member is not NULL, it points to the memory area immediately after the structure. While copying the returned buffer from a function into another buffer, the pointer members should be fixed to point to the appropriate place in the new buffer. The following code example shows how to copy into another buffer.

lpDstCEInfo->lpszSourceUrlName =
(LPINTERNET_CACHE_ENTRY_INFO) ( (LPBYTE) lpSrcCEInfo + ((DWORD)
(lpOldCEInfo->lpszSourceUrlName) - (DWORD) lpOldCEInfo))

Some cache functions fail with the ERROR_INSUFFICIENT_BUFFER error message if you specify a buffer that is too small to contain the cache-entry data retrieved by the function. In this case, the function also returns the required size of the buffer. You can then allocate a buffer of the appropriate size and call the function again.



 Last updated on Friday, April 02, 2004

© 2004 Microsoft Corporation. All rights reserved.