We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3472fef commit bc0af4cCopy full SHA for bc0af4c
1 file changed
src/hooks.zig
@@ -211,6 +211,12 @@ const bootstrap = @import("bootstrap.zig");
211
const runtimes = @import("runtimes.zig");
212
213
fn dlsym_hook(handle: util.Module(false), name_ptr: [*:0]const u8) callconv(if (builtin.os.tag == .windows) .winapi else .c) ?*anyopaque {
214
+ if (builtin.os.tag == .windows and @intFromPtr(name_ptr) >> 16 == 0) {
215
+ // documented that if the "HIWORD" is 0, the name_ptr actually specifies an ordinal.
216
+ logger.debug("dlsym({}, {})", .{ util.fmtAddress(handle), @intFromPtr(name_ptr) });
217
+ return std.os.windows.kernel32.GetProcAddress(handle, name_ptr);
218
+ }
219
+
220
const name = std.mem.span(name_ptr);
221
222
logger.debug("dlsym({}, \"{s}\")", .{ util.fmtAddress(handle), name });
0 commit comments