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
@@ -62,21 +62,21 @@ static void expect_status(const char* what, uint32_t got, uint32_t expected) {
|
||||
int main(void) {
|
||||
print("input_api_smoke: start\n");
|
||||
|
||||
expect_status("poll keyboard null", SysPollKeyboard((INPUT_KEY*)0), STATUS_INVALID_PARAMETER);
|
||||
expect_status("is key down null", SysIsKeyDown(INPUT_KEY_A, (bool*)0), STATUS_INVALID_PARAMETER);
|
||||
expect_status("read key null", SysReadKey((INPUT_KEY*)0), STATUS_INVALID_PARAMETER);
|
||||
expect_status("read char null", SysReadKeyboardChar((char*)0), STATUS_INVALID_PARAMETER);
|
||||
expect_status("poll keyboard null", SysPollKeyboard((INPUT_KEY*)0), NTLSTATUS_INVALID_PARAMETER);
|
||||
expect_status("is key down null", SysIsKeyDown(INPUT_KEY_A, (bool*)0), NTLSTATUS_INVALID_PARAMETER);
|
||||
expect_status("read key null", SysReadKey((INPUT_KEY*)0), NTLSTATUS_INVALID_PARAMETER);
|
||||
expect_status("read char null", SysReadKeyboardChar((char*)0), NTLSTATUS_INVALID_PARAMETER);
|
||||
|
||||
bool down = true;
|
||||
uint32_t status = SysIsKeyDown(INPUT_KEY_A, &down);
|
||||
if (status != STATUS_SUCCESS)
|
||||
if (status != NTLSTATUS_SUCCESS)
|
||||
fail_status("is key down", status);
|
||||
|
||||
INPUT_KEY key = INPUT_KEY_A;
|
||||
status = SysPollKeyboard(&key);
|
||||
if (status != STATUS_SUCCESS && status != STATUS_WOULD_BLOCK)
|
||||
if (status != NTLSTATUS_SUCCESS && status != NTLSTATUS_WOULD_BLOCK)
|
||||
fail_status("poll keyboard", status);
|
||||
if (status == STATUS_WOULD_BLOCK && key != INPUT_KEY_NONE)
|
||||
if (status == NTLSTATUS_WOULD_BLOCK && key != INPUT_KEY_NONE)
|
||||
fail_status("poll keyboard would-block key", key);
|
||||
|
||||
INPUT_KEY_RECORD input;
|
||||
@@ -87,33 +87,33 @@ int main(void) {
|
||||
inputReq.TimeoutMilliseconds = 0;
|
||||
inputReq.RecordOut = &input;
|
||||
|
||||
expect_status("peek input null", SysPeekInputEvent((const SYS_INPUT_EVENT_REQUEST*)0), STATUS_INVALID_PARAMETER);
|
||||
expect_status("peek input null", SysPeekInputEvent((const SYS_INPUT_EVENT_REQUEST*)0), NTLSTATUS_INVALID_PARAMETER);
|
||||
status = SysPeekInputEvent(&inputReq);
|
||||
if (status != STATUS_SUCCESS && status != STATUS_WOULD_BLOCK)
|
||||
if (status != NTLSTATUS_SUCCESS && status != NTLSTATUS_WOULD_BLOCK)
|
||||
fail_status("peek input", status);
|
||||
|
||||
INPUT_MOUSE_EVENT mouse;
|
||||
expect_status("peek mouse null", SysPeekMouse((INPUT_MOUSE_EVENT*)0), STATUS_INVALID_PARAMETER);
|
||||
expect_status("read mouse null", SysReadMouse((INPUT_MOUSE_EVENT*)0), STATUS_INVALID_PARAMETER);
|
||||
expect_status("peek mouse null", SysPeekMouse((INPUT_MOUSE_EVENT*)0), NTLSTATUS_INVALID_PARAMETER);
|
||||
expect_status("read mouse null", SysReadMouse((INPUT_MOUSE_EVENT*)0), NTLSTATUS_INVALID_PARAMETER);
|
||||
|
||||
status = SysPeekMouse(&mouse);
|
||||
if (status != STATUS_SUCCESS && status != STATUS_WOULD_BLOCK)
|
||||
if (status != NTLSTATUS_SUCCESS && status != NTLSTATUS_WOULD_BLOCK)
|
||||
fail_status("peek mouse", status);
|
||||
|
||||
uint32_t readStatus = SysReadMouse(&mouse);
|
||||
if (status == STATUS_SUCCESS) {
|
||||
if (readStatus != STATUS_SUCCESS)
|
||||
if (status == NTLSTATUS_SUCCESS) {
|
||||
if (readStatus != NTLSTATUS_SUCCESS)
|
||||
fail_status("read mouse after peek", readStatus);
|
||||
} else if (readStatus != STATUS_WOULD_BLOCK) {
|
||||
} else if (readStatus != NTLSTATUS_WOULD_BLOCK) {
|
||||
fail_status("read mouse would-block", readStatus);
|
||||
}
|
||||
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
expect_status("get mouse pos null x", SysGetMousePos((int*)0, &y), STATUS_INVALID_PARAMETER);
|
||||
expect_status("get mouse pos null y", SysGetMousePos(&x, (int*)0), STATUS_INVALID_PARAMETER);
|
||||
expect_status("get mouse pos null x", SysGetMousePos((int*)0, &y), NTLSTATUS_INVALID_PARAMETER);
|
||||
expect_status("get mouse pos null y", SysGetMousePos(&x, (int*)0), NTLSTATUS_INVALID_PARAMETER);
|
||||
status = SysGetMousePos(&x, &y);
|
||||
if (status != STATUS_SUCCESS)
|
||||
if (status != NTLSTATUS_SUCCESS)
|
||||
fail_status("get mouse pos", status);
|
||||
|
||||
print("input_api_smoke: PASS\n");
|
||||
|
||||
Reference in new issue
Block a user