Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions core/sys/windows/kernel32.odin
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,16 @@ foreign kernel32 {
) -> BOOL ---
WaitForSingleObject :: proc(hHandle: HANDLE, dwMilliseconds: DWORD) -> DWORD ---
WaitForSingleObjectEx :: proc(hHandle: HANDLE, dwMilliseconds: DWORD, bAlterable: BOOL) -> DWORD ---
EnterSynchronizationBarrier :: proc(
lpBarrier: ^SYNCHRONIZATION_BARRIER,
dwFlags: SYNCHRONIZATION_BARRIER_FLAGS,
) -> BOOL ---
InitializeSynchronizationBarrier :: proc(
lpBarrier: ^SYNCHRONIZATION_BARRIER,
lTotalThreads: LONG,
lSpinCount: LONG,
) -> BOOL ---
DeleteSynchronizationBarrier :: proc(lpBarrier: ^SYNCHRONIZATION_BARRIER) -> BOOL ---
Sleep :: proc(dwMilliseconds: DWORD) ---
GetProcessId :: proc(handle: HANDLE) -> DWORD ---
CopyFileW :: proc(
Expand Down
15 changes: 15 additions & 0 deletions core/sys/windows/types.odin
Original file line number Diff line number Diff line change
Expand Up @@ -2991,6 +2991,21 @@ CRITICAL_SECTION :: struct {
SpinCount: ULONG_PTR,
}

SYNCHRONIZATION_BARRIER :: struct {
Reserved1: DWORD,
Reserved2: DWORD,
Reserved3: [2]ULONG_PTR,
Reserved4: DWORD,
Reserved5: DWORD,
}

SYNCHRONIZATION_BARRIER_FLAG :: enum {
SPIN_ONLY = 0,
BLOCK_ONLY = 1,
NO_DELETE = 2,
}
SYNCHRONIZATION_BARRIER_FLAGS :: distinct bit_set[SYNCHRONIZATION_BARRIER_FLAG; DWORD]

REPARSE_MOUNTPOINT_DATA_BUFFER :: struct {
ReparseTag: DWORD,
ReparseDataLength: DWORD,
Expand Down
8 changes: 8 additions & 0 deletions core/sys/windows/user32.odin
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,14 @@ MAKEINTRESOURCEW :: #force_inline proc "contextless" (#any_int i: int) -> LPWSTR
return cast(LPWSTR)uintptr(WORD(i))
}

RAWINPUT_ALIGN :: proc(x: uintptr) -> uintptr {
return (x + size_of(uintptr) - 1) & ~uintptr(size_of(uintptr) - 1)
}

NEXTRAWINPUTBLOCK :: proc(ptr: ^RAWINPUT) -> ^RAWINPUT {
return cast(^RAWINPUT)RAWINPUT_ALIGN(uintptr(ptr) + uintptr(ptr.header.dwSize))
}

Monitor_From_Flags :: enum DWORD {
MONITOR_DEFAULTTONULL = 0x00000000, // Returns NULL
MONITOR_DEFAULTTOPRIMARY = 0x00000001, // Returns a handle to the primary display monitor
Expand Down