|
|
@@ -70,12 +70,16 @@ static void SetEnvPath(const char *mod_name)
|
|
|
|
|
|
DWORD sphostMonitor(LPVOID param)
|
|
|
{
|
|
|
- HANDLE spShellProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, GetProcessIdFromName(PROCESS_SPSHELL));
|
|
|
+ HANDLE spShellProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, GetProcessIdFromName(PROCESS_SPSHELL)); //»ñÈ¡µÄÊÇ׼ȷµÄspshell.exeµÄpid
|
|
|
int waitTimes = 1;
|
|
|
if (NULL == spShellProcess)
|
|
|
+ {
|
|
|
+ CloseHandle(spShellProcess);
|
|
|
ExitProcess(-1); //can not find spShell
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
- while (WAIT_TIMEOUT == WaitForSingleObject(spShellProcess, 1000)) //spshell exit
|
|
|
+ while (WAIT_OBJECT_0 != WaitForSingleObject(spShellProcess, 1000)) //spshell exit
|
|
|
{
|
|
|
|
|
|
if (waitTimes % DEFAULT_MEMORY_CLEAN_TIME == 0)
|
|
|
@@ -91,6 +95,7 @@ DWORD sphostMonitor(LPVOID param)
|
|
|
}
|
|
|
waitTimes++;
|
|
|
}
|
|
|
+
|
|
|
CloseHandle(spShellProcess);
|
|
|
ExitProcess(0);
|
|
|
|