The problem seems to be that the INTERNET_CACHE_ENTRY_INFO structure has a member lpHeaderInfo that is a LPBYTE, but the corresponding parameter of CommitURLCacheEntry() - sorry, I truncated its name in the original posting - ought to be a LPTSTR. It is not yet clear to me what is required.
-- Andy.