Commit 624b008f authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

mshtml: Only allow one thread to use Gecko.

The new test doesn't pass, but it doesn't crash either, and that's enough to fix the WinZip installer. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54071
parent 5d516dd9
......@@ -818,7 +818,8 @@ BOOL load_gecko(void)
MESSAGE("Could not find Wine Gecko. HTML rendering will be disabled.\n");
}
}else {
ret = pCompMgr != NULL;
FIXME("Gecko can only be used from one thread.\n");
ret = FALSE;
}
LeaveCriticalSection(&cs_load_gecko);
......
......@@ -11980,6 +11980,29 @@ static void test_document_mode_lock(void)
IHTMLDocument2_Release(doc);
}
static DWORD WINAPI create_document_proc(void *param)
{
IHTMLDocument2 *doc = NULL;
HRESULT hres;
CoInitialize(NULL);
hres = CoCreateInstance(&CLSID_HTMLDocument, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
&IID_IHTMLDocument2, (void**)&doc);
todo_wine
ok(hres == S_OK, "Creation of an HTMLDocument in a separate thread failed: %08lx\n", hres);
if (doc) IHTMLDocument2_Release(doc);
return 0;
}
static void test_threads(void)
{
HANDLE thread = CreateThread(NULL, 0, create_document_proc, 0, 0, NULL);
DWORD ret = WaitForSingleObject(thread, 2000);
ok(!ret, "Document creation thread failed to complete\n");
}
static void test_custom_user_agent(IHTMLDocument2 *doc)
{
static const WCHAR ua[] = L"1234567890xxxABC";
......@@ -12080,6 +12103,7 @@ START_TEST(dom)
test_quirks_mode();
test_document_mode_lock();
test_threads();
/* Run this last since it messes with the process-wide user agent */
if (winetest_interactive || ! is_ie_hardened()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment