Fix advpack test compilation on Windows

Francois Gouget fgouget at codeweavers.com
Fri Feb 11 16:12:46 CST 2005


My Windows Platform SDK (xpsp2-200408) does not have advpack.lib. This 
caused the test to fail the link phase on Windows. So I modified the 
test to load advpack.dll at runtime.


Changelog:

  * dlls/advpack/tests/Makefile.in
    dlls/advpack/tests/advpack.c

    Francois Gouget <fgouget at codeweavers.com>
    Load advpack.dll at runtime to avoid link problems with the platform 
sdk.

-- 
Francois Gouget
fgouget at codeweavers.com

-------------- next part --------------
Index: dlls/advpack/tests/Makefile.in
===================================================================
RCS file: /var/cvs/wine/dlls/advpack/tests/Makefile.in,v
retrieving revision 1.1
diff -u -p -r1.1 Makefile.in
--- dlls/advpack/tests/Makefile.in	20 Jan 2005 20:03:13 -0000	1.1
+++ dlls/advpack/tests/Makefile.in	11 Feb 2005 18:43:16 -0000
@@ -3,7 +3,7 @@ TOPOBJDIR = ../../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 TESTDLL   = advpack.dll
-IMPORTS   = advpack user32 kernel32
+IMPORTS   = user32 kernel32
 
 CTESTS = \
        advpack.c
Index: dlls/advpack/tests/advpack.c
===================================================================
RCS file: /var/cvs/wine/dlls/advpack/tests/advpack.c,v
retrieving revision 1.1
diff -u -p -r1.1 advpack.c
--- dlls/advpack/tests/advpack.c	20 Jan 2005 20:03:13 -0000	1.1
+++ dlls/advpack/tests/advpack.c	11 Feb 2005 18:33:55 -0000
@@ -18,12 +18,14 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#define NONAMELESSSTRUCT
-#define NONAMELESSUNION
 #include <windows.h>
+#include <advpub.h>
 
 #include "wine/test.h"
-#include "advpub.h"
+
+
+static HRESULT (WINAPI *pGetVersionFromFile)(LPSTR,LPDWORD,LPDWORD,BOOL);
+
 
 static void version_test()
 {
@@ -31,7 +33,7 @@ static void version_test()
     DWORD major, minor;
 
     major = minor = 0;
-    hr = GetVersionFromFile("kernel32.dll", &major, &minor, FALSE);
+    hr = pGetVersionFromFile("kernel32.dll", &major, &minor, FALSE);
     ok (hr == S_OK, "GetVersionFromFileEx(kernel32.dll) failed, returned "
         "0x%08lx\n", hr);
 
@@ -39,7 +41,7 @@ static void version_test()
            major, minor);
 
     major = minor = 0;
-    hr = GetVersionFromFile("kernel32.dll", &major, &minor, TRUE);
+    hr = pGetVersionFromFile("kernel32.dll", &major, &minor, TRUE);
     ok (hr == S_OK, "GetVersionFromFileEx(kernel32.dll) failed, returned "
         "0x%08lx\n", hr);
 
@@ -49,5 +51,14 @@ static void version_test()
 
 START_TEST(advpack)
 {
+    HMODULE hdll;
+
+    hdll = LoadLibraryA("advpack.dll");
+    if (!hdll)
+        return;
+    pGetVersionFromFile = (void*)GetProcAddress(hdll, "GetVersionFromFile");
+    if (!pGetVersionFromFile)
+        return;
+
     version_test();
 }


More information about the wine-patches mailing list