Load advpack.dll at runtime to avoid link problems with the platform

sdk.
This commit is contained in:
Francois Gouget 2005-02-14 11:02:46 +00:00 committed by Alexandre Julliard
parent 737da5864a
commit fe2b31a569
2 changed files with 17 additions and 6 deletions

View File

@ -3,7 +3,7 @@ TOPOBJDIR = ../../..
SRCDIR = @srcdir@
VPATH = @srcdir@
TESTDLL = advpack.dll
IMPORTS = advpack user32 kernel32
IMPORTS = user32 kernel32
CTESTS = \
advpack.c

View File

@ -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();
}