Restructure repository to include all source folders
Move git root from Client/ to src/ to track all source code: - Client: Game client source (moved to Client/Client/) - Server: Game server source - GameTools: Development tools - CryptoSource: Encryption utilities - database: Database scripts - Script: Game scripts - rylCoder_16.02.2008_src: Legacy coder tools - GMFont, Game: Additional resources 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
#pragma once
|
||||
|
||||
class CDLLModule
|
||||
{
|
||||
public:
|
||||
CDLLModule() : m_hDLL(NULL)
|
||||
{
|
||||
}
|
||||
virtual ~CDLLModule() //destructor, free the library
|
||||
{
|
||||
Release();
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////
|
||||
// See if dll been loaded, returning true dose not mean that all
|
||||
// functions of the dll is valid.
|
||||
BOOL IsLoaded(void)
|
||||
{
|
||||
return m_hDLL != NULL;
|
||||
}
|
||||
|
||||
VOID Release()
|
||||
{
|
||||
if( m_hDLL )
|
||||
::FreeLibrary( m_hDLL );
|
||||
|
||||
m_hDLL = NULL;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
// pure virtual, must implemented in derived class
|
||||
// used macros to generate the implementation
|
||||
virtual BOOL Init( LPCTSTR szDll ) = 0;
|
||||
|
||||
protected:
|
||||
HMODULE m_hDLL;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// macros to implement the Init function
|
||||
#define DECLARE_DLL_FUNCTION(ret, cc, func, params) \
|
||||
ret (cc *func)params;
|
||||
|
||||
#define BEGIN_DLL_INIT() \
|
||||
BOOL Init( LPCTSTR szDll ) \
|
||||
{ \
|
||||
if( m_hDLL ) \
|
||||
::FreeLibrary( m_hDLL ); \
|
||||
m_hDLL = ::LoadLibrary( szDll ); \
|
||||
BOOL bOk = FALSE;
|
||||
|
||||
#define INIT_DLL_TWIN_FUNCTION(ret, cc, func, params, origin) \
|
||||
if( m_hDLL ) { \
|
||||
func = (ret (cc* )params) GetProcAddress( m_hDLL, origin ); \
|
||||
} else \
|
||||
func = NULL; \
|
||||
if( func ) \
|
||||
bOk = TRUE;
|
||||
|
||||
#define END_DLL_INIT() \
|
||||
return bOk; \
|
||||
}
|
||||
|
||||
#define INIT_DLL_FUNCTION(ret, cc, func, params) \
|
||||
if( m_hDLL ) { \
|
||||
func = (ret (cc* )params)GetProcAddress( m_hDLL, #func ); \
|
||||
} else \
|
||||
func = NULL; \
|
||||
if( func ) \
|
||||
bOk = TRUE;
|
||||
|
||||
Reference in New Issue
Block a user