From d59805a9d2645caa366d42fedcc4d4de430740f3 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Mon, 30 Mar 2015 06:53:14 +0000 Subject: [PATCH] EgtMachKernel 1.6c8 : - aggiornata gestione codici di protezione ( con opzioni). --- EMkDllMain.cpp | 20 ++++++++------------ EgtMachKernel.rc | Bin 11774 -> 11774 bytes MachMgr.cpp | 22 +++++++++++++--------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/EMkDllMain.cpp b/EMkDllMain.cpp index 009a9f0..98a64a8 100644 --- a/EMkDllMain.cpp +++ b/EMkDllMain.cpp @@ -19,18 +19,14 @@ #include "\EgtDev\Include\EgtTrace.h" //--------------------------- Costanti ---------------------------------------- -#if defined( _WIN64) - #if defined( _DEBUG) - const char* EMK_STR = "EgtMachKernelD64.dll ver. " ; - #else - const char* EMK_STR = "EgtMachKernelR64.dll ver. " ; - #endif -#elif defined( _WIN32) - #if defined( _DEBUG) - const char* EMK_STR = "EgtMachKernelD32.dll ver. " ; - #else - const char* EMK_STR = "EgtMachKernelR32.dll ver. " ; - #endif +#if defined( _WIN64) && defined( _DEBUG) + const char* EMK_STR = "EgtMachKernelD64.dll ver. " ; +#elif defined( _WIN64) + const char* EMK_STR = "EgtMachKernelR64.dll ver. " ; +#elif defined( _WIN32) && defined( _DEBUG) + const char* EMK_STR = "EgtMachKernelD32.dll ver. " ; +#else + const char* EMK_STR = "EgtMachKernelR32.dll ver. " ; #endif const int STR_DIM = 40 ; diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index 15ef549f5d6f7c058fe70ece670f7244ffde6bfc..1985b6898a2be66e6a4c95fb584e1dcc369b5aae 100644 GIT binary patch delta 97 zcmewt{V#gMFE&Pt&A-`fnHeo6Ka|wnoW?bQ1uSxrY4Qod0+^@}R1`^_2jk{d(jGv4 NK<#LXK~l;gTmUdVBe(zn delta 97 zcmewt{V#gMFE&Q=&A-`fnHkL|Ka|wnoW?bQ1uSxrY4Qod0+^@}R1`^_2jk{d(jGv4 NK<#LXK~l;gTmUYMBd`Df diff --git a/MachMgr.cpp b/MachMgr.cpp index d69c74a..449ad4a 100644 --- a/MachMgr.cpp +++ b/MachMgr.cpp @@ -18,25 +18,29 @@ #include "MachConst.h" #include "/EgtDev/Include/EGnStringUtils.h" #include "/EgtDev/Include/SELkKeyProc.h" +#include "/EgtDev/Include/EgtKeyCodes.h" #include using namespace std ; -//---------------------------------------------------------------------------- -const int MMG_PROD = 1231 ; -const int MMG_VER = 16 ; -const int MMG_LEV = 1 ; - //---------------------------------------------------------------------------- IMachMgr* CreateMachMgr( void) { - // verifico la chiave - int nRet = VerifyKey( GetEMkKey(), MMG_PROD, MMG_VER, MMG_LEV) ; + // verifico la chiave e le opzioni + 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) { - string sErr = "Error on M.Key (" + ToString( nRet) + ")" ; + string sErr = "Error on Key (MKC/" + ToString( nRet) + ")" ; LOG_ERROR( GetEMkLogger(), sErr.c_str()) ; - return nullptr ; + return false ; + } + if ( (nOpt1 & KEYOPT_EMK_BASE) == 0 || nOptExpDays < GetCurrDay()) { + string sErr = "Error on Key (MKC/OPT)" ; + LOG_ERROR( GetEMkLogger(), sErr.c_str()) ; + return false ; } // creo il MachMgr return static_cast ( new(nothrow) MachMgr) ;