mirror of
https://github.com/odin-lang/Odin.git
synced 2026-02-13 06:43:35 +00:00
Merge pull request #5277 from benjryan/master
Add windows bindings to support overlapped IO
This commit is contained in:
@@ -372,6 +372,12 @@ foreign kernel32 {
|
||||
bInitialState: BOOL,
|
||||
lpName: LPCWSTR,
|
||||
) -> HANDLE ---
|
||||
CreateEventExW :: proc(
|
||||
lpEventAttributes: LPSECURITY_ATTRIBUTES,
|
||||
lpName: LPCWSTR,
|
||||
dwFlags: DWORD,
|
||||
dwDesiredAccess: DWORD,
|
||||
) -> HANDLE ---
|
||||
ResetEvent :: proc(hEvent: HANDLE) -> BOOL ---
|
||||
SetEvent :: proc(hEvent: HANDLE) -> BOOL ---
|
||||
WaitForMultipleObjects :: proc(
|
||||
|
||||
@@ -4845,6 +4845,12 @@ SOMAXCONN :: 128 // The number of messages that can be queued in memory after
|
||||
SOCKET_ERROR :: -1
|
||||
|
||||
// Networking errors
|
||||
WSA_INVALID_HANDLE :: 6 // Specified event object handle is invalid.
|
||||
WSA_NOT_ENOUGH_MEMORY :: 8 // Insufficient memory available.
|
||||
WSA_INVALID_PARAMETER :: 87 // One or more parameters are invalid.
|
||||
WSA_OPERATION_ABORTED :: 995 // Overlapped operation aborted.
|
||||
WSA_IO_INCOMPLETE :: 996 // Overlapped I/O event object not in signaled state.
|
||||
WSA_IO_PENDING :: 997 // Overlapped operations will complete later.
|
||||
WSAEINTR :: 10004 // Call interrupted. CancelBlockingCall was called. (This is different on Linux.)
|
||||
WSAEACCES :: 10013 // If you try to bind a Udp socket to the broadcast address without the socket option set.
|
||||
WSAEFAULT :: 10014 // A pointer that was passed to a WSA function is invalid, such as a buffer size is smaller than you said it was
|
||||
|
||||
@@ -131,6 +131,10 @@ foreign ws2_32 {
|
||||
) -> SOCKET ---
|
||||
// [MS-Docs](https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsaioctl)
|
||||
WSAIoctl :: proc(s: SOCKET, dwIoControlCode: DWORD, lpvInBuffer: rawptr, cbInBuffer: DWORD, lpvOutBuffer: rawptr, cbOutBuffer: DWORD, lpcbBytesReturned: ^DWORD, lpOverlapped: ^OVERLAPPED, lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE) -> c_int ---
|
||||
// [MS-Docs](https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsacreateevent)
|
||||
WSACreateEvent :: proc() -> WSAEVENT ---
|
||||
// [MS-Docs](https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsacloseevent)
|
||||
WSACloseEvent :: proc(hEvent: WSAEVENT) -> bool ---
|
||||
// [MS-Docs](https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsaeventselect)
|
||||
WSAEventSelect :: proc(s: SOCKET, hEventObject: WSAEVENT, lNetworkEvents: i32) -> c_int ---
|
||||
// [MS-Docs](https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsawaitformultipleevents)
|
||||
|
||||
Reference in New Issue
Block a user