--- /dev/null
+#ifndef MSP_CORE_MODULE_H_
+#define MSP_CORE_MODULE_H_
+
+#include <string>
+
+namespace Msp {
+
+class Module
+{
+private:
+ struct Private;
+
+ Private *priv;
+
+public:
+ Module(const std::string &);
+ ~Module();
+
+ void *get_symbol(const std::string &) const;
+};
+
+} // namespace Msp
+
+#endif
--- /dev/null
+#ifndef MSP_CORE_MODULE_PRIVATE_H_
+#define MSP_CORE_MODULE_PRIVATE_H_
+
+#include "module.h"
+#include "module_platform.h"
+
+namespace Msp {
+
+struct Module::Private
+{
+ ModuleHandle handle;
+};
+
+} // namespace Msp
+
+#endif
--- /dev/null
+#include <dlfcn.h>
+#include "module.h"
+#include "module_private.h"
+#include "systemerror.h"
+
+using namespace std;
+
+namespace Msp {
+
+Module::Module(const string &name)
+{
+ ModuleHandle handle = dlopen(name.c_str(), RTLD_NOW);
+ if(!handle)
+ throw system_error("dlopen", dlerror());
+
+ priv = new Private;
+ priv->handle = handle;
+}
+
+Module::~Module()
+{
+ dlclose(priv->handle);
+ delete priv;
+}
+
+void *Module::get_symbol(const string &name) const
+{
+ dlerror();
+ void *result = dlsym(priv->handle, name.c_str());
+ if(!result)
+ {
+ const char *err = dlerror();
+ if(err)
+ throw system_error("dlsym", err);
+ }
+
+ return result;
+}
+
+} // namespace Msp
--- /dev/null
+#ifndef MSP_CORE_MODULE_PLATFORM_H_
+#define MSP_CORE_MODULE_PLATFORM_H_
+
+namespace Msp {
+
+typedef void *ModuleHandle;
+
+} // namespace Msp
+
+#endif
--- /dev/null
+#include "module.h"
+#include "module_private.h"
+#include "systemerror.h"
+
+using namespace std;
+
+namespace Msp {
+
+Module::Module(const string &name)
+{
+ ModuleHandle handle = LoadLibrary(name.c_str());
+ if(!handle)
+ throw system_error("LoadLibrary");
+
+ priv = new Private;
+ priv->handle = handle;
+}
+
+Module::~Module()
+{
+ FreeLibrary(priv->handle);
+ delete priv;
+}
+
+void *Module::get_symbol(const string &name) const
+{
+ FARPROC result = GetProcAddress(priv->handle, name.c_str());
+ if(!result)
+ throw system_error("GetProcAddress");
+
+ return reinterpret_cast<void *>(result);
+}
+
+} // namespace Msp
--- /dev/null
+#ifndef MSP_CORE_MODULE_PLATFORM_H_
+#define MSP_CORE_MODULE_PLATFORM_H_
+
+#include <windows.h>
+
+namespace Msp {
+
+typedef HMODULE ModuleHandle;
+
+} // namespace Msp;
+
+#endif