summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2012-02-21 15:12:22 +0100
committerJose <jose@zeroc.com>2012-02-21 15:12:22 +0100
commita88c32a39e09573d08d5426e50cdb6bff29ad14b (patch)
tree597ef891b8165bb8458f42e44039d6fb10d002ac /cpp
parentICE-4322 - Use "#pragma once" in Slice files (diff)
downloadice-a88c32a39e09573d08d5426e50cdb6bff29ad14b.tar.bz2
ice-a88c32a39e09573d08d5426e50cdb6bff29ad14b.tar.xz
ice-a88c32a39e09573d08d5426e50cdb6bff29ad14b.zip
ICE-4588 - DynamicLibrary & LoadLibraryW
Diffstat (limited to 'cpp')
-rwxr-xr-xcpp/allTests.py2
-rw-r--r--cpp/include/Ice/DynamicLibrary.h4
-rw-r--r--cpp/src/Ice/DynamicLibrary.cpp10
-rw-r--r--cpp/src/Ice/PluginManagerI.cpp3
-rw-r--r--cpp/src/IceBox/ServiceManagerI.cpp5
5 files changed, 15 insertions, 9 deletions
diff --git a/cpp/allTests.py b/cpp/allTests.py
index 7e3c813e710..79e2904ab1b 100755
--- a/cpp/allTests.py
+++ b/cpp/allTests.py
@@ -55,7 +55,7 @@ tests = [
("Ice/checksum", ["core"]),
("Ice/stream", ["core"]),
("Ice/hold", ["core"]),
- ("Ice/custom", ["core", "novc6"]),
+ ("Ice/custom", ["core", "novc6", "nossl"]),
("Ice/retry", ["core"]),
("Ice/timeout", ["core"]),
("Ice/background", ["core"]),
diff --git a/cpp/include/Ice/DynamicLibrary.h b/cpp/include/Ice/DynamicLibrary.h
index aa4f8171f50..1bdbd3b55e7 100644
--- a/cpp/include/Ice/DynamicLibrary.h
+++ b/cpp/include/Ice/DynamicLibrary.h
@@ -11,6 +11,7 @@
#define ICE_DYNAMIC_LIBRARY_H
#include <Ice/DynamicLibraryF.h>
+#include <Ice/StringConverter.h>
#include <IceUtil/Shared.h>
namespace IceInternal
@@ -20,7 +21,7 @@ class ICE_API DynamicLibrary : public ::IceUtil::Shared
{
public:
- DynamicLibrary();
+ DynamicLibrary(const Ice::StringConverterPtr&);
~DynamicLibrary();
#ifdef _WIN32
@@ -88,6 +89,7 @@ private:
#endif
std::string _err;
+ const Ice::StringConverterPtr _stringConverter;
};
class ICE_API DynamicLibraryList : public ::IceUtil::Shared
diff --git a/cpp/src/Ice/DynamicLibrary.cpp b/cpp/src/Ice/DynamicLibrary.cpp
index 031d9942fc7..7cefbcebeea 100644
--- a/cpp/src/Ice/DynamicLibrary.cpp
+++ b/cpp/src/Ice/DynamicLibrary.cpp
@@ -9,6 +9,7 @@
#include <Ice/DynamicLibrary.h>
#include <IceUtil/StringUtil.h>
+#include <IceUtil/Unicode.h>
#ifndef _WIN32
# include <dlfcn.h>
@@ -21,8 +22,9 @@ using namespace std;
IceUtil::Shared* IceInternal::upCast(DynamicLibrary* p) { return p; }
IceUtil::Shared* IceInternal::upCast(DynamicLibraryList* p) { return p; }
-IceInternal::DynamicLibrary::DynamicLibrary()
- : _hnd(0)
+IceInternal::DynamicLibrary::DynamicLibrary(const Ice::StringConverterPtr& stringConverter) :
+ _stringConverter(stringConverter),
+ _hnd(0)
{
}
@@ -155,7 +157,7 @@ bool
IceInternal::DynamicLibrary::load(const string& lib)
{
#ifdef _WIN32
- _hnd = LoadLibrary(lib.c_str());
+ _hnd = LoadLibraryW(IceUtil::stringToWstring(nativeToUTF8(_stringConverter, lib)).c_str());
#else
int flags = RTLD_NOW | RTLD_GLOBAL;
@@ -193,7 +195,7 @@ IceInternal::DynamicLibrary::getSymbol(const string& name)
string newName = "_" + name;
symbol_type result = GetProcAddress(_hnd, newName.c_str());
# else
- symbol_type result = GetProcAddress(_hnd,name.c_str());
+ symbol_type result = GetProcAddress(_hnd, name.c_str());
# endif
#else
symbol_type result = dlsym(_hnd, name.c_str());
diff --git a/cpp/src/Ice/PluginManagerI.cpp b/cpp/src/Ice/PluginManagerI.cpp
index 8f705b31ead..48aae7190e7 100644
--- a/cpp/src/Ice/PluginManagerI.cpp
+++ b/cpp/src/Ice/PluginManagerI.cpp
@@ -298,7 +298,6 @@ void
Ice::PluginManagerI::loadPlugin(const string& name, const string& pluginSpec, StringSeq& cmdArgs)
{
assert(_communicator);
-
//
// Separate the entry point from the arguments.
//
@@ -343,7 +342,7 @@ Ice::PluginManagerI::loadPlugin(const string& name, const string& pluginSpec, St
// Load the entry point symbol.
//
PluginPtr plugin;
- DynamicLibraryPtr library = new DynamicLibrary();
+ DynamicLibraryPtr library = new DynamicLibrary(IceInternal::getInstance(_communicator)->initializationData().stringConverter);
DynamicLibrary::symbol_type sym = library->loadEntryPoint(entryPoint);
if(sym == 0)
{
diff --git a/cpp/src/IceBox/ServiceManagerI.cpp b/cpp/src/IceBox/ServiceManagerI.cpp
index f5575d72504..fc760f6c68e 100644
--- a/cpp/src/IceBox/ServiceManagerI.cpp
+++ b/cpp/src/IceBox/ServiceManagerI.cpp
@@ -12,6 +12,8 @@
#include <Ice/Ice.h>
#include <Ice/DynamicLibrary.h>
#include <Ice/SliceChecksums.h>
+#include <Ice/Initialize.h>
+#include <Ice/Instance.h>
#include <IceBox/ServiceManagerI.h>
using namespace Ice;
@@ -591,7 +593,8 @@ IceBox::ServiceManagerI::start(const string& service, const string& entryPoint,
//
// Load the entry point.
//
- IceInternal::DynamicLibraryPtr library = new IceInternal::DynamicLibrary();
+ IceInternal::DynamicLibraryPtr library =
+ new IceInternal::DynamicLibrary(IceInternal::getInstance(_communicator)->initializationData().stringConverter);
IceInternal::DynamicLibrary::symbol_type sym = library->loadEntryPoint(entryPoint, false);
if(sym == 0)
{