From c380c0d87e1cbb2005cbdf78e3191fc1c988abf4 Mon Sep 17 00:00:00 2001 From: connnnal <216976529+connnnal@users.noreply.github.com> Date: Wed, 29 Jul 2026 12:08:29 +0100 Subject: [PATCH] win32: LoadLibraryEx_Flags off-by-one bit_set without a backing type counts bits from the enum's lowest value (141299eb02bc9a7330daa30d75d279e84ba28cc3) in this case it causes an off-by-one offset, so flags fall down to the one below. I experienced `LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR` -> `LOAD_LIBRARY_REQUIRE_SIGNED_TARGET`, for instance, so unsigned DLLs wouldn't load. aw. fix is adding a dword backing type to the bit flags, like the other types in this file --- core/sys/windows/types.odin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/sys/windows/types.odin b/core/sys/windows/types.odin index 89a94b1da..b3efbdb34 100644 --- a/core/sys/windows/types.odin +++ b/core/sys/windows/types.odin @@ -3538,7 +3538,7 @@ LoadLibraryEx_Flag :: enum DWORD { LOAD_LIBRARY_SEARCH_DEFAULT_DIRS = 12, // 1 << 12: 0x1000, LOAD_LIBRARY_SAFE_CURRENT_DIRS = 13, // 1 << 13: 0x2000, } -LoadLibraryEx_Flags :: distinct bit_set[LoadLibraryEx_Flag] +LoadLibraryEx_Flags :: distinct bit_set[LoadLibraryEx_Flag; DWORD] // https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-quota_limits // Used in LogonUserExW