diff --git a/programs/winetest/Makefile.in b/programs/winetest/Makefile.in index d50284abdc9..05427e78306 100644 --- a/programs/winetest/Makefile.in +++ b/programs/winetest/Makefile.in @@ -4,7 +4,7 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = winetest.exe APPMODE = -mconsole -IMPORTS = comctl32 version user32 gdi32 advapi32 wsock32 kernel32 +IMPORTS = uuid comctl32 version user32 gdi32 advapi32 wsock32 kernel32 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 211ec2e65fd..ab9c79e73d1 100644 --- a/programs/winetest/main.c +++ b/programs/winetest/main.c @@ -28,9 +28,11 @@ #include "config.h" #include "wine/port.h" +#define COBJMACROS #include #include #include +#include #include "winetest.h" #include "resource.h" @@ -149,6 +151,34 @@ static int running_on_visible_desktop (void) return IsWindowVisible(desktop); } +/* 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; + 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 ); + return ret; +} + static void print_version (void) { #ifdef __i386__ @@ -520,6 +550,12 @@ extract_test_proc (HMODULE hModule, LPCTSTR lpszType, xprintf (" %s=dll is missing\n", dllname); return TRUE; } + if (!strcmp( dllname, "mshtml" ) && running_under_wine() && !gecko_check()) + { + FreeLibrary(dll); + xprintf (" %s=load error Gecko is not installed\n", dllname); + return TRUE; + } GetModuleFileNameA(dll, filename, MAX_PATH); FreeLibrary(dll);