Commit in reactos on MAIN
include/ddk/psfuncs.h+6-61.32 -> 1.33
           /pstypes.h+21.45 -> 1.46
ntoskrnl/include/internal/ps.h+68-11.66 -> 1.67
ntoskrnl/ps/job.c+67-731.3 -> 1.4
           /process.c+4-51.140 -> 1.141
+147-85
5 modified files
1. added EJOB structure
2. implemented PsGetProcessJob(), PsGetJobLock(), PsGetJobSessionId() and PsGetJobUIRestrictionsClass()

reactos/include/ddk
psfuncs.h 1.32 -> 1.33
diff -u -r1.32 -r1.33
--- psfuncs.h	12 Aug 2004 06:04:21 -0000	1.32
+++ psfuncs.h	22 Sep 2004 14:53:26 -0000	1.33
@@ -1,4 +1,4 @@
-/* $Id: psfuncs.h,v 1.32 2004/08/12 06:04:21 ion Exp $
+/* $Id: psfuncs.h,v 1.33 2004/09/22 14:53:26 weiden Exp $
  */
 #ifndef _INCLUDE_DDK_PSFUNCS_H
 #define _INCLUDE_DDK_PSFUNCS_H
@@ -118,17 +118,17 @@
 
 PVOID
 STDCALL PsGetJobLock(
-    PVOID */*PEJOB*/	Job
+    PEJOB	Job
 	);
 
 PVOID
 STDCALL PsGetJobSessionId(
-    PVOID /*PEJOB*/	Job
+    PEJOB	Job
 	);
 
 ULONG
 STDCALL PsGetJobUIRestrictionsClass(
-   	PVOID /*PEJOB*/	Job
+   	PEJOB	Job
 	);
 
 LONGLONG
@@ -167,7 +167,7 @@
     	PEPROCESS	Process
 	);
 
-PVOID /*PEJOB*/
+PEJOB
 STDCALL PsGetProcessJob(
 	PEPROCESS Process
 	);
@@ -311,7 +311,7 @@
 
 VOID
 STDCALL PsSetJobUIRestrictionsClass(
-    PVOID /*PEJOB*/	Job,
+    PEJOB	Job,
     ULONG	UIRestrictionsClass	
 	);
 

reactos/include/ddk
pstypes.h 1.45 -> 1.46
diff -u -r1.45 -r1.46
--- pstypes.h	7 Mar 2004 20:31:52 -0000	1.45
+++ pstypes.h	22 Sep 2004 14:53:26 -0000	1.46
@@ -20,7 +20,9 @@
 struct _KPROCESS;
 struct _ETHREAD;
 struct _KTHREAD;
+struct _EJOB;
 
+typedef struct _EJOB *PEJOB;
 typedef struct _KTHREAD *PKTHREAD, *PRKTHREAD;
 
 typedef struct _IMAGE_INFO {

reactos/ntoskrnl/include/internal
ps.h 1.66 -> 1.67
diff -u -r1.66 -r1.67
--- ps.h	31 Aug 2004 20:17:17 -0000	1.66
+++ ps.h	22 Sep 2004 14:53:26 -0000	1.67
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: ps.h,v 1.66 2004/08/31 20:17:17 hbirr Exp $
+/* $Id: ps.h,v 1.67 2004/09/22 14:53:26 weiden Exp $
  *
  * FILE:            ntoskrnl/ke/kthread.c
  * PURPOSE:         Process manager definitions
@@ -33,6 +33,7 @@
 /* Forward declarations. */
 struct _KTHREAD;
 struct _KTRAPFRAME;
+struct _EJOB;
 
 #endif /* __ASM__ */
 
@@ -433,6 +434,9 @@
   /* Added by Alex Ionescu (alex@relsoft.net)*/
   ULONG					SessionId;
   struct _EPORT*		SecurityPort;
+  
+  struct _EJOB*         Job;
+  UINT                  JobStatus;
 };
 
 #define PROCESS_STATE_TERMINATED (1)
@@ -574,6 +578,69 @@
 STDCALL
 PspRunCreateProcessNotifyRoutines(PEPROCESS, BOOLEAN);
 
