[WININET]
authorThomas Faber <thomas.faber@reactos.org>
Mon, 17 Aug 2015 08:14:24 +0000 (08:14 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Mon, 17 Aug 2015 08:14:24 +0000 (08:14 +0000)
- Repair the ROS-Diff from r54992. Now we hopefully don't initialize the URL cache multiple times anymore.

svn path=/trunk/; revision=68726

reactos/dll/win32/wininet/urlcache.c
reactos/dll/win32/wininet/wininet_ros.diff

index a78093c..45137bd 100644 (file)
@@ -804,6 +804,10 @@ static void cache_containers_init(void)
         cache_containers_add(DefaultContainerData[i].cache_prefix, wszCachePath,
                 DefaultContainerData[i].default_entry_type, wszMutexName);
     }
+
+#ifdef __REACTOS__
+    bDefaultContainersAdded = TRUE;
+#endif
 }
 
 static void cache_containers_free(void)
@@ -823,9 +827,11 @@ static DWORD cache_containers_find(const char *url, cache_container **ret)
     if(!url)
         return ERROR_INVALID_PARAMETER;
 
+#ifdef __REACTOS__
     /* ReactOS r54992 */
     if (!bDefaultContainersAdded)
         cache_containers_init();
+#endif
 
     LIST_FOR_EACH_ENTRY(container, &UrlContainers, cache_container, entry)
     {
@@ -853,9 +859,11 @@ static BOOL cache_containers_enum(char *search_pattern, DWORD index, cache_conta
     if (search_pattern && index > 0)
         return FALSE;
 
+#ifdef __REACTOS__
     /* ReactOS r54992 */
     if (!bDefaultContainersAdded)
         cache_containers_init();
+#endif
 
     LIST_FOR_EACH_ENTRY(container, &UrlContainers, cache_container, entry)
     {
@@ -4014,7 +4022,9 @@ BOOL init_urlcache(void)
         return FALSE;
     }
 
+#ifndef __REACTOS__
     cache_containers_init();
+#endif
     return TRUE;
 }
 
index 4ed80ff..e277926 100644 (file)
@@ -111,25 +111,50 @@ diff -pudN e:\wine\dlls\wininet/urlcache.c e:\reactos\dll\win32\wininet/urlcache
      for (i = 0; i < sizeof(DefaultContainerData) / sizeof(DefaultContainerData[0]); i++)
      {
          WCHAR wszCachePath[MAX_PATH];
-@@ -835,6 +823,10 @@ static DWORD cache_containers_find(const
+@@ -816,6 +804,10 @@ static void cache_containers_init(void)
+         cache_containers_add(DefaultContainerData[i].cache_prefix, wszCachePath,
+                 DefaultContainerData[i].default_entry_type, wszMutexName);
+     }
++
++#ifdef __REACTOS__
++    bDefaultContainersAdded = TRUE;
++#endif
+ }
+ static void cache_containers_free(void)
+@@ -835,6 +827,12 @@ static DWORD cache_containers_find(const
      if(!url)
          return ERROR_INVALID_PARAMETER;
  
++#ifdef __REACTOS__
 +    /* ReactOS r54992 */
 +    if (!bDefaultContainersAdded)
 +        cache_containers_init();
++#endif
 +
      LIST_FOR_EACH_ENTRY(container, &UrlContainers, cache_container, entry)
      {
          int prefix_len = strlen(container->cache_prefix);
-@@ -861,6 +853,10 @@ static BOOL cache_containers_enum(char *
+@@ -861,6 +859,12 @@ static BOOL cache_containers_enum(char *
      if (search_pattern && index > 0)
          return FALSE;
  
++#ifdef __REACTOS__
 +    /* ReactOS r54992 */
 +    if (!bDefaultContainersAdded)
 +        cache_containers_init();
++#endif
 +
      LIST_FOR_EACH_ENTRY(container, &UrlContainers, cache_container, entry)
      {
          if (search_pattern)
+@@ -4018,7 +4022,9 @@ BOOL init_urlcache(void)
+         return FALSE;
+     }
++#ifndef __REACTOS__
+     cache_containers_init();
++#endif
+     return TRUE;
+ }