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:
maksw committed 2026-10-12 18:17:43 +02:00
1 parent 899225f551
commit c0ad63c27f
226 files changed
+6562 -4147

No files matched your search

@@ -1,5 +1,6 @@
// User-mode smoke test for process-local userspace module loading.
#include <stdbool.h>
#include <stdint.h>
#include <stddef.h>
#include <string.h>
@@ -26,7 +27,7 @@ static void print_u64(uint64_t v) {
static void exit_now(int32_t code) { while (true) SysExitProcess(code); }
static void fail(const char* message) { print("module_load_smoke: "); print(message); print("\n"); exit_now(1); }
static void fail_status(const char* what, uint32_t status) {
static void fail_status(const char* what, KSTATUS status) {
print("module_load_smoke: "); print(what); print(" status="); print_u64(status); print("\n"); exit_now(1);
}
@@ -36,12 +37,12 @@ static void check_module_info(const NTL_MODULE_INFO* info) {
if (strcmp(info->Name, "posix.dll") != 0) fail("module name mismatch");
}
static int module_list_contains(uintptr_t base) {
static bool module_list_contains(uintptr_t base) {
size_t count = 0;
uint32_t status = NtlGetModuleList(0, 0, &count);
KSTATUS status = NtlGetModuleList(0, 0, &count);
if (status != NTLSTATUS_BUFFER_TOO_SMALL && status != NTLSTATUS_SUCCESS)
fail_status("query module count", status);
if (count == 0) return 0;
if (count == 0) return false;
if (count > SIZE_MAX / sizeof(NTL_MODULE_INFO)) fail("module count overflow");
size_t bytes = count * sizeof(NTL_MODULE_INFO);
size_t pages = (bytes + 4095u) / 4096u;
@@ -60,8 +61,8 @@ static int module_list_contains(uintptr_t base) {
size_t copied = count;
status = NtlGetModuleList(modules, count, &copied);
if (status != NTLSTATUS_SUCCESS) { (void)SysFreeVm(memory); fail_status("query module list", status); }
int found = 0;
for (size_t i = 0; i < copied; ++i) if (modules[i].Base == base) { found = 1; break; }
bool found = false;
for (size_t i = 0; i < copied; ++i) if (modules[i].Base == base) { found = true; break; }
(void)SysFreeVm(memory);
return found;
}
@@ -81,7 +82,7 @@ static NTL_MODULE_HANDLE load_module(SYS_HANDLE root, const char* path,
req.ResolveModuleName = resolver;
req.ModuleHandleOut = &handle;
req.InfoOut = info;
uint32_t status = NtlLoadModuleAt(&req);
KSTATUS status = NtlLoadModuleAt(&req);
if (status != NTLSTATUS_SUCCESS) fail_status("load module", status);
if (handle == NTL_MODULE_HANDLE_INVALID) fail("load returned null handle");
return handle;
@@ -91,7 +92,7 @@ static NTL_MODULE_HANDLE load_module(SYS_HANDLE root, const char* path,
int main(void) {
print("module_load_smoke: start\n");
SYS_HANDLE root = SYS_HANDLE_INVALID;
uint32_t status = NtlResourceOpenSystemRoot(SYS_RIGHT_QUERY | SYS_VOLUME_RIGHT_OPEN, &root);
KSTATUS status = NtlResourceOpenSystemRoot(SYS_RIGHT_QUERY | SYS_VOLUME_RIGHT_OPEN, &root);
if (status != NTLSTATUS_SUCCESS) fail_status("open system root", status);
NTL_MODULE_HANDLE syscallModule = load_module(root, "system/syscall.dll",