[URLCACHE]
authorEric Kohl <eric.kohl@reactos.org>
Sat, 26 Feb 2011 22:23:03 +0000 (22:23 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Sat, 26 Feb 2011 22:23:03 +0000 (22:23 +0000)
Do not initialize the URL-Cache for a system process.
Patch will be submitted to WINE.
See issue #5372 for more details.

svn path=/trunk/; revision=50916

reactos/dll/win32/wininet/urlcache.c

index 2129f42..63a160d 100644 (file)
@@ -527,6 +527,7 @@ void URLCacheContainers_CreateDefaults(void)
     static const WCHAR HistoryPrefix[] = {'V','i','s','i','t','e','d',':',0};
     static const WCHAR CookieSuffix[] = {0};
     static const WCHAR CookiePrefix[] = {'C','o','o','k','i','e',':',0};
+    static const WCHAR UserProfile[] = {'U','S','E','R','P','R','O','F','I','L','E',0};
     static const struct
     {
         int nFolder; /* CSIDL_* constant */
@@ -540,6 +541,12 @@ void URLCacheContainers_CreateDefaults(void)
     };
     DWORD i;
 
+    if (GetEnvironmentVariableW(UserProfile, NULL, 0) == 0 && GetLastError() == ERROR_ENVVAR_NOT_FOUND)
+    {
+        TRACE("Environment variable 'USERPROFILE' does not exist!\n");
+        return;
+    }
+
     for (i = 0; i < sizeof(DefaultContainerData) / sizeof(DefaultContainerData[0]); i++)
     {
         WCHAR wszCachePath[MAX_PATH];