[2/3] kernel32: TerminateProcess unlike NtTerminateProcess is supposed to fail with process == 0.

Dmitry Timoshkov dmitry at baikal.ru
Fri Apr 12 04:01:37 CDT 2013


---
 dlls/kernel32/process.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

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;
 }
-- 
1.8.2.1




More information about the wine-patches mailing list