wininet: Set file size in container object to avoid closing/reopening index on every lock index operation.

Morten Rønne morten.roenne at tdcadsl.dk
Wed Apr 4 17:23:09 CDT 2012


This is a internal wine problem, which doesn't affect any tests.

If you want to see the problem in action, comment the assignment and 
change the added TRACE to a FIXME, and run tests.
Then do the tests again with the assignment added and see the difference.

Best Regards

Morten Rønne
-------------- next part --------------
>From 070135159a84bda5e80543643b4dfd11e0a1a1cf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Morten=20R=C3=B8nne?= <morten.roenne at tdcadsl.dk>
Date: Sat, 24 Mar 2012 19:18:24 +0100
Subject: [PATCH] wininet: Set file size in container object to avoid
 closing/reopening index on every lock index
 operation.

---
 dlls/wininet/urlcache.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/dlls/wininet/urlcache.c b/dlls/wininet/urlcache.c
index a217236..9e2baae 100644
--- a/dlls/wininet/urlcache.c
+++ b/dlls/wininet/urlcache.c
@@ -433,6 +433,9 @@ static DWORD URLCacheContainer_OpenIndex(URLCACHECONTAINER * pContainer)
         return GetLastError();
     }
 
+    /* Save size of mapping created */
+    pContainer->file_size = dwFileSize;
+
     ReleaseMutex(pContainer->hMutex);
 
     return ERROR_SUCCESS;
@@ -681,6 +684,7 @@ static LPURLCACHE_HEADER URLCacheContainer_LockIndex(URLCACHECONTAINER * pContai
      * of the memory mapped file */
     if (pHeader->dwFileSize != pContainer->file_size)
     {
+        TRACE("Remap index file (file size change)\n");
         UnmapViewOfFile( pHeader );
         URLCacheContainer_CloseIndex(pContainer);
         error = URLCacheContainer_OpenIndex(pContainer);
-- 
1.7.5.4



More information about the wine-patches mailing list