- Fix one of the oldest hacks in ReactOS: KeGetCurrentThread() and PsGetcurrentProces...
authorAlex Ionescu <aionescu@gmail.com>
Sat, 16 Sep 2006 20:37:49 +0000 (20:37 +0000)
committerAlex Ionescu <aionescu@gmail.com>
Sat, 16 Sep 2006 20:37:49 +0000 (20:37 +0000)
commit78ef70dedacceec84beeddc018157c12a0fd4633
tree8d7ac126d1001eff8522ebf56eda23c0a6a6a99a
parent0d996fd421270cbcd322ca3d43c64d05469abdfe
- Fix one of the oldest hacks in ReactOS: KeGetCurrentThread() and PsGetcurrentProcess used to be NULL during early boot stage. We also didn't have an official idle therad/process. Also system intialization was not in its sepearte thread. Changes:
   - Implemented SeAssignPrimaryToken.
   - Setup Boot/System Token for Idle Process in SeInit2.
   - Remove ROS hack in SeCaptureSubjectContextEx.
   - Call SeAssignPrimaryToken in PspInitializeProcessSecurty when called for the Initial Process creation.
   - Implement PsInitiailizeQuotaSystem and set PspDefauptQuotaBlock for the idle process so that it can be used for the initial process.
   - Rewrite Process Manager Phase 0 initialization from scratch, to create a new initial system process and thread which will be used for Phase 1 (in ROS, phase 2) initialization of the executive.
   - Fix a bug in PspCreateProcess which was using an uninitialized value of SectionObject in some cases, instead of NULL.
   - Call PsInitailizeQuotaSystem from ObInit, and also create the system handle table inside the idle process, and make it the ObpKernelHandleTable.
   - Do Executive Phase 0 Initialization at APC_LEVEL.
   - Start idle thread at HIGH_PRIORITY then lower it to 0 once the Initial Thread is setup, so that it can run, then keep priority to 0 at DISPATCH_LEVEL and jump into idle loop code.
   - Add NtYieldExecution to idle loop code since it's now being used.
   - Fix IoGetCurrentProcess which was previously hacked.
   - Remove some checks for Thread == NULL in ke_x.h, since this is now impossible.
   - Split Phase 0/1 initialization in ex\init.c, since one runs in a separate thread now. Also don't lower IRQL to PASSIVE_LEVEL anymore (run at APC_LEVEL).

svn path=/trunk/; revision=24148
14 files changed:
reactos/ntoskrnl/KrnlFun.c
reactos/ntoskrnl/ex/init.c
reactos/ntoskrnl/include/internal/ke_x.h
reactos/ntoskrnl/io/iomgr/util.c
reactos/ntoskrnl/ke/i386/ctxswitch.S
reactos/ntoskrnl/ke/i386/kiinit.c
reactos/ntoskrnl/ob/obinit.c
reactos/ntoskrnl/ps/job.c
reactos/ntoskrnl/ps/process.c
reactos/ntoskrnl/ps/psmgr.c
reactos/ntoskrnl/ps/quota.c
reactos/ntoskrnl/ps/security.c
reactos/ntoskrnl/se/semgr.c
reactos/ntoskrnl/se/token.c