Re: wininet(3/7): Account for disk space used by cache
Juan Lang <juan.lang(a)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(a)winehq.org
participants (1)
-
Alexandre Julliard