#define NDEBUG
#include <debug.h>
-/* FIXME: From winbase.h... what to do? */
-#define SEM_NOALIGNMENTFAULTEXCEPT 0x04
-
/* Debugging Level */
ULONG PspTraceLevel = 0;
PPROCESS_BASIC_INFORMATION ProcessBasicInfo =
(PPROCESS_BASIC_INFORMATION)ProcessInformation;
PKERNEL_USER_TIMES ProcessTime = (PKERNEL_USER_TIMES)ProcessInformation;
+ ULONG UserTime, KernelTime;
PPROCESS_PRIORITY_CLASS PsPriorityClass = (PPROCESS_PRIORITY_CLASS)ProcessInformation;
ULONG HandleCount;
PPROCESS_SESSION_INFORMATION SessionInfo =
(ProcessHandle != NtCurrentProcess()))
{
/*
- * Retreiving the process cookie is only allowed for the calling process
- * itself! XP only allowes NtCurrentProcess() as process handles even if
+ * Retrieving the process cookie is only allowed for the calling process
+ * itself! XP only allows NtCurrentProcess() as process handles even if
* a real handle actually represents the current process.
*/
return STATUS_INVALID_PARAMETER;
_SEH2_TRY
{
/* Copy time information from EPROCESS/KPROCESS */
- /* FIXME: Call KeQueryRuntimeProcess */
+ KernelTime = KeQueryRuntimeProcess(&Process->Pcb, &UserTime);
ProcessTime->CreateTime = Process->CreateTime;
- ProcessTime->UserTime.QuadPart = Process->Pcb.UserTime *
- KeMaximumIncrement;
- ProcessTime->KernelTime.QuadPart = Process->Pcb.KernelTime *
- KeMaximumIncrement;
+ ProcessTime->UserTime.QuadPart = (LONGLONG)UserTime * KeMaximumIncrement;
+ ProcessTime->KernelTime.QuadPart = (LONGLONG)KernelTime * KeMaximumIncrement;
ProcessTime->ExitTime = Process->ExitTime;
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
Length = sizeof(ULONG_PTR);
if (ProcessInformationLength != Length)
{
+ Length = 0;
Status = STATUS_INFO_LENGTH_MISMATCH;
break;
}
/* Validate the number */
if ((BasePriority > HIGH_PRIORITY) || (BasePriority <= LOW_PRIORITY))
{
+ ObDereferenceObject(Process);
return STATUS_INVALID_PARAMETER;
}
case ProcessQuotaLimits:
- return PspSetQuotaLimits(ProcessHandle,
+ Status = PspSetQuotaLimits(Process,
1,
ProcessInformation,
ProcessInformationLength,
PreviousMode);
+ break;
case ProcessWorkingSetWatch:
DPRINT1("WS watch not implemented\n");