Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArun Thondapu2015-01-27 17:27:21 +0000
committerArun Thondapu2015-01-27 17:31:17 +0000
commite2c7e75a3c7029bdfdb129c0ff7ed68edfe36677 (patch)
tree96d7eb367638dd86ec0b355fb064958488001437 /features/org.eclipse.equinox.executable.feature/library/win32/eclipseWin.c
parent1aea8dc45282dc32e96608c465c30761feb1d268 (diff)
downloadrt.equinox.framework-e2c7e75a3c7029bdfdb129c0ff7ed68edfe36677.tar.gz
rt.equinox.framework-e2c7e75a3c7029bdfdb129c0ff7ed68edfe36677.tar.xz
rt.equinox.framework-e2c7e75a3c7029bdfdb129c0ff7ed68edfe36677.zip
Bug 458558 - [1.9] --launcher.XXMaxPermSize should not pass
-XX:MaxPermSize= for Oracle VMs >= 8 Change-Id: If930c83b63af879e0edd31713f9bcc75a62efa87 Signed-off-by: Arun Thondapu <arunkumar.thondapu@in.ibm.com>
Diffstat (limited to 'features/org.eclipse.equinox.executable.feature/library/win32/eclipseWin.c')
-rw-r--r--features/org.eclipse.equinox.executable.feature/library/win32/eclipseWin.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/features/org.eclipse.equinox.executable.feature/library/win32/eclipseWin.c b/features/org.eclipse.equinox.executable.feature/library/win32/eclipseWin.c
index e93388257..cd8806732 100644
--- a/features/org.eclipse.equinox.executable.feature/library/win32/eclipseWin.c
+++ b/features/org.eclipse.equinox.executable.feature/library/win32/eclipseWin.c
@@ -78,6 +78,7 @@ typedef struct {
} TRANSLATIONS;
#define COMPANY_NAME_KEY _T_ECLIPSE("\\StringFileInfo\\%04x%04x\\CompanyName")
+#define PRODUCT_VERSION_KEY _T_ECLIPSE("\\StringFileInfo\\%04x%04x\\ProductVersion")
#define SUN_MICROSYSTEMS _T_ECLIPSE("Sun Microsystems")
#define ORACLE _T_ECLIPSE("Oracle")
@@ -584,9 +585,9 @@ int isMaxPermSizeVM( _TCHAR * javaVM, _TCHAR * jniLib ) {
DWORD handle;
void * info;
- _TCHAR * key, *value;
+ _TCHAR *key, *value, *versionKey, *version;
size_t i;
- int valueSize;
+ int valueSize, versionSize;
if (vm == NULL)
return 0;
@@ -598,22 +599,25 @@ int isMaxPermSizeVM( _TCHAR * javaVM, _TCHAR * jniLib ) {
TRANSLATIONS * translations;
int translationsSize;
VerQueryValue(info, _T_ECLIPSE("\\VarFileInfo\\Translation"), (void *) &translations, &translationsSize);
-
+
/* this size is only right because %04x is 4 characters */
- key = malloc( (_tcslen(COMPANY_NAME_KEY) + 1) * sizeof(_TCHAR));
+ key = malloc((_tcslen(COMPANY_NAME_KEY) + 1) * sizeof(_TCHAR));
+ versionKey = malloc((_tcslen(PRODUCT_VERSION_KEY) + 1) * sizeof(_TCHAR));
for (i = 0; i < (translationsSize / sizeof(TRANSLATIONS)); i++) {
_stprintf(key, COMPANY_NAME_KEY, translations[i].language, translations[i].codepage);
-
VerQueryValue(info, key, (void *)&value, &valueSize);
- if (_tcsncmp(value, SUN_MICROSYSTEMS, _tcslen(SUN_MICROSYSTEMS)) == 0) {
- result = 1;
- break;
- } else if (_tcsncmp(value, ORACLE, _tcslen(ORACLE)) == 0) {
- result = 1;
+
+ if ((_tcsncmp(value, SUN_MICROSYSTEMS, _tcslen(SUN_MICROSYSTEMS)) == 0) || (_tcsncmp(value, ORACLE, _tcslen(ORACLE)) == 0)) {
+ _stprintf(versionKey, PRODUCT_VERSION_KEY, translations[i].language, translations[i].codepage);
+ VerQueryValue(info, versionKey, (void *)&version, &versionSize);
+ if ((version[0] - '0') < 8) {
+ result = 1;
+ }
break;
}
}
free(key);
+ free(versionKey);
}
free(info);
}

Back to the top