clean up and standardize types across the codebase, unify atomic operations, improve UTF-8 handling throughout the system, remove obsolete input and named queue interfaces, redesign process preparation and creation, tighten IPC and service boundaries, improve error handling and reliability, minor documentation cleanup, fix doom surfaces, fix panic in ini parsing.
This commit is contained in:
1 parent
899225f551
commit
c0ad63c27f
226 files changed
+6562
-4147
No files matched your search
@@ -1,5 +1,7 @@
|
||||
// Kernel APC infrastructure. This file owns APC queuing, delivery, and user-mode return transitions.
|
||||
|
||||
#include <ntlite/atomic.h>
|
||||
#include <stdbool.h>
|
||||
#include <kernel/ke_apc.h>
|
||||
#include <kernel/ke_thread.h>
|
||||
#include <kernel/ke_cpu.h>
|
||||
@@ -19,7 +21,7 @@
|
||||
#define KI_RFLAGS_NT 0x4000ULL
|
||||
#define KI_RFLAGS_VM 0x20000ULL
|
||||
|
||||
static volatile long long gUserApcReturnTokenSeed;
|
||||
static volatile int64_t gUserApcReturnTokenSeed;
|
||||
|
||||
// Returns whether an address is in the canonical user half accepted by IRET.
|
||||
static bool KiUserAddressValid(uint64_t address) {
|
||||
@@ -49,7 +51,7 @@ static KSTATUS KiValidateUserApcResumeState(uint64_t rip, uint64_t rsp, uint64_t
|
||||
|
||||
// Allocates a nonzero token for one active user APC return frame.
|
||||
static uint64_t KiNextUserApcReturnToken(THREAD* thread, uintptr_t frameAddress) {
|
||||
uint64_t seed = (uint64_t)_InterlockedIncrement64(&gUserApcReturnTokenSeed);
|
||||
uint64_t seed = (uint64_t)NtlAtomicIncrement64(&gUserApcReturnTokenSeed);
|
||||
uint64_t token = seed ^ (uint64_t)(uintptr_t)thread ^ (uint64_t)frameAddress ^ SYS_USER_APC_FRAME_MAGIC;
|
||||
if (token == 0)
|
||||
token = SYS_USER_APC_FRAME_MAGIC;
|
||||
@@ -113,7 +115,7 @@ __declspec(dllexport) bool KeInsertQueueApc(KAPC* apc,
|
||||
if (thread->State == ThreadDead || KeThreadExitInProgress(thread))
|
||||
return false;
|
||||
|
||||
if (_InterlockedCompareExchange(&apc->Inserted, 1, 0) != 0)
|
||||
if (NtlAtomicCompareExchange32(&apc->Inserted, 1, 0) != 0)
|
||||
return false;
|
||||
|
||||
apc->SystemArgument1 = systemArgument1;
|
||||
|
||||
Reference in new issue
Block a user