winecfg: Also distinguish versions by product type
André Hentschel
nerv at dawncrow.de
Sat Apr 16 06:50:53 CDT 2011
Fixes http://bugs.winehq.org/show_bug.cgi?id=26764
---
programs/winecfg/appdefaults.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/programs/winecfg/appdefaults.c b/programs/winecfg/appdefaults.c
index 452071e..6836ea9 100644
--- a/programs/winecfg/appdefaults.c
+++ b/programs/winecfg/appdefaults.c
@@ -70,11 +70,12 @@ static const struct
static const char szKey9x[] = "Software\\Microsoft\\Windows\\CurrentVersion";
static const char szKeyNT[] = "Software\\Microsoft\\Windows NT\\CurrentVersion";
+static const char szKeyProdNT[] = "System\\CurrentControlSet\\Control\\ProductOptions";
static int get_registry_version(void)
{
int i, best = -1, platform, major, minor = 0, build = 0;
- char *p, *ver;
+ char *p, *ver, *type;
if ((ver = get_reg_key( HKEY_LOCAL_MACHINE, szKeyNT, "CurrentVersion", NULL )))
{
@@ -82,8 +83,10 @@ static int get_registry_version(void)
platform = VER_PLATFORM_WIN32_NT;
- build_str = get_reg_key( HKEY_LOCAL_MACHINE, szKeyNT, "CurrentBuildNumber", NULL );
+ build_str = get_reg_key( HKEY_LOCAL_MACHINE, szKeyNT, "CurrentBuildNumber", NULL );
build = atoi(build_str);
+
+ type = get_reg_key( HKEY_LOCAL_MACHINE, szKeyProdNT, "ProductType", NULL );
}
else if ((ver = get_reg_key( HKEY_LOCAL_MACHINE, szKey9x, "VersionNumber", NULL )))
platform = VER_PLATFORM_WIN32_WINDOWS;
@@ -108,6 +111,7 @@ static int get_registry_version(void)
{
if (win_versions[i].dwPlatformId != platform) continue;
if (win_versions[i].dwMajorVersion != major) continue;
+ if (type && strcmp(win_versions[i].szProductType, type)) continue;
best = i;
if ((win_versions[i].dwMinorVersion == minor) &&
(win_versions[i].dwBuildNumber == build))
@@ -409,7 +413,6 @@ static void on_winver_change(HWND dialog)
}
else /* global version only */
{
- static const char szKeyProdNT[] = "System\\CurrentControlSet\\Control\\ProductOptions";
static const char szKeyWindNT[] = "System\\CurrentControlSet\\Control\\Windows";
static const char szKeyEnvNT[] = "System\\CurrentControlSet\\Control\\Session Manager\\Environment";
char Buffer[40];
--
Best Regards, André Hentschel
More information about the wine-patches
mailing list