summaryrefslogtreecommitdiff
path: root/jvmfwk
diff options
context:
space:
mode:
authorAriel Constenla-Haile <arielch@apache.org>2012-09-21 17:08:44 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-05-29 12:58:47 +0100
commit37ca14359b8c4027f1d9f9569ddfa2740cd2731e (patch)
tree7522996308c7920f73633e80b856c0f5ee63a5ed /jvmfwk
parent33c2427824ac893b15777527b818ec99c78c61dd (diff)
Related: #i119525# List only JREs whose jvm library can be loaded
(cherry picked from commit 0b31fa19e50d8259d3cbe695723ea02e2c5ff711) Change-Id: I1f96c6239d7278c4eb0c17b69f9d35e08eb8260b
Diffstat (limited to 'jvmfwk')
-rw-r--r--jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
index 6fa931d44eb7..b1cd72231d64 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
@@ -19,6 +19,9 @@
#include "osl/file.hxx"
+#include "osl/diagnose.h"
+#include "osl/module.hxx"
+#include "osl/thread.hxx"
#include "vendorbase.hxx"
#include "util.hxx"
@@ -158,6 +161,25 @@ bool VendorBase::initialize(vector<pair<OUString, OUString> > props)
if (!bRt)
return false;
+#if defined(WNT)
+ oslModule moduleRt = 0;
+ rtl::OUString sRuntimeLib;
+ if( File::getSystemPathFromFileURL( m_sRuntimeLibrary, sRuntimeLib ) == File::E_None )
+ {
+ if ( ( moduleRt = osl_loadModule( sRuntimeLib.pData, SAL_LOADMODULE_DEFAULT ) ) == 0 )
+ {
+ OSL_TRACE( "jfw_plugin::VendorBase::initialize - cannot load library %s",
+ rtl::OUStringToOString( sRuntimeLib, osl_getThreadTextEncoding() ).getStr() );
+ return false;
+ }
+ else
+ {
+ // do not leave the module loaded!
+ osl_unloadModule( moduleRt );
+ }
+ }
+#endif
+
// init m_sLD_LIBRARY_PATH
OSL_ASSERT(!m_sHome.isEmpty());
size = 0;