Skip to content

eiz/nt-token

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nt-token

CI crates.io docs.rs license

AI DISCLAIMER: This project was initially generated by OpenAI "o3" language model. The compies were supervised heavily but no warranties express or implied etc etc.

Memory-safe, ergonomic helpers for working with Windows access tokens and security identifiers (SIDs) – built on top of the windows crate.

use nt_token::{OwnedToken, Sid};
use windows::Win32::Security::TOKEN_QUERY;

fn main() -> windows::core::Result<()> {
    let token = OwnedToken::from_current_process(TOKEN_QUERY)?;
    println!("elevated = {}", token.is_elevated()?);
    println!("integrity level = 0x{:x}", token.integrity_level()?);

    for g in token.groups()? {
        println!("group → {}", g);
    }
    Ok(())
}

About

Ergonomic wrapper for Windows NT access tokens

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages