Print dsound.dll version from file versioninfo resource.

oldstable
Robert Reif 2005-03-05 10:49:08 +00:00 committed by Alexandre Julliard
parent a7609ee155
commit c3f06fb2e6
8 changed files with 50 additions and 2 deletions

View File

@ -3,7 +3,7 @@ TOPOBJDIR = ../../..
SRCDIR = @srcdir@
VPATH = @srcdir@
TESTDLL = dsound.dll
IMPORTS = dsound ole32 user32 kernel32
IMPORTS = dsound ole32 version user32 kernel32
EXTRALIBS = -ldxguid -luuid -ldxerr8
CTESTS = \

View File

@ -541,6 +541,9 @@ START_TEST(capture)
trace("dsound.dll not found\n");
return;
}
trace("DLL Version: %s\n", get_file_version("dsound.dll"));
pDirectSoundCaptureCreate=(void*)GetProcAddress(hDsound,"DirectSoundCaptureCreate");
pDirectSoundCaptureEnumerateA=(void*)GetProcAddress(hDsound,"DirectSoundCaptureEnumerateA");
if (!pDirectSoundCaptureCreate || !pDirectSoundCaptureEnumerateA)

View File

@ -1232,6 +1232,8 @@ START_TEST(ds3d)
{
CoInitialize(NULL);
trace("DLL Version: %s\n", get_file_version("dsound.dll"));
ds3d_tests();
CoUninitialize();

View File

@ -1133,6 +1133,8 @@ START_TEST(ds3d8)
return;
}
trace("DLL Version: %s\n", get_file_version("dsound.dll"));
pDirectSoundCreate8 = (void*)GetProcAddress(hDsound, "DirectSoundCreate8");
if (!pDirectSoundCreate8) {
trace("ds3d8 test skipped\n");

View File

@ -926,6 +926,8 @@ START_TEST(dsound)
{
CoInitialize(NULL);
trace("DLL Version: %s\n", get_file_version("dsound.dll"));
IDirectSound_tests();
dsound_tests();

View File

@ -28,6 +28,7 @@
#define NONAMELESSSTRUCT
#define NONAMELESSUNION
#include <windows.h>
#include <stdio.h>
#include "wine/test.h"
#include "dsound.h"
@ -785,6 +786,39 @@ static void dsound8_tests()
ok(rc==DS_OK,"DirectSoundEnumerateA() failed: %s\n",DXGetErrorString8(rc));
}
const char * get_file_version(const char * file_name)
{
static char version[32];
DWORD size;
DWORD handle;
size = GetFileVersionInfoSizeA("dsound.dll", &handle);
if (size) {
char * data = HeapAlloc(GetProcessHeap(), 0, size);
if (data) {
if (GetFileVersionInfoA("dsound.dll", handle, size, data)) {
VS_FIXEDFILEINFO *pFixedVersionInfo;
UINT len;
if (VerQueryValueA(data, "\\", (LPLPVOID)&pFixedVersionInfo, &len)) {
sprintf(version, "%ld.%ld.%ld.%ld",
pFixedVersionInfo->dwFileVersionMS >> 16,
pFixedVersionInfo->dwFileVersionMS & 0xffff,
pFixedVersionInfo->dwFileVersionLS >> 16,
pFixedVersionInfo->dwFileVersionLS & 0xffff);
} else
sprintf(version, "not available");
} else
sprintf(version, "failed");
HeapFree(GetProcessHeap(), 0, data);
} else
sprintf(version, "failed");
} else
sprintf(version, "not available");
return version;
}
START_TEST(dsound8)
{
HMODULE hDsound;
@ -797,6 +831,8 @@ START_TEST(dsound8)
return;
}
trace("DLL Version: %s\n", get_file_version("dsound.dll"));
pDirectSoundCreate8 = (void*)GetProcAddress(hDsound, "DirectSoundCreate8");
if (!pDirectSoundCreate8) {
trace("dsound8 test skipped\n");

View File

@ -61,3 +61,4 @@ extern void test_buffer8(LPDIRECTSOUND8,LPDIRECTSOUNDBUFFER,
LPDIRECTSOUND3DLISTENER,BOOL,BOOL);
extern const char * getDSBCAPS(DWORD xmask);
extern int align(int length, int align);
extern const char * get_file_version(const char * file_name);

View File

@ -435,7 +435,9 @@ START_TEST(propset)
trace("dsound.dll not found\n");
return;
}
trace("DLL Version: %s\n", get_file_version("dsound.dll"));
pDirectSoundCreate8 = (void*)GetProcAddress(hDsound, "DirectSoundCreate8");
pDirectSoundCaptureCreate=(void*)GetProcAddress(hDsound,"DirectSoundCaptureCreate");
pDirectSoundCaptureCreate8=(void*)GetProcAddress(hDsound,"DirectSoundCaptureCreate8");