mirror of
https://github.com/reactos/reactos.git
synced 2025-04-18 19:47:14 +00:00
the last parameter of NtQueryInformationProcess() is optional, don't use it when not needed.
svn path=/trunk/; revision=11329
This commit is contained in:
parent
b35df7844e
commit
2bcdc488b3
1 changed files with 6 additions and 9 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: proc.c,v 1.69 2004/10/02 21:14:08 weiden Exp $
|
/* $Id: proc.c,v 1.70 2004/10/19 10:27:11 weiden Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS system libraries
|
* PROJECT: ReactOS system libraries
|
||||||
|
@ -41,14 +41,13 @@ GetProcessAffinityMask (HANDLE hProcess,
|
||||||
LPDWORD lpSystemAffinityMask)
|
LPDWORD lpSystemAffinityMask)
|
||||||
{
|
{
|
||||||
PROCESS_BASIC_INFORMATION ProcessInfo;
|
PROCESS_BASIC_INFORMATION ProcessInfo;
|
||||||
ULONG BytesWritten;
|
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
Status = NtQueryInformationProcess (hProcess,
|
Status = NtQueryInformationProcess (hProcess,
|
||||||
ProcessBasicInformation,
|
ProcessBasicInformation,
|
||||||
(PVOID)&ProcessInfo,
|
(PVOID)&ProcessInfo,
|
||||||
sizeof(PROCESS_BASIC_INFORMATION),
|
sizeof(PROCESS_BASIC_INFORMATION),
|
||||||
&BytesWritten);
|
NULL);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
SetLastErrorByStatus (Status);
|
SetLastErrorByStatus (Status);
|
||||||
|
@ -280,14 +279,13 @@ GetExitCodeProcess(HANDLE hProcess,
|
||||||
LPDWORD lpExitCode)
|
LPDWORD lpExitCode)
|
||||||
{
|
{
|
||||||
PROCESS_BASIC_INFORMATION ProcessBasic;
|
PROCESS_BASIC_INFORMATION ProcessBasic;
|
||||||
ULONG BytesWritten;
|
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
Status = NtQueryInformationProcess(hProcess,
|
Status = NtQueryInformationProcess(hProcess,
|
||||||
ProcessBasicInformation,
|
ProcessBasicInformation,
|
||||||
&ProcessBasic,
|
&ProcessBasic,
|
||||||
sizeof(PROCESS_BASIC_INFORMATION),
|
sizeof(PROCESS_BASIC_INFORMATION),
|
||||||
&BytesWritten);
|
NULL);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
SetLastErrorByStatus(Status);
|
SetLastErrorByStatus(Status);
|
||||||
|
@ -308,14 +306,13 @@ InternalGetProcessId(HANDLE hProcess,
|
||||||
LPDWORD lpProcessId)
|
LPDWORD lpProcessId)
|
||||||
{
|
{
|
||||||
PROCESS_BASIC_INFORMATION ProcessBasic;
|
PROCESS_BASIC_INFORMATION ProcessBasic;
|
||||||
ULONG BytesWritten;
|
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
Status = NtQueryInformationProcess(hProcess,
|
Status = NtQueryInformationProcess(hProcess,
|
||||||
ProcessBasicInformation,
|
ProcessBasicInformation,
|
||||||
&ProcessBasic,
|
&ProcessBasic,
|
||||||
sizeof(PROCESS_BASIC_INFORMATION),
|
sizeof(PROCESS_BASIC_INFORMATION),
|
||||||
&BytesWritten);
|
NULL);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
SetLastErrorByStatus(Status);
|
SetLastErrorByStatus(Status);
|
||||||
|
@ -949,14 +946,14 @@ STDCALL
|
||||||
GetProcessHandleCount(HANDLE hProcess,
|
GetProcessHandleCount(HANDLE hProcess,
|
||||||
PDWORD pdwHandleCount)
|
PDWORD pdwHandleCount)
|
||||||
{
|
{
|
||||||
ULONG phc, BytesWritten;
|
ULONG phc;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
Status = NtQueryInformationProcess(hProcess,
|
Status = NtQueryInformationProcess(hProcess,
|
||||||
ProcessHandleCount,
|
ProcessHandleCount,
|
||||||
&phc,
|
&phc,
|
||||||
sizeof(ULONG),
|
sizeof(ULONG),
|
||||||
&BytesWritten);
|
NULL);
|
||||||
if(NT_SUCCESS(Status))
|
if(NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
*pdwHandleCount = phc;
|
*pdwHandleCount = phc;
|
||||||
|
|
Loading…
Reference in a new issue