diff --git a/src/driver/driver_main.cpp b/src/driver/driver_main.cpp index 1ffeda3..d40169b 100644 --- a/src/driver/driver_main.cpp +++ b/src/driver/driver_main.cpp @@ -225,9 +225,6 @@ extern "C" NTSTATUS DriverEntry(const PDRIVER_OBJECT DriverObject, PUNICODE_STRI debug_log("Waking up!"); } }); - - sleep_cb->dispatcher(sleep_callback::type::sleep); - sleep_cb->dispatcher(sleep_callback::type::wakeup); } catch (...) { diff --git a/src/driver/sleep_callback.cpp b/src/driver/sleep_callback.cpp index a3fea9b..9f650f1 100644 --- a/src/driver/sleep_callback.cpp +++ b/src/driver/sleep_callback.cpp @@ -53,7 +53,6 @@ void sleep_callback::dispatcher(const type type) const } _Function_class_(CALLBACK_FUNCTION) - void sleep_callback::static_callback(void* context, void* argument1, void* argument2) { if (!context || argument1 != reinterpret_cast(PO_CB_SYSTEM_STATE_LOCK)) @@ -62,7 +61,7 @@ void sleep_callback::static_callback(void* context, void* argument1, void* argum } auto type = type::sleep; - if(ARGUMENT_PRESENT(argument2)) + if (ARGUMENT_PRESENT(argument2)) { type = type::wakeup; } diff --git a/src/driver/sleep_callback.hpp b/src/driver/sleep_callback.hpp index e0afd3b..d08ce79 100644 --- a/src/driver/sleep_callback.hpp +++ b/src/driver/sleep_callback.hpp @@ -20,13 +20,12 @@ public: sleep_callback(const sleep_callback& obj) = delete; sleep_callback& operator=(const sleep_callback& obj) = delete; - void dispatcher(type type) const; private: void* handle_{nullptr}; callback_function callback_{}; - + void dispatcher(type type) const; _Function_class_(CALLBACK_FUNCTION) static void static_callback(void* context, void* argument1, void* argument2);