File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -211,6 +211,12 @@ const bootstrap = @import("bootstrap.zig");
211211const runtimes = @import ("runtimes.zig" );
212212
213213fn 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+
214220 const name = std .mem .span (name_ptr );
215221
216222 logger .debug ("dlsym({}, \" {s}\" )" , .{ util .fmtAddress (handle ), name });
You can’t perform that action at this time.
0 commit comments