diff options
author | George Hazan <ghazan@miranda.im> | 2017-12-11 16:45:31 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-12-11 16:45:31 +0300 |
commit | eebad29559ff027ff2955fe63f95478668e968de (patch) | |
tree | bc480b6507b6df334fd2f6051bbc465ff7a9d44f | |
parent | a569fea827be7c1719f3eaca1d8b33d82d4b7889 (diff) |
IsTerminalDisconnected() moved to core
-rw-r--r-- | include/m_core.h | 23 | ||||
-rw-r--r-- | libs/win32/mir_core.lib | bin | 318226 -> 318478 bytes | |||
-rw-r--r-- | libs/win64/mir_core.lib | bin | 319200 -> 319436 bytes | |||
-rw-r--r-- | src/core/stdidle/src/idle.cpp | 17 | ||||
-rw-r--r-- | src/core/stdidle/src/stdafx.h | 1 | ||||
-rw-r--r-- | src/mir_core/src/mir_core.def | 1 | ||||
-rw-r--r-- | src/mir_core/src/mir_core64.def | 1 | ||||
-rw-r--r-- | src/mir_core/src/stdafx.h | 1 | ||||
-rw-r--r-- | src/mir_core/src/winver.cpp | 15 |
9 files changed, 31 insertions, 28 deletions
diff --git a/include/m_core.h b/include/m_core.h index 1f2d328e92..7502a967b5 100644 --- a/include/m_core.h +++ b/include/m_core.h @@ -533,17 +533,18 @@ MIR_CORE_DLL(void) KillModuleSubclassing(HMODULE hInst); ///////////////////////////////////////////////////////////////////////////////
// Windows utilities
-MIR_CORE_DLL(BOOL) IsWinVerVistaPlus();
-MIR_CORE_DLL(BOOL) IsWinVer7Plus();
-MIR_CORE_DLL(BOOL) IsWinVer8Plus();
-MIR_CORE_DLL(BOOL) IsWinVer81Plus();
-MIR_CORE_DLL(BOOL) IsWinVer10Plus();
-
-MIR_CORE_DLL(BOOL) IsFullScreen();
-MIR_CORE_DLL(BOOL) IsWorkstationLocked();
-MIR_CORE_DLL(BOOL) IsScreenSaverRunning();
-
-MIR_CORE_DLL(BOOL) GetOSDisplayString(wchar_t *buf, size_t bufSize);
+MIR_CORE_DLL(BOOL) IsWinVerVistaPlus();
+MIR_CORE_DLL(BOOL) IsWinVer7Plus();
+MIR_CORE_DLL(BOOL) IsWinVer8Plus();
+MIR_CORE_DLL(BOOL) IsWinVer81Plus();
+MIR_CORE_DLL(BOOL) IsWinVer10Plus();
+
+MIR_CORE_DLL(BOOL) IsFullScreen();
+MIR_CORE_DLL(BOOL) IsWorkstationLocked();
+MIR_CORE_DLL(BOOL) IsScreenSaverRunning();
+MIR_CORE_DLL(BOOL) IsTerminalDisconnected();
+
+MIR_CORE_DLL(BOOL) GetOSDisplayString(wchar_t *buf, size_t bufSize);
///////////////////////////////////////////////////////////////////////////////
diff --git a/libs/win32/mir_core.lib b/libs/win32/mir_core.lib Binary files differindex 2e3ef00691..cb83c2c2b2 100644 --- a/libs/win32/mir_core.lib +++ b/libs/win32/mir_core.lib diff --git a/libs/win64/mir_core.lib b/libs/win64/mir_core.lib Binary files differindex c1328f007e..189b02e354 100644 --- a/libs/win64/mir_core.lib +++ b/libs/win64/mir_core.lib 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;
|