Improve system call support

This commit is contained in:
Justine Tunney 2021-08-25 21:35:58 -07:00
parent 63b867bd2f
commit 3085ac7837
65 changed files with 900 additions and 544 deletions

View file

@ -19,6 +19,13 @@
#include "libc/nt/struct/teb.h"
#include "libc/runtime/runtime.h"
/**
* Returns New Technology version, e.g.
*
* if (IsWindows() && NtGetVersion() >= kNtVersionWindows10) {...}
*
* This can only be called on Windows.
*/
textwindows noasan int NtGetVersion(void) {
return (NtGetPeb()->OSMajorVersion & 0xff) << 8 | NtGetPeb()->OSMinorVersion;
}