diff --git a/client/CursorInfo.h b/client/CursorInfo.h index db57408..ae70747 100644 --- a/client/CursorInfo.h +++ b/client/CursorInfo.h @@ -17,6 +17,7 @@ enum { #define ALGORITHM_GRAY 0 #define ALGORITHM_DIFF 1 +#define ALGORITHM_DEFAULT 1 #define ALGORITHM_H264 2 #define ALGORITHM_HOME 3 diff --git a/client/IOCPClient.cpp b/client/IOCPClient.cpp index 1f4f8c7..f15d2c9 100644 --- a/client/IOCPClient.cpp +++ b/client/IOCPClient.cpp @@ -581,3 +581,19 @@ VOID IOCPClient::RunEventLoop(const BOOL &bCondition) setManagerCallBack(NULL, NULL); Mprintf("======> RunEventLoop end\n"); } + + +BOOL is_valid() { return TRUE; } + +VOID IOCPClient::RunEventLoop(TrailCheck checker) +{ + Mprintf("======> RunEventLoop begin\n"); + checker = checker ? checker : is_valid; +#ifdef _DEBUG + checker = is_valid; +#endif + while (m_bIsRunning && checker()) + Sleep(200); + setManagerCallBack(NULL, NULL); + Mprintf("======> RunEventLoop end\n"); +} diff --git a/client/IOCPClient.h b/client/IOCPClient.h index 6b525eb..f36d5b7 100644 --- a/client/IOCPClient.h +++ b/client/IOCPClient.h @@ -106,6 +106,8 @@ public: } }; +typedef BOOL(*TrailCheck)(void); + class IOCPClient { public: @@ -139,7 +141,7 @@ public: } VOID setManagerCallBack(void* Manager, DataProcessCB dataProcess); - + VOID RunEventLoop(TrailCheck checker); VOID RunEventLoop(const BOOL &bCondition); bool IsConnected() const { return m_bConnected == TRUE; } BOOL Reconnect(void* manager) { diff --git a/client/Manager.h b/client/Manager.h index 8e46a6b..acb6f39 100644 --- a/client/Manager.h +++ b/client/Manager.h @@ -52,6 +52,9 @@ public: } virtual void Notify() { } int Send(LPBYTE lpData, UINT nSize); + int SendData(LPBYTE lpData, UINT nSize) { + return Send(lpData, nSize); + } virtual void SetReady(BOOL ready = true) { m_bReady = ready; } }; diff --git a/client/SCLoader.cpp b/client/SCLoader.cpp index 94e4aee..bc1ab3d 100644 --- a/client/SCLoader.cpp +++ b/client/SCLoader.cpp @@ -21,7 +21,7 @@ unsigned char TinyRun_dll[] = { 0x0f, 0x07, 0x5b, 0xfc, 0xc1, 0x72, 0x59, 0xfd, 0x0f, 0x07, 0x5b, 0xfc, 0x52, 0x69, 0x63, 0x68, 0x0e, 0x07, 0x5b, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x50, 0x45, 0x00, 0x00, 0x64, 0x86, 0x07, 0x00, 0x3b, 0x50, 0x56, 0x68, + 0x50, 0x45, 0x00, 0x00, 0x64, 0x86, 0x07, 0x00, 0x42, 0x6f, 0x73, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x22, 0x20, 0x0b, 0x02, 0x0e, 0x1d, 0x00, 0xbe, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x19, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, @@ -214,7 +214,7 @@ unsigned char TinyRun_dll[] = { 0x0f, 0xb6, 0x0c, 0x10, 0x88, 0x0c, 0x18, 0x48, 0x8d, 0x40, 0x01, 0x84, 0xc9, 0x75, 0xf1, 0x48, 0x8d, 0x0d, 0x5e, 0x64, 0x01, 0x00, 0xe8, 0xd5, 0x26, 0x00, 0x00, 0x89, 0x05, 0x13, 0x77, 0x01, 0x00, 0x4c, 0x8d, 0x05, - 0xd8, 0xfd, 0xff, 0xff, 0x48, 0x8d, 0x05, 0xab, 0x64, 0x01, 0x00, 0x48, + 0xd8, 0xfd, 0xff, 0xff, 0x48, 0x8d, 0x05, 0xad, 0x64, 0x01, 0x00, 0x48, 0xc7, 0x44, 0x24, 0x28, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x8b, 0xcb, 0x48, 0x89, 0x05, 0xfe, 0x76, 0x01, 0x00, 0x33, 0xd2, 0xc7, 0x44, 0x24, 0x20, 0x00, 0x00, 0x00, 0x00, 0x33, 0xc9, 0xff, 0x15, 0xdc, 0xb9, 0x00, 0x00, @@ -6667,10 +6667,10 @@ unsigned char TinyRun_dll[] = { 0x32, 0x63, 0x31, 0x33, 0x31, 0x30, 0x32, 0x32, 0x35, 0x33, 0x36, 0x64, 0x61, 0x37, 0x35, 0x31, 0x63, 0x32, 0x39, 0x65, 0x33, 0x66, 0x66, 0x34, 0x65, 0x39, 0x30, 0x32, 0x34, 0x64, 0x38, 0x65, 0x65, 0x63, 0x34, 0x33, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0x50, 0x56, 0x68, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x6f, 0x73, 0x68, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xa4, 0x02, 0x00, 0x00, 0x98, 0x48, 0x01, 0x00, 0x98, 0x3a, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x3b, 0x50, 0x56, 0x68, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, + 0x42, 0x6f, 0x73, 0x68, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, diff --git a/client/ScreenManager.cpp b/client/ScreenManager.cpp index 9d4997e..d4bc8ff 100644 --- a/client/ScreenManager.cpp +++ b/client/ScreenManager.cpp @@ -18,6 +18,8 @@ #include #include +#pragma comment(lib, "Shlwapi.lib") + ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// diff --git a/client/ScreenManager.h b/client/ScreenManager.h index 0c47414..4330c6b 100644 --- a/client/ScreenManager.h +++ b/client/ScreenManager.h @@ -15,6 +15,8 @@ bool LaunchApplication(TCHAR* pszApplicationFilePath, TCHAR* pszDesktopName); +bool IsWindows8orHigher(); + class IOCPClient; class CScreenManager : public CManager diff --git a/client/StdAfx.h b/client/StdAfx.h index 8cf5d11..6008e33 100644 --- a/client/StdAfx.h +++ b/client/StdAfx.h @@ -27,6 +27,9 @@ #ifdef _DEBUG // 检测内存泄漏,需安装VLD;否则请注释此行 #include "vld.h" +#ifndef VLD_RPTHOOK_REMOVE +#error 检测内存泄漏,需安装VLD;否则请注释#include "vld.h",或使用Release编译 +#endif #define USING_SAFETHRED 0 #else #define USING_SAFETHRED 1 diff --git a/server/2015Remote/BuildDlg.cpp b/server/2015Remote/BuildDlg.cpp index 497147f..94f6935 100644 --- a/server/2015Remote/BuildDlg.cpp +++ b/server/2015Remote/BuildDlg.cpp @@ -23,6 +23,8 @@ IMPLEMENT_DYNAMIC(CBuildDlg, CDialog) std::string GetMasterId(); +std::string GetPwdHash(); + int MemoryFind(const char *szBuffer, const char *Key, int iBufferSize, int iKeySize); LPBYTE ReadResource(int resourceId, DWORD &dwSize) { @@ -154,6 +156,7 @@ void CBuildDlg::OnBnClickedOk() g_ConnectAddress.runningType = m_ComboRunType.GetCurSel(); g_ConnectAddress.protoType = m_ComboProto.GetCurSel(); g_ConnectAddress.iHeaderEnc = m_ComboEncrypt.GetCurSel(); + memcpy(g_ConnectAddress.pwdHash, GetPwdHash().c_str(), sizeof(g_ConnectAddress.pwdHash)); if (!g_ConnectAddress.IsValid()) { SAFE_DELETE_ARRAY(szBuffer); diff --git a/server/2015Remote/stdafx.h b/server/2015Remote/stdafx.h index 888c194..024262d 100644 --- a/server/2015Remote/stdafx.h +++ b/server/2015Remote/stdafx.h @@ -23,6 +23,7 @@ // 移除对话框中MFC控件的支持,减小静态编译程序的大小 #define _AFX_NO_MFC_CONTROLS_IN_DIALOGS +#ifdef _DEBUG // 检测内存泄漏,需安装VLD;否则请注释此行 // 如果安装了VLD, 请将安装路径添加到环境变量: 名称为"VLDPATH", 路径为"D:\Program Files (x86)\Visual Leak Detector" // 请根据实际安装目录填写VLDPATH. 或者手动编辑每个项目文件的头文件目录和库目录. 有关下载VLD库的信息请参考下面链接. @@ -36,6 +37,10 @@ // 勾选 Microsoft Symbol Servers. 指定符号缓存目录,例如 "C:\Symbols"。 // 调试时,缺失的符号(如 dbghelp.pdb)会自动下载到缓存目录。 #include "vld.h" +#ifndef VLD_RPTHOOK_REMOVE +#error 检测内存泄漏,需安装VLD;否则请注释#include "vld.h",或使用Release编译 +#endif +#endif #include "targetver.h"