summaryrefslogtreecommitdiff
path: root/crates/windows-kernel-rs/examples/safe_framework/src/lib.rs
blob: 33292e42dc0a872d3326bb41d3201dd529e34220 (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
#![no_std]
#![feature(lang_items, const_extern_fn)]
#![deny(
  warnings,
  nonstandard_style,
  unused,
  future_incompatible,
  rust_2018_idioms
)]
#![deny(clippy::all, clippy::nursery, clippy::pedantic)]

use windows_kernel_rs::{kernel_module, println, Driver, Error, KernelModule};

struct Module;
impl KernelModule for Module {
  fn init(_: Driver, _: &str) -> Result<Self, Error> {
    println!("Hello, world!");

    Ok(Module)
  }

  fn cleanup(&mut self, _: Driver) {
    println!("Bye bye!");
  }
}

kernel_module!(Module);