提交 9d7462dc 编写于 作者: L ljc545w

修复部分已知Bug

上级 6e049261
...@@ -234,6 +234,7 @@ DWORD StartRobotService() { ...@@ -234,6 +234,7 @@ DWORD StartRobotService() {
bool status = Injert(wxPid, workPath); bool status = Injert(wxPid, workPath);
if (status == 1) { if (status == 1) {
CloseHandle(hProcess); CloseHandle(hProcess);
hProcess = NULL;
return status; return status;
} }
return status; return status;
...@@ -242,13 +243,16 @@ DWORD StartRobotService() { ...@@ -242,13 +243,16 @@ DWORD StartRobotService() {
DWORD StopRobotService() { DWORD StopRobotService() {
DWORD cpid = GetCurrentProcessId(); DWORD cpid = GetCurrentProcessId();
DWORD wxPid = GetWeChatPid(); DWORD wxPid = GetWeChatPid();
if (!wxPid) if (!wxPid) {
hProcess = NULL;
return cpid; return cpid;
}
if (!hProcess) if (!hProcess)
hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, wxPid); hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, wxPid);
RemoveDll(wxPid); RemoveDll(wxPid);
ZeroMemory((wchar_t*)SelfInfoString.c_str(), SelfInfoString.length() * 2 + 2); ZeroMemory((wchar_t*)SelfInfoString.c_str(), SelfInfoString.length() * 2 + 2);
CloseHandle(hProcess); CloseHandle(hProcess);
hProcess = NULL;
StopReceiveMessage(); StopReceiveMessage();
return cpid; return cpid;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册