mirror of
https://git.code.sf.net/p/mingw-w64/mingw-w64
synced 2024-12-02 14:24:32 +08:00
Improve Compatibility TerminateProcess to fail if called from another process
git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/trunk@5678 4407c894-4637-0410-b4f5-ada5f102cad1
This commit is contained in:
parent
8457321bba
commit
20e171e2f8
@ -32,8 +32,13 @@
|
||||
|
||||
BOOL WINAPI TerminateProcess(HANDLE hProcess, UINT uExitCode)
|
||||
{
|
||||
_exit(uExitCode);
|
||||
return uExitCode;
|
||||
if (hProcess == GetCurrentProcess()) {
|
||||
_exit(uExitCode);
|
||||
return uExitCode;
|
||||
} else {
|
||||
SetLastError(ERROR_ACCESS_DENIED);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
BOOL WINAPI (*__MINGW_IMP_SYMBOL(TerminateProcess))(HANDLE, UINT) asm("__imp__TerminateProcess@8") = TerminateProcess;
|
||||
|
Loading…
Reference in New Issue
Block a user