[ros-diffs] [weiden] 13197: NtCreateJobObject() should create the handle instead of just returning a uninitialized variable

weiden at svn.reactos.com weiden at svn.reactos.com
Fri Jan 21 23:25:56 CET 2005


NtCreateJobObject() should create the handle instead of just returning a
uninitialized variable
Modified: trunk/reactos/ntoskrnl/ps/job.c
  _____  

Modified: trunk/reactos/ntoskrnl/ps/job.c
--- trunk/reactos/ntoskrnl/ps/job.c	2005-01-21 21:37:32 UTC (rev
13196)
+++ trunk/reactos/ntoskrnl/ps/job.c	2005-01-21 22:25:54 UTC (rev
13197)
@@ -262,19 +262,28 @@

     InsertTailList(&PsJobListHead, &Job->JobLinks);
     ExReleaseFastMutex(&PsJobListLock);
     
-    /* pass the handle back to the caller */
-    _SEH_TRY
+    Status = ObInsertObject(Job,
+                            NULL,
+                            DesiredAccess,
+                            0,
+                            NULL,
+                            &hJob);
+    if(NT_SUCCESS(Status))
     {
-      /* 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;
+      /* pass the handle back to the caller */
+      _SEH_TRY
+      {
+        /* 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;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.reactos.org/pipermail/ros-diffs/attachments/20050121/2f7c3217/attachment.html


More information about the Ros-diffs mailing list