implement user mode catchable exceptions, refactor system status codes to use NTLSTATUS_ prefix, update build scripts to use shared literal macros for linker arguments, update named queue lifetime cleanup to include KeNamedQueueUnpublishHandle.

This commit is contained in:
maksw committed 2026-06-27 20:38:43 +02:00
1 parent 1f5477cf66
commit b7fcfce6f7
140 files changed
+7649 -3943

No files matched your search

@@ -78,13 +78,13 @@ static uint32_t open_test_file(uint32_t* out, const char** pathOut) {
SYS_FILE_FLAG_NONE,
&h);
uint32_t s = SysOpenFile(&req);
if (s == STATUS_SUCCESS) {
if (s == NTLSTATUS_SUCCESS) {
*out = h;
if (pathOut) *pathOut = paths[i];
return STATUS_SUCCESS;
return NTLSTATUS_SUCCESS;
}
}
return STATUS_NOT_FOUND;
return NTLSTATUS_NOT_FOUND;
}
int main(void) {
@@ -94,16 +94,16 @@ int main(void) {
SYS_FILE_CACHE_STATS afterFault;
SYS_FILE_CACHE_STATS afterRead;
uint32_t s = query_cache(&before);
if (s != STATUS_SUCCESS) fail_status("query initial stats", s);
if (s != NTLSTATUS_SUCCESS) fail_status("query initial stats", s);
uint32_t file = 0;
const char* path = 0;
s = open_test_file(&file, &path);
if (s != STATUS_SUCCESS) fail_status("open test file", s);
if (s != NTLSTATUS_SUCCESS) fail_status("open test file", s);
uint64_t fileSize = 0;
s = SysGetFileSize(file, &fileSize);
if (s != STATUS_SUCCESS) fail_status("get file size", s);
if (s != NTLSTATUS_SUCCESS) fail_status("get file size", s);
if (fileSize < 4096) fail("test file too small");
size_t mapSize = (fileSize < TEST_SIZE) ? (size_t)fileSize : TEST_SIZE;
@@ -115,12 +115,12 @@ int main(void) {
uint32_t mapping = 0;
s = SysCreateFileMapping(file, SYS_VM_READ, SYS_MAP_FLAG_NONE, mapSize, &mapping);
if (s != STATUS_SUCCESS) fail_status("create mapping", s);
if (s != NTLSTATUS_SUCCESS) fail_status("create mapping", s);
void* base = 0;
s = SysMapFile(mapping, 0, mapSize, SYS_MAP_ACCESS_READ, SYS_MAP_FLAG_NONE, &base);
SysCloseHandle(mapping);
if (s != STATUS_SUCCESS) fail_status("map file", s);
if (s != NTLSTATUS_SUCCESS) fail_status("map file", s);
if (!base) fail("map returned null");
volatile uint8_t* view = (volatile uint8_t*)base;
@@ -129,14 +129,14 @@ int main(void) {
(void)view[mapSize - 1];
s = query_cache(&afterFault);
if (s != STATUS_SUCCESS) fail_status("query after mmap faults", s);
if (s != NTLSTATUS_SUCCESS) fail_status("query after mmap faults", s);
if (afterFault.Loads <= before.Loads) {
SysFreeVm(base);
fail("mmap faults did not populate file cache");
}
s = SysSeekFile(file, 0);
if (s != STATUS_SUCCESS) {
if (s != NTLSTATUS_SUCCESS) {
SysFreeVm(base);
fail_status("seek", s);
}
@@ -145,7 +145,7 @@ int main(void) {
memset(gReadback, 0xCC, sizeof(gReadback));
SYS_FILE_IO_REQUEST readReq = SysMakeFileIoRequest(file, gReadback, mapSize, &got);
s = SysReadFile(&readReq);
if (s != STATUS_SUCCESS) {
if (s != NTLSTATUS_SUCCESS) {
SysFreeVm(base);
fail_status("read", s);
}
@@ -159,7 +159,7 @@ int main(void) {
}
s = query_cache(&afterRead);
if (s != STATUS_SUCCESS) {
if (s != NTLSTATUS_SUCCESS) {
SysFreeVm(base);
fail_status("query after read", s);
}