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 11:12:33-08:00
logbaa075ac8cf3ff666b9f3d5c5a75e139f33b5d86
tree729b3509495c86a353e4d4e3a7747fa9569a178b
parent0369b65082be49eefacf767774a3d40ad7706de7

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
......@@ -338,9 +338,14 @@ pub const WindowsDynLib = struct {
338338 }
339339
340340 pub fn openW(path_w: [*:0]const u16) !WindowsDynLib {
341 return WindowsDynLib{
341 var offset: usize = 0;
342 if (path_w[0] == '\\' and path_w[1] == '?' and path_w[2] == '?' and path_w[3] == '\\') {
342343 // + 4 to skip over the \??\
343 .dll = try windows.LoadLibraryW(path_w + 4),
344 offset = 4;
345 }
346
347 return WindowsDynLib{
348 .dll = try windows.LoadLibraryW(path_w + offset),
344349 };
345350 }
346351