diff options
| author | a1xd <[email protected]> | 2021-04-01 21:35:13 -0400 |
|---|---|---|
| committer | a1xd <[email protected]> | 2021-04-01 21:35:13 -0400 |
| commit | 2bfe95fb4e271d723a0aae537ec6c8732785442e (patch) | |
| tree | 6c59391f66c12f0b4b72b91eff3b26640ae09299 | |
| parent | add minimum to complement speed cap (diff) | |
| download | rawaccel-2bfe95fb4e271d723a0aae537ec6c8732785442e.tar.xz rawaccel-2bfe95fb4e271d723a0aae537ec6c8732785442e.zip | |
check for safe mode before hooking into dev stack
can't stop the driver from being loaded in safe mode, an early return here is the best we can do
| -rw-r--r-- | driver/driver.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/driver/driver.cpp b/driver/driver.cpp index a7fe3b6..0c272e1 100644 --- a/driver/driver.cpp +++ b/driver/driver.cpp @@ -20,6 +20,8 @@ struct { ra::mouse_modifier modifier; } global = {}; +extern "C" PULONG InitSafeBootMode; + VOID RawaccelCallback( IN PDEVICE_OBJECT DeviceObject, @@ -433,13 +435,17 @@ Return Value: NTSTATUS status; WDFDEVICE hDevice; WDF_IO_QUEUE_CONFIG ioQueueConfig; - + UNREFERENCED_PARAMETER(Driver); PAGED_CODE(); DebugPrint(("Enter FilterEvtDeviceAdd \n")); + if (*InitSafeBootMode > 0) { + return STATUS_SUCCESS; + } + // // Tell the framework that you are filter driver. Framework // takes care of inherting all the device flags & characterstics |