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 966ab62..e3d9210 100644 Binary files a/EgtMachKernel.rc and b/EgtMachKernel.rc differ 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) ;