|
1 | | -use winapi::shared::ntdef::{HANDLE, LONG, NTSTATUS, ULONG, ULONGLONG, USHORT}; |
2 | | -use winapi::shared::ntstatus::FACILITY_NTWIN32; |
3 | | -pub type KPRIORITY = LONG; |
4 | | -pub type RTL_ATOM = USHORT; |
| 1 | +use windows_sys::Win32::Foundation::{FACILITY_NTWIN32, HANDLE, NTSTATUS}; |
| 2 | + |
| 3 | +use crate::ctypes::{__uint64, c_long, c_ulong, c_ushort}; |
| 4 | + |
| 5 | +pub type KPRIORITY = c_long; |
| 6 | +pub type RTL_ATOM = c_ushort; |
5 | 7 | pub type PRTL_ATOM = *mut RTL_ATOM; |
6 | | -pub const NT_FACILITY_MASK: ULONG = 0xfff; |
7 | | -pub const NT_FACILITY_SHIFT: ULONG = 16; |
| 8 | +pub const NT_FACILITY_MASK: c_ulong = 0xfff; |
| 9 | +pub const NT_FACILITY_SHIFT: c_ulong = 16; |
8 | 10 | #[inline] |
9 | | -pub const fn NT_FACILITY(Status: NTSTATUS) -> ULONG { |
| 11 | +pub const fn NT_FACILITY(Status: NTSTATUS) -> c_ulong { |
10 | 12 | (Status as u32) >> NT_FACILITY_SHIFT & NT_FACILITY_MASK |
11 | 13 | } |
12 | 14 | #[inline] |
13 | 15 | pub const fn NT_NTWIN32(Status: NTSTATUS) -> bool { |
14 | | - NT_FACILITY(Status) == FACILITY_NTWIN32 as u32 |
| 16 | + NT_FACILITY(Status) == FACILITY_NTWIN32 |
15 | 17 | } |
16 | 18 | #[inline] |
17 | | -pub const fn WIN32_FROM_NTSTATUS(Status: NTSTATUS) -> ULONG { |
| 19 | +pub const fn WIN32_FROM_NTSTATUS(Status: NTSTATUS) -> c_ulong { |
18 | 20 | (Status as u32) & 0xffff |
19 | 21 | } |
20 | | -STRUCT!{struct CLIENT_ID { |
| 22 | +STRUCT! {struct CLIENT_ID { |
21 | 23 | UniqueProcess: HANDLE, |
22 | 24 | UniqueThread: HANDLE, |
23 | 25 | }} |
24 | 26 | pub type PCLIENT_ID = *mut CLIENT_ID; |
25 | | -STRUCT!{struct CLIENT_ID32 { |
26 | | - UniqueProcess: ULONG, |
27 | | - UniqueThread: ULONG, |
| 27 | +STRUCT! {struct CLIENT_ID32 { |
| 28 | + UniqueProcess: c_ulong, |
| 29 | + UniqueThread: c_ulong, |
28 | 30 | }} |
29 | 31 | pub type PCLIENT_ID32 = *mut CLIENT_ID32; |
30 | | -STRUCT!{struct CLIENT_ID64 { |
31 | | - UniqueProcess: ULONGLONG, |
32 | | - UniqueThread: ULONGLONG, |
| 32 | +STRUCT! {struct CLIENT_ID64 { |
| 33 | + UniqueProcess: __uint64, |
| 34 | + UniqueThread: __uint64, |
33 | 35 | }} |
34 | 36 | pub type PCLIENT_ID64 = *mut CLIENT_ID64; |
35 | | -STRUCT!{struct KSYSTEM_TIME { |
36 | | - LowPart: ULONG, |
37 | | - High1Time: LONG, |
38 | | - High2Time: LONG, |
| 37 | +STRUCT! {struct KSYSTEM_TIME { |
| 38 | + LowPart: c_ulong, |
| 39 | + High1Time: c_long, |
| 40 | + High2Time: c_long, |
39 | 41 | }} |
40 | 42 | pub type PKSYSTEM_TIME = *mut KSYSTEM_TIME; |
0 commit comments