From e332e18ce65fdc19495746697c862251f74d6c35 Mon Sep 17 00:00:00 2001 From: John Peterson Date: Thu, 22 Jan 2009 11:18:46 +0000 Subject: nJoy and SerialInterface: Fixed the crashes with MAXPADS more than 1, the downside is that it doesn't work well one the second boot git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1980 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Common/Src/DynamicLibrary.cpp | 77 ++++++++++++++++++------------- 1 file changed, 45 insertions(+), 32 deletions(-) (limited to 'Source/Core/Common/Src/DynamicLibrary.cpp') diff --git a/Source/Core/Common/Src/DynamicLibrary.cpp b/Source/Core/Common/Src/DynamicLibrary.cpp index 04f4072f93..628cf5324b 100644 --- a/Source/Core/Common/Src/DynamicLibrary.cpp +++ b/Source/Core/Common/Src/DynamicLibrary.cpp @@ -15,13 +15,21 @@ // Official SVN repository and contact information can be found at // http://code.google.com/p/dolphin-emu/ -/* -All plugins from Core > Plugins are loaded and unloaded with this class when Dolpin is started -and stopped. +////////////////////////////////////////////////////////////////////////////////////////// +// File description +/* ŻŻŻŻŻŻŻŻŻŻŻŻ + + All plugins from Core > Plugins are loaded and unloaded with this class when Dolpin is started + and stopped. + //////////////////////////////////////*/ -#include + +////////////////////////////////////////////////////////////////////////////////////////// +// Include +// ŻŻŻŻŻŻŻŻŻŻŻŻ +#include // System #ifdef _WIN32 #include #else @@ -29,10 +37,13 @@ and stopped. #include #endif -#include "Common.h" +#include "Common.h" // Local #include "FileUtil.h" #include "StringUtil.h" #include "DynamicLibrary.h" +#include "ConsoleWindow.h" +//////////////////////////////////////// + DynamicLibrary::DynamicLibrary() { @@ -41,33 +52,33 @@ DynamicLibrary::DynamicLibrary() std::string GetLastErrorAsString() { -#ifdef _WIN32 - LPVOID lpMsgBuf = 0; - DWORD error = GetLastError(); - FormatMessage( - FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, - NULL, - error, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language - (LPTSTR) &lpMsgBuf, - 0, NULL); - std::string s; - if (lpMsgBuf) - { - s = ((char *)lpMsgBuf); - LocalFree(lpMsgBuf); - } else { - s = StringFromFormat("(unknown error %08x)", error); - } - return s; -#else - static std::string errstr; - char *tmp = dlerror(); - if (tmp) - errstr = tmp; - - return errstr; -#endif + #ifdef _WIN32 + LPVOID lpMsgBuf = 0; + DWORD error = GetLastError(); + FormatMessage( + FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, + NULL, + error, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language + (LPTSTR) &lpMsgBuf, + 0, NULL); + std::string s; + if (lpMsgBuf) + { + s = ((char *)lpMsgBuf); + LocalFree(lpMsgBuf); + } else { + s = StringFromFormat("(unknown error %08x)", error); + } + return s; + #else + static std::string errstr; + char *tmp = dlerror(); + if (tmp) + errstr = tmp; + + return errstr; + #endif } /* Function: Loading means loading the dll with LoadLibrary() to get an instance to the dll. @@ -93,6 +104,7 @@ int DynamicLibrary::Load(const char* filename) } #ifdef _WIN32 + Console::Print("LoadLibrary: %s\n", filename); library = LoadLibrary(filename); #else library = dlopen(filename, RTLD_NOW | RTLD_LOCAL); @@ -118,6 +130,7 @@ int DynamicLibrary::Unload() } #ifdef _WIN32 + Console::Print("FreeLibrary: %i\n", library); retval = FreeLibrary(library); #else retval = dlclose(library)?0:1; -- cgit v1.2.3