Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Niefer2007-05-16 17:15:12 -0400
committerAndrew Niefer2007-05-16 17:15:12 -0400
commitda0c531afabee43a9a32aa11336dd2e16f232847 (patch)
treecb9d7b75cc04ee03da6fd9c0877144d0f371095d /bundles/org.eclipse.equinox.executable/library/wpf
parentc13d04fe5adf1caf39962bbf257df6332aafc00e (diff)
downloadrt.equinox.framework-da0c531afabee43a9a32aa11336dd2e16f232847.tar.gz
rt.equinox.framework-da0c531afabee43a9a32aa11336dd2e16f232847.tar.xz
rt.equinox.framework-da0c531afabee43a9a32aa11336dd2e16f232847.zip
Diffstat (limited to 'bundles/org.eclipse.equinox.executable/library/wpf')
-rw-r--r--bundles/org.eclipse.equinox.executable/library/wpf/eclipseWpf.cpp46
-rw-r--r--bundles/org.eclipse.equinox.executable/library/wpf/make_wpf.mak2
2 files changed, 47 insertions, 1 deletions
diff --git a/bundles/org.eclipse.equinox.executable/library/wpf/eclipseWpf.cpp b/bundles/org.eclipse.equinox.executable/library/wpf/eclipseWpf.cpp
index 94328c761..390cb14a3 100644
--- a/bundles/org.eclipse.equinox.executable/library/wpf/eclipseWpf.cpp
+++ b/bundles/org.eclipse.equinox.executable/library/wpf/eclipseWpf.cpp
@@ -64,6 +64,14 @@ static const _TCHAR* jvmLocations [] = { _T("j9vm"), _T("..\\jre\\bin\\j9vm"),
_T("classic"), _T("..\\jre\\bin\\classic"),
_T("jrockit"), _T("..\\jre\\bin\\jrockit"),
NULL };
+/* for detecting sun vms */
+typedef struct {
+ WORD language;
+ WORD codepage;
+} TRANSLATIONS;
+
+#define COMPANY_NAME_KEY _T_ECLIPSE("\\StringFileInfo\\%04x%04x\\CompanyName")
+#define SUN_MICROSYSTEMS _T_ECLIPSE("Sun Microsystems")
delegate void NoArgsHandler ();
@@ -513,4 +521,42 @@ int startJavaVM( _TCHAR* libPath, _TCHAR* vmArgs[], _TCHAR* progArgs[] )
return startJavaJNI(libPath, vmArgs, progArgs);
}
+int isSunVM( _TCHAR * vm ) {
+ int result = 0;
+ DWORD infoSize;
+ DWORD handle;
+ void * info;
+
+ _TCHAR * key, *value;
+ int i, valueSize;
+
+ if (vm == NULL)
+ return 0;
+
+ infoSize = GetFileVersionInfoSize(vm, &handle);
+ if (infoSize > 0) {
+ info = malloc(infoSize);
+ if (GetFileVersionInfo(vm, 0, infoSize, info)) {
+ TRANSLATIONS * translations;
+ int translationsSize;
+ VerQueryValue(info, _T_ECLIPSE("\\VarFileInfo\\Translation"), (LPVOID *) &translations, (PUINT)&translationsSize);
+
+ /* this size is only right because %04x is 4 characters */
+ key = (_TCHAR *) malloc( (_tcslen(COMPANY_NAME_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, (LPVOID *)&value, (PUINT)&valueSize);
+ if (_tcsncmp(value, SUN_MICROSYSTEMS, _tcslen(SUN_MICROSYSTEMS)) == 0) {
+ result = 1;
+ break;
+ }
+ }
+ free(key);
+ }
+ free(info);
+ }
+ return result;
+}
+
} // extern "C"
diff --git a/bundles/org.eclipse.equinox.executable/library/wpf/make_wpf.mak b/bundles/org.eclipse.equinox.executable/library/wpf/make_wpf.mak
index aa548cb62..2afca3cab 100644
--- a/bundles/org.eclipse.equinox.executable/library/wpf/make_wpf.mak
+++ b/bundles/org.eclipse.equinox.executable/library/wpf/make_wpf.mak
@@ -31,7 +31,7 @@ COMMON_OBJS = eclipseConfig.obj eclipseCommon.obj eclipseWpfCommon.obj
DLL_OBJS = eclipse.obj eclipseWpf.obj eclipseUtil.obj eclipseJNI.obj eclipseShm.obj
LIBS = kernel32.lib msvcrt.lib mscoree.lib
-DLL_LIBS = kernel32.lib Advapi32.lib msvcrt.lib
+DLL_LIBS = kernel32.lib Advapi32.lib msvcrt.lib version.lib
LFLAGS = -CLRTHREADATTRIBUTE:STA /NODEFAULTLIB:LIBCMT /INCREMENTAL:NO /RELEASE /NOLOGO -subsystem:windows,4.0 -entry:wmainCRTStartup
CONSOLEFLAGS = -CLRTHREADATTRIBUTE:STA /NODEFAULTLIB:LIBCMT /INCREMENTAL:NO /RELEASE /NOLOGO -subsystem:console,4.0 -entry:wmainCRTStartup
DLL_LFLAGS = -CLRTHREADATTRIBUTE:STA /NODEFAULTLIB:LIBCMT /INCREMENTAL:NO /PDB:NONE -dll /BASE:0x10000000 /DLL

Back to the top