From eebad29559ff027ff2955fe63f95478668e968de Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 11 Dec 2017 16:45:31 +0300 Subject: IsTerminalDisconnected() moved to core --- src/core/stdidle/src/idle.cpp | 17 +---------------- src/core/stdidle/src/stdafx.h | 1 - 2 files changed, 1 insertion(+), 17 deletions(-) (limited to 'src/core') diff --git a/src/core/stdidle/src/idle.cpp b/src/core/stdidle/src/idle.cpp index 4802dd1262..a022c56cb2 100644 --- a/src/core/stdidle/src/idle.cpp +++ b/src/core/stdidle/src/idle.cpp @@ -111,22 +111,6 @@ typedef enum _WTS_INFO_CLASS static BOOL bModuleInitialized = FALSE; -BOOL IsTerminalDisconnected() -{ - PVOID pBuffer = nullptr; - DWORD pBytesReturned = 0; - BOOL result = FALSE; - - if (WTSQuerySessionInformation(WTS_CURRENT_SERVER_HANDLE, WTS_CURRENT_SESSION, WTSConnectState, (LPTSTR *)&pBuffer, &pBytesReturned)) { - if (*(PDWORD)pBuffer == WTSDisconnected) - result = TRUE; - } - - if (pBuffer) - WTSFreeMemory(pBuffer); - return result; -} - typedef struct { UINT_PTR hTimer; @@ -222,6 +206,7 @@ static void IdleObject_Tick(IdleObject * obj) obj->idleType = idleType; NotifyEventHooks(hIdleEvent, 0, IDF_ISIDLE | flags); } + if (IdleObject_IsIdle(obj) && !idle) { IdleObject_ClearIdle(obj); obj->idleType = 0; diff --git a/src/core/stdidle/src/stdafx.h b/src/core/stdidle/src/stdafx.h index dde53388fd..6ca7b977ad 100644 --- a/src/core/stdidle/src/stdafx.h +++ b/src/core/stdidle/src/stdafx.h @@ -26,7 +26,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include #include -#include #include #include -- cgit v1.2.3