diff options
| author | pravic <[email protected]> | 2016-04-12 16:39:37 +0300 |
|---|---|---|
| committer | pravic <[email protected]> | 2016-04-12 16:39:37 +0300 |
| commit | 28ff216899e95a6a9756bcbe580f28ed8ce61228 (patch) | |
| tree | bbf00e3c5f3b440db5ddb3f86b6d3a893349cee0 /src/debug.rs | |
| parent | git ignore (diff) | |
| download | winapi-kmd-rs-28ff216899e95a6a9756bcbe580f28ed8ce61228.tar.xz winapi-kmd-rs-28ff216899e95a6a9756bcbe580f28ed8ce61228.zip | |
Windows Kernel-Mode library
Diffstat (limited to 'src/debug.rs')
| -rw-r--r-- | src/debug.rs | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/debug.rs b/src/debug.rs new file mode 100644 index 0000000..66e46ab --- /dev/null +++ b/src/debug.rs @@ -0,0 +1,46 @@ +//! Debugger support. + +use ::status::NTSTATUS; + +extern "C" +{ + /// `DbgPrint` routine sends a message to the kernel debugger. + pub fn DbgPrint(Format: *const u8, ...) -> NTSTATUS; + /// The `DbgPrintEx` routine sends a string to the kernel debugger if certain conditions are met. + pub fn DbgPrintEx(ComponentId: u32, Level: u32, Format: *const u8, ...) -> NTSTATUS; +} + +extern "system" +{ + /// Breaks into the kernel debugger. + pub fn DbgBreakPoint(); + /// Breaks into the kernel debugger and sends the value of `Status` to the debugger. + pub fn DbgBreakPointWithStatus(Status: NTSTATUS); +} + +/// `DbgPrintEx` Message severity. +#[repr(C)] +pub enum DPFLTR_LEVEL { + ERROR = 0, + WARNING, + TRACE, + INFO, +} + +/// `DbgPrintEx` Component name. +#[repr(C)] +pub enum DPFLTR_ID { + SYSTEM = 0, + SMSS, + SETUP, + NTFS, + // ... + IHVDRIVER = 77, + IHVVIDEO, + IHVAUDIO, + IHVNETWORK, + IHVSTREAMING, + IHVBUS, + + DEFAULT = 99, +} |