diff --git a/xvaga/oswin32.cpp b/xvaga/oswin32.cpp index f045f016e..d55e665e2 100755 --- a/xvaga/oswin32.cpp +++ b/xvaga/oswin32.cpp @@ -1044,10 +1044,10 @@ bool OsWin32_Speak(const char* text, bool async) int OsWin32_GetSessionId() { -// DWORD session = 0; -// ::ProcessIdToSessionId(::GetCurrentProcessId(), &session); -// return (int)session; - return WTSGetActiveConsoleSessionId(); // Unknown modern way! + DWORD session = 0; + ::ProcessIdToSessionId(::GetCurrentProcessId(), &session); + return (int)session; + // return WTSGetActiveConsoleSessionId(); // Always 1! :-( } bool OsWin32_IsWindowsServer() diff --git a/xvaga/xvt_ssa.cpp b/xvaga/xvt_ssa.cpp index 7ce9416c0..4e77e586f 100644 --- a/xvaga/xvt_ssa.cpp +++ b/xvaga/xvt_ssa.cpp @@ -11,16 +11,17 @@ static int _ssa_serial = SSA_UTENTE_NON_LOGGATO; static wxString _ssa_module; static const char* const _ssa_product = "CAMPO"; + static const char* xvt_dongle_sa_id() { - static char id[80]; + static char id[256] = { '\0' }; if (!*id) { - char user[32], host[32]; const int sess = xvt_sys_get_session_id(); + char user[64], host[64]; xvt_sys_get_user_name(user, sizeof(user)); xvt_sys_get_host_name(host, sizeof(host)); - sprintf(id, "%s@%s:%d", user, host, sess); + sprintf_s(id, sizeof(id), "%s@%s:%d", user, host, sess); } return id; } @@ -58,7 +59,7 @@ void TSSA_Pinger::Notify() TSSA_Pinger::TSSA_Pinger() { - const int sec = xvt_sys_get_profile_int("ssa.ini", "", "PING-DELAY", 60); + const int sec = xvt_sys_get_profile_int("ssa.ini", "", "PING-DELAY", 600); if (sec > 0) Start(sec*1000); } @@ -81,7 +82,7 @@ int xvt_dongle_sa_login(const char* module) { err = _ssa_serial = SSA_NumeroSerie(_ssa_product); if (_ssa_timer == NULL && xvt_dongle_sa_is_remote_ba0()) - _ssa_timer = new TSSA_Pinger; + _ssa_timer = new TSSA_Pinger; // solo il menu principale fa il ping } }