From 156f0f8ef81b857e3d83f39285826bc15fb3aec6 Mon Sep 17 00:00:00 2001 From: DarioS Date: Tue, 17 May 2022 08:26:38 +0200 Subject: [PATCH] EgtMachKernel 2.4e3 : - modifiche per prima versione chiave di rete. --- DllMain.h | 1 + EMkDllMain.cpp | 15 +++++++++++++++ EgtMachKernel.rc | Bin 11774 -> 11774 bytes Generator.cpp | 17 ++++++++++++----- MachMgrBasic.cpp | 2 +- 5 files changed, 29 insertions(+), 6 deletions(-) diff --git a/DllMain.h b/DllMain.h index 1f46ef2..867b9f3 100644 --- a/DllMain.h +++ b/DllMain.h @@ -21,3 +21,4 @@ std::string GetEMkVer( void) ; ILogger* GetEMkLogger( void) ; const std::string& GetEMkKey( void) ; +bool GetEMkNetHwKey( void) ; diff --git a/EMkDllMain.cpp b/EMkDllMain.cpp index ed30544..ed18039 100644 --- a/EMkDllMain.cpp +++ b/EMkDllMain.cpp @@ -98,6 +98,7 @@ GetEMkLogger( void) //----------------------------------------------------------------------------- static std::string s_sKey ; +static bool s_bNetHwKey = false ; //----------------------------------------------------------------------------- void @@ -106,9 +107,23 @@ SetEMkKey( const std::string& sKey) s_sKey = sKey ; } +//----------------------------------------------------------------------------- +void +SetEMkNetHwKey( bool bNetHwKey) +{ + s_bNetHwKey = bNetHwKey ; +} + //----------------------------------------------------------------------------- const std::string& GetEMkKey( void) { return s_sKey ; } + +//----------------------------------------------------------------------------- +bool +GetEMkNetHwKey( void) +{ + return s_bNetHwKey ; +} diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index 966ab6205843ba3e9830e33c8be9af1f686e1647..e3d92103a2e7a02d40dda2a1289cc3bc1bb15d43 100644 GIT binary patch delta 97 zcmewt{V#gMFE&Qw&A-`fnHh~IKa|wnoW?bQ1uSxrY4Qod0+^@}R1`^_2jk{d(jGv4 NK<#LXK~l;gTmUD-Bai?9 delta 97 zcmewt{V#gMFE&P_&A-`fnHh~HKa|wnoW?bQ1uSxrY4Qod0+^@}R1`^_2jk{d(jGv4 NK<#LXK~l;gTmU8!BZvS1 diff --git a/Generator.cpp b/Generator.cpp index 19b9c56..8457ed1 100644 --- a/Generator.cpp +++ b/Generator.cpp @@ -47,11 +47,18 @@ bool Generator::Run( const string& sCncFile, const string& sInfo) { // verifico sia abilitato dalla licenza - unsigned int nOpt1, nOpt2 ; - int nOptExpDays ; - int nRet = GetKeyOptions( GetEMkKey(), KEY_BASELIB_PROD, KEY_BASELIB_VER, KEY_BASELIB_LEV, - nOpt1, nOpt2, nOptExpDays) ; - if ( nRet == KEY_OK && ( nOpt1 & KEYOPT_EMK_NC_OFF) == 0) { + bool bEnabled = false ; + if ( GetEMkNetHwKey()) { + bEnabled = true ; + } + else { + unsigned int nOpt1, nOpt2 ; + int nOptExpDays ; + int nRet = GetKeyOptions( GetEMkKey(), KEY_BASELIB_PROD, KEY_BASELIB_VER, KEY_BASELIB_LEV, + nOpt1, nOpt2, nOptExpDays) ; + bEnabled = ( nRet == KEY_OK && ( nOpt1 & KEYOPT_EMK_NC_OFF) == 0) ; + } + if ( bEnabled) { // emetto info di log { string sOut = "Generator Run : " + sCncFile ; diff --git a/MachMgrBasic.cpp b/MachMgrBasic.cpp index ae9c0a8..4595292 100644 --- a/MachMgrBasic.cpp +++ b/MachMgrBasic.cpp @@ -30,7 +30,7 @@ IMachMgr* CreateMachMgr( void) { // verifico la chiave e le opzioni - if ( ! TestKeyForEMk( GetEMkKey(), 0, GetEMkLogger())) + if ( ! GetEMkNetHwKey() && ! TestKeyForEMk( GetEMkKey(), 0, GetEMkLogger())) return nullptr ; // creo il MachMgr return static_cast ( new(nothrow) MachMgr) ;