summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/stdidle/src/idle.cpp17
-rw-r--r--src/core/stdidle/src/stdafx.h1
-rw-r--r--src/mir_core/src/mir_core.def1
-rw-r--r--src/mir_core/src/mir_core64.def1
-rw-r--r--src/mir_core/src/stdafx.h1
-rw-r--r--src/mir_core/src/winver.cpp15
6 files changed, 19 insertions, 17 deletions
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 <shlobj.h>
#include <commctrl.h>
#include <vssym32.h>
-#include <Wtsapi32.h>
#include <stdio.h>
#include <time.h>
diff --git a/src/mir_core/src/mir_core.def b/src/mir_core/src/mir_core.def
index 7d0d544d86..700a447198 100644
--- a/src/mir_core/src/mir_core.def
+++ b/src/mir_core/src/mir_core.def
@@ -1054,3 +1054,4 @@ HookTemporaryEvent @1241
?Click@CCtrlButton@@QAEXXZ @1242 NONAME
??0CTimer@@QAE@$$QAV0@@Z @1243 NONAME
??4CTimer@@QAEAAV0@$$QAV0@@Z @1244 NONAME
+IsTerminalDisconnected @1245
diff --git a/src/mir_core/src/mir_core64.def b/src/mir_core/src/mir_core64.def
index c1d716b5d9..6608c359c7 100644
--- a/src/mir_core/src/mir_core64.def
+++ b/src/mir_core/src/mir_core64.def
@@ -1054,3 +1054,4 @@ HookTemporaryEvent @1241
?Click@CCtrlButton@@QEAAXXZ @1242 NONAME
??0CTimer@@QEAA@$$QEAV0@@Z @1243 NONAME
??4CTimer@@QEAAAEAV0@$$QEAV0@@Z @1244 NONAME
+IsTerminalDisconnected @1245
diff --git a/src/mir_core/src/stdafx.h b/src/mir_core/src/stdafx.h
index e72153c8b7..67dea82922 100644
--- a/src/mir_core/src/stdafx.h
+++ b/src/mir_core/src/stdafx.h
@@ -33,6 +33,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <vssym32.h>
#include <Uxtheme.h>
#include <Richedit.h>
+#include <Wtsapi32.h>
#include <malloc.h>
#include <stdio.h>
diff --git a/src/mir_core/src/winver.cpp b/src/mir_core/src/winver.cpp
index 07faca4d1c..a724f6e443 100644
--- a/src/mir_core/src/winver.cpp
+++ b/src/mir_core/src/winver.cpp
@@ -100,6 +100,21 @@ MIR_CORE_DLL(BOOL) IsWorkstationLocked(void)
return bLocked;
}
+MIR_CORE_DLL(BOOL) IsTerminalDisconnected(void)
+{
+ 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;
+}
+
MIR_CORE_DLL(BOOL) IsScreenSaverRunning(void)
{
BOOL rc = FALSE;