1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//! # windows-token
//!
//! RAII wrappers over the Win32 access-token surface:
//! `OpenProcessToken`, `OpenThreadToken`, `DuplicateTokenEx`,
//! `ImpersonateLoggedOnUser`, `SetThreadToken`, `LookupPrivilegeValue`,
//! `AdjustTokenPrivileges`.
//!
//! The single hard requirement: dropping an [`ImpersonationGuard`] calls
//! `RevertToSelf`, always — including on unwind. Hand-written impersonation
//! code (Rubeus-style) forgets this on early returns; here it is structurally
//! impossible.
//!
//! ## Status
//!
//! **0.1.0-dev — pre-alpha.** Skeleton with the intended API surface, a
//! partial implementation of the core primitives (open / duplicate / adjust /
//! impersonate / query user + integrity), and structural + smoke + round-trip
//! tests. Not yet exercised against a live DC. `OpenThreadToken` and named-SID
//! lookup (`LookupAccountSidW`) are not yet wired.
//!
//! ## Example
//!
//! ```no_run
//! use windows_token::{Token, Privilege};
//!
//! let tok = Token::open_current_process()?;
//! // Normal users always hold SeChangeNotifyPrivilege enabled.
//! let prev = tok.enable_privilege(Privilege::SeChangeNotify)?;
//! let _ = prev;
//! # Ok::<(), windows_token::Error>(())
//! ```
pub use ;
pub use ImpersonationGuard;
pub use ;
pub use ;
pub use ;
compile_error!;