Dmitry Timoshkov : kernel32: TerminateProcess unlike NtTerminateProcess is supposed to fail with process == 0.
Alexandre Julliard
julliard at winehq.org
Fri Apr 12 10:40:36 CDT 2013
Module: wine
Branch: master
Commit: 37f7e7ea0c57416e9eb39a884f9f5d9a7bdee0e1
URL: http://source.winehq.org/git/wine.git/?a=commit;h=37f7e7ea0c57416e9eb39a884f9f5d9a7bdee0e1
Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date: Fri Apr 12 18:01:37 2013 +0900
kernel32: TerminateProcess unlike NtTerminateProcess is supposed to fail with process == 0.
---
dlls/kernel32/process.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c
index 93c0267..7abb732 100644
--- a/dlls/kernel32/process.c
+++ b/dlls/kernel32/process.c
@@ -2593,7 +2593,15 @@ DWORD WINAPI LoadModule( LPCSTR name, LPVOID paramBlock )
*/
BOOL WINAPI TerminateProcess( HANDLE handle, DWORD exit_code )
{
- NTSTATUS status = NtTerminateProcess( handle, exit_code );
+ NTSTATUS status;
+
+ if (!handle)
+ {
+ SetLastError( ERROR_INVALID_HANDLE );
+ return FALSE;
+ }
+
+ status = NtTerminateProcess( handle, exit_code );
if (status) SetLastError( RtlNtStatusToDosError(status) );
return !status;
}
More information about the wine-cvs
mailing list