[pkg-wine-party] [SCM] Debian Wine packaging branch, wheezy, updated. wine-1.4-7-302-gb61b690

Alexandre Julliard julliard at winehq.org
Sun Jun 17 20:03:15 UTC 2012


The following commit has been merged in the wheezy branch:
commit 69d8e22b60517244291bc01d936cb48057839123
Author: Jacek Caban <jacek at codeweavers.com>
Date:   Fri Apr 6 12:34:12 2012 +0200

    urlmon: Build more appropriate user agent string.
    
    The registry value we used previously seems to be ignored by recent IEs.
    (cherry picked from commit 6f9e33083860fc64fded56a71e09a98994aa7ecd)

diff --git a/dlls/urlmon/session.c b/dlls/urlmon/session.c
index fc36c0b..221f662 100644
--- a/dlls/urlmon/session.c
+++ b/dlls/urlmon/session.c
@@ -517,31 +517,38 @@ static LPWSTR user_agent;
 
 static void ensure_useragent(void)
 {
-    DWORD size = sizeof(DWORD), res, type;
-    HKEY hkey;
-
-    static const WCHAR user_agentW[] = {'U','s','e','r',' ','A','g','e','n','t',0};
+    OSVERSIONINFOW info = {sizeof(info)};
+    const WCHAR *os_type, *is_nt;
+    WCHAR buf[512];
+    BOOL is_wow;
+
+    static const WCHAR formatW[] =
+        {'M','o','z','i','l','l','a','/','4','.','0',
+         ' ','(','c','o','m','p','a','t','i','b','l','e',';',
+         ' ','M','S','I','E',' ','8','.','0',';',
+         ' ','W','i','n','d','o','w','s',' ','%','s','%','d','.','%','d',';',
+         ' ','%','s',';',' ','T','r','i','d','e','n','t','/','5','.','0',')',0};
+    static const WCHAR ntW[] = {'N','T',' ',0};
+    static const WCHAR win32W[] = {'W','i','n','3','2',0};
+    static const WCHAR win64W[] = {'W','i','n','6','4',0};
+    static const WCHAR wow64W[] = {'W','O','W','6','4',0};
+    static const WCHAR emptyW[] = {0};
 
     if(user_agent)
         return;
 
-    res = RegOpenKeyW(HKEY_CURRENT_USER, internet_settings_keyW, &hkey);
-    if(res != ERROR_SUCCESS)
-        return;
+    GetVersionExW(&info);
+    is_nt = info.dwPlatformId == VER_PLATFORM_WIN32_NT ? ntW : emptyW;
 
-    res = RegQueryValueExW(hkey, user_agentW, NULL, &type, NULL, &size);
-    if(res == ERROR_SUCCESS && type == REG_SZ) {
-        user_agent = heap_alloc(size);
-        res = RegQueryValueExW(hkey, user_agentW, NULL, &type, (LPBYTE)user_agent, &size);
-        if(res != ERROR_SUCCESS) {
-            heap_free(user_agent);
-            user_agent = NULL;
-        }
-    }else {
-        WARN("Could not find User Agent value: %u\n", res);
-    }
+    if(sizeof(void*) == 8)
+        os_type = win64W;
+    else if(IsWow64Process(GetCurrentProcess(), &is_wow) && is_wow)
+        os_type = wow64W;
+    else
+        os_type = win32W;
 
-    RegCloseKey(hkey);
+    sprintfW(buf, formatW, is_nt, info.dwMajorVersion, info.dwMinorVersion, os_type);
+    user_agent = heap_strdupW(buf);
 }
 
 LPWSTR get_useragent(void)

-- 
Debian Wine packaging



More information about the pkg-wine-party mailing list