EgtExecutor :

- modifiche per caricare le dll opzionali solo se codici chiave le abilitano.
This commit is contained in:
Dario Sassi
2015-05-26 15:51:48 +00:00
parent 785c9add4b
commit 136557b6c2
8 changed files with 65 additions and 19 deletions
+15 -2
View File
@@ -13,7 +13,9 @@
//--------------------------- Include ----------------------------------------
#include "stdafx.h"
#include "EXE.h"
#include "DllMachKernel.h"
#include "/EgtDev/Include/EMkDllMain.h"
#define NOMINMAX
#include <windows.h>
@@ -42,14 +44,25 @@ HMODULE s_hEMk = nullptr ;
//-----------------------------------------------------------------------------
bool
LoadMachKernelDll( void)
LoadMachKernelDll( ILogger* pLogger, const string& sKey)
{
// verifico la chiave
if ( ! TestKeyForEMk( sKey, 0, pLogger)) {
FreeMachKernelDll() ;
return false ;
}
// se già caricata
if ( s_hEMk != nullptr)
return true ;
// carico la libreria EgtMachKernel
s_hEMk = LoadLibrary( EMK_NAME) ;
return ( s_hEMk != nullptr) ;
if ( s_hEMk == nullptr)
return false ;
// imposto logger
MySetEMkLogger( pLogger) ;
// imposto i codici della chiave
MySetEMkKey( sKey) ;
return true ;
}
//-----------------------------------------------------------------------------