+#ifdef _WIN32 +static void print_dll_version(const char *file_name) +{ + DWORD size, handle; + bool done = false; + + size = GetFileVersionInfoSizeA(file_name, &handle); + if (size) + { + char *data = malloc(size); + if (GetFileVersionInfoA(file_name, handle, size, data)) { + VS_FIXEDFILEINFO *pFixedVersionInfo; + UINT len; + if (VerQueryValueA(data, "\\", (LPVOID *)&pFixedVersionInfo, &len)) { + trace("%s version: %ld.%ld.%ld.%ld\n", + file_name, + pFixedVersionInfo->dwFileVersionMS >> 16, + pFixedVersionInfo->dwFileVersionMS & 0xffff, + pFixedVersionInfo->dwFileVersionLS >> 16, + pFixedVersionInfo->dwFileVersionLS & 0xffff); + done = true; + } + } + free(data); + } + + if (!done) + trace("%s version: unknown\n", file_name); +} +#endif
This mixes styles, and the most consequential part of that function uses a style that's not the usual vkd3d style at all. Was this perhaps copied a bit too quickly?
Perhaps more significantly, does this work with non-cross Win32 builds of vkd3d? Those builds would link to vkd3d-utils instead of d3dcompiler_47, and while printing the d3dcompiler_47 version anyway in that case might not hurt too much, those builds wouldn't link to the "version" library, right?