diff options
Diffstat (limited to 'src/libs/7zip/unix/CPP/Windows/DLL.h')
-rw-r--r-- | src/libs/7zip/unix/CPP/Windows/DLL.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/libs/7zip/unix/CPP/Windows/DLL.h b/src/libs/7zip/unix/CPP/Windows/DLL.h new file mode 100644 index 000000000..9b57bec8a --- /dev/null +++ b/src/libs/7zip/unix/CPP/Windows/DLL.h @@ -0,0 +1,48 @@ +// Windows/DLL.h + +#ifndef __WINDOWS_DLL_H +#define __WINDOWS_DLL_H + +#include "../Common/MyString.h" + +typedef void * HMODULE; + +typedef int (*FARPROC)(); + +namespace NWindows { +namespace NDLL { + +class CLibrary +{ + bool LoadOperations(HMODULE newModule); + HMODULE _module; +public: + operator HMODULE() const { return _module; } + HMODULE* operator&() { return &_module; } + + + CLibrary():_module(NULL) {}; + ~CLibrary(); + + bool Free(); + + void Attach(HMODULE m) + { + Free(); + _module = m; + } + HMODULE Detach() + { + HMODULE m = _module; + _module = NULL; + return m; + } + + + bool Load(LPCTSTR fileName); + FARPROC GetProc(LPCSTR procName) const; +}; + +}} + +#endif |