mshtml: Disable Gecko installation on unsupported CPU architectures.

This commit is contained in:
Jacek Caban 2009-12-03 15:08:30 +01:00 committed by Alexandre Julliard
parent a9ecdc6024
commit 412f4a6091
1 changed files with 21 additions and 4 deletions

View File

@ -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");