使用WinInet的方法迭代缓存文件时,如何跳过大文件?

发布于 2024-09-24 09:55:34 字数 367 浏览 0 评论 0原文

我的程序的一部分使用WinInet的缓存功能(例如FindFirstUrlCacheEntry、FindNextUrlCacheEntry)来遍历系统缓存并删除满足特定条件的文件。

问题是,当在缓存中找到大文件时,FindNextUrlCacheEntry 会因 ERROR_INSUFFICIENT_BUFFER 失败,并请求不合理的缓冲区大小继续(超过 10MB),而我无法在该系统上分配该缓冲区大小。

我需要一种方法: - 跳过大文件(以某种方式到达下一个条目) - 在不分配大缓冲区的情况下获取大文件的缓存条目

我注意到“检索”缓存功能,但它们都需要 URL - 我什至无法获取我的条目的 URL...

有什么建议吗?

谢谢, 古浦

A part of my program uses WinInet's caching function (e.g. FindFirstUrlCacheEntry, FindNextUrlCacheEntry) to go through the system cache and delete files that meet certain criteria.

The problem is that when a large file is found in the cache, FindNextUrlCacheEntry fails with ERROR_INSUFFICIENT_BUFFER, and requests an unreasonable buffer size to continue (over 10MB), which I fail to allocate on that system.

I need a way to either:
- Skip large files (somehow get to the next entry)
- Get the cache entry of large files without allocating a large buffer

I noticed the "Retrieve" cache functions, but they all require URLs - and I can't even get the URL of my entry...

Any suggestions?

Thanks,
Guypo

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

唐婉 2024-10-01 09:55:34

事实证明这是我的错误,WinInet 实际上并没有尝试读取完整的文件。
尽管如此,跳过文件的方法可能还是有用的......

Turns out it was my bug, WinInet doesn't actually attempt to read the full file.
Still, a way to skip files could have been useful...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文