From a0397541036f7cedd47cde5bb830e576c5c654b5 Mon Sep 17 00:00:00 2001 From: Juan Lang Date: Tue, 8 Mar 2011 08:06:10 -0800 Subject: [PATCH] wininet: Account for disk space usage when deleting url cache entries. --- dlls/wininet/urlcache.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dlls/wininet/urlcache.c b/dlls/wininet/urlcache.c index e8883605301..639e13590c7 100644 --- a/dlls/wininet/urlcache.c +++ b/dlls/wininet/urlcache.c @@ -2963,6 +2963,10 @@ BOOL WINAPI DeleteUrlCacheEntryA(LPCSTR lpszUrlName) if (pHeader->directory_data[pUrlEntry->CacheDir].dwNumFiles) pHeader->directory_data[pUrlEntry->CacheDir].dwNumFiles--; } + if (pUrlEntry->size.QuadPart < pHeader->CacheUsage.QuadPart) + pHeader->CacheUsage.QuadPart -= pUrlEntry->size.QuadPart; + else + pHeader->CacheUsage.QuadPart = 0; URLCache_DeleteEntry(pHeader, pEntry); @@ -3042,6 +3046,10 @@ BOOL WINAPI DeleteUrlCacheEntryW(LPCWSTR lpszUrlName) if (pHeader->directory_data[pUrlEntry->CacheDir].dwNumFiles) pHeader->directory_data[pUrlEntry->CacheDir].dwNumFiles--; } + if (pUrlEntry->size.QuadPart < pHeader->CacheUsage.QuadPart) + pHeader->CacheUsage.QuadPart -= pUrlEntry->size.QuadPart; + else + pHeader->CacheUsage.QuadPart = 0; URLCache_DeleteEntry(pHeader, pEntry);