mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 06:22:58 +00:00
no need to reference the job object pointer in NtIsProcessInJob()
svn path=/trunk/; revision=11543
This commit is contained in:
parent
8ee82ee7cc
commit
8655dad649
1 changed files with 18 additions and 29 deletions
|
@ -126,19 +126,11 @@ NtIsProcessInJob(IN HANDLE ProcessHandle,
|
||||||
PEJOB ProcessJob = Process->Job;
|
PEJOB ProcessJob = Process->Job;
|
||||||
|
|
||||||
if(ProcessJob != NULL)
|
if(ProcessJob != NULL)
|
||||||
{
|
|
||||||
/* reference the object without caring about access rights as it does not necessarily
|
|
||||||
have to be accessible from the calling process */
|
|
||||||
Status = ObReferenceObjectByPointer(ProcessJob,
|
|
||||||
0,
|
|
||||||
PsJobType,
|
|
||||||
KernelMode);
|
|
||||||
if(NT_SUCCESS(Status))
|
|
||||||
{
|
{
|
||||||
if(JobHandle == NULL)
|
if(JobHandle == NULL)
|
||||||
{
|
{
|
||||||
/* simply test whether the process is assigned to a job */
|
/* the process is assigned to a job */
|
||||||
Status = ((ProcessJob != NULL) ? STATUS_PROCESS_IN_JOB : STATUS_PROCESS_NOT_IN_JOB);
|
Status = STATUS_PROCESS_IN_JOB;
|
||||||
}
|
}
|
||||||
else /* JobHandle != NULL */
|
else /* JobHandle != NULL */
|
||||||
{
|
{
|
||||||
|
@ -157,9 +149,6 @@ NtIsProcessInJob(IN HANDLE ProcessHandle,
|
||||||
ObDereferenceObject(JobObject);
|
ObDereferenceObject(JobObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ObDereferenceObject(ProcessJob);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue