Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在win10专业版下,重新载入失败 #8

Open
lucasbozhi opened this issue Jan 8, 2018 · 2 comments
Open

在win10专业版下,重新载入失败 #8

lucasbozhi opened this issue Jan 8, 2018 · 2 comments

Comments

@lucasbozhi
Copy link

命令行提示
错误:远程系统必须运行WINDOW2000或更高版本

跟踪了一下代码,发现pid正常获取的情况下,杀掉进程的命令执行出错,导致这个报错

@lucasbozhi
Copy link
Author

static BOOL MyEndTask(DWORD dwPid)
{
DWORD DELAYTIME = 2000;
HANDLE hPrc;

if( 0 == dwPid) return FALSE;  

hPrc = OpenProcess( PROCESS_ALL_ACCESS, FALSE, dwPid);  // Opens handle to the process.  

if( !TerminateProcess(hPrc,0) ) // Terminates a process.  
{  
	CloseHandle( hPrc );  
	return FALSE;  
}else  
	WaitForSingleObject(hPrc, DELAYTIME); // At most ,wait 2000  millisecond.  

CloseHandle(hPrc);  
return TRUE;   

}

MyEndTask 改为上述实现 问题解决

@phuslu
Copy link
Owner

phuslu commented Jan 9, 2018

谢谢,尽快合并你的 patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants