Alexandre Julliard : winetest: Don't try to unload mshtml, it's broken.

Alexandre Julliard julliard at winehq.org
Mon Feb 23 10:00:33 CST 2009


Module: wine
Branch: master
Commit: 6b6ca1a801e9e348a1467c7cf6b2036b0e9cef9e
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=6b6ca1a801e9e348a1467c7cf6b2036b0e9cef9e

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Feb 23 12:34:57 2009 +0100

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 140adb5..20fd2ba 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 0ab512a..5423ddb 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;
 }
 




More information about the wine-cvs mailing list