EgtExecutor 2.1a7 :

- aggiunte funzioni ExeGetKeyLeftDays e ExeGetKeyOptLeftDays.
This commit is contained in:
Dario Sassi
2019-01-29 15:09:32 +00:00
parent 0274b9cc24
commit f4eafeb606
2 changed files with 25 additions and 5 deletions
+25 -5
View File
@@ -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)