Start filling in the file_windows.odin procedures

This commit is contained in:
gingerBill
2022-02-21 13:38:25 +00:00
parent 345032f804
commit 9c3cdc4620
10 changed files with 477 additions and 136 deletions
+5 -1
View File
@@ -4,8 +4,12 @@ package os2
import win32 "core:sys/windows"
_pipe :: proc() -> (r, w: Handle, err: Error) {
sa: win32.SECURITY_ATTRIBUTES
sa.nLength = size_of(win32.SECURITY_ATTRIBUTES)
sa.bInheritHandle = true
p: [2]win32.HANDLE
if !win32.CreatePipe(&p[0], &p[1], nil, 0) {
if !win32.CreatePipe(&p[0], &p[1], &sa, 0) {
return 0, 0, Platform_Error{i32(win32.GetLastError())}
}
return Handle(p[0]), Handle(p[1]), nil