diff options
| author | Ryan Liptak <squeek502@hotmail.com> | 2024-07-13 17:25:06 -0700 |
|---|---|---|
| committer | Ryan Liptak <squeek502@hotmail.com> | 2024-07-13 18:19:19 -0700 |
| commit | 1a62cfffa79917d930b77f2598b1bfc93efeede5 (patch) | |
| tree | 18c3465ef63c25164c536787baae250613c54ad0 /lib/std/process.zig | |
| parent | 1418c8a5d49ecc38a20df07151a7fe942992aea4 (diff) | |
| download | zig-1a62cfffa79917d930b77f2598b1bfc93efeede5.tar.gz zig-1a62cfffa79917d930b77f2598b1bfc93efeede5.zip | |
Replace GetCommandLineW with PEB access, delete GetCommandLine bindings
Diffstat (limited to 'lib/std/process.zig')
| -rw-r--r-- | lib/std/process.zig | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/std/process.zig b/lib/std/process.zig index be8576442d..434e0fbbcc 100644 --- a/lib/std/process.zig +++ b/lib/std/process.zig @@ -1150,8 +1150,9 @@ pub const ArgIterator = struct { return ArgIterator{ .inner = try InnerType.init(allocator) }; } if (native_os == .windows) { - const cmd_line_w = windows.kernel32.GetCommandLineW(); - return ArgIterator{ .inner = try InnerType.init(allocator, cmd_line_w) }; + const cmd_line = std.os.windows.peb().ProcessParameters.CommandLine; + const cmd_line_w = cmd_line.Buffer.?[0 .. cmd_line.Length / 2 :0]; + return ArgIterator{ .inner = try InnerType.init(allocator, cmd_line_w.ptr) }; } return ArgIterator{ .inner = InnerType.init() }; |
