From f4eafeb6064996d6673e169ab011b190de034e97 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Tue, 29 Jan 2019 15:09:32 +0000 Subject: [PATCH] EgtExecutor 2.1a7 : - aggiunte funzioni ExeGetKeyLeftDays e ExeGetKeyOptLeftDays. --- EXE_General.cpp | 30 +++++++++++++++++++++++++----- EgtExecutor.rc | Bin 16176 -> 16176 bytes 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/EXE_General.cpp b/EXE_General.cpp index c494d43..0411f1e 100644 --- a/EXE_General.cpp +++ b/EXE_General.cpp @@ -42,6 +42,8 @@ static bool s_bCmdLog = false ; static Logger* s_pCmdLog = nullptr ; static string s_sKey ; static int s_nKeyType = KEY_LOCK_TYPE_ANY ; +static int s_nKeyExpDays = 0 ; +static int s_nKeyOptExpDays = 0 ; static string s_sIniFile ; static pfProcEvents s_pFunProcEvents = nullptr ; static pfOutText s_pFunOutText = nullptr ; @@ -339,8 +341,7 @@ bool ExeGetKeyLevel( int nProd, int nVer, int nLev, int& nKLev) { // verifico la chiave e il livello - int nExpDays ; - int nRet = GetKeyLevel( s_sKey, nProd, nVer, nLev, nKLev, nExpDays) ; + int nRet = GetKeyLevel( s_sKey, nProd, nVer, nLev, nKLev, s_nKeyExpDays) ; if ( nRet != KEY_OK) { string sErr = "Error on Key (EGKL/" + ToString( nRet) + ")" ; LOG_ERROR( s_pGenLog, sErr.c_str()) ; @@ -357,15 +358,14 @@ ExeGetKeyOptions( int nProd, int nVer, int nLev, unsigned int& nOpt2) { // verifico la chiave e le opzioni unsigned int nOpt1 ; - int nOptExpDays ; - int nRet = GetKeyOptions( s_sKey, nProd, nVer, nLev, nOpt1, nOpt2, nOptExpDays) ; + int nRet = GetKeyOptions( s_sKey, nProd, nVer, nLev, nOpt1, nOpt2, s_nKeyOptExpDays) ; if ( nRet != KEY_OK) { nOpt2 = 0 ; string sErr = "Error on Key (EGKO/" + ToString( nRet) + ")" ; LOG_ERROR( s_pGenLog, sErr.c_str()) ; return false ; } - if ( nOptExpDays < GetCurrDay()) { + if ( s_nKeyOptExpDays < GetCurrDay()) { nOpt2 = 0 ; string sErr = "Error on Key (EGKO/OPT)" ; LOG_ERROR( s_pGenLog, sErr.c_str()) ; @@ -375,6 +375,26 @@ ExeGetKeyOptions( int nProd, int nVer, int nLev, unsigned int& nOpt2) return true ; } +//----------------------------------------------------------------------------- +bool +ExeGetKeyLeftDays( int& nLeftDays) +{ + if ( s_nKeyExpDays == 0) + return false ; + nLeftDays = s_nKeyExpDays - GetCurrDay() ; + return true ; +} + +//----------------------------------------------------------------------------- +bool +ExeGetKeyOptLeftDays( int& nOptLeftDays) +{ + if ( s_nKeyOptExpDays == 0) + return false ; + nOptLeftDays = s_nKeyOptExpDays - GetCurrDay() ; + return true ; +} + //----------------------------------------------------------------------------- bool ExeGetOsInfo( string& sOs) diff --git a/EgtExecutor.rc b/EgtExecutor.rc index 30d97d48443ebecbca6592fc6ccb511827ae3d37..ef2f8b3e359d53e605ece5409fd9f885c6a78a0c 100644 GIT binary patch delta 79 zcmdl`x1nysFE&Q=&A-`PnSqoe*K!sx?>N)s4T4pS=93+{k~jAW*?>e(i-FY$N+HxV MD8kglDP58Q0Dq?&g8%>k delta 79 zcmdl`x1nysFE&QA&A-`PnSqoe*K!sx?>N)s4T4pSW|JMck~jAW*?>e(i-FY$N+HxV MD8kglDP58Q0DfB=djJ3c