EgtGraphics 2.5e5 :

- migliorato controllo gestione chiave di rete.
This commit is contained in:
DarioS
2023-05-30 10:24:50 +02:00
parent 59ddf02887
commit 30b56dbfc8
5 changed files with 37 additions and 12 deletions
+3 -2
View File
@@ -1,7 +1,7 @@
//----------------------------------------------------------------------------
// EgalTech 2013-2013
// EgalTech 2013-2023
//----------------------------------------------------------------------------
// File : DllMain.h Data : 17.02.14 Versione : 1.5b3
// File : DllMain.h Data : 30.05.23 Versione : 2.5e5
// Contenuto : Prototipi funzioni per uso locale della DLL.
//
//
@@ -21,3 +21,4 @@
ILogger* GetEGrLogger( void) ;
const std::string& GetEGrKey( void) ;
bool GetEGrNetHwKey( void) ;
bool VerifyKey( int nKeyOpt) ;
+30 -2
View File
@@ -1,7 +1,7 @@
//----------------------------------------------------------------------------
// EgalTech 2014-2014
// EgalTech 2014-2023
//----------------------------------------------------------------------------
// File : EGrDllMain.cpp Data : 13.02.14 Versione : 1.5b1
// File : EGrDllMain.cpp Data : 30.05.23 Versione : 2.5e
// Contenuto : Inizializzazione della DLL.
//
//
@@ -16,6 +16,7 @@
#include "DllMain.h"
#include "/EgtDev/Include/EGrDllMain.h"
#include "/EgtDev/Include/EGnGetModuleVer.h"
#include "/EgtDev/Include/EGnGetKeyData.h"
#include "/EgtDev/Include/EgtTrace.h"
//--------------------------- Costanti ----------------------------------------
@@ -118,3 +119,30 @@ GetEGrNetHwKey( void)
{
return s_bNetHwKey ;
}
//-----------------------------------------------------------------------------
bool
VerifyKey( int nKeyOpt)
{
// Controllo della licenza
unsigned int nOpt1, nOpt2 ;
int nOptExpDays ;
int nRet = GetEGnKeyOptions( KEY_BASELIB_PROD, KEY_BASELIB_VER, KEY_BASELIB_LEV,
nOpt1, nOpt2, nOptExpDays) ;
if ( ! GetEGrNetHwKey())
nRet = GetKeyOptions( GetEGrKey(), KEY_BASELIB_PROD, KEY_BASELIB_VER, KEY_BASELIB_LEV,
nOpt1, nOpt2, nOptExpDays) ;
if ( nRet != KEY_OK) {
std::string sErr = "Error on Key (GRC/" + ToString( nRet) + ")" ;
LOG_ERROR( GetEGrLogger(), sErr.c_str()) ;
return false ;
}
if ( ( nOpt1 & KEYOPT_EGR_BASE) == 0 ||
( nKeyOpt != 0 && ( nOpt1 & nKeyOpt) == 0) ||
nOptExpDays < GetCurrDay()) {
std::string sErr = "Warning on Key (GRC/OPT)" ;
LOG_ERROR( GetEGrLogger(), sErr.c_str()) ;
return false ;
}
return true ;
}
BIN
View File
Binary file not shown.
+2 -4
View File
@@ -29,10 +29,8 @@ IEgrImageMgr*
CreateEgrImageMgr( void)
{
// verifico la chiave e le opzioni
if ( ! GetEGrNetHwKey()) {
if ( ! TestKeyForEGr( GetEGrKey(), 0, GetEGrLogger()))
return nullptr ;
}
if ( ! VerifyKey( 0))
return nullptr ;
// creo l'oggetto
return static_cast<IEgrImageMgr*> ( new(nothrow) ImageMgr) ;
}
+2 -4
View File
@@ -38,10 +38,8 @@ IEGrScene*
CreateEGrScene( void)
{
// verifico la chiave e le opzioni
if ( ! GetEGrNetHwKey()) {
if ( ! TestKeyForEGr( GetEGrKey(), 0, GetEGrLogger()))
return nullptr ;
}
if ( ! VerifyKey( 0))
return nullptr ;
// creo l'oggetto
return static_cast<IEGrScene*> ( new(nothrow) Scene) ;
}