From aa17b2b080b42b30a6d12444c78add184a3d8146 Mon Sep 17 00:00:00 2001 From: DarioS Date: Tue, 17 May 2022 08:21:53 +0200 Subject: [PATCH] EgtExecutor 2.4e3 : - modifiche per prima gestione chiave di rete. --- DllExchange.cpp | 20 +++++++++++++++++++- DllExchange.h | 3 ++- DllGraphics.cpp | 20 +++++++++++++++++++- DllGraphics.h | 3 ++- DllMachKernel.cpp | 20 +++++++++++++++++++- DllMachKernel.h | 3 ++- EXE_General.cpp | 18 ++++++++++++++---- EgtExecutor.rc | Bin 18890 -> 18890 bytes 8 files changed, 77 insertions(+), 10 deletions(-) diff --git a/DllExchange.cpp b/DllExchange.cpp index 45e7a90..662cb30 100644 --- a/DllExchange.cpp +++ b/DllExchange.cpp @@ -38,6 +38,7 @@ using namespace std ; static const char* EEX_SETEEXLOGGER = "SetEExLogger" ; static const char* EEX_GETEEXVERSION = "GetEExVersion" ; static const char* EEX_SETEEXKEY = "SetEExKey" ; +static const char* EEX_SETEEXNETHWKEY = "SetEExNetHwKey" ; static const char* EEX_SETBTLAUXDIR = "SetBtlAuxDir" ; static const char* EEX_CREATEBEAMMGR = "CreateBeamMgr" ; static const char* EEX_CREATEIMPORTBTL = "CreateImportBtl" ; @@ -60,7 +61,7 @@ HMODULE s_hEEx = nullptr ; //----------------------------------------------------------------------------- bool -LoadExchangeDll( ILogger* pLogger, const string& sKey) +LoadExchangeDll( ILogger* pLogger, const string& sKey, bool bNetHwKey) { // verifico la chiave if ( ! TestKeyForEEx( sKey, 0, pLogger)) { @@ -78,6 +79,8 @@ LoadExchangeDll( ILogger* pLogger, const string& sKey) MySetEExLogger( pLogger) ; // imposto i codici della chiave MySetEExKey( sKey) ; + // imposto eventuale chiave di rete + MySetEExNetHwKey( bNetHwKey) ; return true ; } @@ -146,6 +149,21 @@ MySetEExKey( const string& sKey) pFun( sKey) ; } +//----------------------------------------------------------------------------- +void +MySetEExNetHwKey( bool bNetHwKey) +{ + // verifico caricamento libreria EgtGraphics + if ( s_hEEx == nullptr) + return ; + // recupero funzione che imposta il flag per chiave di rete + typedef void (* PF_SetEExNetHwKey) ( bool bNetHwKey) ; + PF_SetEExNetHwKey pFun = (PF_SetEExNetHwKey)GetProcAddress( s_hEEx, EEX_SETEEXNETHWKEY) ; + if ( pFun == nullptr) + return ; + pFun( bNetHwKey) ; +} + //----------------------------------------------------------------------------- bool MySetBtlAuxDir( const string& sBtlAuxDir) diff --git a/DllExchange.h b/DllExchange.h index 382f3ae..3c87070 100644 --- a/DllExchange.h +++ b/DllExchange.h @@ -32,11 +32,12 @@ class IExportSvg ; class IExcExecutor ; //---------------------------------------------------------------------------- -bool LoadExchangeDll( ILogger* pLogger, const std::string& sKey) ; +bool LoadExchangeDll( ILogger* pLogger, const std::string& sKey, bool bNetHwKey) ; bool FreeExchangeDll( void) ; bool IsLoadedExchangeDll( void) ; void MySetEExLogger( ILogger* pLogger) ; void MySetEExKey( const std::string& sKey) ; +void MySetEExNetHwKey( bool bNetHwKey) ; const char* MyGetEExVersion( void) ; bool MySetBtlAuxDir( const std::string& sBtlAuxDir) ; IBeamMgr* MyCreateBeamMgr( void) ; diff --git a/DllGraphics.cpp b/DllGraphics.cpp index 0a7660e..a1e2e99 100644 --- a/DllGraphics.cpp +++ b/DllGraphics.cpp @@ -36,6 +36,7 @@ using namespace std ; static const char* EGR_SETEGRLOGGER = "SetEGrLogger" ; static const char* EGR_GETEGRVERSION = "GetEGrVersion" ; static const char* EGR_SETEGRKEY = "SetEGrKey" ; +static const char* EGR_SETEGRNETHWKEY = "SetEGrNetHwKey" ; static const char* EGR_CREATEEGRSCENE = "CreateEGrScene" ; static const char* EGR_CREATESCEEXECUTOR = "CreateSceExecutor" ; static const char* EGR_CREATEEGRIMAGEMGR = "CreateEgrImageMgr" ; @@ -46,7 +47,7 @@ HMODULE s_hEGr = nullptr ; //----------------------------------------------------------------------------- bool -LoadGraphicsDll( ILogger* pLogger, const string& sKey) +LoadGraphicsDll( ILogger* pLogger, const string& sKey, bool bNetHwKey) { // verifico la chiave if ( ! TestKeyForEGr( sKey, 0, pLogger)) { @@ -64,6 +65,8 @@ LoadGraphicsDll( ILogger* pLogger, const string& sKey) MySetEGrLogger( pLogger) ; // imposto i codici della chiave MySetEGrKey( sKey) ; + // imposto eventuale chiave di rete + MySetEGrNetHwKey( bNetHwKey) ; return true ; } @@ -132,6 +135,21 @@ MySetEGrKey( const string& sKey) pFun( sKey) ; } +//----------------------------------------------------------------------------- +void +MySetEGrNetHwKey( bool bNetHwKey) +{ + // verifico caricamento libreria EgtGraphics + if ( s_hEGr == nullptr) + return ; + // recupero funzione che imposta il flag per chiave di rete + typedef void (* PF_SetEGrNetHwKey) ( bool bNetHwKey) ; + PF_SetEGrNetHwKey pFun = (PF_SetEGrNetHwKey)GetProcAddress( s_hEGr, EGR_SETEGRNETHWKEY) ; + if ( pFun == nullptr) + return ; + pFun( bNetHwKey) ; +} + //----------------------------------------------------------------------------- IEGrScene* MyCreateEGrScene( void) diff --git a/DllGraphics.h b/DllGraphics.h index a2eadf7..26f5a1a 100644 --- a/DllGraphics.h +++ b/DllGraphics.h @@ -21,11 +21,12 @@ class ISceExecutor ; class IEgrImageMgr ; //---------------------------------------------------------------------------- -bool LoadGraphicsDll( ILogger* pLogger, const std::string& sKey) ; +bool LoadGraphicsDll( ILogger* pLogger, const std::string& sKey, bool bNetHwKey) ; bool FreeGraphicsDll( void) ; bool IsLoadedGraphicsDll( void) ; void MySetEGrLogger( ILogger* pLogger) ; void MySetEGrKey( const std::string& sKey) ; +void MySetEGrNetHwKey( bool bNetHwKey) ; const char* MyGetEGrVersion( void) ; IEGrScene* MyCreateEGrScene( void) ; ISceExecutor* MyCreateSceExecutor(void) ; diff --git a/DllMachKernel.cpp b/DllMachKernel.cpp index 038a4d3..dac5133 100644 --- a/DllMachKernel.cpp +++ b/DllMachKernel.cpp @@ -36,6 +36,7 @@ using namespace std ; static const char* EMK_SETEMKLOGGER = "SetEMkLogger" ; static const char* EMK_GETEMKVERSION = "GetEMkVersion" ; static const char* EMK_SETEMKKEY = "SetEMkKey" ; +static const char* EMK_SETEMKNETHWKEY = "SetEMkNetHwKey" ; static const char* EMK_CREATEMACHMGR = "CreateMachMgr" ; @@ -44,7 +45,7 @@ HMODULE s_hEMk = nullptr ; //----------------------------------------------------------------------------- bool -LoadMachKernelDll( ILogger* pLogger, const string& sKey) +LoadMachKernelDll( ILogger* pLogger, const string& sKey, bool bNetHwKey) { // verifico la chiave if ( ! TestKeyForEMk( sKey, 0, pLogger)) { @@ -62,6 +63,8 @@ LoadMachKernelDll( ILogger* pLogger, const string& sKey) MySetEMkLogger( pLogger) ; // imposto i codici della chiave MySetEMkKey( sKey) ; + // imposto eventuale chiave di rete + MySetEMkNetHwKey( bNetHwKey) ; return true ; } @@ -130,6 +133,21 @@ MySetEMkKey( const string& sKey) pFun( sKey) ; } +//----------------------------------------------------------------------------- +void +MySetEMkNetHwKey( bool bNetHwKey) +{ + // verifico caricamento libreria EgtGraphics + if ( s_hEMk == nullptr) + return ; + // recupero funzione che imposta il flag per chiave di rete + typedef void (* PF_SetEMkNetHwKey) ( bool bNetHwKey) ; + PF_SetEMkNetHwKey pFun = (PF_SetEMkNetHwKey)GetProcAddress( s_hEMk, EMK_SETEMKNETHWKEY) ; + if ( pFun == nullptr) + return ; + pFun( bNetHwKey) ; +} + //----------------------------------------------------------------------------- IMachMgr* MyCreateMachMgr( void) diff --git a/DllMachKernel.h b/DllMachKernel.h index 711261a..2819d51 100644 --- a/DllMachKernel.h +++ b/DllMachKernel.h @@ -19,10 +19,11 @@ class ILogger ; class IMachMgr ; //---------------------------------------------------------------------------- -bool LoadMachKernelDll( ILogger* pLogger, const std::string& sKey) ; +bool LoadMachKernelDll( ILogger* pLogger, const std::string& sKey, bool bNetHwKey) ; bool FreeMachKernelDll( void) ; bool IsLoadedMachKernelDll( void) ; void MySetEMkLogger( ILogger* pLogger) ; void MySetEMkKey( const std::string& sKey) ; +void MySetEMkNetHwKey( bool bNetHwKey) ; const char* MyGetEMkVersion( void) ; IMachMgr* MyCreateMachMgr( void) ; diff --git a/EXE_General.cpp b/EXE_General.cpp index 17c4973..2fa231d 100644 --- a/EXE_General.cpp +++ b/EXE_General.cpp @@ -47,6 +47,7 @@ static Logger* s_pCmdLog = nullptr ; static int s_nUserLev = 1 ; static string s_sKey ; static int s_nKeyType = KEY_LOCK_TYPE_ANY ; +static bool s_bNetHwKey = false ; static int s_nKeyExpDays = 0 ; static int s_nKeyOptExpDays = 0 ; static string s_sNestKey ; @@ -99,20 +100,21 @@ ExeInit( int nDebug, const string& sLogFile, const string& sLogMsg) // imposto la chiave di protezione sulle librerie di base SetEGkKeyType( s_nKeyType) ; SetEGkKey( s_sKey) ; + SetEGkNetHwKey( s_bNetHwKey) ; // carico libreria grafica opzionale - if ( LoadGraphicsDll( s_pGenLog, s_sKey)) + if ( LoadGraphicsDll( s_pGenLog, s_sKey, s_bNetHwKey)) LOG_INFO( s_pGenLog, MyGetEGrVersion()) // carico libreria exchange opzionale - if ( LoadExchangeDll( s_pGenLog, s_sKey)) + if ( LoadExchangeDll( s_pGenLog, s_sKey, s_bNetHwKey)) LOG_INFO( s_pGenLog, MyGetEExVersion()) // carico libreria di lavorazione opzionale - if ( LoadMachKernelDll( s_pGenLog, s_sKey)) + if ( LoadMachKernelDll( s_pGenLog, s_sKey, s_bNetHwKey)) LOG_INFO( s_pGenLog, MyGetEMkVersion()) - // carico libreria neting opzionale + // carico libreria nesting opzionale (non puņ usare la chiave di rete) if ( LoadNestingDll( s_pGenLog, s_sKey, s_sNestKey)) LOG_INFO( s_pGenLog, MyGetENsVersion()) @@ -249,6 +251,14 @@ ExeSetLockType( int nType) return SetLockType( nType) ; } +//----------------------------------------------------------------------------- +bool +ExeSetNetHwKey( bool bNetHwKey) +{ + s_bNetHwKey = bNetHwKey ; + return SetNetHwKey( bNetHwKey) ; +} + //----------------------------------------------------------------------------- bool ExeSetFont( const string& sNfeFontDir, const string& sDefaultFont) diff --git a/EgtExecutor.rc b/EgtExecutor.rc index 7c81203ebca400d7d7fb59a80f4b07bb1d3f1271..33441060c255d1513d70bcef845283f080851ca1 100644 GIT binary patch delta 81 zcmX>#neo(Q#tpyN7>zgoW^-i*QjT29S-`yGOp`YVRxuh+cH~Ol+$UrM5#neo(Q#tpyN7>zdnW^-i*QjT29S-`yGOp`YVRxuh)cH~Ol+$UrM5m>XaK