diff options
Diffstat (limited to 'std/os/windows/util.zig')
| -rw-r--r-- | std/os/windows/util.zig | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/std/os/windows/util.zig b/std/os/windows/util.zig index 6534d16f5e..7d983421e0 100644 --- a/std/os/windows/util.zig +++ b/std/os/windows/util.zig @@ -188,37 +188,6 @@ pub fn createWindowsEnvBlock(allocator: *mem.Allocator, env_map: *const BufMap) return allocator.shrink(u16, result, i); } -pub fn windowsLoadDllW(dll_path_w: [*]const u16) !windows.HMODULE { - return windows.LoadLibraryW(dll_path_w) orelse { - const err = windows.GetLastError(); - switch (err) { - windows.ERROR.FILE_NOT_FOUND => return error.FileNotFound, - windows.ERROR.PATH_NOT_FOUND => return error.FileNotFound, - windows.ERROR.MOD_NOT_FOUND => return error.FileNotFound, - else => return os.unexpectedErrorWindows(err), - } - }; -} - -pub fn windowsLoadDll(dll_path: []const u8) !windows.HMODULE { - const dll_path_w = try sliceToPrefixedFileW(dll_path); - return windowsLoadDllW(&dll_path_w); -} - -pub fn windowsUnloadDll(hModule: windows.HMODULE) void { - assert(windows.FreeLibrary(hModule) != 0); -} - -test "InvalidDll" { - if (builtin.os != builtin.Os.windows) return error.SkipZigTest; - - const handle = os.windowsLoadDll("asdf.dll") catch |err| { - assert(err == error.FileNotFound); - return; - }; - @panic("Expected error from function"); -} - pub fn windowsFindFirstFile( dir_path: []const u8, find_file_data: *windows.WIN32_FIND_DATAW, |
