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
@@ -38,15 +38,15 @@ static uint32_t open_test_file(uint32_t* handleOut, const char** pathOut) {
|
||||
SYS_FILE_FLAG_NONE,
|
||||
&h);
|
||||
uint32_t s = SysOpenFile(&req);
|
||||
if (s == STATUS_SUCCESS) {
|
||||
if (s == NTLSTATUS_SUCCESS) {
|
||||
*handleOut = h;
|
||||
if (pathOut)
|
||||
*pathOut = paths[i];
|
||||
return STATUS_SUCCESS;
|
||||
return NTLSTATUS_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
return STATUS_NOT_FOUND;
|
||||
return NTLSTATUS_NOT_FOUND;
|
||||
}
|
||||
|
||||
// Prints u64.
|
||||
@@ -77,7 +77,7 @@ int main(void) {
|
||||
|
||||
const char* openedPath = 0;
|
||||
uint32_t s = open_test_file(&file, &openedPath);
|
||||
if (s != STATUS_SUCCESS) {
|
||||
if (s != NTLSTATUS_SUCCESS) {
|
||||
print("async_cancel: open failed status="); print_u64(s); print("\n");
|
||||
SysExitProcess(1);
|
||||
}
|
||||
@@ -87,7 +87,7 @@ int main(void) {
|
||||
print("\n");
|
||||
|
||||
s = SysCreateEvent(EVENT_AUTO_RESET, 0, &event);
|
||||
if (s != STATUS_SUCCESS) {
|
||||
if (s != NTLSTATUS_SUCCESS) {
|
||||
print("async_cancel: event create failed status="); print_u64(s); print("\n");
|
||||
SysExitProcess(1);
|
||||
}
|
||||
@@ -114,7 +114,7 @@ int main(void) {
|
||||
req.RequestHandleOut = &request;
|
||||
|
||||
s = SysReadFileAsync(&req);
|
||||
if (s != STATUS_PENDING || request == 0) {
|
||||
if (s != NTLSTATUS_PENDING || request == 0) {
|
||||
print("async_cancel: submit failed status="); print_u64(s);
|
||||
print(" request="); print_u64(request); print("\n");
|
||||
SysExitProcess(1);
|
||||
@@ -123,10 +123,10 @@ int main(void) {
|
||||
uint32_t cs = SysCancelIo(request);
|
||||
print("async_cancel: cancel returned "); print_u64(cs); print("\n");
|
||||
|
||||
while (iosb.Status == STATUS_PENDING) {
|
||||
while (iosb.Status == NTLSTATUS_PENDING) {
|
||||
s = SysWait(event, SYS_WAIT_FLAG_ALERTABLE);
|
||||
print("async_cancel: wait returned "); print_u64(s); print("\n");
|
||||
if (s != STATUS_SUCCESS && s != STATUS_KERNEL_APC && s != STATUS_USER_APC && s != STATUS_ALERTED)
|
||||
if (s != NTLSTATUS_SUCCESS && s != NTLSTATUS_KERNEL_APC && s != NTLSTATUS_USER_APC && s != NTLSTATUS_ALERTED)
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -135,9 +135,9 @@ int main(void) {
|
||||
|
||||
// If the worker had already started, cancellation is best-effort and the
|
||||
// request may complete successfully. If it was still queued, it must report
|
||||
// STATUS_CANCELLED. Both outcomes are valid; STATUS_PENDING is not.
|
||||
uint32_t ok = (iosb.Status == STATUS_CANCELLED) ||
|
||||
(iosb.Status == STATUS_SUCCESS && iosb.Information == 512);
|
||||
// NTLSTATUS_CANCELLED. Both outcomes are valid; NTLSTATUS_PENDING is not.
|
||||
uint32_t ok = (iosb.Status == NTLSTATUS_CANCELLED) ||
|
||||
(iosb.Status == NTLSTATUS_SUCCESS && iosb.Information == 512);
|
||||
|
||||
SysCloseHandle(request);
|
||||
SysCloseHandle(event);
|
||||
|
||||
Reference in new issue
Block a user