- Move NtQueueApcThread to ps/state.c since it's a Ps-level function.
- Make NtQueueApcThread use POOL_QUOTA_FAIL_INSTEAD_OF_RAISE and add that flag to our DDK. Also fix the check for SystemThread by looking at the flag, not checking if TEB == NULL. Also fix a memory leak and comment header.
- Fix comment header in KiInitalizeUserApc.
svn path=/trunk/; revision=24051
- Move KiInitializeUserApc to ke/i386/userapc.c. The routine is non-portable.
- Force Ring 3 state into User APC TrapFrame to maintain system integrity and coherency. Also respect IOPL.
- Use SEH handling routine just like when handling exceptions, to properly re-direct a crash here. Thanks to KJK again for showing me how to write these kinds of routines.
svn path=/trunk/; revision=24050
- Release dispatcher lock from DPC level in KiAttachProcess.
- Add missing decoration/assert to KeAttachProcess, and only acquire APC lock after we've made the invalid attach test. Also acquire dispatcher lock at DPC level here and in KeStackAttachProcess.
- Loop in KeUnStachDetachProcess to avoid the case where we acquired the APC lock while a kernel APC was pending. Keep releaing the loop and re-attemping acquire until it has been delivered.
- Add Decoration for *ServiceTable* functions.
svn path=/trunk/; revision=24048
- Add some missing decoration.
- NUMA node semantics for KeInitializeProcess are only required on SMP builds.
- Allow KeInitailizeProcess to receive an argument specifying if alignment faults should be enabled or not.
- Use KiComputeIopmOffset to get the IopmOFfset instead of setting -1
svn path=/trunk/; revision=24047
- Add assertions to relevant functions in process.c and re-format some code.
- Check for invalid APC state in KeDetachProcess.
- Decrease process stack count while holding the Dispatcher Lock at DPC level.
- Implement KiSwapProcess in ctxswitch.S and add SMP-support and LDT swap support for the future, as well as updating the IOPM base in the TSS.
svn path=/trunk/; revision=24044
- Same changes to event.c as with the other files.
- Remove lock property, these files have already been audited as clean and were unlocked.
svn path=/trunk/; revision=24040
- Cleanup mutex.c and sem.c. No real code changes, just add ASSERTs, STDCALL->NTAPI, IN/OUT decoration.
- One change though, in KeReleaseMutant, use KeLeaveCriticalRegion instead of manually writing down the code, it's more readable this way.
svn path=/trunk/; revision=24039
- apc.c -> Also multiple optimizations to use the APC lock instead of the full-fledged dispatcher lock.
- gate.c -> Use APC lock as well, the full dispatcher lock isn't required because a thread can only wait on one and only one gate.
- process.c -> Optimize the code to use the Process and/or APC lock instead of the dispatcher lock. Also delay acquiring the locks after some checks, to make the exit paths simpler.
- More fixes are teh needed.
svn path=/trunk/; revision=24038
- Update KeSetAFfinityThread, KeSetPriorityThread with new locks and assertions (plus the current ROS scheduler hack).
svn path=/trunk/; revision=24034
- Update KeSetIdealProcessorThread to properly do Ideal CPU logic instead of blindgly setting it (most importantly, respect UserIdealProcessor and SystemAffinityActive seettings).
svn path=/trunk/; revision=24033
- Stargint reorganizing some public functions to the bottom of the file.
- Don't hold lock during KeSetKernelStackSwapEnable.
svn path=/trunk/; revision=24030
- Update KeFreezeAllThreads to use the Process and APC In-Stack Queued Spinlock.
- Update KeTerminateThread to use the Process Lock. Call KiRundownThread to cleanup the NPX thread. Add some assertions for Stack in/out-paging. Use KiSetThreadSwapBusy for proper SMP vs UP building.
- NUMA Node semantics in KeStartThread only need to be done for CONFIG_SMP builds, so #ifed them appropriately. Also made it use the Process In-Stack QSL.
svn path=/trunk/; revision=24029
- Implement KeAcquireInStackQueuedSpinLockRaiseToSynch for UP systems.
- Implement KiAcquireApcLock, KiAcquireApcLockAtDpcLevel, KiReleaseApcLock, KiReleaseApcLockFromDpcLevel.
- KeResumeThread, KeSuspendThread, KeAlertThread, KeForceResumeThread, KeTestAlertThread, KeAlertResumeThread are now the first to use the new APC In-Stack Queued Spinlock for sychronization.
svn path=/trunk/; revision=24028
- Also fix KeSetAffinityThread to return the old affinity, instead of NTSTATUS and move NtYieldExecution from Ps to Ke, and move NtDelayExecution to wait.c
- No code changes.
svn path=/trunk/; revision=24024
- Finally get rid of duplicated relocation code in ntdll by using the relocate function from RTL and enable/disable protection
- Some improvements added to RTL's relocation function, it's split up into two functions now
svn path=/trunk/; revision=24020
It did not catch the last input tick from keyboard or mouse.
This code is not tested in reactos, but should work.
See issue #1753 for more details.
svn path=/trunk/; revision=24005