replace ad hoc driver loading with a proper driver manager, new DDK, new PnP manager with device matching, asynchronous startup, resource ownership and removal, add shared PCI capability helpers, replace typed, rigid services with a proper service manager, implement proper system shutdown and restart, shutting down unloads drivers and shuts down services, add simple power button, remove heavyweight boot self-tests and SMP stress runs, add monotonic timestamps to kernel debug output, fruitless USB and PS/2 fixes, make test builds opt in.
This commit is contained in:
1 parent
c0ad63c27f
commit
d36f19509c
160 files changed
+6563
-7366
No files matched your search
@@ -2,10 +2,11 @@
|
||||
// Verifies that kernel-owned processes remain queryable but cannot be terminated.
|
||||
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
#include <ntlite/syscall.h>
|
||||
|
||||
#define MAX_PROCESSES 16u
|
||||
#define MAX_PROCESSES 64u
|
||||
|
||||
// Prints one NUL-terminated string to the console.
|
||||
static void print(const char* text) {
|
||||
@@ -81,10 +82,12 @@ void main(void) {
|
||||
|
||||
int sawIdle = 0;
|
||||
int sawSystem = 0;
|
||||
int sawInit = 0;
|
||||
size_t limit = count < MAX_PROCESSES ? count : MAX_PROCESSES;
|
||||
for (size_t i = 0; i < limit; i++) {
|
||||
const SYS_PROCESS_INFO* process = &processes[i];
|
||||
if (!(process->Flags & (SYS_PROCESS_FLAG_IDLE | SYS_PROCESS_FLAG_SYSTEM)))
|
||||
int isInit = strcmp(process->Name, "system/init.exe") == 0;
|
||||
if (!(process->Flags & (SYS_PROCESS_FLAG_IDLE | SYS_PROCESS_FLAG_SYSTEM)) && !isInit)
|
||||
continue;
|
||||
|
||||
if (!(process->Flags & SYS_PROCESS_FLAG_TERMINATION_PROTECTED))
|
||||
@@ -93,11 +96,19 @@ void main(void) {
|
||||
verify_protected_process(process);
|
||||
if (process->Flags & SYS_PROCESS_FLAG_IDLE) sawIdle = 1;
|
||||
if (process->Flags & SYS_PROCESS_FLAG_SYSTEM) sawSystem = 1;
|
||||
if (isInit) sawInit = 1;
|
||||
}
|
||||
|
||||
if (!sawIdle || !sawSystem)
|
||||
if (!sawIdle || !sawSystem || !sawInit)
|
||||
fail_status("missing kernel process", (uint32_t)((sawIdle ? 1u : 0u) | (sawSystem ? 2u : 0u)));
|
||||
|
||||
uint32_t action = 0;
|
||||
SYS_HANDLE event = SYS_HANDLE_INVALID;
|
||||
if (SysOpenPowerEvent(&event) != NTLSTATUS_ACCESS_DENIED ||
|
||||
SysQuerySystemPower(&action) != NTLSTATUS_ACCESS_DENIED ||
|
||||
SysCompleteSystemPower(SYS_POWER_ACTION_SHUTDOWN) != NTLSTATUS_ACCESS_DENIED)
|
||||
fail_status("power coordinator ownership", NTLSTATUS_FAILURE);
|
||||
|
||||
print("process_protection_smoke: PASS\n");
|
||||
exit_now(0);
|
||||
}
|
||||
Reference in new issue
Block a user