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
+10
-10
@@ -133,7 +133,7 @@ static bool parse_u32(const char* s, uint32_t* out) {
|
||||
// Implements the resolve host operation.
|
||||
static uint32_t resolve_host(const char* host, uint8_t ip[4]) {
|
||||
if (parse_ipv4(host, ip))
|
||||
return STATUS_SUCCESS;
|
||||
return NTLSTATUS_SUCCESS;
|
||||
|
||||
SYS_SOCKET_ADDRESS resolved;
|
||||
size_t resolvedSize = sizeof(resolved);
|
||||
@@ -146,16 +146,16 @@ static uint32_t resolve_host(const char* host, uint8_t ip[4]) {
|
||||
req.AddressSizeInOut = &resolvedSize;
|
||||
|
||||
uint32_t st = SysResolveHost(&req);
|
||||
if (st != STATUS_SUCCESS)
|
||||
if (st != NTLSTATUS_SUCCESS)
|
||||
return st;
|
||||
if (resolved.Family != SYS_AF_INET)
|
||||
return STATUS_NOT_FOUND;
|
||||
return NTLSTATUS_NOT_FOUND;
|
||||
|
||||
ip[0] = resolved.Address[0];
|
||||
ip[1] = resolved.Address[1];
|
||||
ip[2] = resolved.Address[2];
|
||||
ip[3] = resolved.Address[3];
|
||||
return STATUS_SUCCESS;
|
||||
return NTLSTATUS_SUCCESS;
|
||||
}
|
||||
|
||||
// Implements the icmp checksum operation.
|
||||
@@ -258,7 +258,7 @@ int main(void) {
|
||||
|
||||
uint8_t ip[4];
|
||||
uint32_t st = resolve_host(host, ip);
|
||||
if (st != STATUS_SUCCESS) {
|
||||
if (st != NTLSTATUS_SUCCESS) {
|
||||
print("ping: resolve failed "); print_u64(st); print(" for "); print(host); print("\n");
|
||||
SysExitProcess(1);
|
||||
}
|
||||
@@ -268,7 +268,7 @@ int main(void) {
|
||||
|
||||
uint32_t sock = 0;
|
||||
st = SysCreateSocket(SYS_AF_INET, SYS_SOCK_RAW, SYS_IPPROTO_ICMP, &sock);
|
||||
if (st != STATUS_SUCCESS) {
|
||||
if (st != NTLSTATUS_SUCCESS) {
|
||||
print("ping: SysCreateSocket(raw icmp) failed "); print_u64(st); print("\n");
|
||||
SysExitProcess(1);
|
||||
}
|
||||
@@ -283,7 +283,7 @@ int main(void) {
|
||||
|
||||
uint64_t tickFrequency = 0;
|
||||
st = SysGetTickFrequency(&tickFrequency);
|
||||
if (st != STATUS_SUCCESS || !tickFrequency) {
|
||||
if (st != NTLSTATUS_SUCCESS || !tickFrequency) {
|
||||
print("ping: SysGetTickFrequency failed "); print_u64(st); print("\n");
|
||||
SysCloseHandle(sock);
|
||||
SysExitProcess(1);
|
||||
@@ -323,7 +323,7 @@ int main(void) {
|
||||
|
||||
uint64_t start = SysGetTick();
|
||||
st = SysSendToSocket(sock, &sendReq);
|
||||
if (st != STATUS_SUCCESS) {
|
||||
if (st != NTLSTATUS_SUCCESS) {
|
||||
print("ping: send failed seq="); print_u64(seq); print(" status="); print_u64(st); print("\n");
|
||||
if (i + 1 < count) SysSleep(1000);
|
||||
continue;
|
||||
@@ -346,9 +346,9 @@ int main(void) {
|
||||
recvReq.ReceivedOut = &got;
|
||||
|
||||
st = SysRecvFromSocket(sock, &recvReq);
|
||||
if (st == STATUS_TIMEOUT)
|
||||
if (st == NTLSTATUS_TIMEOUT)
|
||||
break;
|
||||
if (st != STATUS_SUCCESS) {
|
||||
if (st != NTLSTATUS_SUCCESS) {
|
||||
print("ping: recv failed status="); print_u64(st); print("\n");
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user