| ... | ... | @@ -166,6 +166,14 @@ pub const FILE_ANY_ACCESS = 0; |
| 166 | 166 | pub const FILE_READ_ACCESS = 1; |
| 167 | 167 | pub const FILE_WRITE_ACCESS = 2; |
| 168 | 168 | |
| 169 | /// https://docs.microsoft.com/en-us/windows-hardware/drivers/kernel/defining-i-o-control-codes |
| 170 | pub fn CTL_CODE(deviceType: u16, function: u12, method: TransferType, access: u2) DWORD { |
| 171 | return (@as(DWORD, deviceType) << 16) | |
| 172 | (@as(DWORD, access) << 14) | |
| 173 | (@as(DWORD, function) << 2) | |
| 174 | @enumToInt(method); |
| 175 | } |
| 176 | |
| 169 | 177 | pub const INVALID_HANDLE_VALUE = @intToPtr(HANDLE, maxInt(usize)); |
| 170 | 178 | |
| 171 | 179 | pub const INVALID_FILE_ATTRIBUTES = @as(DWORD, maxInt(DWORD)); |