+#include <pshpack1.h>
+typedef struct _PS_JOB_TOKEN_FILTER
+{
+  UINT CapturedSidCount;
+  PSID_AND_ATTRIBUTES CapturedSids;
+  UINT CapturedSidsLength;
+  UINT CapturedGroupCount;
+  PSID_AND_ATTRIBUTES CapturedGroups;
+  UINT CapturedGroupsLength;
+  UINT CapturedPrivilegeCount;
+  PLUID_AND_ATTRIBUTES CapturedPrivileges;
+  UINT CapturedPrivilegesLength;
+} PS_JOB_TOKEN_FILTER, *PPS_JOB_TOKEN_FILTER;
+#include <poppack.h>
+
+#include <pshpack1.h>
+typedef struct _EJOB
+{
+  KEVENT Event;
+  LIST_ENTRY JobLinks;
+  LIST_ENTRY ProcessListHead;
+  ERESOURCE JobLock;
+  LARGE_INTEGER TotalUserTime;
+  LARGE_INTEGER TotalKernelTime;
+  LARGE_INTEGER ThisPeriodTotalUserTime;
+  LARGE_INTEGER ThisPeriodTotalKernelTime;
+  UINT TotalPageFaultCount;
+  UINT TotalProcesses;
+  UINT ActiveProcesses;
+  UINT TotalTerminatedProcesses;
+  LARGE_INTEGER PerProcessUserTimeLimit;
+  LARGE_INTEGER PerJobUserTimeLimit;
+  UINT LimitFlags;
+  UINT MinimumWorkingSetSize;
+  UINT MaximumWorkingSetSize;
+  UINT ActiveProcessLimit;
+  UINT Affinity;
+  BYTE PriorityClass;
+  UINT UIRestrictionsClass;
+  UINT SecurityLimitFlags;
+  PVOID Token;
+  PPS_JOB_TOKEN_FILTER Filter;
+  UINT EndOfJobTimeAction;
+  PVOID CompletionPort;
+  PVOID CompletionKey;
+  UINT SessionId;
+  UINT SchedulingClass;
+  ULONGLONG ReadOperationCount;
+  ULONGLONG WriteOperationCount;
+  ULONGLONG OtherOperationCount;
+  ULONGLONG ReadTransferCount;
+  ULONGLONG WriteTransferCount;
+  ULONGLONG OtherTransferCount;
+  IO_COUNTERS IoInfo;
+  UINT ProcessMemoryLimit;
+  UINT JobMemoryLimit;
+  UINT PeakProcessMemoryUsed;
+  UINT PeakJobMemoryUsed;
+  UINT CurrentJobMemoryUsed;
+  FAST_MUTEX MemoryLimitsLock;
+} EJOB;
+#include <poppack.h>
+
 #endif /* ASSEMBLER */
 
 #endif /* __INCLUDE_INTERNAL_PS_H */

reactos/ntoskrnl/ps
job.c 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- job.c	15 Aug 2004 16:39:10 -0000	1.3
+++ job.c	22 Sep 2004 14:53:26 -0000	1.4
@@ -21,152 +21,146 @@
  */
 NTSTATUS 
 STDCALL 
-NtAssignProcessToJobObject(
-	HANDLE JobHandle,
-    HANDLE ProcessHandle
-	)
+NtAssignProcessToJobObject(HANDLE JobHandle,
+                           HANDLE ProcessHandle)
 {
-	UNIMPLEMENTED;
-	return STATUS_NOT_IMPLEMENTED;
+  UNIMPLEMENTED;
+  return STATUS_NOT_IMPLEMENTED;
 }
+
+
 /*
  * @unimplemented
  */
 NTSTATUS 
 STDCALL 
-NtCreateJobObject(
-	PHANDLE JobHandle, 
-	ACCESS_MASK DesiredAccess,
-    POBJECT_ATTRIBUTES ObjectAttributes
-	)
+NtCreateJobObject(PHANDLE JobHandle,
+                  ACCESS_MASK DesiredAccess,
+                  POBJECT_ATTRIBUTES ObjectAttributes)
 {
-	UNIMPLEMENTED;
-	return STATUS_NOT_IMPLEMENTED;
+  UNIMPLEMENTED;
+  return STATUS_NOT_IMPLEMENTED;
 }
+
+
 /*
  * @unimplemented
  */
 NTSTATUS
 STDCALL
-NtIsProcessInJob(
-	IN HANDLE ProcessHandle,  // ProcessHandle must PROCESS_QUERY_INFORMATION grant access.
-	IN HANDLE JobHandle OPTIONAL	// JobHandle must grant JOB_OBJECT_QUERY access. Defaults to the current process's job object.
-	)
+NtIsProcessInJob(IN HANDLE ProcessHandle, // ProcessHandle must PROCESS_QUERY_INFORMATION grant access.
+                 IN HANDLE JobHandle OPTIONAL) // JobHandle must grant JOB_OBJECT_QUERY access. Defaults to the current process's job object.
 {
-	UNIMPLEMENTED;
-	return STATUS_NOT_IMPLEMENTED;
+  UNIMPLEMENTED;
+  return STATUS_NOT_IMPLEMENTED;
 }
+
+
 /*
  * @unimplemented
  */
 NTSTATUS 
 STDCALL 
-NtOpenJobObject(
-	PHANDLE JobHandle, 
-	ACCESS_MASK DesiredAccess,
-    POBJECT_ATTRIBUTES ObjectAttributes
-	)
+NtOpenJobObject(PHANDLE JobHandle,
+                ACCESS_MASK DesiredAccess,
+                POBJECT_ATTRIBUTES ObjectAttributes)
 {
-	UNIMPLEMENTED;
-	return STATUS_NOT_IMPLEMENTED;
+  UNIMPLEMENTED;
+  return STATUS_NOT_IMPLEMENTED;
 }
