diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
commit | 43a97878ce14b72f0981164f87f2e35e14151312 (patch) | |
tree | 620249daf56c0258faa40cbdcf9cfba06de2a846 /third_party/rust/ntapi/src/ntapi_base.rs | |
parent | Initial commit. (diff) | |
download | firefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip |
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/rust/ntapi/src/ntapi_base.rs')
-rw-r--r-- | third_party/rust/ntapi/src/ntapi_base.rs | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/third_party/rust/ntapi/src/ntapi_base.rs b/third_party/rust/ntapi/src/ntapi_base.rs new file mode 100644 index 0000000000..aa341af0b0 --- /dev/null +++ b/third_party/rust/ntapi/src/ntapi_base.rs @@ -0,0 +1,40 @@ +use winapi::shared::ntdef::{HANDLE, LONG, NTSTATUS, ULONG, ULONGLONG, USHORT}; +use winapi::shared::ntstatus::FACILITY_NTWIN32; +pub type KPRIORITY = LONG; +pub type RTL_ATOM = USHORT; +pub type PRTL_ATOM = *mut RTL_ATOM; +pub const NT_FACILITY_MASK: ULONG = 0xfff; +pub const NT_FACILITY_SHIFT: ULONG = 16; +#[inline] +pub const fn NT_FACILITY(Status: NTSTATUS) -> ULONG { + (Status as u32) >> NT_FACILITY_SHIFT & NT_FACILITY_MASK +} +#[inline] +pub const fn NT_NTWIN32(Status: NTSTATUS) -> bool { + NT_FACILITY(Status) == FACILITY_NTWIN32 as u32 +} +#[inline] +pub const fn WIN32_FROM_NTSTATUS(Status: NTSTATUS) -> ULONG { + (Status as u32) & 0xffff +} +STRUCT!{struct CLIENT_ID { + UniqueProcess: HANDLE, + UniqueThread: HANDLE, +}} +pub type PCLIENT_ID = *mut CLIENT_ID; +STRUCT!{struct CLIENT_ID32 { + UniqueProcess: ULONG, + UniqueThread: ULONG, +}} +pub type PCLIENT_ID32 = *mut CLIENT_ID32; +STRUCT!{struct CLIENT_ID64 { + UniqueProcess: ULONGLONG, + UniqueThread: ULONGLONG, +}} +pub type PCLIENT_ID64 = *mut CLIENT_ID64; +STRUCT!{struct KSYSTEM_TIME { + LowPart: ULONG, + High1Time: LONG, + High2Time: LONG, +}} +pub type PKSYSTEM_TIME = *mut KSYSTEM_TIME; |