NtCreateJobObject() should create the handle instead of just returning a uninitialized variable

svn path=/trunk/; revision=13197
This commit is contained in:
Thomas Bluemel 2005-01-21 22:25:54 +00:00
parent 81fd53f09d
commit bbc9243d77

View file

@ -262,19 +262,28 @@ NtCreateJobObject(PHANDLE JobHandle,
InsertTailList(&PsJobListHead, &Job->JobLinks); InsertTailList(&PsJobListHead, &Job->JobLinks);
ExReleaseFastMutex(&PsJobListLock); ExReleaseFastMutex(&PsJobListLock);
/* pass the handle back to the caller */ Status = ObInsertObject(Job,
_SEH_TRY NULL,
DesiredAccess,
0,
NULL,
&hJob);
if(NT_SUCCESS(Status))
{ {
/* NOTE: if the caller passed invalid buffers to receive the handle it's his /* pass the handle back to the caller */
own fault! the object will still be created and live... It's possible _SEH_TRY
to find the handle using ObFindHandleForObject()! */ {
*JobHandle = hJob; /* NOTE: if the caller passed invalid buffers to receive the handle it's his
own fault! the object will still be created and live... It's possible
to find the handle using ObFindHandleForObject()! */
*JobHandle = hJob;
}
_SEH_HANDLE
{
Status = _SEH_GetExceptionCode();
}
_SEH_END;
} }
_SEH_HANDLE
{
Status = _SEH_GetExceptionCode();
}
_SEH_END;
} }
return Status; return Status;