separate GPUModel and WineVer, plus a little cleanup

This commit is contained in:
somewhatlurker
2020-08-01 01:09:55 +10:00
parent fb902802f3
commit 2c3fe62372
4 changed files with 104 additions and 71 deletions
@@ -0,0 +1,29 @@
/*
Simple header for detecting version of Wine
*/
namespace WineVer
{
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <windows.h>
#include <string>
#include <stdio.h>
#pragma comment(lib, "advapi32")
std::string getWineVer()
{
HMODULE hntdll = LoadLibraryW(L"ntdll.dll");
if (hntdll == NULL)
return "";
char*(WINAPI * wine_get_version)() = (char*(WINAPI*)())GetProcAddress(hntdll, "wine_get_version");
if (wine_get_version)
{
//puts("Wine detected.");
//printf("Running on Wine... %s\n", wine_get_version());
return std::string(wine_get_version());
}
return "";
}
}