diff --git a/dlls/mshtml/nsembed.c b/dlls/mshtml/nsembed.c index 9952a553afd..95c07c90390 100644 --- a/dlls/mshtml/nsembed.c +++ b/dlls/mshtml/nsembed.c @@ -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); diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index bb86a7e0a1b..07c4fec9bd8 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -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()) {