Improved Windows DLL calls

This commit is contained in:
2024-08-19 11:11:45 +02:00
parent 0db54ff639
commit 05789d9626
12 changed files with 124 additions and 68 deletions

View File

@ -1,14 +1,13 @@
write(_ Int, _ Pointer, _ Int) -> Int {
// WriteFile(fd, buffer, length, out numberOfBytesWritten, out overlapped)
return 0
write(fd Int, address Pointer, length Int) -> Int {
// out numberOfBytesWritten
// out overlapped
return kernel32.WriteFile(fd, address, length)
}
mmap(_ Int, _ Int, _ Int, _ Int) -> Pointer {
// VirtualAlloc(address, length, flags, protection)
return 0
mmap(address Int, length Int, protection Int, flags Int) -> Pointer {
return kernel32.VirtualAlloc(address, length, flags, protection)
}
exit(_ Int) {
// ExitProcess(code)
return
exit(code Int) {
kernel32.ExitProcess(code)
}