fix: #71 Development of a simple Linux Client

This commit is contained in:
yuanyuanxiang
2025-04-06 19:35:20 +08:00
parent 9475e59887
commit 7a6b57917a
31 changed files with 629 additions and 124 deletions

View File

@@ -6,18 +6,15 @@
#include "ShellManager.h"
#include "Common.h"
#include <IOSTREAM>
using namespace std;
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
BOOL bStarting = TRUE;
CShellManager::CShellManager(IOCPClient* ClientObject, int n, void* user):CManager(ClientObject)
{
m_nCmdLength = 0;
bStarting = TRUE;
m_bStarting = TRUE;
m_hThreadRead = NULL;
m_hShellProcessHandle = NULL; //<2F><><EFBFBD><EFBFBD>Cmd<6D><64><EFBFBD>̵Ľ<CCB5><C4BD>̾<EFBFBD><CCBE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߳̾<DFB3><CCBE><EFBFBD>
m_hShellThreadHandle = NULL;
@@ -109,7 +106,7 @@ DWORD WINAPI CShellManager::ReadPipeThread(LPVOID lParam)
char szBuffer[1024] = {0};
DWORD dwTotal = 0;
CShellManager *This = (CShellManager*)lParam;
while (bStarting)
while (This->m_bStarting)
{
Sleep(100);
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ݵĴ<DDB5>С<EFBFBD>Ƕ<EFBFBD><C7B6><EFBFBD>
@@ -160,7 +157,7 @@ VOID CShellManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
CShellManager::~CShellManager()
{
bStarting = FALSE;
m_bStarting = FALSE;
TerminateProcess(m_hShellProcessHandle, 0); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Լ<EFBFBD><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Cmd<6D><64><EFBFBD><EFBFBD>
TerminateThread(m_hShellThreadHandle, 0); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Լ<EFBFBD><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Cmd<6D>߳<EFBFBD>