reactos/ntoskrnl/include/internal
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
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 */