- Implement KeReadStateThread.
- Fix PspTerminateProcess to handle case where there's no threads in the process.
- Fix check in PspTerminateProcess. ObClearProcessHandleTable gets called if there's a debug port, not if there's an object table.
- Simplfy PspReapRoutine.
- Fix PspExitThread to wait for all other threads before continuing to kill the last thread. Should fix lots of race/wait conditions.
- PspExitThread should check for !DeadThread and not !Terminated before determining if it should free the TEB. Also, the DbgK handle should only be closed if the thread isn't already dead.
- Fixup formatting of some code to warn less on MSVC.
- Fail various APIs if acquiring rundown protection failed.
- Fix Process Quantum/Priority settings.
- Grant PROCESS_TERMINATE by default.
- Add PROCESS_SET_INFORMATION, STANDARD_RIGHTS_ALL and PROCESS_SET_QUOTA to the default process granted access mask.
- Initialize process/thread/image notification callbacks durin phase 0 Ps initialization.
- The Audit Name belongs to the system process, not the idle process.
- Detect more failures in phase 0 startup.
- Fix various race conditions/incorrect checks in ps/security.c related to impersonation information. Also allow PspAssignPrimaryToken to be called directly with the token pointer and not only the handle.
- Wrap system thread startup stub in SEH and write a SEH filter function to print out debug information when a system thread dies unexpectedly.
svn path=/trunk/; revision=25504
- Fix some stupid bugs in NtCreateDebugObject.
- Add tracing framework and add tracing to all of debug.c.
- Dbgk *almost* works: http://www.tinykrnl.org/dbgworking.png. Here I attach to services.exe and the kernel is sending notifications for all threads and DLLs loaded.
svn path=/trunk/; revision=24981
- Add Dbgk-calls to NtMap/UnmapViewOfSection to nodify debugging services of new DLL image load.
- Dbgk support is now skeletally complete, I will write a simple test app to test some functionality and start finding/fixing bugs.
svn path=/trunk/; revision=24980
- Implement DbgkpCloseObject.
- Implement DbgkpOpenHandles.
- Fix various bugs in the code and flag usage.
- Enable calling DbgkClearProcessDebugObject when terminating a process.
svn path=/trunk/; revision=24574
- Call PsInitSystem instead of PspInitPhase0, since PsInitsystem is the "external" phase-choosing routine.
- Implement ExComputeTickCountMultiplier to create a 24-bit precision remainder + whole integer of the ms/clock tick used in SharedUserData.
- Set the OS version and Machine Type (i386/PPC (<3 Arty) in SharedUserData.
- Move some HAL calls in Phase 2 (actually Phase 1...), same for KeInit2.
- Break into KDBG a bit earlier.
svn path=/trunk/; revision=24363
- Optimize PspLookupUserEntrypoints to use static ANSI_STRINGs instead of building them at runtime.
- Fix mapping/loading of the System DLL so that it's loaded as executable code, not read-only code. Also fix a handle leak of the section, and re-factor some code into smaller shared functions to reduce code duplication.
svn path=/trunk/; revision=24154
1>ReactOS Kernel - 0 error(s), 253 warning(s)
- Add winerror.h to ps/win32.c so it can get the Win32 error definition it needs (winerror.h doesn't add any other nasty win32 headers, so this isn't really a header policy violation).
- Fix prototypes of KdEnableDebugger and KdDisableDebugger.
- Write one of the cleanest and most ingenious hacks I've ever come up with it, which bypasses the incompatibility of hard-coded WDK externals.
svn path=/trunk/; revision=23973
- Remove #ifed out code in PspCreateProcess which was attempting to create the name structure. Add code to MmCreateProcessAddressSpace to initialize the audit name after the 16-byte name.
- Implement some helper APIs for better code refactoring.
- TODO: Get rid of PspGetImagePath and wrap around SeLocateProcessImageName instead.
svn path=/trunk/; revision=23303
- Implement PspSetCrossThreadFlag and PspClearCrossThreadFlag and use them. Thanks to Thomas for the idea.
- Fix a bug in Fast Referencing, thanks to Thomas.
svn path=/trunk/; revision=23260
- Add a new tracing class/macro for reference counts and add it in kill/process/thread.c.
- Remove tracing TODO from kernel fun.
svn path=/trunk/; revision=23254
- Call PspComputeQuantumAndPriority in PspCreateProcess to calculate process base priority and quantum for child threads.
- Add security code to calculate process's access rights to itself, as documented in WI II.
svn path=/trunk/; revision=23248
- Implement PspWriteTebImpersonationInfo for setting the impersonation locale and impersonation status in the TEB (since User-mode needs to read this value and we don't want to NtQueryInformationThread for it each time to read the ETHERAD flag).
- Complete the implementation of PspSetPrimaryToken to recalculate a process's access rights to itself based on a new primary token.
- Reorganize ps.h header like ob.h and io.h, implement Tracing support but not the tracing itself yet.
- Get rid of some deprecated cruft.
svn path=/trunk/; revision=23233
- PspAssignPrimaryToken was good enough for actually *assigning* the token, but when NtSetInfoProcess is called with ProcessPrimaryToken, we want to do a lot more then just randomly assigning it. Added PspSetPrimaryToken which first verifies if the token being assigned is a child token and if not, checks for SeAssignPrimaryTokenPrivilege. Also added a fixme for more code that's needed, to actually re-calculate the process's granted access towards itself. Also added thread-safety.
svn path=/trunk/; revision=23226
- Remove a bunch of deprecated crap from ps.h
- Get rid of PsLockProcess, PsUnlockProcess. Use the process pushlock instead.
- When assigning the job, only acquiring rundown protection is enough.
- Use interlocked intrinsics for setting the ExceptionPort instead of locking the entire process object.
- Disable locking in ProcessSessionInformation for NtSetInformationProcess. The whole API seems wrong anyway, on my XP machine calling it does not change the session or change any token data. To verify later...
svn path=/trunk/; revision=23197
- Change FAST_MUTEX PsActiveProcessMutex to KGUARDED_MUTEX.
- Define PS Flags and use them, isntead of magic numbers. (For magic mushrooms, you'll have to wait a while, these aren't implemented yet).
svn path=/trunk/; revision=23194
- Cleanup formatting in the file and add proper credits (Thomas and Eric).
- Create internal Exp* functions for Setting/Getting the user langid, since they need to be called 2, 3 times by other code and thus shared.
- Remove some deprecated code, make the functions themselves initialize the default ID when called for the first time (which should be done by winlogon --> it seems this isn't done yet?).
- Set default locale to 0x409 instead of 0x0.
svn path=/trunk/; revision=23133
- Cleanup notify.c and fix the return value of PsSetCreateProcessNotifyRoutine.
- Create ps_x.h for inlined Ps routines and put the internal routines which call the registered callbacks in it.
svn path=/trunk/; revision=23131
- Architectural changes to match information in Windows Internals 4 and other documented sources of information (Windows Internals II by Probert). Code should match Win2003 layout.
- Handle almost any possible process/thread sub structure and add its cleanup code stubs, so that when we actually implement them, we won't forget to clean them up in the process code.
- Add interlocked usage of process and thread flags in order to make everything more thread-safe.
- Better handle cases where threads die instantly, race conditions, and other weird issues.
- Better handle process termination and thread termination.
- Implement NtCreateProcessEx and update PspCreateProcess/NtCreateProcess.
- Improve cleanup of process object in PspProcessDelete.
- Optimize some things like User Thread startup.
- Add some extra asserts, paged_code checks and also user-mode security check.
- Implement helper API PsGetNextProcessThread
- Optimize thread reaper (thanks Filip)
- Do proper referencing/dereferencing of thread/processes (thanks Thomas)
- Document FIXMEs needed for Ps code to be up to standards and complete.
svn path=/trunk/; revision=22976
- Overlay MADDRES_SPACE over MM_AVL_NODE. Even though our structures are currently incompatible, they represent the same thing (The EPROCESS's Address space).
svn path=/trunk/; revision=21934
- Rename LdrLoadInitialProcess to Exp... and move to executive initialization.
- Removed ldr/init.c
- Renamed ldr/sysdll.c functions to Psp (correct naming) and deleted file.
- Renamed SystemDll... ntdll pointers to correct Ke names
- Use direct Ke names instead of going through an API call.
- Make ExpInit... functions STDCALL
svn path=/trunk/; revision=17053
- Detect if Kernel APCs were pending during thread shutdown.
- Call Lego Routine, if registered, during thread shutdown.
svn path=/trunk/; revision=16705