#uac #windows #winapi

no-std check_elevation

Check if the current process is elevated. A successor to the is_elevated crate. Now no_std!

5 releases

0.2.4 Oct 11, 2023
0.2.3 Oct 9, 2023
0.1.2 Oct 8, 2023

#162 in Windows APIs

Download history 64/week @ 2024-07-22 18/week @ 2024-07-29 21/week @ 2024-08-05 25/week @ 2024-08-12 8/week @ 2024-08-19 14/week @ 2024-08-26 37/week @ 2024-09-02 71/week @ 2024-09-09 15/week @ 2024-09-16 45/week @ 2024-09-23 16/week @ 2024-09-30 19/week @ 2024-10-07 42/week @ 2024-10-14 21/week @ 2024-10-21 15/week @ 2024-10-28 48/week @ 2024-11-04

127 downloads per month

BSD-2-Clause

5KB

check_elevation

license version

A tool to check the elevation status through a simple function.

Successor to is_elevated.

Example

use check_elevation::is_elevated;


fn main() {
    if is_elevated().expect("Failed to get elevation status.") {
        println!("Running as administrator.");
    } else {
        println!("Not running as administrator.");
    }
}

Dependencies


lib.rs:

Checks if the current Windows process is elevated. Returns true if the process is elevated, false if not.

Example

use check_elevation::is_elevated;
fn main() {
    if is_elevated().expect("Failed to get elevation status.") {
        println!("Running as administrator.");
    } else {
        println!("Not running as administrator.");
    }
}

made with ♥ by h4rl uses bsd-2-clause license

Dependencies

~130MB
~2M SLoC