Minor fixes in KERNEL32.TerminateThread() and in

KERNEL32.TerminateProcess().

svn path=/trunk/; revision=2177
This commit is contained in:
Emanuele Aliberti
2001-08-15 20:35:39 +00:00
parent 5a9b7bebbc
commit 3869ce90e5
2 changed files with 31 additions and 20 deletions

View File

@@ -1,4 +1,4 @@
/* $Id: proc.c,v 1.40 2001/03/31 01:17:30 dwelch Exp $
/* $Id: proc.c,v 1.41 2001/08/15 20:35:38 ea Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
@@ -523,15 +523,21 @@ TerminateProcess (
UINT uExitCode
)
{
NTSTATUS errCode;
errCode = NtTerminateProcess (hProcess, uExitCode);
if (!NT_SUCCESS(errCode))
if (0 == hProcess)
{
SetLastError (ERROR_INVALID_HANDLE);
}
else
{
NTSTATUS Status = NtTerminateProcess (hProcess, uExitCode);
if (NT_SUCCESS(Status))
{
SetLastErrorByStatus (errCode);
return FALSE;
}
return TRUE;
return TRUE;
}
SetLastErrorByStatus (Status);
}
return FALSE;
}

View File

@@ -1,4 +1,4 @@
/* $Id: thread.c,v 1.25 2001/08/07 14:13:45 ekohl Exp $
/* $Id: thread.c,v 1.26 2001/08/15 20:35:39 ea Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
@@ -415,16 +415,21 @@ WINBOOL STDCALL
TerminateThread (HANDLE hThread,
DWORD dwExitCode)
{
NTSTATUS errCode;
errCode = NtTerminateThread(hThread,
dwExitCode);
if (!NT_SUCCESS(errCode))
{
SetLastErrorByStatus(errCode);
return FALSE;
}
return TRUE;
if (0 == hThread)
{
SetLastError (ERROR_INVALID_HANDLE);
}
else
{
NTSTATUS Status = NtTerminateThread (hThread, dwExitCode);
if (NT_SUCCESS(Status))
{
return TRUE;
}
SetLastErrorByStatus (Status);
}
return FALSE;
}