summaryrefslogtreecommitdiff
path: root/crates/windows-kernel-sys/src/ntoskrnl.rs
blob: f1daa4e8ef601569945bc35573f2eb6b7b145b72 (plain) (blame)
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
#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]

use crate::base::*;

#[link(name = "wrapper_ntoskrnl")]
extern "C" {
  pub fn _ExInitializeFastMutex(mutex: PFAST_MUTEX);
  pub fn _ExAcquirePushLockExclusive(push_lock: PEX_PUSH_LOCK);
  pub fn _ExReleasePushLockExclusive(push_lock: PEX_PUSH_LOCK);
  pub fn _ExAcquirePushLockShared(push_lock: PEX_PUSH_LOCK);
  pub fn _ExReleasePushLockShared(push_lock: PEX_PUSH_LOCK);
  pub fn _IoGetCurrentIrpStackLocation(irp: PIRP) -> PIO_STACK_LOCATION;
  pub fn _IoGetNextIrpStackLocation(irp: PIRP) -> PIO_STACK_LOCATION;
  pub fn _IoSetCompletionRoutine(
    irp: PIRP,
    completion_routine: PIO_COMPLETION_ROUTINE,
    context: PVOID,
    invoke_on_success: BOOLEAN,
    invoke_on_error: BOOLEAN,
    invoke_on_cancel: BOOLEAN,
  );
  pub fn _IoCompleteRequest(irp: PIRP, priority_boost: CCHAR);
  pub fn _MmGetMdlByteCount(mdl: PMDL) -> ULONG;
  pub fn _MmGetMdlByteOffset(mdl: PMDL) -> ULONG;
  pub fn _MmGetSystemAddressForMdlSafe(mdl: PMDL, priority: ULONG) -> PVOID;
  pub fn _ObDereferenceObject(p: *mut cty::c_void);
  pub fn _ObReferenceObject(p: *mut cty::c_void);
}

pub use self::{
  IoGetCurrentProcess as PsGetCurrentProcess,
  _ExAcquirePushLockExclusive as ExAcquirePushLockExclusive,
  _ExAcquirePushLockShared as ExAcquirePushLockShared,
  _ExInitializeFastMutex as ExInitializeFastMutex,
  _ExReleasePushLockExclusive as ExReleasePushLockExclusive,
  _ExReleasePushLockShared as ExReleasePushLockShared,
  _IoCompleteRequest as IoCompleteRequest,
  _IoGetCurrentIrpStackLocation as IoGetCurrentIrpStackLocation,
  _IoGetNextIrpStackLocation as IoGetNextIrpStackLocation,
  _IoSetCompletionRoutine as IoSetCompletionRoutine,
  _MmGetMdlByteCount as MmGetMdlByteCount,
  _MmGetMdlByteOffset as MmGetMdlByteOffset,
  _MmGetSystemAddressForMdlSafe as MmGetSystemAddressForMdlSafe,
  _ObDereferenceObject as ObDereferenceObject,
  _ObReferenceObject as ObReferenceObject,
};

include!(concat!(env!("OUT_DIR"), "/ntoskrnl.rs"));