From cfee8b94fd29745e585b52afbbbdf8f06879b384 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Thu, 12 Mar 2015 08:29:22 +0000 Subject: [PATCH] EgtInterface 1.6c1 : - aggiunte funzioni per info su OS, CPU e memoria. --- API_General.cpp | 46 ++++++++++++++++++++++++++++++++++++++++++++++ EgtInterface.rc | Bin 11718 -> 11718 bytes 2 files changed, 46 insertions(+) diff --git a/API_General.cpp b/API_General.cpp index 8eb8608..80956d7 100644 --- a/API_General.cpp +++ b/API_General.cpp @@ -24,6 +24,7 @@ #include "/EgtDev/Include/EGrDllMain.h" #include "/EgtDev/Include/EGnStringUtils.h" #include "/EgtDev/Include/EGnStringConverter.h" +#include "/EgtDev/Include/EGnPcInfo.h" #include "/EgtDev/Include/EgtLogger.h" #include @@ -70,6 +71,14 @@ __stdcall EgtInit( int nDebug, const wchar_t* sLogFile, const wchar_t* sLogMsg) LOG_INFO( s_pGenLog, GetEGkVersion()) LOG_INFO( s_pGenLog, GetEExVersion()) LOG_INFO( s_pGenLog, GetEGrVersion()) + // Info sul sistema + string sTmp ; + if ( GetOsInfo( sTmp)) + LOG_INFO( s_pGenLog, sTmp.c_str()) + if ( GetCpuInfo( sTmp)) + LOG_INFO( s_pGenLog, sTmp.c_str()) + if ( GetMemoryInfo( sTmp)) + LOG_INFO( s_pGenLog, sTmp.c_str()) // inizializzo l'interprete LUA LuaInit() ; @@ -224,9 +233,46 @@ EgtGetVersionInfo( string& sVer, const char* szNewLine) sVer += GetENkVersion() ; sVer += szNewLine ; sVer += GetEGnVersion() ; + return true ; } +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtGetOsInfo( wchar_t*& wsOs) +{ + // recupero le informazioni sul sistema operativo + string sOs ; + if ( ! GetOsInfo( sOs)) + return FALSE ; + wsOs = _wcsdup( stringtoW( sOs)) ; + return (( wsOs == nullptr) ? FALSE : TRUE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtGetCpuInfo( wchar_t*& wsCpu) +{ + // recupero le informazioni sulla Cpu + string sCpu ; + if ( ! GetCpuInfo( sCpu)) + return FALSE ; + wsCpu = _wcsdup( stringtoW( sCpu)) ; + return (( wsCpu == nullptr) ? FALSE : TRUE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtGetMemoryInfo( wchar_t*& wsMem) +{ + // recupero le informazioni sulla memoria presente + string sMem ; + if ( ! GetMemoryInfo( sMem)) + return FALSE ; + wsMem = _wcsdup( stringtoW( sMem)) ; + return (( wsMem == nullptr) ? FALSE : TRUE) ; +} + //----------------------------------------------------------------------------- BOOL __stdcall EgtFreeMemory( void* pMem) diff --git a/EgtInterface.rc b/EgtInterface.rc index 409793a0ef145b327b7a44d6aa73520a36a23255..ab825b766c845ef0909a020dba55f5f72e5808c0 100644 GIT binary patch delta 135 zcmX>WeJpyzH#Syd1|0^&%^&$rGEF|hS;L&nU^w}qpzh`Zt{N7&oFg+#d~yMo#bg5> joym8&o@`zvtiudf1Ju7n5}`jp3aWeJpyzH#Sxy1|0^o%^&$rGEF|hS;L&fU^e-opzh`Zt{N7&oFg+#d~yMo#bg5> joym8&o@`zvtiudf1Ju7n5}`jp3a