improve win version logging
This commit is contained in:
parent
d3dbab102f
commit
cd3a52363b
1 changed files with 19 additions and 7 deletions
26
src/debug.c
26
src/debug.c
|
@ -217,33 +217,45 @@ void dbg_init()
|
||||||
|
|
||||||
TRACE("cnc-ddraw = %p\n", g_ddraw_module);
|
TRACE("cnc-ddraw = %p\n", g_ddraw_module);
|
||||||
|
|
||||||
HKEY hkey;
|
HKEY hkey = NULL;
|
||||||
LONG status =
|
LONG status =
|
||||||
RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", 0L, KEY_READ, &hkey);
|
RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", 0L, KEY_READ, &hkey);
|
||||||
|
|
||||||
|
HKEY hkey9x = NULL;
|
||||||
|
LONG status9x =
|
||||||
|
RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion", 0L, KEY_READ, &hkey9x);
|
||||||
|
|
||||||
if (status == ERROR_SUCCESS)
|
if (status == ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
char name[256] = { 0 };
|
char name[256] = { 0 };
|
||||||
DWORD name_size = sizeof(name);
|
DWORD name_size = sizeof(name);
|
||||||
RegQueryValueExA(hkey, "ProductName", NULL, NULL, (PVOID)&name, &name_size);
|
if (RegQueryValueExA(hkey, "ProductName", NULL, NULL, (PVOID)&name, &name_size) != ERROR_SUCCESS && hkey9x)
|
||||||
|
{
|
||||||
|
RegQueryValueExA(hkey9x, "ProductName", NULL, NULL, (PVOID)&name, &name_size);
|
||||||
|
}
|
||||||
|
|
||||||
char dversion[256] = { 0 };
|
char vers[256] = { 0 };
|
||||||
DWORD dversion_size = sizeof(dversion);
|
DWORD vers_size = sizeof(vers);
|
||||||
RegQueryValueExA(hkey, "DisplayVersion", NULL, NULL, (PVOID)&dversion, &dversion_size);
|
if (RegQueryValueExA(hkey, "DisplayVersion", NULL, NULL, (PVOID)&vers, &vers_size) != ERROR_SUCCESS && hkey9x)
|
||||||
|
{
|
||||||
|
RegQueryValueExA(hkey9x, "VersionNumber", NULL, NULL, (PVOID)&vers, &vers_size);
|
||||||
|
}
|
||||||
|
|
||||||
char build[256] = { 0 };
|
char build[256] = { 0 };
|
||||||
DWORD build_size = sizeof(build);
|
DWORD build_size = sizeof(build);
|
||||||
if (RegQueryValueExA(hkey, "BuildLabEx", NULL, NULL, (PVOID)&build, &build_size) != ERROR_SUCCESS)
|
if (RegQueryValueExA(hkey, "BuildLabEx", NULL, NULL, (PVOID)&build, &build_size) != ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
build_size = sizeof(build);
|
|
||||||
RegQueryValueExA(hkey, "BuildLab", NULL, NULL, (PVOID)&build, &build_size);
|
RegQueryValueExA(hkey, "BuildLab", NULL, NULL, (PVOID)&build, &build_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE("%s %s (%s)\n", name, dversion, build);
|
TRACE("%s %s (%s)\n", name, vers, build);
|
||||||
|
|
||||||
RegCloseKey(hkey);
|
RegCloseKey(hkey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (status9x == ERROR_SUCCESS)
|
||||||
|
RegCloseKey(hkey9x);
|
||||||
|
|
||||||
if (IsWine())
|
if (IsWine())
|
||||||
{
|
{
|
||||||
TRACE("Wine version = %s\n", verhelp_wine_get_version());
|
TRACE("Wine version = %s\n", verhelp_wine_get_version());
|
||||||
|
|
Loading…
Reference in a new issue