+
+
 /*
  * @unimplemented
  */
 NTSTATUS 
 STDCALL 
-NtQueryInformationJobObject(
-	HANDLE JobHandle,
-    JOBOBJECTINFOCLASS JobInformationClass, 
-	PVOID JobInformation,
-    ULONG JobInformationLength, 
-	PULONG ReturnLength
-	)
+NtQueryInformationJobObject(HANDLE JobHandle,
+                            JOBOBJECTINFOCLASS JobInformationClass,
+                            PVOID JobInformation,
+                            ULONG JobInformationLength,
+                            PULONG ReturnLength)
 {
-	UNIMPLEMENTED;
-	return STATUS_NOT_IMPLEMENTED;
+  UNIMPLEMENTED;
+  return STATUS_NOT_IMPLEMENTED;
 }
+
+
 /*
  * @unimplemented
  */
 NTSTATUS 
 STDCALL 
-NtSetInformationJobObject(
-	HANDLE JobHandle,
-    JOBOBJECTINFOCLASS JobInformationClass,
-    PVOID JobInformation, 
-	ULONG JobInformationLength
-	)
+NtSetInformationJobObject(HANDLE JobHandle,
+                          JOBOBJECTINFOCLASS JobInformationClass,
+                          PVOID JobInformation,
+                          ULONG JobInformationLength)
 {
-	UNIMPLEMENTED;
-	return STATUS_NOT_IMPLEMENTED;
+  UNIMPLEMENTED;
+  return STATUS_NOT_IMPLEMENTED;
 }
 
+
 /*
  * @unimplemented
  */
 NTSTATUS 
 STDCALL 
-NtTerminateJobObject(
-	HANDLE JobHandle, 
-	NTSTATUS ExitStatus
-	)
+NtTerminateJobObject(HANDLE JobHandle,
+                     NTSTATUS ExitStatus)
 {
-	UNIMPLEMENTED;
-	return STATUS_NOT_IMPLEMENTED;
+  UNIMPLEMENTED;
+  return STATUS_NOT_IMPLEMENTED;
 }
 
+
 /*
- * @unimplemented
+ * @implemented
  */
 PVOID
 STDCALL 
-PsGetJobLock(
-    PVOID */*PEJOB*/ Job
-	)
+PsGetJobLock(PEJOB Job)
 {
-	UNIMPLEMENTED;
-	return 0;	
+  assert(Job);
+  return (PVOID)&Job->JobLock;
 }
 
 
-
 /*
- * @unimplemented
+ * @implemented
  */
 PVOID
 STDCALL
-PsGetJobSessionId(
-    PVOID /*PEJOB*/	Job
-	)
+PsGetJobSessionId(PEJOB Job)
 {
-	UNIMPLEMENTED;
-	return 0;	
+  assert(Job);
+  return (PVOID)Job->SessionId;
 }
 
+
 /*
- * @unimplemented
+ * @implemented
  */
 ULONG
 STDCALL
-PsGetJobUIRestrictionsClass(
-   	PVOID /*PEJOB*/	Job
-	)
+PsGetJobUIRestrictionsClass(PEJOB Job)
 {
-	UNIMPLEMENTED;
-	return 0;	
+  assert(Job);
+  return Job->UIRestrictionsClass;
 }
 
+
 /*
  * @unimplemented
  */                       
 VOID
 STDCALL
-PsSetJobUIRestrictionsClass(
-    PVOID /*PEJOB*/	Job,
-    ULONG	UIRestrictionsClass	
-	)
+PsSetJobUIRestrictionsClass(PEJOB Job,
+                            ULONG UIRestrictionsClass)
 {
-	UNIMPLEMENTED;
+  assert(Job);
+  InterlockedExchange((LONG*)&Job->UIRestrictionsClass, (LONG)UIRestrictionsClass);
+  /* FIXME - walk through the job process list and update the restrictions? */
 }
+
 /* EOF */

reactos/ntoskrnl/ps
process.c 1.140 -> 1.141
diff -u -r1.140 -r1.141
--- process.c	31 Aug 2004 20:17:18 -0000	1.140
+++ process.c	22 Sep 2004 14:53:26 -0000	1.141
@@ -1,4 +1,4 @@
-/* $Id: process.c,v 1.140 2004/08/31 20:17:18 hbirr Exp $
+/* $Id: process.c,v 1.141 2004/09/22 14:53:26 weiden Exp $
  *
  * COPYRIGHT:         See COPYING in the top level directory
  * PROJECT:           ReactOS kernel
@@ -1671,16 +1671,15 @@
 }
 
 /*
- * @unimplemented
+ * @implemented
  */
-PVOID /*PEJOB*/
+PEJOB
 STDCALL
 PsGetProcessJob(
 	PEPROCESS Process
 	)
 {
-	UNIMPLEMENTED;
-	return 0;	
+	return Process->Job;
 }
 
 /*
CVSspam 0.2.8