diff --git a/programs/winetest/Makefile.in b/programs/winetest/Makefile.in index 01111f4444b..30d29ff178d 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 user32 gdi32 wsock32 kernel32 +IMPORTS = comctl32 version user32 gdi32 wsock32 kernel32 C_SRCS = \ gui.c \ diff --git a/programs/winetest/main.c b/programs/winetest/main.c index 5d5462ba4ce..54574b16750 100644 --- a/programs/winetest/main.c +++ b/programs/winetest/main.c @@ -62,6 +62,39 @@ static struct rev_info *rev_infos = NULL; static const char whitespace[] = " \t\r\n"; static const char testexe[] = "_test.exe"; +static char * get_file_version(char * file_name) +{ + static char version[32]; + DWORD size; + DWORD handle; + + size = GetFileVersionInfoSizeA(file_name, &handle); + if (size) { + char * data = xmalloc(size); + if (data) { + if (GetFileVersionInfoA(file_name, handle, size, data)) { + static char backslash[] = "\\"; + VS_FIXEDFILEINFO *pFixedVersionInfo; + UINT len; + if (VerQueryValueA(data, backslash, (LPVOID *)&pFixedVersionInfo, &len)) { + sprintf(version, "%d.%d.%d.%d", + pFixedVersionInfo->dwFileVersionMS >> 16, + pFixedVersionInfo->dwFileVersionMS & 0xffff, + pFixedVersionInfo->dwFileVersionLS >> 16, + pFixedVersionInfo->dwFileVersionLS & 0xffff); + } else + sprintf(version, "version not available"); + } else + sprintf(version, "unknown"); + free(data); + } else + sprintf(version, "failed"); + } else + sprintf(version, "version not available"); + + return version; +} + static int running_under_wine (void) { HMODULE module = GetModuleHandleA("ntdll.dll"); @@ -448,6 +481,8 @@ extract_test_proc (HMODULE hModule, LPCTSTR lpszType, } FreeLibrary(dll); + xprintf (" %s=%s\n", dllname, get_file_version(dllname)); + get_subtests( tempdir, &wine_tests[nr_of_files], lpszName ); nr_of_tests += wine_tests[nr_of_files].subtest_count; nr_of_files++;