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:
1 parent
1f5477cf66
commit
b7fcfce6f7
140 files changed
+7649
-3943
No files matched your search
@@ -72,14 +72,14 @@ static uint32_t set_timer(uint32_t timer, uint64_t dueMs, uint64_t periodMs) {
|
||||
// Verifies timer request validation paths.
|
||||
static void test_validation(void) {
|
||||
uint32_t timer = 0;
|
||||
expect_status("create timer null", SysCreateTimer((uint32_t*)0), STATUS_INVALID_PARAMETER);
|
||||
expect_status("create timer null", SysCreateTimer((uint32_t*)0), NTLSTATUS_INVALID_PARAMETER);
|
||||
|
||||
uint32_t s = SysCreateTimer(&timer);
|
||||
if (s != STATUS_SUCCESS) fail_status("create validation timer", s);
|
||||
if (s != NTLSTATUS_SUCCESS) fail_status("create validation timer", s);
|
||||
|
||||
expect_status("set timer null", SysSetTimer((const SYS_SET_TIMER_REQUEST*)0), STATUS_INVALID_PARAMETER);
|
||||
expect_status("cancel invalid", SysCancelTimer(0xdeadbeefu), STATUS_INVALID_HANDLE);
|
||||
expect_status("wait invalid", SysWaitSingle(0xdeadbeefu, SYS_WAIT_FLAG_NONE, 0), STATUS_INVALID_HANDLE);
|
||||
expect_status("set timer null", SysSetTimer((const SYS_SET_TIMER_REQUEST*)0), NTLSTATUS_INVALID_PARAMETER);
|
||||
expect_status("cancel invalid", SysCancelTimer(0xdeadbeefu), NTLSTATUS_INVALID_HANDLE);
|
||||
expect_status("wait invalid", SysWaitSingle(0xdeadbeefu, SYS_WAIT_FLAG_NONE, 0), NTLSTATUS_INVALID_HANDLE);
|
||||
|
||||
SYS_SET_TIMER_REQUEST req = {
|
||||
0,
|
||||
@@ -88,11 +88,11 @@ static void test_validation(void) {
|
||||
1,
|
||||
0,
|
||||
};
|
||||
expect_status("set bad size", SysSetTimer(&req), STATUS_INVALID_PARAMETER);
|
||||
expect_status("set bad size", SysSetTimer(&req), NTLSTATUS_INVALID_PARAMETER);
|
||||
|
||||
req.Size = sizeof(req);
|
||||
req.Flags = 1;
|
||||
expect_status("set bad flags", SysSetTimer(&req), STATUS_INVALID_PARAMETER);
|
||||
expect_status("set bad flags", SysSetTimer(&req), NTLSTATUS_INVALID_PARAMETER);
|
||||
|
||||
SysCloseHandle(timer);
|
||||
}
|
||||
@@ -101,16 +101,16 @@ static void test_validation(void) {
|
||||
static void test_one_shot(void) {
|
||||
uint32_t timer = 0;
|
||||
uint32_t s = SysCreateTimer(&timer);
|
||||
if (s != STATUS_SUCCESS) fail_status("create one-shot timer", s);
|
||||
if (s != NTLSTATUS_SUCCESS) fail_status("create one-shot timer", s);
|
||||
|
||||
expect_status("unset immediate wait", SysWaitSingle(timer, SYS_WAIT_FLAG_NONE, 0), STATUS_TIMEOUT);
|
||||
expect_status("unset immediate wait", SysWaitSingle(timer, SYS_WAIT_FLAG_NONE, 0), NTLSTATUS_TIMEOUT);
|
||||
s = set_timer(timer, 20, 0);
|
||||
if (s != STATUS_SUCCESS) fail_status("set one-shot", s);
|
||||
if (s != NTLSTATUS_SUCCESS) fail_status("set one-shot", s);
|
||||
|
||||
s = SysWaitSingle(timer, SYS_WAIT_FLAG_NONE, SYS_WAIT_TIMEOUT_INFINITE);
|
||||
if (s != STATUS_SUCCESS) fail_status("wait one-shot", s);
|
||||
if (s != NTLSTATUS_SUCCESS) fail_status("wait one-shot", s);
|
||||
|
||||
expect_status("one-shot consumed", SysWaitSingle(timer, SYS_WAIT_FLAG_NONE, 0), STATUS_TIMEOUT);
|
||||
expect_status("one-shot consumed", SysWaitSingle(timer, SYS_WAIT_FLAG_NONE, 0), NTLSTATUS_TIMEOUT);
|
||||
SysCloseHandle(timer);
|
||||
}
|
||||
|
||||
@@ -118,24 +118,24 @@ static void test_one_shot(void) {
|
||||
static void test_cancel(void) {
|
||||
uint32_t timer = 0;
|
||||
uint32_t s = SysCreateTimer(&timer);
|
||||
if (s != STATUS_SUCCESS) fail_status("create cancel timer", s);
|
||||
if (s != NTLSTATUS_SUCCESS) fail_status("create cancel timer", s);
|
||||
|
||||
s = set_timer(timer, 100, 0);
|
||||
if (s != STATUS_SUCCESS) fail_status("set cancel timer", s);
|
||||
if (s != NTLSTATUS_SUCCESS) fail_status("set cancel timer", s);
|
||||
s = SysCancelTimer(timer);
|
||||
if (s != STATUS_SUCCESS) fail_status("cancel timer", s);
|
||||
if (s != NTLSTATUS_SUCCESS) fail_status("cancel timer", s);
|
||||
|
||||
expect_status("cancelled timer wait", SysWaitSingle(timer, SYS_WAIT_FLAG_NONE, 30), STATUS_TIMEOUT);
|
||||
expect_status("cancelled timer wait", SysWaitSingle(timer, SYS_WAIT_FLAG_NONE, 30), NTLSTATUS_TIMEOUT);
|
||||
|
||||
s = set_timer(timer, 0, 0);
|
||||
if (s != STATUS_SUCCESS) fail_status("set immediate", s);
|
||||
expect_status("immediate timer wait", SysWaitSingle(timer, SYS_WAIT_FLAG_NONE, 0), STATUS_SUCCESS);
|
||||
if (s != NTLSTATUS_SUCCESS) fail_status("set immediate", s);
|
||||
expect_status("immediate timer wait", SysWaitSingle(timer, SYS_WAIT_FLAG_NONE, 0), NTLSTATUS_SUCCESS);
|
||||
|
||||
s = set_timer(timer, 0, 0);
|
||||
if (s != STATUS_SUCCESS) fail_status("set immediate before cancel", s);
|
||||
if (s != NTLSTATUS_SUCCESS) fail_status("set immediate before cancel", s);
|
||||
s = SysCancelTimer(timer);
|
||||
if (s != STATUS_SUCCESS) fail_status("cancel signaled", s);
|
||||
expect_status("cancel clears signal", SysWaitSingle(timer, SYS_WAIT_FLAG_NONE, 0), STATUS_TIMEOUT);
|
||||
if (s != NTLSTATUS_SUCCESS) fail_status("cancel signaled", s);
|
||||
expect_status("cancel clears signal", SysWaitSingle(timer, SYS_WAIT_FLAG_NONE, 0), NTLSTATUS_TIMEOUT);
|
||||
|
||||
SysCloseHandle(timer);
|
||||
}
|
||||
@@ -144,15 +144,15 @@ static void test_cancel(void) {
|
||||
static void test_reset_changes_deadline(void) {
|
||||
uint32_t timer = 0;
|
||||
uint32_t s = SysCreateTimer(&timer);
|
||||
if (s != STATUS_SUCCESS) fail_status("create reset timer", s);
|
||||
if (s != NTLSTATUS_SUCCESS) fail_status("create reset timer", s);
|
||||
|
||||
s = set_timer(timer, 100, 0);
|
||||
if (s != STATUS_SUCCESS) fail_status("set reset timer long", s);
|
||||
if (s != NTLSTATUS_SUCCESS) fail_status("set reset timer long", s);
|
||||
s = set_timer(timer, 20, 0);
|
||||
if (s != STATUS_SUCCESS) fail_status("set reset timer short", s);
|
||||
if (s != NTLSTATUS_SUCCESS) fail_status("set reset timer short", s);
|
||||
|
||||
s = SysWaitSingle(timer, SYS_WAIT_FLAG_NONE, 80);
|
||||
if (s != STATUS_SUCCESS) fail_status("wait reset timer", s);
|
||||
if (s != NTLSTATUS_SUCCESS) fail_status("wait reset timer", s);
|
||||
|
||||
SysCloseHandle(timer);
|
||||
}
|
||||
@@ -161,18 +161,18 @@ static void test_reset_changes_deadline(void) {
|
||||
static void test_periodic(void) {
|
||||
uint32_t timer = 0;
|
||||
uint32_t s = SysCreateTimer(&timer);
|
||||
if (s != STATUS_SUCCESS) fail_status("create periodic timer", s);
|
||||
if (s != NTLSTATUS_SUCCESS) fail_status("create periodic timer", s);
|
||||
|
||||
s = set_timer(timer, 10, 20);
|
||||
if (s != STATUS_SUCCESS) fail_status("set periodic timer", s);
|
||||
if (s != NTLSTATUS_SUCCESS) fail_status("set periodic timer", s);
|
||||
s = SysWaitSingle(timer, SYS_WAIT_FLAG_NONE, 80);
|
||||
if (s != STATUS_SUCCESS) fail_status("wait periodic first", s);
|
||||
if (s != NTLSTATUS_SUCCESS) fail_status("wait periodic first", s);
|
||||
s = SysWaitSingle(timer, SYS_WAIT_FLAG_NONE, 80);
|
||||
if (s != STATUS_SUCCESS) fail_status("wait periodic second", s);
|
||||
if (s != NTLSTATUS_SUCCESS) fail_status("wait periodic second", s);
|
||||
|
||||
s = SysCancelTimer(timer);
|
||||
if (s != STATUS_SUCCESS) fail_status("cancel periodic", s);
|
||||
expect_status("periodic cancelled wait", SysWaitSingle(timer, SYS_WAIT_FLAG_NONE, 30), STATUS_TIMEOUT);
|
||||
if (s != NTLSTATUS_SUCCESS) fail_status("cancel periodic", s);
|
||||
expect_status("periodic cancelled wait", SysWaitSingle(timer, SYS_WAIT_FLAG_NONE, 30), NTLSTATUS_TIMEOUT);
|
||||
|
||||
SysCloseHandle(timer);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user