| 1 | const std = @import("std"); |
| 2 | const windows = std.os.windows; |
| 3 | |
| 4 | extern "kernel32" fn LoadLibraryW(windows.LPCWSTR) callconv(.winapi) ?windows.HMODULE; |
| 5 | |
| 6 | pub fn main(init: std.process.Init) !void { |
| 7 | const arena = init.arena.allocator(); |
| 8 | const args = try init.minimal.args.toSlice(arena); |
| 9 | if (args.len < 2) return error.NoDllPathSpecified; |
| 10 | const dll_path = args[1]; |
| 11 | const dll_path_w = try std.unicode.wtf8ToWtf16LeAllocZ(arena, dll_path); |
| 12 | _ = LoadLibraryW(dll_path_w) orelse return error.FailedToLoadDll; |
| 13 | } |