Small fixes

This commit is contained in:
momo5502 2022-03-26 16:09:05 +01:00
parent da7204ee90
commit a5dab1e9ba
3 changed files with 2 additions and 7 deletions

View File

@ -225,9 +225,6 @@ extern "C" NTSTATUS DriverEntry(const PDRIVER_OBJECT DriverObject, PUNICODE_STRI
debug_log("Waking up!"); debug_log("Waking up!");
} }
}); });
sleep_cb->dispatcher(sleep_callback::type::sleep);
sleep_cb->dispatcher(sleep_callback::type::wakeup);
} }
catch (...) catch (...)
{ {

View File

@ -53,7 +53,6 @@ void sleep_callback::dispatcher(const type type) const
} }
_Function_class_(CALLBACK_FUNCTION) _Function_class_(CALLBACK_FUNCTION)
void sleep_callback::static_callback(void* context, void* argument1, void* argument2) void sleep_callback::static_callback(void* context, void* argument1, void* argument2)
{ {
if (!context || argument1 != reinterpret_cast<PVOID>(PO_CB_SYSTEM_STATE_LOCK)) if (!context || argument1 != reinterpret_cast<PVOID>(PO_CB_SYSTEM_STATE_LOCK))
@ -62,7 +61,7 @@ void sleep_callback::static_callback(void* context, void* argument1, void* argum
} }
auto type = type::sleep; auto type = type::sleep;
if(ARGUMENT_PRESENT(argument2)) if (ARGUMENT_PRESENT(argument2))
{ {
type = type::wakeup; type = type::wakeup;
} }

View File

@ -20,13 +20,12 @@ public:
sleep_callback(const sleep_callback& obj) = delete; sleep_callback(const sleep_callback& obj) = delete;
sleep_callback& operator=(const sleep_callback& obj) = delete; sleep_callback& operator=(const sleep_callback& obj) = delete;
void dispatcher(type type) const;
private: private:
void* handle_{nullptr}; void* handle_{nullptr};
callback_function callback_{}; callback_function callback_{};
void dispatcher(type type) const;
_Function_class_(CALLBACK_FUNCTION) _Function_class_(CALLBACK_FUNCTION)
static void static_callback(void* context, void* argument1, void* argument2); static void static_callback(void* context, void* argument1, void* argument2);