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

@@ -75,7 +75,7 @@ static void get_current_drive_root(char* out, size_t cap) {
&required,
};
uint32_t status = SysRealPath(&req);
if (status != STATUS_SUCCESS) fail_status("query current path", status);
if (status != NTLSTATUS_SUCCESS) fail_status("query current path", status);
if (required < 4 || current[0] < '0' || current[0] > '7' || current[1] != ':' || current[2] != '/')
fail("current path is not native drive-rooted");
if (cap < 4) fail("drive root output too small");
@@ -98,7 +98,7 @@ static void expect_realpath(const char* input, const char* expected) {
&required,
};
uint32_t status = SysRealPath(&req);
if (status != STATUS_SUCCESS) fail_status("realpath", status);
if (status != NTLSTATUS_SUCCESS) fail_status("realpath", status);
if (required != strlen(expected) + 1) fail("required size mismatch");
if (strcmp(out, expected) != 0) fail("resolved path mismatch");
}
@@ -115,7 +115,7 @@ static void check_size_reporting(const char* input, const char* expected) {
&required,
};
uint32_t status = SysRealPath(&query);
if (status != STATUS_SUCCESS) fail_status("size query", status);
if (status != NTLSTATUS_SUCCESS) fail_status("size query", status);
if (required != strlen(expected) + 1) fail("size query required mismatch");
char small[4];
@@ -129,7 +129,7 @@ static void check_size_reporting(const char* input, const char* expected) {
&smallRequired,
};
status = SysRealPath(&smallReq);
if (status != STATUS_BUFFER_TOO_SMALL) fail_status("small buffer", status);
if (status != NTLSTATUS_BUFFER_TOO_SMALL) fail_status("small buffer", status);
if (smallRequired != required) fail("small required mismatch");
}
@@ -165,7 +165,7 @@ int main(void) {
(size_t*)0,
};
uint32_t status = SysRealPath(&currentReq);
if (status != STATUS_SUCCESS) fail_status("current realpath", status);
if (status != NTLSTATUS_SUCCESS) fail_status("current realpath", status);
memcpy(input, "missing_realpath_dir/../missing_file", sizeof("missing_realpath_dir/../missing_file"));
append(expected, sizeof(expected), expected[strlen(expected) - 1] == '/' ? "missing_file" : "/missing_file");