# Add Zig wrapper for kernel32.DeviceIoControl · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/4fdfaf69c8c55ebac4c5b3c00025c0ac51281b5b)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 4fdfaf69c8c55ebac4c5b3c00025c0ac51281b5b

Requested commit: 4fdfaf69c8c55ebac4c5b3c00025c0ac51281b5b

Commit: 4fdfaf69c8c55ebac4c5b3c00025c0ac51281b5b

Tree: b72a3971bb8ec0076ff94b19eab38e78586b41ee

Author: Jakub Konka

Committer: Andrew Kelley

## Message

```
Add Zig wrapper for kernel32.DeviceIoControl

This commit adds a Zig wrapper for `kernel32.DeviceIoControl` which
applies ReactOS logic for deciding whether to use
`ntdll.NtDeviceIoControlFile` or `ntdll.NtFsControlFile` based on the
value of passed `IO_CONTROL_CODE`. The decision logic is based on the
logic found in ReactOS found in the following [link].

Thanks to Daurnimator for finding this bit in ReactOS!

[link]: https://doxygen.reactos.org/d3/d74/deviceio_8c.html

```

## Parents

- [606b6462ceaaeb2d993df684829a27db16eea18a](https://git.cafe/gitcafe/zig/commit/606b6462ceaaeb2d993df684829a27db16eea18a?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/4fdfaf69c8c55ebac4c5b3c00025c0ac51281b5b?format=markdown)
