aboutsummaryrefslogtreecommitdiff
path: root/lib/std/process.zig
diff options
context:
space:
mode:
authorRyan Liptak <squeek502@hotmail.com>2024-07-13 17:25:06 -0700
committerRyan Liptak <squeek502@hotmail.com>2024-07-13 18:19:19 -0700
commit1a62cfffa79917d930b77f2598b1bfc93efeede5 (patch)
tree18c3465ef63c25164c536787baae250613c54ad0 /lib/std/process.zig
parent1418c8a5d49ecc38a20df07151a7fe942992aea4 (diff)
downloadzig-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.zig5
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() };