Riprisitinato metodo di calcolo session id in quanto quello nuovo torna sempre 1

git-svn-id: svn://10.65.10.50/branches/R_10_00@23032 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2014-12-22 08:56:07 +00:00
parent 825bba7e77
commit ff829d22f6
2 changed files with 10 additions and 9 deletions

View File

@ -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()

View File

@ -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
}
}