mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-05-31 13:27:43 +03:00
14 lines
524 B
Zig
14 lines
524 B
Zig
const std = @import("std");
|
|
const windows = std.os.windows;
|
|
|
|
extern "kernel32" fn LoadLibraryW(windows.LPCWSTR) callconv(.winapi) ?windows.HMODULE;
|
|
|
|
pub fn main(init: std.process.Init) !void {
|
|
const arena = init.arena.allocator();
|
|
const args = try init.minimal.args.toSlice(arena);
|
|
if (args.len < 2) return error.NoDllPathSpecified;
|
|
const dll_path = args[1];
|
|
const dll_path_w = try std.unicode.wtf8ToWtf16LeAllocZ(arena, dll_path);
|
|
_ = LoadLibraryW(dll_path_w) orelse return error.FailedToLoadDll;
|
|
}
|