Skip to content

Commit 2148881

Browse files
committed
Remove the 'beta' feature and everything related to it
1 parent 9f56b14 commit 2148881

File tree

7 files changed

+13
-59
lines changed

7 files changed

+13
-59
lines changed

Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ edition = "2018"
1414

1515
[package.metadata.docs.rs]
1616
default-target = "x86_64-pc-windows-msvc"
17-
features = ["beta"]
1817
targets = ["aarch64-pc-windows-msvc", "i686-pc-windows-msvc", "x86_64-pc-windows-msvc"]
1918

2019
[dependencies.winapi]
@@ -27,5 +26,3 @@ func-types = []
2726
impl-default = ["winapi/impl-default"]
2827
user = []
2928
kernel = []
30-
beta = []
31-
nightly = ["beta"]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Rust FFI bindings for Native API. Mostly based on Process Hacker [phnt](https://github.com/processhacker/processhacker/tree/master/phnt) headers as the most complete source of bindings to be found. The comments there also contain useful information on how to use specific things.
44

55
### Minimum supported Rust
6-
Always the latest stable. Some [features][docs_link] require a beta compiler.
6+
1.64
77

88
[appveyor_link]: https://ci.appveyor.com/project/MSxDOS/ntapi
99
[appveyor_badge]: https://ci.appveyor.com/api/projects/status/i1fcmm0c5b7c6b6u/branch/master?svg=true

appveyor.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,7 @@ install:
2828
)
2929

3030
build_script:
31-
- if "%channel%"=="nightly" (
32-
cargo test --verbose --color always --features "func-types impl-default nightly user"
33-
) else (
34-
cargo test --verbose --color always --features "func-types impl-default user"
35-
)
31+
- cargo test --verbose --color always --features "func-types impl-default user"
3632
- if defined aarch64 (
37-
cargo test --verbose --color always --features "func-types impl-default nightly user" --target aarch64-pc-windows-msvc --no-run
33+
cargo test --verbose --color always --features "func-types impl-default user" --target aarch64-pc-windows-msvc --no-run
3834
)

src/lib.rs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,7 @@
33
//! **`impl-default`** -- Implement [`Default`] for structs and unions.<br/>
44
//! **`user`** *(default)* -- Link to `ntdll`.<br/>
55
//! **`kernel`** -- Link to `ntoskrnl` on MSVC targets.<br/>
6-
//! **`beta`** -- Unlock unstable features that require a beta compiler:
7-
//! - [`NtCurrentTeb`]
8-
//! - [`__readfsdword`]
9-
//! - [`__readgsqword`]
10-
//! - [`_bittest64`]
11-
//! - [`NtCurrentPeb`]
12-
//! - [`NtCurrentProcessId`]
13-
//! - [`NtCurrentThreadId`]
14-
//! - [`RtlProcessHeap`]
15-
//! - [`RtlCheckBit`] implementation using [`_bittest64`] on x86_64.
166
//!
17-
//! [`NtCurrentTeb`]: winapi_local/um/winnt/fn.NtCurrentTeb.html
18-
//! [`__readfsdword`]: winapi_local/um/winnt/fn.__readfsdword.html
19-
//! [`__readgsqword`]: winapi_local/um/winnt/fn.__readgsqword.html
20-
//! [`_bittest64`]: winapi_local/um/winnt/fn._bittest64.html
21-
//! [`NtCurrentPeb`]: ntpsapi/fn.NtCurrentPeb.html
22-
//! [`NtCurrentProcessId`]: ntpsapi/fn.NtCurrentProcessId.html
23-
//! [`NtCurrentThreadId`]: ntpsapi/fn.NtCurrentThreadId.html
24-
//! [`RtlProcessHeap`]: ntrtl/fn.RtlProcessHeap.html
25-
//! [`RtlCheckBit`]: ntrtl/fn.RtlCheckBit.html
267
//! [fn_ptr]: https://doc.rust-lang.org/reference/types.html#function-pointer-types
278
//! [`Default`]: https://doc.rust-lang.org/std/default/trait.Default.html#tymethod.default
289
#![cfg(all(windows, any(target_arch = "x86", target_arch = "x86_64", target_arch = "aarch64")))]

