Jacek Caban : mshtml: Disable Gecko installation on unsupported CPU architectures.
Alexandre Julliard
julliard at winehq.org
Thu Dec 3 10:29:55 CST 2009
Module: wine
Branch: master
Commit: 412f4a6091232a932d49a9bb7f4d00e84a578d05
URL: http://source.winehq.org/git/wine.git/?a=commit;h=412f4a6091232a932d49a9bb7f4d00e84a578d05
Author: Jacek Caban <jacek at codeweavers.com>
Date: Thu Dec 3 15:08:30 2009 +0100
mshtml: Disable Gecko installation on unsupported CPU architectures.
---
dlls/mshtml/install.c | 25 +++++++++++++++++++++----
1 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/dlls/mshtml/install.c b/dlls/mshtml/install.c
index cfe3cd0..4122194 100644
--- a/dlls/mshtml/install.c
+++ b/dlls/mshtml/install.c
@@ -47,7 +47,13 @@
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
-#define GECKO_FILE_NAME "wine_gecko-" GECKO_VERSION "-x86.cab"
+#ifdef __i386__
+#define GECKO_ARCH "x86"
+#else
+#define GECKO_ARCH ""
+#endif
+
+#define GECKO_FILE_NAME "wine_gecko-" GECKO_VERSION "-" GECKO_ARCH ".cab"
static const WCHAR mshtml_keyW[] =
{'S','o','f','t','w','a','r','e',
@@ -430,7 +436,8 @@ static LPWSTR get_url(void)
static const WCHAR wszGeckoUrl[] = {'G','e','c','k','o','U','r','l',0};
static const WCHAR httpW[] = {'h','t','t','p'};
- static const WCHAR v_formatW[] = {'?','a','r','c','h','=','x','8','6','&','v','=',0};
+ static const WCHAR arch_formatW[] = {'?','a','r','c','h','='};
+ static const WCHAR v_formatW[] = {'&','v','='};
/* @@ Wine registry key: HKCU\Software\Wine\MSHTML */
res = RegOpenKeyW(HKEY_CURRENT_USER, mshtml_keyW, &hkey);
@@ -448,8 +455,15 @@ static LPWSTR get_url(void)
}
if(returned_size > sizeof(httpW) && !memcmp(url, httpW, sizeof(httpW))) {
- strcatW(url, v_formatW);
- MultiByteToWideChar(CP_ACP, 0, GECKO_VERSION, -1, url+strlenW(url), size/sizeof(WCHAR)-strlenW(url));
+ DWORD len;
+
+ len = strlenW(url);
+ memcpy(url+len, arch_formatW, sizeof(arch_formatW));
+ len += sizeof(arch_formatW)/sizeof(WCHAR);
+ len += MultiByteToWideChar(CP_ACP, 0, GECKO_ARCH, sizeof(GECKO_ARCH), url+len, size/sizeof(WCHAR)-len)-1;
+ memcpy(url+len, v_formatW, sizeof(v_formatW));
+ len += sizeof(v_formatW)/sizeof(WCHAR);
+ MultiByteToWideChar(CP_ACP, 0, GECKO_VERSION, -1, url+len, size/sizeof(WCHAR)-len);
}
TRACE("Got URL %s\n", debugstr_w(url));
@@ -512,6 +526,9 @@ BOOL install_wine_gecko(BOOL silent)
{
HANDLE hsem;
+ if(!*GECKO_ARCH)
+ return FALSE;
+
SetLastError(ERROR_SUCCESS);
hsem = CreateSemaphoreA( NULL, 0, 1, "mshtml_install_semaphore");
More information about the wine-cvs
mailing list