Skip to content

Commit

Permalink
feat: add helpers for errors
Browse files Browse the repository at this point in the history
  • Loading branch information
f1zm0 committed Apr 24, 2023
1 parent c381280 commit 4d57328
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions native.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package acheron

// Ref: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/87fba13e-bf06-450e-83b1-9241dc81e781
const (
ErrSyscallNotFound = ((3 << 30) | (1 << 29) | 1) // Severity: STATUS_SEVERITY_ERROR, Custom: 1, Code: 1
)

func NT_SUCCESS(x uint32) bool {
return (x)&(1<<31) != 0 // error if severity bit (MSB) is 0x1
}

0 comments on commit 4d57328

Please sign in to comment.