src/ntpsapi.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use winapi::um::winnt::{
1919
PROCESS_MITIGATION_STRICT_HANDLE_CHECK_POLICY, PROCESS_MITIGATION_SYSTEM_CALL_DISABLE_POLICY,
2020
PROCESS_MITIGATION_SYSTEM_CALL_FILTER_POLICY, PSECURITY_QUALITY_OF_SERVICE,
2121
};
22-
#[cfg(all(feature = "beta", not(target_arch = "aarch64")))]
22+
#[cfg(not(target_arch = "aarch64"))]
2323
use crate::winapi_local::um::winnt::NtCurrentTeb;
2424
pub const GDI_HANDLE_BUFFER_SIZE32: usize = 34;
2525
pub const GDI_HANDLE_BUFFER_SIZE64: usize = 60;
@@ -932,19 +932,19 @@ pub const NtCurrentThread: HANDLE = -2isize as *mut c_void;
932932
pub const ZwCurrentThread: HANDLE = NtCurrentThread;
933933
pub const NtCurrentSession: HANDLE = -3isize as *mut c_void;
934934
pub const ZwCurrentSession: HANDLE = NtCurrentSession;
935-
#[inline] #[cfg(all(feature = "beta", not(target_arch = "aarch64")))]
935+
#[inline] #[cfg(not(target_arch = "aarch64"))]
936936
pub unsafe fn NtCurrentPeb() -> PPEB {
937937
(*NtCurrentTeb()).ProcessEnvironmentBlock
938938
}
939939
pub const NtCurrentProcessToken: HANDLE = -4isize as *mut c_void;
940940
pub const NtCurrentThreadToken: HANDLE = -5isize as *mut c_void;
941941
pub const NtCurrentEffectiveToken: HANDLE = -6isize as *mut c_void;
942942
pub const NtCurrentSilo: HANDLE = -1isize as *mut c_void;
943-
#[inline] #[cfg(all(feature = "beta", not(target_arch = "aarch64")))]
943+
#[inline] #[cfg(not(target_arch = "aarch64"))]
944944
pub unsafe fn NtCurrentProcessId() -> HANDLE {
945945
(*NtCurrentTeb()).ClientId.UniqueProcess
946946
}
947-
#[inline] #[cfg(all(feature = "beta", not(target_arch = "aarch64")))]
947+
#[inline] #[cfg(not(target_arch = "aarch64"))]
948948
pub unsafe fn NtCurrentThreadId() -> HANDLE {
949949
(*NtCurrentTeb()).ClientId.UniqueThread
950950
}

src/ntrtl.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2196,7 +2196,7 @@ EXTERN!{extern "system" {
21962196
MakeReadOnly: BOOLEAN,
21972197
);
21982198
}}
2199-
#[inline] #[cfg(all(feature = "beta", not(target_arch = "aarch64")))]
2199+
#[inline] #[cfg(not(target_arch = "aarch64"))]
22002200
pub unsafe fn RtlProcessHeap() -> PVOID {
22012201
use crate::ntpsapi::NtCurrentPeb;
22022202
(*NtCurrentPeb()).ProcessHeap
@@ -2944,15 +2944,10 @@ EXTERN!{extern "system" {
29442944
}}
29452945
#[inline]
29462946
pub unsafe fn RtlCheckBit(BitMapHeader: &RTL_BITMAP, BitPosition: ULONG) -> u8 {
2947-
#[cfg(all(target_arch = "x86_64", feature = "beta"))] {
2948-
use crate::winapi_local::um::winnt::_bittest64;
2949-
_bittest64(BitMapHeader.Buffer as *const i64, BitPosition as i64)
2947+
#[cfg(target_arch = "x86_64")] {
2948+
core::arch::x86_64::_bittest64(BitMapHeader.Buffer as *const i64, BitPosition as i64)
29502949
}
2951-
#[cfg(any(
2952-
target_arch = "x86",
2953-
all(target_arch = "x86_64", not(feature = "beta")),
2954-
target_arch = "aarch64",
2955-
))] {
2950+
#[cfg(any(target_arch = "x86", target_arch = "aarch64"))] {
29562951
(*BitMapHeader.Buffer.offset(BitPosition as isize / 32) >> (BitPosition % 32) & 1) as u8
29572952
}
29582953
}

src/winapi_local/um/winnt.rs

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#[cfg(all(feature = "beta", not(target_arch = "aarch64")))]
2-
use core::arch::asm;
31
use winapi::shared::basetsd::{DWORD64, SIZE_T, ULONG64};
42
use winapi::shared::minwindef::DWORD;
53
use winapi::um::winnt::{HANDLE, PVOID};
@@ -8,24 +6,11 @@ use winapi::um::winnt::{HANDLE, PVOID};
86
pub const fn UInt32x32To64(a: u32, b: u32) -> u64 {
97
a as u64 * b as u64
108
}
11-
#[cfg(all(feature = "beta", not(target_arch = "aarch64")))]
9+
#[cfg(not(target_arch = "aarch64"))]
1210
IFDEF!{
11+
use core::arch::asm;
1312
use crate::ntpebteb::TEB;
1413
#[inline]
15-
#[cfg(target_pointer_width = "64")]
16-
pub unsafe fn _bittest64(Base: *const i64, Offset: i64) -> u8 {
17-
let out: u8;
18-
asm!(
19-
"bt {1}, {2}",
20-
"setb {0}",
21-
out(reg_byte) out,
22-
in(reg) Base,
23-
in(reg) Offset,
24-
options(nostack, pure, readonly),
25-
);
26-
out
27-
}
28-
#[inline]
2914
pub unsafe fn __readfsdword(Offset: DWORD) -> DWORD {
3015
let out: u32;
3116
asm!(

0 commit comments

Comments
 (0)