From 6b6ca1a801e9e348a1467c7cf6b2036b0e9cef9e Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 23 Feb 2009 12:34:57 +0100 Subject: [PATCH] winetest: Don't try to unload mshtml, it's broken. --- programs/winetest/Makefile.in | 1 + programs/winetest/main.c | 25 ++++++------------------- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/programs/winetest/Makefile.in b/programs/winetest/Makefile.in index 140adb55e09..20fd2ba694d 100644 --- a/programs/winetest/Makefile.in +++ b/programs/winetest/Makefile.in @@ -5,6 +5,7 @@ VPATH = @srcdir@ MODULE = winetest.exe APPMODE = -mconsole IMPORTS = uuid comctl32 version user32 gdi32 advapi32 wsock32 kernel32 +DELAYIMPORTS = ole32 EXTRARCFLAGS = -DBUILD_SHA1=\"`GIT_DIR=$(TOPSRCDIR)/.git git rev-parse HEAD 2>/dev/null`\" diff --git a/programs/winetest/main.c b/programs/winetest/main.c index 0ab512a109e..5423ddb2e8a 100644 --- a/programs/winetest/main.c +++ b/programs/winetest/main.c @@ -154,28 +154,15 @@ static int running_on_visible_desktop (void) /* check if Gecko is present, trying to trigger the install if not */ static BOOL gecko_check(void) { - HMODULE mshtml; - HRESULT (WINAPI *pDllGetClassObject)(REFCLSID rclsid, REFIID riid, LPVOID *ppv); - IClassFactory *factory = NULL; - IHTMLDocument2 *doc = NULL; + IHTMLDocument2 *doc; IHTMLElement *body; BOOL ret = FALSE; - if (!(mshtml = LoadLibraryA( "mshtml.dll" ))) return FALSE; - if (!(pDllGetClassObject = (void *)GetProcAddress( mshtml, "DllGetClassObject" ))) - goto done; - if (FAILED(pDllGetClassObject( &CLSID_HTMLDocument, &IID_IClassFactory, (void **)&factory ))) - goto done; - if (FAILED(IClassFactory_CreateInstance( factory, NULL, &IID_IHTMLDocument2, (void **)&doc ))) - goto done; - if (FAILED(IHTMLDocument2_get_body( doc, &body ))) - goto done; - IHTMLElement_Release( body ); - ret = TRUE; -done: - if (doc) IHTMLDocument_Release( doc ); - if (factory) IClassFactory_Release( factory ); - FreeLibrary( mshtml ); + CoInitialize( NULL ); + if (FAILED( CoCreateInstance( &CLSID_HTMLDocument, NULL, CLSCTX_INPROC_SERVER, + &IID_IHTMLDocument2, (void **)&doc ))) return FALSE; + if ((ret = SUCCEEDED( IHTMLDocument2_get_body( doc, &body )))) IHTMLElement_Release( body ); + IHTMLDocument_Release( doc ); return ret; }