diff --git a/dlls/dsound/tests/Makefile.in b/dlls/dsound/tests/Makefile.in index b27a2e1ab6e..506ca752ab0 100644 --- a/dlls/dsound/tests/Makefile.in +++ b/dlls/dsound/tests/Makefile.in @@ -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 = \ diff --git a/dlls/dsound/tests/capture.c b/dlls/dsound/tests/capture.c index 7daf86af498..99af19dc80a 100644 --- a/dlls/dsound/tests/capture.c +++ b/dlls/dsound/tests/capture.c @@ -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) diff --git a/dlls/dsound/tests/ds3d.c b/dlls/dsound/tests/ds3d.c index 58715543f69..79d4d1506ef 100644 --- a/dlls/dsound/tests/ds3d.c +++ b/dlls/dsound/tests/ds3d.c @@ -1232,6 +1232,8 @@ START_TEST(ds3d) { CoInitialize(NULL); + trace("DLL Version: %s\n", get_file_version("dsound.dll")); + ds3d_tests(); CoUninitialize(); diff --git a/dlls/dsound/tests/ds3d8.c b/dlls/dsound/tests/ds3d8.c index 823c2f2ce43..d1333c63270 100644 --- a/dlls/dsound/tests/ds3d8.c +++ b/dlls/dsound/tests/ds3d8.c @@ -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"); diff --git a/dlls/dsound/tests/dsound.c b/dlls/dsound/tests/dsound.c index 9aca2dab65a..69e5f9c7f69 100644 --- a/dlls/dsound/tests/dsound.c +++ b/dlls/dsound/tests/dsound.c @@ -926,6 +926,8 @@ START_TEST(dsound) { CoInitialize(NULL); + trace("DLL Version: %s\n", get_file_version("dsound.dll")); + IDirectSound_tests(); dsound_tests(); diff --git a/dlls/dsound/tests/dsound8.c b/dlls/dsound/tests/dsound8.c index 05842eb82c7..569e270ffbf 100644 --- a/dlls/dsound/tests/dsound8.c +++ b/dlls/dsound/tests/dsound8.c @@ -28,6 +28,7 @@ #define NONAMELESSSTRUCT #define NONAMELESSUNION #include +#include #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"); diff --git a/dlls/dsound/tests/dsound_test.h b/dlls/dsound/tests/dsound_test.h index 3359938f065..9c84de44871 100644 --- a/dlls/dsound/tests/dsound_test.h +++ b/dlls/dsound/tests/dsound_test.h @@ -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); diff --git a/dlls/dsound/tests/propset.c b/dlls/dsound/tests/propset.c index e7c7d865cc3..d8b82022ea3 100644 --- a/dlls/dsound/tests/propset.c +++ b/dlls/dsound/tests/propset.c @@ -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");