authorgravatar for contact@mfreundorfercg.comMichael Freundorfer <contact@mfreundorfercg.com> 2020-11-27 19:21:29+01:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-11-30 12:13:17-07:00
log1a61a9d4bf37183282de8a09431ed1baaf049999
tree54e323085fce395ab557aa5ff79956a6dcabe816
parent8f346d9a4bd9c10a76bee0b33b09ac31eb5438fe

Fix WindowsDynLib.openW trying to strip the \??\ prefix when it does not exist


1 files changed, 7 insertions(+), 2 deletions(-)

lib/std/dynamic_library.zig+7-2
......@@ -344,9 +344,14 @@ pub const WindowsDynLib = struct {
344344 }
345345
346346 pub fn openW(path_w: [*:0]const u16) !WindowsDynLib {
347 return WindowsDynLib{
347 var offset: usize = 0;
348 if (path_w[0] == '\\' and path_w[1] == '?' and path_w[2] == '?' and path_w[3] == '\\') {
348349 // + 4 to skip over the \??\
349 .dll = try windows.LoadLibraryW(path_w + 4),
350 offset = 4;
351 }
352
353 return WindowsDynLib{
354 .dll = try windows.LoadLibraryW(path_w + offset),
350355 };
351356 }
352357