implemented NtOpenJobObject()
Modified: trunk/reactos/ntoskrnl/ps/job.c
_____
Modified: trunk/reactos/ntoskrnl/ps/job.c
--- trunk/reactos/ntoskrnl/ps/job.c 2005-01-21 14:12:03 UTC (rev
13184)
+++ trunk/reactos/ntoskrnl/ps/job.c 2005-01-21 14:40:06 UTC (rev
13185)
@@ -337,7 +337,7 @@
/*
- * @unimplemented
+ * @implemented
*/
NTSTATUS
STDCALL
@@ -345,8 +345,53 @@
ACCESS_MASK DesiredAccess,
POBJECT_ATTRIBUTES ObjectAttributes)
{
- UNIMPLEMENTED;
- return STATUS_NOT_IMPLEMENTED;
+ KPROCESSOR_MODE PreviousMode;
+ HANDLE hJob;
+ NTSTATUS Status = STATUS_SUCCESS;
+
+ PreviousMode = ExGetPreviousMode();
+
+ /* check for valid buffers */
+ if(PreviousMode == UserMode)
+ {
+ _SEH_TRY
+ {
+ /* probe with 32bit alignment */
+ ProbeForWrite(JobHandle,
+ sizeof(HANDLE),
+ sizeof(ULONG));
+ }
+ _SEH_HANDLE
+ {
+ Status = _SEH_GetExceptionCode();
+ }
+ _SEH_END;
+ }
+
+ if(NT_SUCCESS(Status))
+ {
+ Status = ObOpenObjectByName(ObjectAttributes,
+ PsJobType,
+ NULL,
+ PreviousMode,
+ DesiredAccess,
+ NULL,
+ &hJob);
+ if(NT_SUCCESS(Status))
+ {
+ _SEH_TRY
+ {
+ *JobHandle = hJob;
+ }
+ _SEH_HANDLE
+ {
+ Status = _SEH_GetExceptionCode();
+ }
+ _SEH_END;
+ }
+ }
+
+ return Status;
}
Show replies by date