moon-driver-utils 0.1.0

Windows Kernel Utils
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use wdk_sys::ntddk::{KeEnterCriticalRegion, KeLeaveCriticalRegion};

pub struct CriticalRegion {}

impl CriticalRegion {
    pub fn new() -> Self {
        unsafe { KeEnterCriticalRegion() };
        Self {}
    }
}

impl Drop for CriticalRegion {
    fn drop(&mut self) {
        unsafe { KeLeaveCriticalRegion() };
    }
}