wininet(3/7): Account for disk space used by cache
Alexandre Julliard
julliard at winehq.org
Tue Mar 8 05:52:40 CST 2011
Juan Lang <juan.lang at gmail.com> writes:
> +{
> + ULARGE_INTEGER currentSize, addedSize, limit;
> +
> + currentSize.u.LowPart = pHeader->dwCacheUsageLow;
> + currentSize.u.HighPart = pHeader->dwCacheUsageHigh;
> + addedSize.u.HighPart = fileSizeHigh;
> + addedSize.u.LowPart = fileSizeLow;
> + currentSize.QuadPart += addedSize.QuadPart;
> + limit.u.LowPart = pHeader->dwCacheLimitLow;
> + limit.u.HighPart = pHeader->dwCacheLimitHigh;
> + if (commit)
> + {
> + pHeader->dwCacheUsageLow = currentSize.u.LowPart;
> + pHeader->dwCacheUsageHigh = currentSize.u.HighPart;
> + }
> + return currentSize.QuadPart > limit.QuadPart;
You should store the fields as large integer in the header structure,
that would save a lot of redundant manipulations.
--
Alexandre Julliard
julliard at winehq.org
More information about the wine-devel
mailing list