aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKostas Nakos2007-10-28 17:53:52 +0000
committerKostas Nakos2007-10-28 17:53:52 +0000
commit10462134804bae828d98b79872bbe4648fdff3ed (patch)
treed3bdeaebef373905aa6581d12a8a7c3b3e476499
parentb93f68405b3c2b3c0aa20d265749d070045d387f (diff)
downloadscummvm-rg350-10462134804bae828d98b79872bbe4648fdff3ed.tar.gz
scummvm-rg350-10462134804bae828d98b79872bbe4648fdff3ed.tar.bz2
scummvm-rg350-10462134804bae828d98b79872bbe4648fdff3ed.zip
unicod-ify syscalls for ce backend
svn-id: r29299
-rw-r--r--backends/plugins/win32/win32-provider.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/backends/plugins/win32/win32-provider.cpp b/backends/plugins/win32/win32-provider.cpp
index b340c23709..06855e16bb 100644
--- a/backends/plugins/win32/win32-provider.cpp
+++ b/backends/plugins/win32/win32-provider.cpp
@@ -37,12 +37,28 @@
class Win32Plugin : public DynamicPlugin {
+private:
+ static const TCHAR* toUnicode(const char *x) {
+ #ifndef _WIN32_WCE
+ return (const TCHAR *)x;
+ #else
+ static TCHAR unicodeString[MAX_PATH];
+ MultiByteToWideChar(CP_ACP, 0, x, strlen(x) + 1, unicodeString, sizeof(unicodeString) / sizeof(TCHAR));
+ return unicodeString;
+ #endif
+ }
+
+
protected:
void *_dlHandle;
Common::String _filename;
virtual VoidFunc findSymbol(const char *symbol) {
+ #ifndef _WIN32_WCE
void *func = (void *)GetProcAddress((HMODULE)_dlHandle, symbol);
+ #else
+ void *func = (void *)GetProcAddress((HMODULE)_dlHandle, toUnicode(symbol));
+ #endif
if (!func)
warning("Failed loading symbol '%s' from plugin '%s'", symbol, _filename.c_str());
@@ -62,10 +78,14 @@ public:
bool loadPlugin() {
assert(!_dlHandle);
+ #ifndef _WIN32_WCE
_dlHandle = LoadLibrary(_filename.c_str());
+ #else
+ _dlHandle = LoadLibrary(toUnicode(_filename.c_str()));
+ #endif
if (!_dlHandle) {
- warning("Failed loading plugin '%s'", _filename.c_str());
+ warning("Failed loading plugin '%s' (error code %d)", _filename.c_str(), GetLastError());
return false;
}