From c8cdb94333406086d8db79b1d537a4f1529123e7 Mon Sep 17 00:00:00 2001 From: Jacob Young Date: Sun, 14 Dec 2025 18:44:26 -0500 Subject: [PATCH] windows: fix `DeviceIoControl` dispatch --- lib/std/os/windows.zig | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/std/os/windows.zig b/lib/std/os/windows.zig index 70219c35101e232ff53ea9228de2e39e64262c17..be8f68e024f756440cfe58827eee8faf4db7bfee 100644 --- a/lib/std/os/windows.zig +++ b/lib/std/os/windows.zig @@ -2609,18 +2609,6 @@ pub fn DeviceIoControl( ) DeviceIoControlError!void { var io_status_block: IO_STATUS_BLOCK = undefined; const rc = switch (io_control_code.DeviceType) { - .FILE_SYSTEM, .NAMED_PIPE => ntdll.NtFsControlFile( - device, - opts.event, - opts.apc_routine, - opts.apc_context, - opts.io_status_block orelse &io_status_block, - io_control_code, - if (opts.in.len > 0) opts.in.ptr else null, - @intCast(opts.in.len), - if (opts.out.len > 0) opts.out.ptr else null, - @intCast(opts.out.len), - ), else => ntdll.NtDeviceIoControlFile( device, opts.event, @@ -2633,6 +2621,18 @@ pub fn DeviceIoControl( if (opts.out.len > 0) opts.out.ptr else null, @intCast(opts.out.len), ), + .FILE_SYSTEM => ntdll.NtFsControlFile( + device, + opts.event, + opts.apc_routine, + opts.apc_context, + opts.io_status_block orelse &io_status_block, + io_control_code, + if (opts.in.len > 0) opts.in.ptr else null, + @intCast(opts.in.len), + if (opts.out.len > 0) opts.out.ptr else null, + @intCast(opts.out.len), + ), }; switch (rc) { .SUCCESS => {}, -- 2.54.0