EgtExchange 2.5e5 :

- migliorato controllo gestione chiave di rete.
This commit is contained in:
DarioS
2023-05-30 10:25:16 +02:00
parent 48a590d27a
commit 8426092c6f
17 changed files with 47 additions and 16 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ IBeamMgr*
CreateBeamMgr( void)
{
// verifico la chiave e le opzioni
if ( ! TestKeyForEEx( GetEExKey(), KEYOPT_EEX_INPADV, GetEExLogger()))
if ( ! VerifyKey( KEYOPT_EEX_INPADV))
return nullptr ;
// creo l'oggetto
return static_cast<IBeamMgr*> ( new(nothrow) BeamMgr) ;
+3 -2
View File
@@ -1,7 +1,7 @@
//----------------------------------------------------------------------------
// EgalTech 2014-2014
// EgalTech 2014-2023
//----------------------------------------------------------------------------
// File : DllMain.h Data : 04.04.14 Versione : 1.5d1
// File : DllMain.h Data : 30.05.23 Versione : 2.5e5
// Contenuto : Prototipi funzioni per uso locale della DLL.
//
//
@@ -20,3 +20,4 @@
ILogger* GetEExLogger( void) ;
const std::string& GetEExKey( void) ;
bool GetEExNetHwKey( void) ;
bool VerifyKey( int nKeyOpt) ;
+30
View File
@@ -16,6 +16,7 @@
#include "DllMain.h"
#include "/EgtDev/Include/EExDllMain.h"
#include "/EgtDev/Include/EGnGetModuleVer.h"
#include "/EgtDev/Include/EGnGetKeyData.h"
#include "/EgtDev/Include/EgtTrace.h"
//--------------------------- Costanti ----------------------------------------
@@ -118,3 +119,32 @@ GetEExNetHwKey( 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 ( ! GetEExNetHwKey())
nRet = GetKeyOptions( GetEExKey(), KEY_BASELIB_PROD, KEY_BASELIB_VER, KEY_BASELIB_LEV,
nOpt1, nOpt2, nOptExpDays) ;
if ( nRet != KEY_OK && ! EqualNoCase( GetEExKey(), "EExBase")) {
if ( nRet != KEY_OK) {
std::string sErr = "Error on Key (EXC/" + ToString( nRet) + ")" ;
LOG_ERROR( GetEExLogger(), sErr.c_str()) ;
return false ;
}
if ( ( nOpt1 & ( KEYOPT_EEX_INPBASE|KEYOPT_EEX_EXPBASE)) == 0 ||
( nKeyOpt != 0 && ( nOpt1 & nKeyOpt) == 0) ||
nOptExpDays < GetCurrDay()) {
std::string sErr = "Warning on Key (EXC/OPT)" ;
LOG_ERROR( GetEExLogger(), sErr.c_str()) ;
return false ;
}
}
return true ;
}
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -35,7 +35,7 @@ IExport3MF*
CreateExport3MF( void)
{
// verifico la chiave e le opzioni
if ( ! GetEExNetHwKey() && ! TestKeyForEEx( GetEExKey(), KEYOPT_EEX_EXPBASE, GetEExLogger()))
if ( ! VerifyKey( KEYOPT_EEX_EXPBASE))
return nullptr ;
// creo l'oggetto
return static_cast<IExport3MF*> ( new(nothrow) Export3MF) ;
+1 -1
View File
@@ -46,7 +46,7 @@ IExportDxf*
CreateExportDxf( void)
{
// verifico la chiave e le opzioni
if ( ! GetEExNetHwKey() && ! TestKeyForEEx( GetEExKey(), KEYOPT_EEX_EXPBASE, GetEExLogger()))
if ( ! VerifyKey( KEYOPT_EEX_EXPBASE))
return nullptr ;
// creo l'oggetto
return static_cast<IExportDxf*> ( new(nothrow) ExportDxf) ;
+1 -1
View File
@@ -34,7 +34,7 @@ IExportStl*
CreateExportStl( void)
{
// verifico la chiave e le opzioni
if ( ! GetEExNetHwKey() && ! TestKeyForEEx( GetEExKey(), KEYOPT_EEX_EXPBASE, GetEExLogger()))
if ( ! VerifyKey( KEYOPT_EEX_EXPBASE))
return nullptr ;
// creo l'oggetto
return static_cast<IExportStl*> ( new(nothrow) ExportStl) ;
+1 -1
View File
@@ -41,7 +41,7 @@ IExportSvg*
CreateExportSvg( void)
{
// verifico la chiave e le opzioni
if ( ! GetEExNetHwKey() && ! TestKeyForEEx( GetEExKey(), KEYOPT_EEX_EXPBASE, GetEExLogger()))
if ( ! VerifyKey( KEYOPT_EEX_EXPBASE))
return nullptr ;
// creo l'oggetto
return static_cast<IExportSvg*> ( new(nothrow) ExportSvg) ;
+1 -1
View File
@@ -60,7 +60,7 @@ IExportThreeJS*
CreateExportThreeJS( void)
{
// verifico la chiave e le opzioni
if ( ! GetEExNetHwKey() && ! TestKeyForEEx( GetEExKey(), KEYOPT_EEX_EXPBASE, GetEExLogger()))
if ( ! VerifyKey( KEYOPT_EEX_EXPBASE))
return nullptr ;
// creo l'oggetto
return static_cast< IExportThreeJS*> ( new( nothrow) ExportThreeJS) ;
+1 -1
View File
@@ -28,7 +28,7 @@ IImport3MF*
CreateImport3MF( void)
{
// verifico la chiave e le opzioni
if ( ! GetEExNetHwKey() && ! TestKeyForEEx( GetEExKey(), KEYOPT_EEX_INPBASE, GetEExLogger()))
if ( ! VerifyKey( KEYOPT_EEX_INPBASE))
return nullptr ;
// creo l'oggetto
return static_cast<IImport3MF*> ( new( nothrow) Import3MF) ;
+1 -1
View File
@@ -39,7 +39,7 @@ IImportBtl*
CreateImportBtl( void)
{
// verifico la chiave e le opzioni
if ( ! GetEExNetHwKey() && ! TestKeyForEEx( GetEExKey(), KEYOPT_EEX_INPADV, GetEExLogger()))
if ( ! VerifyKey( KEYOPT_EEX_INPADV))
return nullptr ;
// creo l'oggetto
return static_cast<IImportBtl*> ( new(nothrow) ImportBtl) ;
+1 -1
View File
@@ -42,7 +42,7 @@ IImportBtlx*
CreateImportBtlx( void)
{
// verifico la chiave e le opzioni
if ( ! GetEExNetHwKey() && ! TestKeyForEEx( GetEExKey(), KEYOPT_EEX_INPADV, GetEExLogger()))
if ( ! VerifyKey( KEYOPT_EEX_INPADV))
return nullptr ;
// creo l'oggetto
return static_cast<IImportBtlx*> ( new(nothrow) ImportBtlx) ;
+1 -1
View File
@@ -53,7 +53,7 @@ IImportCnc*
CreateImportCnc( void)
{
// verifico la chiave e le opzioni
if ( ! GetEExNetHwKey() && ! TestKeyForEEx( GetEExKey(), KEYOPT_EEX_INPBASE, GetEExLogger()))
if ( ! VerifyKey( KEYOPT_EEX_INPBASE))
return nullptr ;
// creo l'oggetto
return static_cast<IImportCnc*> ( new(nothrow) ImportCnc) ;
+1 -1
View File
@@ -62,7 +62,7 @@ IImportCsf*
CreateImportCsf( void)
{
// verifico la chiave e le opzioni
if ( ! GetEExNetHwKey() && ! TestKeyForEEx( GetEExKey(), KEYOPT_EEX_INPBASE, GetEExLogger()))
if ( ! VerifyKey( KEYOPT_EEX_INPBASE))
return nullptr ;
// creo l'oggetto
return static_cast<IImportCsf*> ( new(nothrow) ImportCsf) ;
+1 -1
View File
@@ -30,7 +30,7 @@ IImportDxf*
CreateImportDxf( void)
{
// verifico la chiave e le opzioni
if ( ! GetEExNetHwKey() && ! TestKeyForEEx( GetEExKey(), KEYOPT_EEX_INPBASE, GetEExLogger()))
if ( ! VerifyKey( KEYOPT_EEX_INPBASE))
return nullptr ;
// creo l'oggetto
return static_cast<IImportDxf*> ( new(nothrow) ImportDxf) ;
+1 -1
View File
@@ -28,7 +28,7 @@ IImportPnt*
CreateImportPnt( void)
{
// verifico la chiave e le opzioni
if ( ! GetEExNetHwKey() && ! TestKeyForEEx( GetEExKey(), KEYOPT_EEX_INPBASE, GetEExLogger()))
if ( ! VerifyKey( KEYOPT_EEX_INPBASE))
return nullptr ;
// creo l'oggetto
return static_cast<IImportPnt*> ( new(nothrow) ImportPnt) ;
+1 -1
View File
@@ -34,7 +34,7 @@ IImportStl*
CreateImportStl( void)
{
// verifico la chiave e le opzioni
if ( ! GetEExNetHwKey() && ! TestKeyForEEx( GetEExKey(), KEYOPT_EEX_INPBASE, GetEExLogger()))
if ( ! VerifyKey( KEYOPT_EEX_INPBASE))
return nullptr ;
// creo l'oggetto
return static_cast<IImportStl*> ( new(nothrow) ImportStl) ;